08-11-2015 08:52 AM
Hi all,
Is there a way to find the gradient in a xy graph at the y intercept?
I can use the linear fit VI and plot only minimum data around the y intercept and find slope that way. Or is there a more elegant way people do this?
Any advice is welcomed, thanks!
08-11-2015 08:58 AM
Why not just take the two X values surrounding zero and calculate dy/dx from those points? That would be the simplest way if you want the slope just at zero and don't care about the rest of the data.
If you want some form of smoothing with relation to the rest of the data, then you would need to use a fit curve.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
08-11-2015 11:05 PM
That's the idea, except taking only 2 data points might be quite inaccurate. Hence, what I thought of doing is taking several point near the y-intercept. (basically same idea) and finding the linear fitted slope.
Was wondering if there is any way to find the tangent/slope at y-intercept which imo would be much more elegant.
08-12-2015 07:44 AM
The Linear Fit.vi returns slope and intercept values. If the intercept is far from zero (the y intercept), then the points chosen for the fit process are probably not a representative set or the data curves too much for a linear fit to be a good model.
Linear Fit is quite elegant if your data can be modeled as a straight line near the intercept. If your data has a lot of curvature, choose a different, more appropriate model.
Lynn