LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Iterative Solution for a given equation

Solved!
Go to solution

Hello all,

 

I have an equation that I need to program and solve iteratively starting with an initial guess.

On excel I would use goal seek for this but I need to do this in real time for an application.

 

I'm relatively a beginner with Labview and I went through the different VI libraries but I cant find exactly what I need

This snippet of the equation below is attached.

Silverfang_1-1725892694508.png

I need to start solving this with an initial guess for M (rest of the coefficients on the RHS are constants). There will be a value of M which corresponds to a known Pt1/Pt0 that I am looking for (within a specific tolerance) and that value of M is my final solution.

 

Can anyone advise me on how to implement this?

 

0 Kudos
Message 1 of 4
(197 Views)

Hi Silverfang,

 

You could solve this on excel because you know how to use it and you cannot do this in LabVIEW because you do not know how to use it. 

Even if a solution is provided to you, you will need to understand how it is working and how you can adjust it to satisfy your needs. Attached is a LabVIEW code snippet to give you some ideas.

For ideas.png

Then depending upon your needs, you will need to learn what is:

1) While Loop

Xonmyth_0-1725897483532.png

 


2) Shift registers

3) For Loop (If you will be working with arrays).

4) Basic Math functions in LabVIEW

Xonmyth_1-1725897511781.png

 

5) Exponential functions in LabVIEW.

Xonmyth_2-1725897555620.png

This is of course excluding having a basic understanding of how LabVIEW works.

 

x

Message 2 of 4
(165 Views)
Solution
Accepted by topic author Silverfang-

Hello Xonmyth,

 

Thank you for such a detailed explanation as well as the screenshot.

I had some time to tinker with this and I programmed a solution that worked for me using formula node.

This gives me almost similar results to what goal seek was giving me.

Posting it here for the archive.

Silverfang_0-1725898465629.png

Thanks either way for the reply! 🙂

0 Kudos
Message 3 of 4
(157 Views)

I see that this is already solved, in large part because you have a specific algorithm to follow.

 

However, for future benefit of anyone looking at this or for other equations you might need to optimize that are less well defined, there is a whole set of optimization VIs built into LabVIEW:

https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/menus/categories/mathematics/anoptimize-mn...

 

Many of the VIs in that group can be used as partial or complete replacements for optimizations that one might use the "solver" or "goal seek" in Excel to do normally.

Message 4 of 4
(128 Views)