LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate an integral where x is different from "time"?

Hi everyone,
I have a vi that acquires data from a LVDT and a Load Cell and generates and array with this data, so I can plot a load (F) x displacement (l) curve in order to calculate the energy associated to this curve (∫Field = Energy). I have been able to easily get the load cell data as f(x) but using the numeric integration vi I can only play at the time domain, when what I need is x=displacement and f(x)= load instead of x=time (t). Would anyone know a way of replacing the time reading by my displacement signal reading instead?
I am sending the vi on as an image file to illustrate it. Note that I use Field Point for Data Acquisition.
Thanks for the help.
Adriana
0 Kudos
Message 1 of 2
(2,513 Views)
Adriana,

The help file for the Numeric Intrgration VI defines the algorithm for integration by the trapezoidal rule as:

result = sum ((x[i+1] + x[i])*dt/2), where the sum is taken over all values of i in the input data array.

For your application try replacing dt with dl = l[i+1] - l[i]. You will need to do the sum in a loop with a shift register and create your own integrating subVI. Try it with some simple data where you know or can manualy calculate the correct value to make sure it works well. Watch for errors where the data chages very rapidly or very slowly.

Lynn
0 Kudos
Message 2 of 2
(2,498 Views)