Difficulty in plotting equation in matlab
2 ビュー (過去 30 日間)
古いコメントを表示
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;
0 件のコメント
回答 (2 件)
Francisco J. Triveno Vargas
2024 年 7 月 9 日
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 件のコメント
Sam Chak
2024 年 7 月 9 日
Hi @mitsuo
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
Walter Roberson
2024 年 7 月 9 日
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) )
fimplicit(eqn, [0 200 0 30])
xlabel('V'); ylabel('I')
参考
カテゴリ
Help Center および File Exchange で Mathematics and Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!