08-01-2024 09:40 AM
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?
08-01-2024 09:43 AM - edited 08-01-2024 09:43 AM
Check the function Derivative vi do a search on help
08-01-2024 09:47 AM
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?
08-01-2024 09:55 AM
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.
08-01-2024 09:58 AM - edited 08-01-2024 10:04 AM
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.
08-01-2024 11:44 AM
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.
08-01-2024 12:18 PM
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.