plotting I-V curves

Hello,
I am fairly new to MATLAB, and I am trying to plot I-V curves with temperature as a variable. With a changing temperature Voc has multiple answers, and so does Ipv. I would like to plot multiple curves that start at Isc (y axis) and end at Voc (x axis), but when I go to plot the two using the plot comand I get one straight line starting from the origin. The Code I used is below. Any help firguring this out would be greatly appreciated!
Isc = 8.7 % short circuit current
S = 1000 % apparent power
ns = 30
np = 40
n = 1.95 %Ideality factor
K0 = 0.0017
Tr = 300 % refrence temperature
Is = 1.2*10^-7 % diode reverse saturated current
q = 1.602*10^-19 % electron charge
K = 1.38*10^-23 %Boltzmann constant
Rs = 0.013
Rp = 3.5
Vd = Isc*Rs
T = [233.15, 253.15, 273.15, 293.15, 313.15, 333.15] % Absolute temperature
Id = Is*(exp((q*Vd)./(1.95*K*T))-1)
Voc = ((n.*K.*T)./q).*log((Isc./Id)+1)
Ipv = np.*((Isc+K0.*(T-Tr))./(100)).*S-(np.*Is.*(exp((q.*Voc)./(n.*K.*T.*ns))-1)-((np.*Voc)./ns.*Rp))
plot(Voc,Ipv)

9 Comments

darova
darova on 24 Mar 2020
What values are independent? Can you explain more? Do you have a picture of expected result?
Yes,
The independent values are:
Isc
S
ns
np
n
K0
Tr
Is
q
k
Rs
Rp
Vd
The rest depend on how the temperature changes. The result I am looking to achieve can be seen from the fifth image where the curves change with temperature in the link provided: https://www.seaward.com/gb/support/solar/faqs/29495-curve-tracing-faq-s/#15
I end up getting one straight line that starts at the origin instead of multiple curved lines that start on the y axis.
Another attempt
clc,clear
ii = [3 5 8.7 10 20]; % short circuit current
% tt = [233.15, 253.15, 273.15, 293.15, 313.15, 333.15]; % Absolute temperature
tt = linspace(0,100,30);
[Isc,T] = meshgrid(ii,tt);
S = 1000; % apparent power
ns = 30;
np = 40;
n = 1.95; %Ideality factor
K0 = 0.0017;
Tr = 300; % refrence temperature
Is = 1.2*10^-7; % diode reverse saturated current
q = 1.602*10^-19; % electron charge
K = 1.38*10^-23; %Boltzmann constant
Rs = 0.013;
Rp = 3.5;
Vd = Isc*Rs;
Id = Is*(exp((q*Vd)./(1.95*K*T))-1);
Voc = ((n.*K.*T)./q).*log((Isc./Id)+1);
Ipv = np.*((Isc+K0.*(T-Tr))./(100)).*S-(np.*Is.*(exp((q.*Voc)./(n.*K.*T.*ns))-1)-((np.*Voc)./ns.*Rp));
plot(Voc,Ipv)
I gave that a try and I ended up getting 5 straight lines that do not curve to Voc ( the x axis ), but just go straight to a certain point and stop.
This is close but i just don't understand how to make the lines curve to get to the x axis. Also each of the lines should start at Isc which is a constant value on the Y axis.
darova
darova on 24 Mar 2020
I think you should have more Isc values
Unfortunetely the project gives only one value for Isc which is 8.7 amps. the focus for the I-V curves is to show how the change with temperature. they should all start at the Isc value, but have different Voc values. The image at the top of my attachment depicts the result I am looking to achieve.
darova
darova on 24 Mar 2020
Looks like you should have 3 values of Isc to create 3 curves
The example in the figure uses three values for Isc, but for my example the curves should all start at the same point on the y axis ( the single Isc value). Is it possible to have all the curves start at the same point?

Sign in to comment.

Answers (1)

Joel Van Sickel
Joel Van Sickel on 2 Feb 2023

0 votes

The problem is this. You have a set of equations that answer this question: given a short circuit current, what is my open circuit voltage? What you want is an equation that answers this question, given a load (o ohms being short circuit) what is my circuit load current and voltage? You could then sweep the load from short circuit to open circuit to generate the operating curve. While that equation probably is somewhere in literature, the more common approach is to use circuit simulation to get the results as shown here:

Categories

Asked:

on 24 Mar 2020

Answered:

on 2 Feb 2023

Community Treasure Hunt

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

Start Hunting!