LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Solving for a variable - Question

I am somewhat new to LabView, so please forgive the elementary level of this question.
I am using LV 8
 
I know that you can use an Express VI to solve for y in the following equation: y=a+b.  I am also familiar with using a formula node to do the same thing.  However, how can I go about solving the same equation for a?  Obviously I could re-arrange the y=a+b equation and solve in a similar manner as above, but the actual formulas that I am working with are far too cumbersome to do this.
 
y=a+b
solve for a, without re-arranging the formula.
 
Thanks!
 
0 Kudos
Message 1 of 11
(3,429 Views)
Without rearranging to A=Y-B, I don't know how it can be done with Express vi or formula node.  In both, you have to declare Y as an output and A and B as inputs.  There is no way to solve for A without A being declared an output and Y and B inputs.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 11
(3,422 Views)

Any other ideas as to how this could be accomplished (besides the formula node and express VI)?

If this were just a single instance, I would just do the alegbra, but there are serveral equations in which I would need to rearrange and then I would have to do this all over again for each variance of the program when I solve for different variables.  I would rather just enter the formula and then specify what variable I want to solve for (if possible).

 

Thanks!

0 Kudos
Message 3 of 11
(3,422 Views)
You can use the Lev-Mar fitting algorithms and simply specify the variables before otimization.  Setting the knowns, and taking a guess at the unknowns should solve for the equation.  Bearing in mind that this is a probabilistic approach, depending on the start values, you could end up with different end values.  But, assuming this part will work, you have ALL variables available at the end of the optimization / minimization.

I use such routines a bit when it comes to processing spectrometer data and I find it to be quite robust, especially when you know approximately where your "unknowns" should lie.

To answer your original question, in order to be able to use the SAME equations and routines to get DIFFERENT variables, you simply declare ALL values as variables, even those you already know.  This actually gives you the chance to check the results by making sure the variation between the starting known values and the "optimized" known values isn't too large.  Numerically there will almost always be a small difference.

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 4 of 11
(3,408 Views)
Uh, that was a little over my head.  :womansad:  Sorry.  I am a newbie to this program.  It seems like Lab View would be able to do this fairly simply.  Heck, my calculator can do it!  Smiley Mad
0 Kudos
Message 5 of 11
(3,380 Views)

No other ideas?  I was a bit lost with the last post, so it wasn't much help.

:womansad:

0 Kudos
Message 6 of 11
(3,363 Views)
The Lev-Mar VI is a VI which basically allow you to enter an equation in text (Parsed to a particular format) and to supply some starting values for the various coefficients.  Then, by making probabilistic variations to the different variables, it minimises the error between the equation result and the supplied raw data.

The VIs should be available under "Mathematics"->"Curve fitting"->"Levenberg Marquard"

You'll probably only have it if you have the advanced analysis toolset installed.

Look at the help file for this VI, and see if there are any examples of it delivered with LabVIEW.  It's a bit complicated, but a very versatile tool when you get used to it.  Please note that due to the text-based nature of the equation parsing used in this version, the performance is not great for complicated equations.

Here's a screen shot of the help file on my LabVIEW version (6.1)

Hope this helps you a bit further

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 7 of 11
(3,351 Views)

Hmm...okay.  What you said makes sense now, but I don't believe we have that tool installed.  We have LV 8 with all the bells and whistles, but I can't find that tool.  I will keep looking.  Perhaps it was renamed to something else.  I know some of the other tools were replaced over the course of version changes.

 

Thanks again for your help!

0 Kudos
Message 8 of 11
(3,342 Views)
Hello,
 
For examples, open the example finder in LabVIEW 8 (click Help -> Find Examples...), then click the Search tab, and search the string "Levenberg-Marquardt" (without quotes)... this should show up in the double-click keywords list, and you'll get a nice set of examples, some of which use lev-mar fitting.
 
I hope this helps!
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 9 of 11
(3,320 Views)

Found it!

Thanks for all the advice.

0 Kudos
Message 10 of 11
(3,313 Views)