Someone help me to plot Ids vs Vds for HEMT AlGaN/GaN

37 次查看(过去 30 天)
i'm trinig to plot Ids vs Vds with matlab and i'm not having any result please check my code ;
Vth=2e-7;
Vs=1.5e-7;
Z=150e-6;
e=1.6e-19;
ep=8.85e-12;
mn=9.1e-31;
dd=30e-9;
di=7e-9;
x=1.05e-34;
u=1.257e-6;
L=150e-6;
Vgs=-4;
Vds=0;
Vdsat=Vgs-Vth+Vs-((Vgs-Vth)*(Vgs-Vth)+Vs*Vs);
if(Vdsat<Vds)
Ids=2*Z*e*e*ep*mn*Vs/(2*(dd+di)*e*e*mn+ep*pi*x*x)*(((Vgs-Vth)*(Vgs-Vth)+Vs^0.5)-Vs);
end
if(Vdsat>Vds)
Ids=2*u*Z*ep*e*e*mn/(L*(2*(dd+di)*e*e*mn+ep*pi*x*x))*((Vgs-Vth)*Vds-((Vds*Vds)/2));
end
figure;
plot(Vds,Ids);
xlabel('Vds (V)');
ylabel('Ids (mA/mm)');

回答(1 个)

Aquatris
Aquatris 2024-6-28
编辑:Aquatris 2024-6-28
I think what you are trying to do is vary Vds and see what Ids becomes. So here is a simple some modification for it using for loop. However you should try to vectorize the for loop for efficient code:
Vth=2e-7;
Vs=1.5e-7;
Z=150e-6;
e=1.6e-19;
ep=8.85e-12;
mn=9.1e-31;
dd=30e-9;
di=7e-9;
x=1.05e-34;
u=1.257e-6;
L=150e-6;
Vgs=-4;
Vds=-60:0.01:60; % generate a vector of interest
Vdsat=Vgs-Vth+Vs-((Vgs-Vth)*(Vgs-Vth)+Vs*Vs);
for i = 1:length(Vds) % loop through Vds and calculate corresponding Ids
if(Vdsat<Vds(i))
Ids(i)=2*Z*e*e*ep*mn*Vs/(2*(dd+di)*e*e*mn+ep*pi*x*x)*(((Vgs-Vth)*(Vgs-Vth)+Vs^0.5)-Vs);
end
if(Vdsat>Vds(i))
Ids(i)=2*u*Z*ep*e*e*mn/(L*(2*(dd+di)*e*e*mn+ep*pi*x*x))*((Vgs-Vth)*Vds(i)-((Vds(i).*Vds(i))/2));
end
end
figure;
plot(Vds,Ids);
xlabel('Vds (V)');
ylabel('Ids (mA/mm)');
  2 个评论
Stacy
Stacy 2024-11-2,0:41
Can you please tell me how you are getting the unit of current as A/mm? As I can see in the code you didn't mention any division by 1000.
Aquatris
Aquatris 2024-11-4,10:10
I have no idea about the units since non of the units are written for the variables. I just copied and modified the OP's code and modified to do what I assumed OP wanted to do.
Unless the units of each variable are given, it is hard to judge if this plot labels are correct ro not

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by