LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to integrate manually without using a integration VI ?

Solved!
Go to solution

Hello Everyone, 

 

My programm acquire data in single points that I would like to integrate using the real dt and the trapezoidal rule: ((X(i-1) + X(i)) / 2) * dt 

 

Here is what is happening in my programm: I become through a scale the mass in [g]. After derivating in manually with the realt dt (see VI attached) I become the mass flow [g/s]. In order to validate my results I want to integrate the mass flow to get the mass [g]. However, the results of the integration differ significantely from the mesured mass from the scale itself. 

 

I tried to explain the context in the screenshot attached.

 

Do you have any ideas why am I getting false results ?  

 

 

best regards 

 

 

 

 

Download All
0 Kudos
Message 1 of 7
(932 Views)
Solution
Accepted by topic author Ezzow

Hi Ezzow,

 

1. I'm not sure why you want to "validate" a measured value by derivating it and then re-integrating it right away...

Note that numerical integration is an approximation of the true integral and that you will have a deviation over time due to iterative approximation and rounding errors.

 

2. Your formula is right but you only compute the surface of the current trapeze.

You must add it up to a shift register to compute the sum of all trapezes to get the global integral.

 

Test the attached VI:

Message 2 of 7
(906 Views)

@raphschru wrote:

Hi Ezzow,

 

1. I'm not sure why you want to "validate" a measured value by derivating it and then re-integrating it right away...

Note that numerical integration is an approximation of the true integral and that you will have a deviation over time due to iterative approximation and rounding errors.

 

2. Your formula is right but you only compute the surface of the current trapeze.

You must add it up to a shift register to compute the sum of all trapezes to get the global integral.

 

Test the attached VI:


That made me laugh.  You meant "trapezoid" not "trapeze".

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 7
(876 Views)

Damn I was fooled by the french translation "Méthode des trapèzes", I thought trapezoid was the adjective and trapeze the noun.

0 Kudos
Message 4 of 7
(856 Views)

@raphschru wrote:

Damn I was fooled by the french translation "Méthode des trapèzes", I thought trapezoid was the adjective and trapeze the noun.


They're both nouns.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 7
(849 Views)

Hi raphschru, 

 

I apreciate your help, thank you! 

 

The VI is working. 

 

Can you please explain the role of the red marked part? because I didn't get it. I even removed it and it's still working. 

 

Ezzow_0-1665561190684.png

 

best regards

 

0 Kudos
Message 6 of 7
(764 Views)

@Ezzow wrote:

 

Can you please explain the role of the red marked part? because I didn't get it. I even removed it and it's still working. 

 

Ezzow_0-1665561190684.png


The True sets the starting value to m(g), and then it adds the dy/dx (i assume) If you set a breakpoint after the Select and Retain wire values or Highlight mode it should be obvious.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 7
(755 Views)