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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Symbolic evaluation

JohnRudnicki
14-Alexandrite

Symbolic evaluation

I do not use symbolic evaluation very often so I am sure I am doing something wrong.  The following expression should equal mu_0 . Why do I keep getting the same thing back? Do I need a different keyword (I tried several)  or a modifier? 

 

JohnRudnicki_0-1621874339675.png

 

1 ACCEPTED SOLUTION

Accepted Solutions


@JohnRudnicki wrote:

The following expression should equal mu_0 .

No! Why do you think so? Its NOT equal to mu_0, just close for large values of mu_0.

The expression you show "approaches" mu_0 for large mu_0, but is always a bit larger.

Consequently we have

Werner_E_1-1621876662237.png

 

or

Werner_E_0-1621876644716.png

 

For a:=3 we have

Werner_E_2-1621876724306.png

 

 

 

View solution in original post

7 REPLIES 7


@JohnRudnicki wrote:

The following expression should equal mu_0 .

No! Why do you think so? Its NOT equal to mu_0, just close for large values of mu_0.

The expression you show "approaches" mu_0 for large mu_0, but is always a bit larger.

Consequently we have

Werner_E_1-1621876662237.png

 

or

Werner_E_0-1621876644716.png

 

For a:=3 we have

Werner_E_2-1621876724306.png

 

 

 

JohnRudnicki
14-Alexandrite
(To:Werner_E)

I was actually trying to delete the last post, but could not figure out how to do it quickly enough. But now I get...

JohnRudnicki_0-1621876230406.png

 

ut

LucMeekes
23-Emerald III
(To:JohnRudnicki)

You cannot delete your post, you can only edit (and empty if you like) it for about a day after it was posted.

 

Luc

JohnRudnicki
14-Alexandrite
(To:LucMeekes)

Thanks, tho it would seem like a good idea to be able to delete your own post, at least before someone replies.

Its not surprising that the numeric evaluation yields zero (the actual difference is around 10^-55).

I am surprised that the symbolic also yields zero.

If you use numbers with decimals, then the symbolic unfortunately automatically switches into some sort of numeric/float/approx mode.

 

If I use non-float numbers and switch the symbolic manually to float mode, I get more meaningful results. The example shows quite clearly, that the "float" modifier must be used with great care because it does not affect the display only but the whole calculation. Notice the significantly different magnitude of the results with different number of significant digits:

Werner_E_0-1621878032210.png

I cannot duplicate your last result:

Werner_E_1-1621878109629.png

But it is known that when you play around with symbolic evaluations a lot, creating errors and/or numeric over/underflows, the symbolic may get out of control. In this case its best to start a new worksheet from scratch.

 

>> Thanks, tho it would seem like a good idea to be able to delete your own post, at least before someone replies.

Fully agreed on!

 

 

JohnRudnicki
14-Alexandrite
(To:Werner_E)

Thanks for the follow-up, though it gives me more reason to be wary of using symbolic evaluation. I should have recognized analytically that they are not exactly equal or plotted them as you suggested. For my practical purposes, mu_0 about 0.6 and a small, 0 is fine.

LucMeekes
23-Emerald III
(To:JohnRudnicki)

It's generally a good idea to plot the function you are dealing with:

LucMeekes_0-1621876982723.png

I guess for a<<1, and mu0 postive, it wil be hard to tell the difference between f(a,mu0) and mu0...

LucMeekes_1-1621877082601.png

QED.

 

Success!
Luc

Top Tags