LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error with Newton Raphson zero finder

Solved!
Go to solution

Hi 

 

I am trying to use the Newton Raphson zero solver to solve an equation, sin(x/2) / x = 0.125.

 

The start point is zero and the end point is 2*pi. A known solution for x is 4.9494.

 

I get the error -23001 and NaN as the answer. I am not sure why this problem exists?

 

Any advice is highly appreciated. A snip shot of my trial is attached.

 

Regards

0 Kudos
Message 1 of 15
(3,424 Views)

@eddy1990 wrote:

.... A snip shot of my trial is attached.

 


No, that's just an image that we cannot inspect or debug. If you expect help, please attach your Vi instead

 

Di you try to graph your function to see if your assumptions are sound?.For example, you probably don't want a division by zero.

0 Kudos
Message 2 of 15
(3,410 Views)

Try a start value of 1E-6 or so. At x=0 you have a divide by zero.

0 Kudos
Message 3 of 15
(3,407 Views)

Hi

 

I tried but unfortunately that too gave me NaN.

 

Thanks

0 Kudos
Message 4 of 15
(3,402 Views)

Hi

 

I tried plotting the values and I get a zero crossing. Attaching the VI for reference.

 

Thanks

0 Kudos
Message 5 of 15
(3,401 Views)

Make sure "sin" is lowercase in the formula. (You are using "Sin")

0 Kudos
Message 6 of 15
(3,390 Views)

Hi

 

I tried the lower case as well, but the result is still NaN.

 

Thanks

0 Kudos
Message 7 of 15
(3,387 Views)

Works just fine here....

 

altenbach_0-1591711773740.png

 

 

Message 8 of 15
(3,375 Views)

Hi

 

Thanks for your effort. Can it be because I am using 2019 version of LabView?

 

I tried the VI you send me and it gives NaN result using LabView 2019.

 

Thanks

0 Kudos
Message 9 of 15
(3,366 Views)

Hi

 

Attaching the 2019 version, with which I tried.

 

Thanks

0 Kudos
Message 10 of 15
(3,356 Views)