LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Solving for coefficients

I have a function, z, that is a function of two other variables, call them x and y

or in other words z(x,y).

 

I have a general idea of what the equation should look like, and I have x, y, and z data (experimentally).

I was going to try some type of Least Squares method to solve for the coefficients, but there are 6 of them.

Before I dive waist deep into this, is there anywhere in the LabVIEW palette I should be looking, so I dont reinvent the wheel?

 

 

Heres the formula, with coefficients represented as a1, a2, a3 ... etc

 

z = (a1)*(a2)*y + (a1)*(a3) + (a4)*y*exp((-x-a4)/a5) + (a6)*exp((-x-a4)/a5)

 

I saw the 'Nonlinear Curve Fit' VI but I dont see an input for 'formula'.

Message Edited by Cory K on 09-10-2009 03:34 PM
Cory K
0 Kudos
Message 1 of 3
(2,290 Views)

I see that in the drop down menu in the nonlinear fit, there is an option to specify a formula, rather than a VI.

I can cluster the forumla, an array of coefficients, but its the last input that is a problem.

It requires me to specify what the variable is, but I have 2.

 

Is there a VI just like this one, but for multivariable?

Cory K
0 Kudos
Message 2 of 3
(2,277 Views)

In my version (8.2.1) I have to squeeze my 2D data into 1D.  In this case you are much better off using a VI instead of a formula.  For the X array I just use the integers 1..N^2 and the formula VI maps the value to the proper X,Y coordinate and returns the appropriate f(x,y,a).  With equal number of points in both X and Y I just use sqrt(length(X)) to find N.  There are probably examples on the forum (mine are on a different machine) or maybe life beyond 8.2 is better.

0 Kudos
Message 3 of 3
(2,268 Views)