# LabVIEW

cancel
Showing results for
Did you mean:

## Calculating derivative of array data set

Hi everyone. In my current project, I generate two numeric arrays of data, for voltage and current measurements. I want to calculate a derivative array of voltage with respect to current (dV/dI). Does anyone know how I can accomplish this in Labview?

Message 1 of 7
(342 Views)

## Re: Calculating derivative of array data set

Check the function Derivative vi  do a search on help

Message 2 of 7
(337 Views)

## Re: Calculating derivative of array data set

Maybe I'm misunderstanding, but it looks like derivative.vi calculates dx/dt, with a set dt. It doesn't find the derivative of one array with respect to another array. Is there a way that I can use this function to find dy/dx rather than dy/dt or dx/dt?

Message 3 of 7
(329 Views)

## Re: Calculating derivative of array data set

you can plot voltage x current (Assuming they are sampled at the same time), then calculate the derivative point by point (angular coeficient) of every two points.

Message 4 of 7
(316 Views)

## Re: Calculating derivative of array data set

Most derivative tools assume a fixed dx. You have xy data and I assume that x is not equally spaced.

There are plenty of ways to do what you want. Maybe you can fit it to a polynomial and calculate the derivative from the coefficients using known math. You could also do a spline interpolation.

Can you attach a simple example so we can see how the data looks like? For example are the x and y-values sorted in some way or are there loops.

Message 5 of 7
(314 Views)

## Re: Calculating derivative of array data set

I ran into a similar problem finding slopes with points with non-equal spacing.  Zabercs suggested using finite difference method.

The Wikipedia reference gives an equation that reduces to the same form as an equally spaced derivative calculation if the spacing is actually equal.

Message 6 of 7
(272 Views)

## Re: Calculating derivative of array data set

Depending on the nature of the problem, it might be better to express the slop as an angle, because the derivative blows up for vertical segments.

We still have not seen any data. Often current/voltage curves can follow some established theory that can be fit to a model. Again, once you have a fit, you can calculate the analytical or numeric derivative.

How much noise is in the data? Piecewise derivatives tend to amplify noise. Often fitting or even filtering is needed for a nice result.

Message 7 of 7
(261 Views)