05-28-2011 09:39 AM
how to calculate area under curve.
i want to calculate area under the positive and negative cycles of green plot.
thanks
Attached VI
Solved! Go to Solution.
05-28-2011 10:30 AM
The green plot is never negative, so what exactly do you mean by a negative cycle of the green plot?
05-28-2011 10:55 AM
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
05-28-2011 11:02 AM
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?)
05-28-2011 11:27 AM
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.
05-28-2011 11:27 AM - edited 05-28-2011 11:30 AM
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?
05-28-2011 11:55 AM
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.
05-28-2011 12:38 PM
What should be in the table? The incremental area with each iteration or only the summary whenever the difference changes sign?
05-28-2011 12:44 PM
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.
05-28-2011 12:56 PM
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.