[WP 34s] Trouble finding root - (solved)
06-29-2015, 01:09 AM (This post was last modified: 06-29-2015 01:19 AM by Marcio.)
Post: #1
 Marcio Senior Member Posts: 438 Joined: Feb 2015
[WP 34s] Trouble finding root - (solved)
Hello all,

I am having troubles finding the root of the following equation:

$0.05=\frac{x\times coth(x) - 1}{10x\times coth(10x) - 1}$

to which I created the following program:

Code:

LBL 01
#10
*
ENTER
TANH
/
1
-
x<>y
ENTER
TANH
/
1
-
x<>y
/
#005
#100
/
-
END

1
5
SLV 01

The 34s will complain there is a domain error.

Hope I am missing something.

Thanks

Marcio

EDIT: Found the error. Problem solved!
06-29-2015, 07:37 AM
Post: #2
 Marcus von Cube Senior Member Posts: 754 Joined: Dec 2013
RE: [WP 34s] Trouble finding root - (solved)
(06-29-2015 01:09 AM)Marcio Wrote:  EDIT: Found the error. Problem solved!

It would be interesting for others to know what went wrong and how you fixed it.

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
06-29-2015, 11:06 AM (This post was last modified: 06-29-2015 11:11 AM by RMollov.)
Post: #3
 RMollov Member Posts: 201 Joined: Dec 2013
RE: [WP 34s] Trouble finding root - (solved)
(06-29-2015 01:09 AM)Marcio Wrote:  Hello all,

I am having troubles finding the root of the following equation:

$0.05=\frac{x\times coth(x) - 1}{10x\times coth(10x) - 1}$

to which I created the following program:

Code:

LBL 01
#10
*
ENTER
TANH
/
1
-
x<>y
ENTER
TANH
/
1
-
x<>y
/
#005
#100
/
-
END

1
5
SLV 01

The 34s will complain there is a domain error.

Hope I am missing something.

Thanks

Marcio

EDIT: Found the error. Problem solved!

You could save a few steps:
Code:
LBL 01
XEQ 00
X<>Y
SDL 001
ENTER
XEQ 00
/
#005
SDR002
-
RTN
LBL 00
TANH
/
1
-
END
06-29-2015, 11:13 AM
Post: #4
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: [WP 34s] Trouble finding root - (solved)
(06-29-2015 07:37 AM)Marcus von Cube Wrote:
(06-29-2015 01:09 AM)Marcio Wrote:  EDIT: Found the error. Problem solved!

It would be interesting for others to know what went wrong and how you fixed it.

The 34s complained because the first guess I entered was zero.
06-29-2015, 11:23 AM
Post: #5
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: [WP 34s] Trouble finding root - (solved)
(06-29-2015 11:06 AM)RMollov Wrote:  You could save a few steps:
Code:
LBL 01
XEQ 00
X<>Y
SDL 001
ENTER
XEQ 00
/
#005
SDR002
-
RTN
LBL 00
TANH
/
1
-
END

Yes, much shorter. Thanks.
06-29-2015, 06:59 PM (This post was last modified: 06-29-2015 07:05 PM by Dieter.)
Post: #6
 Dieter Senior Member Posts: 2,178 Joined: Dec 2013
RE: [WP 34s] Trouble finding root - (solved)
(06-29-2015 11:23 AM)Marcio Wrote:  Yes, much shorter. Thanks.

Both shorter and faster, using the some special 34s features:

Code:
LBL 01
TANH
/
DEC X
X<> Y
SDL 001
ENTER
TANH
/
DEC X
/
#005
SDR 002
-
END

1 [ENTER] 5 [SLV] 01
=> 1,64561382716

Dieter
06-29-2015, 07:20 PM
Post: #7
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: [WP 34s] Trouble finding root - (solved)
Indeed. Faster than the solver of the 35s too.
08-05-2015, 01:40 AM (This post was last modified: 08-05-2015 01:44 AM by Marcio.)
Post: #8
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: [WP 34s] Trouble finding root - (solved)
Code:

LBL 1
1
0
*
ENTER
TANH
/
1
-
x<>y
ENTER
TANH
/
1
-
x<>y
/
0
.
0
5
/
-
END

Gentlemen,

I have been trying to solve this equation for X using the 15C but it is not working.

Anyway, the code above will make the 15C output 0.0389, which is not correct. Could you identify what I am missing here?

Please note that there has been no attempt to optimize the given code.

Very much appreciated.

Marcio
08-05-2015, 03:48 AM
Post: #9
 Didier Lachieze Senior Member Posts: 1,023 Joined: Dec 2013
RE: [WP 34s] Trouble finding root - (solved)
Marcio Wrote:  Could you identify what I am missing here?

Just remove the last "/", before the "-".
08-05-2015, 04:03 AM
Post: #10
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: [WP 34s] Trouble finding root - (solved)
(08-05-2015 03:48 AM)Didier Lachieze Wrote:
Marcio Wrote:  Could you identify what I am missing here?

Just remove the last "/", before the "-".

Oh yes, I forgot to remove that extra /. Thanks.
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)