From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

areaundercurve

Solved!
Go to solution

how to calculate area under curve.

 

i want to calculate area under the positive and negative cycles of green plot.

 

thanks

 

Attached VI

0 Kudos
Message 1 of 37
(3,388 Views)

The green plot is never negative, so what exactly do you mean by a negative cycle of the green plot?

0 Kudos
Message 2 of 37
(3,381 Views)

 

Sorry for not mentioning that

 

I meant to say when you change the white slider, the green plot will go above the Red. That would be the positive cycle.

 

This is what i meant my negative cycle which in this situation means the area when green is below the Red.

 

please change the slider position up and down to observe the situation

0 Kudos
Message 3 of 37
(3,378 Views)

So you want to count the area below the red as negative or not?

 

(I.e. do you want to add the areas above and below 0.5 or do you want to subtract the area below 0.5 from the area above 0.5?)

0 Kudos
Message 4 of 37
(3,373 Views)

I want to measure area above and below 0.5 both, and store both values in a table.

 

 And yes i want to subtract the area above with the area below and store the value in the table.

0 Kudos
Message 5 of 37
(3,366 Views)

Here is a quick draft showing both options.

 

Subtract the green from the red, then simply multiply each new point with dt (0.1s in this case) and add to a shift register or feedback node. Take the absolute value if desired.

 

Please veryfy correct operation and modify as needed.

What do you mean by "store in a table"? Do you heed help with that or are you OK with this?

 

Download All
0 Kudos
Message 6 of 37
(3,365 Views)

yes i need help with building a table

 

What i have observed is that when green is above Red, it would start incrementing in the signed integral value and when it is below red it would start decrement in the current value.

 

What i want is that it should store the Area value in the table when green is above Red. It should also store the negative value for area below the Red.

Both values should be displayed individually. I dont want to subtract the both areas at the moment. i just want to store the values individually and see the area above and below.

0 Kudos
Message 7 of 37
(3,360 Views)

What should be in the table? The incremental area with each iteration or only the summary whenever the difference changes sign?

0 Kudos
Message 8 of 37
(3,343 Views)

The table should only show the summary when the sign is changed i.e the total area in that curve until when the sign is changed.

 

 

 

0 Kudos
Message 9 of 37
(3,338 Views)
Solution
Accepted by topic author weeke

What should happen if the difference temporarily goes to zero and the sign does not change?

Do you want one table entry for each segment or just the overall summary?

 

Here's a version that accumuates the above and below areas seperately and displays them in a table.

0 Kudos
Message 10 of 37
(3,332 Views)