12-12-2025 09:38 AM
I want to use the basic integration VI .
However I don't have a formula for the input, I have an X and Y one dimensional arrays,
How could I use this VI with just the one dimensional arrays rather than a formula?
12-12-2025 10:04 AM
Do you have evenly spaced data points? If so, use Mathematics >> Integ & Diff >> Integral x(t) #
It is in vi.lib\Analysis\2dsp.llb\Integral x(t).vi
12-12-2025 11:40 AM
Try attached implementation of trapezoid rule.
12-12-2025 01:16 PM - edited 12-12-2025 02:03 PM
@LED47 wrote:
I want to use the basic integration VI .
However I don't have a formula for the input, I have an X and Y one dimensional arrays,
How could I use this VI with just the one dimensional arrays rather than a formula?
Your two input arrays differ in size so integration will fail. Can you attach a VI with clean data?
What is the output you want?
12-12-2025 01:39 PM - edited 12-12-2025 02:08 PM
Once you clean up your data such that both arrays have equal length and x is sorted and does not contain duplicates, here's what you could do.
(Sorry, I originally had x and y reversed. I reattach a corrected version. Why would the call the lower input "T" instead of "X"????)
12-12-2025 02:22 PM - edited 12-12-2025 02:44 PM
Integration should not need duplicate time values removed. Yes, I understand that the recommended palette VIs could return an error, but that seems to be an unnecessary restriction.
The following data is easily integrated by hand, and should be supported by the integration VIs:
**Update** Uneven Numeric Integration VI allows for duplicate time values. It only returns an error if sorting changes the order and there's one or more duplicates in T
12-12-2025 03:04 PM
dsb@NI wrote:
Integration should not need duplicate time values removed. Yes, I understand that the recommended palette VIs could return an error, but that seems to be an unnecessary restriction.
Hmmm,... So what would the integral be for the following data where the same X has multiple different Y values? I guess the result would depend on the order of the duplicates.
T, X
1, 5
2, 6
3, 8
3, 1000
3,-20
4, 80
5, 100
(Yes, I originally had the inputs swapped and got the duplicate error)