LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with Newton Raphson Zero Finder

Solved!
Go to solution

Hey all,

I'm trying to solve an equation with the Newton Raphson Zero Finder, but I can't get a result out of it with this data set. It works with other data sets I've tried, and I've solved this instance of the equation with another program and obtained the result I wanted (about 20), but for some reason I'm having difficulty solving it in Labview. I've attached my VI and the data I'm using. This is what the formula going into the Zero Finder VI is supposed to look like: 
((t*((0.05594*t + 5.2842)*t + 137.37))/(1000*(t+246)))-1.987512E-2
Like I said, I'm getting the result I want when I solve for this specific instance of the formula with another program, so I know that the formula is correct.

Please let me know if you have any insight

0 Kudos
Message 1 of 3
(2,320 Views)
Solution
Accepted by topic author mandarinoa

When you tell it to look in the right place for the zero, it returns 19.94484, which seems to be about 20.

 

1. Connecting an indicator to the error output from the Newton Raphson Zero Finder.vi gives -23021: Both function values have the same sign. Automatic error handling does not pick up the errors from VIs which do not have standard error out clusters. This error suggests that the zero is not between the search limits or that there are multiple zeros in that range.

 

2. The default values of start and end are 0 and 1. Changing end to 100 produced the result above. There appears to another zero at -246 so you cannot make the limits too far apart.

 

Often it is useful to visualize the data. Plot the data and the results of the formulas on graphs to see what is happening. Using Eval Single-Variable Array.vi I get this:

 

formula result.png Note that it shows two zero-crossings.

 

Although it does not seem to be a problem here, having very large or very small values can lead to numeric overflow, underflow, or roundoff errors.  Multiplying your Spectrum array and intial parameters by 1E23 and then later dividing by the same factor (if necessary) might help avoid such problems.

 

Lynn

Message 2 of 3
(2,288 Views)

Thank you so much!

0 Kudos
Message 3 of 3
(2,281 Views)