LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

nD 3 equation nonlinear solution to find 3 unknown variables

Solved!
Go to solution

Hello, I tried to use nD Nonlinear System Single Solution to solve

X+3y+2z = -1

2X+4y+3z = 2

-x+2y+4z = 5

 

I know the answer to x,y, and z but I wanted Labview to figure it out. Here's my attached vi in LV 2009 and it only tells me that those 3 equations are soluable and reached 3 zeros.. What I really wanted is to find real answer of x,y and z.

 

Thanks.

0 Kudos
Message 1 of 6
(3,220 Views)

Oops, I forgot to save those data as default. Here's the vi with default values.

0 Kudos
Message 2 of 6
(3,218 Views)
Solution
Accepted by topic author William_Wood

you are solving f(x)=0 so you need to move the constants to the LHS of your equations:

 

 x+3y+2z+1=0

2x+4y+3z-2=0

-x+2y+4z-5=0

 

[0,0,0] works for a starting point and you find the solution is (3,-4,4)

Message 3 of 6
(3,207 Views)
Awesome! That solved it. How about VI instance version? I tried to strict typed VI and it works but I saw that X and F(X) is number not string and F(X) is considered indicator instead of control or constant that confuses me.
0 Kudos
Message 4 of 6
(3,196 Views)

The VI that you supply has a simple job, take in n values (ie. x,y,z values) and return the n function values in F(X).  The variant is there in case you want to pass additional values, such as the coefficients for a more general case.  For your case here is a simple example.

 

Download All
Message 5 of 6
(3,184 Views)
Ah! It solves it again. Many thanks Darin. 🙂 I didn't know that I have to actually fill in formula equations in VI template to do the job.. I learned something new today. That's all I need. Thanks again.
0 Kudos
Message 6 of 6
(3,180 Views)