Difficulty in plotting equation in matlab

2 visualizzazioni (ultimi 30 giorni)
mitsuo
mitsuo il 9 Lug 2024
I need the MATLAB code to plot the equation
V = ((N.*k.*T_ambient./q).*(log(I./Iso)-(q.*Vgo/(N.*k.*T_ambient))) + Vgo+Rso.*I)./(1-(N.*k.*Rth.*I./q).*(log(I./Iso)-(q.*Vgo./(N.*k.*T_ambient))) - alphao.*Rso.*(I.^2).*Rth)
V should be on x axis and I on y axis. I is to be obtained using V. The values of ther variables are :
N = 1.15;
k = 1.38e-23;
q = 1.6e-19;
Vgo = 1.174;
Rso = 0.085;
Iso = 21.6e-15;
alphao = 0.0165;
Rth = 1;
T_ambient = 298;

Risposte (2)

Francisco J. Triveno Vargas
Hello,
You need to create a vector or current like I = 0.01:0.1:20 Ampers,
Calculate the equation for V after plot the vector V related I
figure(10)
plot(V,I)
grid on
xlabel('Current')
ylabel(''Voltage')
  3 Commenti
Sam Chak
Sam Chak il 9 Lug 2024
The vector V is automatically created when the vector I is used in the equation. Of course, if it also possible to define the equation for V first, and then creates vector I, but this 2nd method requires you to create a function handle. To avoid confusion, learn basic of plotting as shown by @Francisco J. Triveno Vargas.
I = linspace(0, 25, 2501);
V = ((N.*k.*T_ambient./q).*(log(I./Iso)-(q.*Vgo/(N.*k.*T_ambient))) + Vgo+Rso.*I)./(1-(N.*k.*Rth.*I./q).*(log(I./Iso)-(q.*Vgo./(N.*k.*T_ambient))) - alphao.*Rso.*(I.^2).*Rth);
plot(V, I), grid on, xlabel I, ylabel V

Accedi per commentare.


Walter Roberson
Walter Roberson il 9 Lug 2024
N = 1.15;
k = 1.38e-23;
q = 1.6e-19;
Vgo = 1.174;
Rso = 0.085;
Iso = 21.6e-15;
alphao = 0.0165;
Rth = 1;
T_ambient=298;
eqn = @(V,I) V - ( ((N.*k.*T_ambient./q).*(log(I./Iso)-(q.*Vgo/(N.*k.*T_ambient))) + Vgo+Rso.*I)./(1-(N.*k.*Rth.*I./q).*(log(I./Iso)-(q.*Vgo./(N.*k.*T_ambient))) - alphao.*Rso.*(I.^2).*Rth) )
eqn = function_handle with value:
@(V,I)V-(((N.*k.*T_ambient./q).*(log(I./Iso)-(q.*Vgo/(N.*k.*T_ambient)))+Vgo+Rso.*I)./(1-(N.*k.*Rth.*I./q).*(log(I./Iso)-(q.*Vgo./(N.*k.*T_ambient)))-alphao.*Rso.*(I.^2).*Rth))
fimplicit(eqn, [0 200 0 30])
xlabel('V'); ylabel('I')

Categorie

Scopri di più su Mathematics and Optimization in Help Center e File Exchange

Prodotti


Release

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by