cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

19-Tanzanite

## x.cos(x) - sin(x) = 0 solve , x ?

Hello, Everyone.

x.cos(x) - sin(x) = 0 solve , x ?

Regards.

1 ACCEPTED SOLUTION

Accepted Solutions
24-Ruby V
(To:Werner_E)
16 REPLIES 16
23-Emerald III
(To:lvl107)

Is related to solving tan(x)-x=0:

You should be able to find local zeros using the bracketed root function:

root(x*cos(x)-sin(x),-1,1)=

root(x*cos(x)-sin(x),-5,-4)=

etc.

Success!
Luc

24-Ruby V
(To:lvl107)

The symbolic "solve" will give you just the only exact solution (0).

All the others you'll have to find one by one using one of the numerical methods provided by Mathcad (solve block, root).

24-Ruby V
(To:Werner_E)

19-Tanzanite
(To:Werner_E)

Many thanks Luc, F.M., and Werner. . Werner, I have a related issue, if you don't mind, please make correction the program function for a simple case :

24-Ruby V
(To:lvl107)

You asked for something similar in another thread and I already explained that the program would have to be slightly modified to deal with the case  when an interval hangs over the last limit you provide with your vector.

This should not have been that difficult.

19-Tanzanite
(To:Werner_E)

Werner, Please make a correction for the program function, the above :

19-Tanzanite
(To:lvl107)

Or writting a slightly different approach.

Best Regards.

24-Ruby V
(To:lvl107)

Just compare my program to the one you modified!

Not sure what you think you get with your program, though.

19-Tanzanite
(To:Werner_E)

I'm very sorry, Werner.

Best Regards.

24-Ruby V
(To:lvl107)

Don't use functions posted here without fully understanding what exactly they do and why they were written the ways the were.

Would this help?

19-Tanzanite
(To:Werner_E)

You're right.

And "could you attach *.xmcd ?"

Best Regards.

19-Tanzanite
(To:Werner_E)

Werner, Yes this does help. And I guess I'm still not fully understanding what exactly they do. And Is there any way to make the "red" becomes the "green" ?

Best Regards.

24-Ruby V
(To:lvl107)

You may consider increasing the step width Delta_x or the last precision parameter.

The method used is brute force. All values from x1 to x2 with stepwidth Delta_x are fed as guess value in the root function and then the results are sorted. Values outside the range x1,x2 are eliminated and values closer as prec are considered the same.

root sometimes gives quite inaccurate values here like -0.01 while it should return 0. So you would have to change prec to 10^-2 or even higher which on the other side could mean that you are missing some other zeros.

24-Ruby V
(To:Werner_E)

Here's a slightly different more stable looking approach using the interval variant of "root".

21-Topaz II
(To:lvl107)

Hi liv107,

since it is a transcendent equation, you can solve it only numerically.

24-Ruby III
(To:lvl107)

More roots - not free

Announcements