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!