LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I enter this formula

Hi,

 

I am new to labview and I have managed to set up a VI that tracks and records center of pressure (COP) using a force plate. I have a couple formulas that I need to enter into this VI to calculate specific measures of balance. The problem is I don't know how to enter them. An example of an equation is:

 

Path length

 

 

P=f/(N-1) ∑_(I=1)^(N-1)√([x_I+1- x_I]^2+ [y_I+1-y_I]^2 )  
f = the sampling rate (sampling at 1000Hz)
N = the number of samples
x_I = the instantaneous COP in the mediolateral direction at sample index I
y_I = the instantaneous COP in the anterior-posterior posterior direction at sample index I

 

The VI I have set up acquires x and y. Do I require the Mathscript Node to enter this equation or how should I go about it?

 

 

 

 

 

 

0 Kudos
Message 1 of 7
(3,128 Views)

Do you have the formula in graphical form. It is a bit hard to read as a plain, single-line text. What is the format? What is the meaning of the underscore? The caret?

 

0 Kudos
Message 2 of 7
(3,118 Views)

Take a look at the formula node. You should be able to do what you want using it.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 7
(3,117 Views)

 


@altenbach wrote:

Do you have the formula in graphical form. It is a bit hard to read as a plain, single-line text. What is the format? What is the meaning of the underscore? The caret?

 


 

I believe the underscores are there for readability to separate variable names and that it implies multiplication. x_I would translate to X times I. X^2 would be X squared.

 

Of course the original poster should verify my assumptions.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 7
(3,114 Views)
0 Kudos
Message 5 of 7
(3,102 Views)

I have attached the formula as a word document for clarification.

0 Kudos
Message 6 of 7
(3,065 Views)

My example abouve will do exactly that.

 

 

For the x and y array, we clip the first element, then subtract the full array. We get an array with one less element containing (x(i+1)-x(i)) or similar.

 

Forming the complex array and taking the absolute value is the same as taking the square root of the sum of squares for each element.

Taking the mean is equivalent of summing, then dividing by the (new) size (n-1).

 

(If you don't like complex, you can do it more explicit, it'll just be a little bit messier ;))

 

Multiply by f to get the result p.

 

Message 7 of 7
(3,050 Views)