LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use of Integration VI

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?

 

0 Kudos
Message 1 of 7
(136 Views)

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

Message 2 of 7
(123 Views)

Try attached implementation of trapezoid rule.

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 3 of 7
(73 Views)

@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?

 

 

Message 4 of 7
(52 Views)

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.

 

altenbach_0-1765569634132.png

 

(Sorry, I originally had x and y reversed. I reattach a corrected version. Why would the call the lower input "T" instead of "X"????)

 

 

0 Kudos
Message 5 of 7
(48 Views)

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:

dsbNI_0-1765569074466.png


**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

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 6 of 7
(29 Views)

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)

0 Kudos
Message 7 of 7
(19 Views)