Jump to content

Bisection


Racer

Recommended Posts

As a learning exercise, I've been trying to convince LV to find the zeros for equations using the most basic bisection method. The method itself involves average an upper and lower number, averaging them, looking for a sign change (in the function) then replace the upper or lower guess based on the sign change. There is an explanation here:

Bisection Method

I've written the program in C++, and Matlab, but I'm having trouble doing it in LV. I was wondering if someone else has already done it (or something similar), and wouldn't mind letting me look at it.

BTW: to complicate things even more, I'm trying to do this without a case structure or formula node. Is this possible?

--CS

Link to comment

Hi Racer:

Haven't got a LV bisection solver handy-- But here's some hints on avoiding the case structure & formula nodes--

To avoid the case structure, use Select from the Comparison menu. (Picture attached-- not always an efficient thing to use, if there's lots of calculations leading up to the choice not selected, but in this case were the chosen & non-chosen values are already calculated anyway, a good choice since it is nice and readable.)

To most easily avoid the formula node, (and probably best in anyway in the interest of generality) write the function you wish to solve as a Sub-vi to be called by the main vi.

If no one else posts a solver from their archives, I might get a chance to sketch one out for you later on.

Best Regards, Louis

post-1144-1102952578.png?width=400

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.