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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Solve for Angle in Radians

ssharma-2
4-Participant

Solve for Angle in Radians

Hi,

I have an expression like:

 

tan (alpha) - alpha = 0.48

where 'alpha' is angle in radians, and want to calculate the Value of Alpha.

 

How to solve this using Mathcad?

 

Pl Help!

 

Regards,

Shashank

 

15 REPLIES 15
LucMeekes
23-Emerald III
(To:ssharma-2)

Set a guess value first:
alpha:=1
Then use the root solver:
alpha:=root (tan (alpha)-alpha-0.48,alpha)
To display the result:
alpha=

Success!
Luc
-MFra-
21-Topaz II
(To:ssharma-2)

Hi ssharma,

 forssharma.jpg

You have to be aware that your task has an infinite number of soltions:Pic1.pngYou may use the symbolics but you will always get the very same solution even if you use something like the "assume" command to limit alpha to a certain range. An old bug in the symbolics.Pic2.png

 So you will have to resort to numerical methods and you have the choice amongst two.

The "root" command usually works pretty well and there are two ways of using it - provinding an interval or providing a guess value. Usually different guesses would give you different solutions, but in case of your equation we get the very same result most of the times - crazy.Pic3.pngThe other numeric method is using a solve block with "Find". Here again you have to provide a guess value which seems to have more impact on the outcome this timePic4.png

 

 

 

 

 

 

 

 

 

 

 

3-Find.png

Has anybody an explanation for the different solutions Valery and I get with the guesses 3 and -5?

I am using Prime 3.0 and TOL is by default 10^-3.

Valery sure used a newer version at which setting of TOL?


@WernerExinger wrote:

Has anybody an explanation for the different solutions Valery and I get with the guesses 3 and -5?

I am using Prime 3.0 and TOL is by default 10^-3.

Valery sure used a newer version at which setting of TOL?


By me Prime 4 and TOL=0.001

vlehner
13-Aquamarine
(To:ValeryOchkov)


@ValeryOchkov wrote:

By me Prime 4 and TOL=0.001


impressive!

you and me are using MP4 with TOL=0.001 and got different results.

Ah! the one MP4 is russian and mine is the german edition...

Volker

Sorry - I have used Prime 3.1

And second!

Without the vectorization - no ansver

With the vectorization - crash! Check please

3-Root.png

vlehner
13-Aquamarine
(To:Werner_E)

My Solutions are:

MP4

11-07-2017 12-58-40.jpg

and with MC15 the same solution:

11-07-2017 12-58-59.jpg

 EDIT: MP4 with TOL=10^-7 and MC15 with TOL=0.001

MP4 with TOL=0.001 i got the same results.

Volker


@WernerExinger wrote:

Has anybody an explanation for the different solutions


Есть многое на свете, друг Горацио, что и не снилось нашим мудрецам.

("There are more things in heaven and earth, Horatio, than are dreamt of in your philosophy.")

LucMeekes
23-Emerald III
(To:Werner_E)

I have no idea why the root function behaves so differently with different guess values.

But in mathcad 11, there is a way to show the steps that the root function takes. ( I guess it won't work in Mathcad 15, but please try).

Here's the function, and a couple of examples of its usage with the function: tan(x)-x-0.48:

RootPath.png

RootPath_1.pngRootPath_2.pngRootPath_4.4.pngRootPath_5.png

In most cases root finds the positive value closest to zero, unless the guess valua is close to another solution.

This is also illustrated by a scan of guess values:

RootPaths.png

Note that the trace is absent at times, that's when a complex root was found.

Oh, and my TOL=10^-7.

Luc

You are right. RootPath does not work in MC15. The return vector would only contain the last guess (aka the solution).

Pic1.png

Only ways I can think of to get the interim guess values of the algorithm is either to throw in a trace-command in the function and turn on debug mode. or throw in a READPRN command which appends the current argument to a data file.

Both ways would slow down calculations significantly.

 

I get the following in MC15:

 

tantest.PNG

I can't explain the difference between the implicit and explicit vectorisations!

 

TOL is the default 10^-3; however, setting it much tighter didn't alter anything.

 

Alan 

 

Interesting effects we experience here.

Here is a nother one (done in MC15). I always thought that "root" would use the same LM algorithm as "Find" in the solve block (not in Prime as here we have the Knitro algorithms). Obviously root works in a different way, not sure how. Most of the times we get 0,966. Only with some selected guess values we get a different result.

The algorithm in the solve block for "Find" was set to "Levenberg-Marquardt" (default). "Conjugate Gradient" and "Quasi Newton" give the very same result with exception of guess value 0 - here "Conjugate Gradient" returns 0,966 and no errror.Pic1.png

 

 

 

 

alpha.png

Top Tags