Difficulty in plotting equation in matlab

조회 수: 2 (최근 30일)
mitsuo
mitsuo 2024년 7월 9일
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;

답변 (2개)

Francisco J. Triveno Vargas
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
Sam Chak 2024년 7월 9일
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
Francisco J. Triveno Vargas
Francisco J. Triveno Vargas 2024년 7월 10일
Nice

댓글을 달려면 로그인하십시오.


Walter Roberson
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) )
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')

카테고리

Help CenterFile Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by