04-14-2020 08:20 PM
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
Solved! Go to Solution.
04-14-2020 08:31 PM - edited 04-14-2020 08:35 PM
@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.
04-14-2020 08:37 PM
Try a start value of 1E-6 or so. At x=0 you have a divide by zero.
04-14-2020 08:45 PM
Hi
I tried but unfortunately that too gave me NaN.
Thanks
04-14-2020 08:49 PM
Hi
I tried plotting the values and I get a zero crossing. Attaching the VI for reference.
Thanks
04-14-2020 09:17 PM
Make sure "sin" is lowercase in the formula. (You are using "Sin")
04-14-2020 09:20 PM
Hi
I tried the lower case as well, but the result is still NaN.
Thanks
04-14-2020 09:31 PM - edited 06-09-2020 09:11 AM
04-14-2020 09:42 PM
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
04-14-2020 09:47 PM
Hi
Attaching the 2019 version, with which I tried.
Thanks