MATLAB Answers

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

12 views (last 30 days)
NITHIN XAVIER
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.
Thanks in advance.

  0 Comments

Sign in to comment.

Accepted Answer

Star Strider
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:
dydx = gradient(y) ./ gradient(x);
That slope will probably be what you want.
If it is not, experiment!

  4 Comments

Show 1 older comment
Star Strider
Star Strider on 1 Nov 2020
See if this does what you want:
Tsc = readtable('solar cell data.txt','ReadVariableNames',0);
Tsc.Properties.VariableNames = {'Voltage_V','Current_mA'};
slope = gradient(Tsc.Voltage_V)./gradient(Tsc.Current_mA*1E-3);
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.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by