Someone help me to plot Ids vs Vds for HEMT AlGaN/GaN
46 次查看(过去 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)');
0 个评论
回答(2 个)
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
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
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
Pavl M.
2024-11-25,4:35
编辑:Pavl M.
2024-11-25,5:58
vectorized solution + units update:
I commited, won(got accepted after a bid/proposal at freelance marketplace) and completed before project on complex modified FET modeling with quantum effects considerations in TCE NCE MPPL Matlab. Today it is reasonable and I want to get re-hired, employed to complete similar works for hardware. If I want I do for you for your sole entrepreneour or corporate project, M.Sc., Ph.D. help/support please you contact me more.
clc
clear all
close all
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=-90:0.01:60; % feasible span(region) of Drain-Source transistor potential, [V]
Vdsat=Vgs-Vth+Vs-((Vgs-Vth)*(Vgs-Vth)+Vs*Vs);
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));
Ids(Vdsat<Vds) = 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);
figure;
plot(Vds,Ids);
xlabel('Vds (V)');
ylabel('Ids (A/mm)');
%https://independent.academia.edu/PMazniker
%+380990535261, https://join.skype.com/invite/oXnJhbgys7oW
%https://diag.net/u/u6r3ondjie0w0l8138bafm095b
%https://github.com/goodengineer
%https://orcid.org/0000-0001-8184-8166
%https://willwork781147312.wordpress.com/portfolio/cp/
%https://www.youtube.com/channel/UCC__7jMOAHak0MVkUFtmO-w
%https://nanohub.org/members/130066
%https://pangian.com/user/hiretoserve/
%https://substack.com/profile/191772642-paul-m
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!