09-09-2024 09:41 AM
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.
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?
Solved! Go to Solution.
09-09-2024 11:04 AM - edited 09-09-2024 11:07 AM
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.
Then depending upon your needs, you will need to learn what is:
1) While Loop
2) Shift registers
3) For Loop (If you will be working with arrays).
4) Basic Math functions in LabVIEW
5) Exponential functions in LabVIEW.
This is of course excluding having a basic understanding of how LabVIEW works.
x
09-09-2024 11:17 AM
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.
Thanks either way for the reply! 🙂
09-09-2024 12:39 PM
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:
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.