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

37 visualizzazioni (ultimi 30 giorni)
Wiem
Wiem il 28 Giu 2024
Commentato: Aquatris il 4 Nov 2024 alle 10:10
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)');

Risposte (1)

Aquatris
Aquatris il 28 Giu 2024
Modificato: Aquatris il 28 Giu 2024
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 Commenti
Stacy
Stacy il 2 Nov 2024 alle 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 il 4 Nov 2024 alle 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

Accedi per commentare.

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by