LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Equation with dynamic variable

Solved!
Go to solution

Is it possible to use one equation with 2 or more variables and make one of these variable as an output without changing the equation?

 

Take the equation below example:

R=x/(0.28706/0.46153+x)*(101.325/P)

 

As usual, by inserting the values of x and P, then value of R will be answered.

But if only the value of R and x can be inserted, how can the value of P to be answered without altering the equation.

 

The equation is being used multiple time in the same VI. One is for generating one part of a graph (Mollier Diagram) and the others are to be used to find the value at the intersection.

 

I hope my question is understandable.

Thank you in advance

-sikat

 

0 Kudos
Message 1 of 5
(2,823 Views)

Have you looked at the formula node? See attached picture.

0 Kudos
Message 2 of 5
(2,784 Views)

The case structure is a very straightforward program element.  Test to see whether R or P has been entered, then select that case which implements the version of the equation for that input combination.

 

If P then R = (x/(a+x)*(b/P)

If R then P = (x/(a+x)*(b/R)

 

Lynn

0 Kudos
Message 3 of 5
(2,751 Views)

R = (x/(a+x)*(b/P) ... thx, this really will be helping me to make this Eq more understandable

 

Formula Node:

It seem that when i entered an equation(Eq), only the left side of the Eq can only be one variable thus producing a single output.

 

Case Structure(or SELECT function):

It changes the formula to a new form for every output. Let say i want make x an output. That means i need to create a new Eq : x=(P*R/b-1)*a, which i want to avoid if posible .

 

 

.... Does this means that a new Eq must be created/converted for each output.

 

Newton Raphson zero finder vi: (base on this N-R Example)

I have tried using this VI by making my Eq equivalent to zero and using SELECT function depending on situation. Somehow i think it will work, but the VI seem too bulky for one simple formula (with 2 variable and 1 output), which i want to avoid since many more formula will be used.

 

I ll be glad to see more suggestions.

0 Kudos
Message 4 of 5
(2,490 Views)
Solution
Accepted by topic author sikat

You simply need to program both formulas:

 

R(x,P)

P(x,R)

 

and select the one depending on the inputs and desired outputs.

 

N-R should be reserved for cases where there is not analytical solution.

0 Kudos
Message 5 of 5
(2,479 Views)