LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error with Newton Raphson zero finder

Solved!
Go to solution
Solution
Accepted by eddy1990

No, I was using LabVIEW 2019. (and down-converted to 2018 for you).

 

Here's the 2019 version.

 

 

Message 11 of 15
(910 Views)

@eddy1990 wrote:

Attaching the 2019 version, with which I tried.

 


Common sense dictates that you inspect the actual inputs to the function. You wired your format string to the wrong input.

0 Kudos
Message 12 of 15
(908 Views)

The problem is in your format into string function.  I put a probe on the string wire coming out of the working and non-working VI's.

 

Working: (sin(0.5*x)/x)-0.125000

Non-working: (sin(0.5*x)/x)-%f0.125000

 

Hmm.  Different.  Why does the Non-working one have an extra %f in there.  Nothing visible on the block diagram to show a difference.

 

So I right clicked on the Format into String and looked at Edit format String

 

Working:   (sin(0.5*x)/x)-%f

Non-working: %f

 

There's the difference.  Those constants you have wired into of "(sin(0.5*x)/x)-%f" are Initial string connection.

They should have been put into the Format String (top of function connector).

 

Just delete that Format into String.  Drop a new one, and wire it up properly with the string constant wired to the top of the function!

 

PS.  This thread is a perfect example of why we request actual VI's and not just pictures.  It is hard to debug without going in and poking around.

 

PPS:  It is also why cleaning up wires in block diagrams is so important.  When I open up Altenbach's VI, the constant is wired to the top, but the wire bends makes it look like it is going into the top left.  (Sorry Christian, your snippet, and your actual VI when I opened it didn't look like it should.)

 

 

Message 13 of 15
(906 Views)

Thanks. My bad not checking into finer details. Thanks a bunch.

0 Kudos
Message 14 of 15
(902 Views)

The problem with programming is that the program will always do what you tell it to do, and not always what you want it to do.  With experience, (hopefully) the two will converge.

 

When something doesn't work right, always assume first that you aren't doing something right.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 15 of 15
(886 Views)