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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

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

lvl107
20-Turquoise

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

  Hello, Everyone.

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

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

     Thanks in advance.

           Regards.

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:Werner_E)

16 REPLIES 16
LucMeekes
23-Emerald III
(To:lvl107)

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

LM_20181023_xcos(x)-sin(x).png

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

 

Werner_E
25-Diamond I
(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).

Werner_E
25-Diamond I
(To:Werner_E)

 

B.PNG

 

lvl107
20-Turquoise
(To:Werner_E)

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

( I-a ).PNG

Werner_E
25-Diamond I
(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.

B.png

lvl107
20-Turquoise
(To:Werner_E)

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

1.PNG2.PNG

lvl107
20-Turquoise
(To:lvl107)

Or writting a slightly different approach.

    Best Regards.

Werner_E
25-Diamond I
(To:lvl107)

Just compare my program to the one you modified!

 

"R" instead of "r"

"last" instead of "rows"

 

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

lvl107
20-Turquoise
(To:Werner_E)

I'm very sorry, Werner. Smiley Sad

1a.PNG2a.PNG

Best Regards.

Werner_E
25-Diamond I
(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?

B.png

 

lvl107
20-Turquoise
(To:Werner_E)

You're right. Smiley Happy

And "could you attach *.xmcd ?"

Best Regards.

lvl107
20-Turquoise
(To:Werner_E)

Werner, Yes this does help.Smiley HappySmiley HappySmiley Happy 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" ?

4.PNG

Best Regards.

Werner_E
25-Diamond I
(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.

Werner_E
25-Diamond I
(To:Werner_E)

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

B.png

-MFra-
21-Topaz II
(To:lvl107)

Hi liv107,

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

 

transcendent eq.jpg

More roots - not free

Roots.png

Announcements

Top Tags