# How to find the slope of the tangent on the graph at X=0 and Y=0 for the given current-voltage graph

18 views (last 30 days)
NITHIN XAVIER on 22 Oct 2020
Commented: Star Strider on 12 Nov 2020 at 15:32
Hi all,
I want to find the slope of the tangent of the I-V graph (this is ploted from the raw data) at V=O and I=0. Can anyone help me to do this?. I don't have a good command on Matlab.

Star Strider on 22 Oct 2020
I am not certain what you want.
See if the gradient funciton does what you want. It requires evenly-spaced data with known differences between the points, however you can get around that with:
That slope will probably be what you want.
If it is not, experiment!

Show 1 older comment
Star Strider on 1 Nov 2020 at 16:37
See if this does what you want:
Tsc.Properties.VariableNames = {'Voltage_V','Current_mA'};
ShuntR = interp1(Tsc.Current_mA, slope, 0); % Resistance
SeriesR = interp1(Tsc.Voltage_V, slope, 0); % Resistance
YatX0 = interp1(Tsc.Voltage_V, Tsc.Current_mA, 0); % Y-Coordinate For Shunt
XatY0 = interp1(Tsc.Current_mA, Tsc.Voltage_V, 0); % X-Coordinate For Series
figure
plot(Tsc.Voltage_V, Tsc.Current_mA)
grid
xlabel('Voltage (V)')
ylabel('Current (mA)')
text(0, YatX0, sprintf('Shunt Resistance = %6.3f \\Omega \n\\downarrow', ShuntR), 'HorizontalAlignment','center', 'VerticalAlignment','bottom')
text(XatY0, 0, sprintf('Series Resistance = %6.1f \\Omega \n\\downarrow', SeriesR), 'HorizontalAlignment','right', 'VerticalAlignment','bottom')
Check it to be sure I got the interpolated resistance values correct and didn’t reverse them.
Windows crashed (again) while I was doing this, destroyed my MATLAB preferences file, and took my MATLAB preferences backup with it. I’m so furious with Micro\$oft right now I can’t see straight. Going Linux with my next desktop. I’m sick of this!
EDIT — (1 Nov 2020 at 18:36)
Corrected typographcal errors.
NITHIN XAVIER on 12 Nov 2020 at 15:24
Thank you so much.
Star Strider on 12 Nov 2020 at 15:32
As always, my pleasure!