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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Root function error: find a value greater than 30^307

Cornel
19-Tanzanite

Root function error: find a value greater than 30^307

Hi,

I do not understand this error in which root function found a number greater than 10^307, as we can see from the plot that on the interval [0.1,10] the magnitude did not go above -1, nor above 1...

Cornel_1-1727079393517.png

 

On the other hand if we specify also the interval [0.1, 10] inside the root function then the root gives no more this error, and can calculate.

Cornel_2-1727079511854.png

 

I do not understand why in the first way root function give that error, as I expected root function to be evaluated between [0.1, 10] interval also in the first way, given only the guess values inside the root function, and not specify explicitly the interval.

 

ACCEPTED SOLUTION

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

Hmm, I always thought the guy was named Muller and not Mueller or Müller ?

The method basically calculates a parabola given three points  (ass opposed to two point in the secant method). So it actually would need three initial guess value. Don't know how Prime calculates the necessary two additional guesses based on the one provided.

 

All values larger than 1.1 (actually 1.059) throw that error.

If we think of the classic Newton method, we could look at the 'next# position, the zero of the tangent. We see that values about 1.1 have a tangent with a zero at about t=-0.65. The function value at this position is quite large, close enough to the numerical limit of an IEEE number.

I sure can imagine that a numerical algorithm jiggling around the guesses may end up at a position (like the -0.66 in the picture) where the numerics has to give up.

We could use the "root" function also symbolically, but then it will not work by just providing a guess value but rather forces us to use the optional range arguments of "root".

Werner_E_0-1727120671154.png

 

View solution in original post

5 REPLIES 5
ttokoro
20-Turquoise
(To:Cornel)

image.pngimage.png

Cornel
19-Tanzanite
(To:ttokoro)

Yes, I already know this, that if we limit maximum value of t0 at 1 then root function will give the answer without error even with first way. But even so, still I do not understand  at this moment why when t0 is > 1 then this error with magnitude greater than 10^307 is occuring as we can see from the plot that when 0.1<t0<1.1 the plot is not going above -1 and 1 on y axis (thus not greater than +10^307 or -10^307).

 

Cornel_0-1727081695832.png

 

Cornel_2-1727081837717.png

StuartBruff
23-Emerald III
(To:Cornel)

 

The difference is due to you specifying exact values to use as the initial guess.   The guess value 1.1 causes the problem when trying to find the root (as do larger values).

 

However, when root is left to its own devices, it skirts around problematic values by approaching the root from over the entire range, hence avoiding values that cause issues.  Provided that solutions can be found, of course.

 

2024 09 23 D.png

 

Stuart

StuartBruff
23-Emerald III
(To:Cornel)

Forgot to add the Mathcad Prime 10 help information (format edited but not the text)...

 

root(f(var1, var2, ...), var1, [a, b])—Returns the value of var1 to make the function f equal to zero. If a and b are specified, root finds var1 on the interval [a, b]. Otherwise, var1 must be defined with a guess value before root is called.

 

  • When a guess value is used, root uses the secant or Mueller’s method;
  • in the case where root bracketing is used, root uses Ridder’s or Brent’s method.

 

Let's see if the modified worksheet will attach ...

 

Success!

 

Stuart

Werner_E
25-Diamond I
(To:StuartBruff)

Hmm, I always thought the guy was named Muller and not Mueller or Müller ?

The method basically calculates a parabola given three points  (ass opposed to two point in the secant method). So it actually would need three initial guess value. Don't know how Prime calculates the necessary two additional guesses based on the one provided.

 

All values larger than 1.1 (actually 1.059) throw that error.

If we think of the classic Newton method, we could look at the 'next# position, the zero of the tangent. We see that values about 1.1 have a tangent with a zero at about t=-0.65. The function value at this position is quite large, close enough to the numerical limit of an IEEE number.

I sure can imagine that a numerical algorithm jiggling around the guesses may end up at a position (like the -0.66 in the picture) where the numerics has to give up.

We could use the "root" function also symbolically, but then it will not work by just providing a guess value but rather forces us to use the optional range arguments of "root".

Werner_E_0-1727120671154.png

 

Announcements

Top Tags