05-29-2020 01:54 AM
Hello.
Who knows how to calculate the area under a curve bounded by two cursors?
I bring my non-working option. I went through the entire “integral” palette and nothing helped. There is no calculation.
Solved! Go to Solution.
05-29-2020 02:19 AM
Hello!
Try to add an indicator (or probe) to the blue indices. You probably want to use the threshold 1d function: https://zone.ni.com/reference/en-XX/help/371361R-01/glang/threshold_1d_array/
Then, add indicators to the X and Y array that You feed into the integration VI. I guess that their size is different, because you limit the X array but not the Y array. This might or might not be an error, depending on what You want to do here.
05-29-2020 04:06 AM
I need to calculate the area under the curve in the selected area.
Example in the picture.
05-29-2020 04:15 AM
Have You tried the things I have written above? What was the result?
Next time, please attach the .vi file.
05-29-2020 06:54 AM - edited 05-29-2020 06:56 AM
Yes. I did as you said. Nothing succeeded. I tried the whole palette of the integral and also nothing.
It does not count correctly or in any way at all.
I found an example of how to calculate the integral, and built it into my VI.
Now everything is correct. I attach my VI. Maybe it will help to someone .
05-29-2020 11:55 AM - edited 05-29-2020 11:56 AM
Hi Fizi,
@Fizikaman wrote:
Yes. I did as you said. Nothing succeeded. I tried the whole palette of the integral and also nothing.
It does not count correctly or in any way at all.
I found an example of how to calculate the integral, and built it into my VI.
Now everything is correct. I attach my VI. Maybe it will help to someone .
What about this:
05-29-2020 12:39 PM - edited 05-29-2020 12:41 PM
I usually use locked to plot cursors and then use the cursor index to get the correct subset. Here's a quick example:
Personally, I would probably resample the input into a linear X axis with a reasonable sampling interval, then use the plain integration tools (not shown). Then you can just integrate the entire dataset and take the difference of the integral between two different indices to get the integral of the subset. (not shown)
06-01-2020 01:46 AM
Thanks to everyone. I think this topic will help many people.