I am taking plot for Id-Vgs plot of AlN\GaN HEMT
2 次查看(过去 30 天)
显示 更早的评论
I am taking graph between Id -Vgs using the following formula but not getting right curve . Can anyone please correct my code.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1087895/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1087900/image.png)
The required graph is:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1087905/image.png)
Following is the code I have written for getting Id-Vg plot.
clear all;
E0=8.85e-12;
Eoxide=(9*E0);
toxide=6e-9;
coxide=(Eoxide/toxide);
dit=1.2e12;
q=1.6e-19;
gamma=(1/(1+dit*q/coxide));
nd=1.5e16;
daln=6e-9;
fim=(5.1*1.6e-19);
xaln=(1.9*1.6e-19);
fi0=(3.4*1.6e-19);
fis0=(gamma*(fim-xaln)-(gamma*q*nd*daln/coxide));
sigmapol=3.38e17;
sigmaaln=3.38e17;
Ealn=(10.78*E0);
detaEc=(0.343*1.6e-19);
Vt=fis0-detaEc-(sigmapol*sigmaaln-daln/Ealn);
cq=3.436e15;
ceq=(coxide*cq/coxide+cq);
mu=0.09;
g=33.3;
Vgs=-2:-0.5:2;
vds=input('ENTER THE vds in volts');
m=length(Vds);
for i=1:m
if vgs < Vt
current(1,i)=0;
current1(1,i)=0;
elseif Vds >= (vgs - Vt)
current(1,i)=((mu*ceq/2)*(g)*(vgs(i)-Vt)^2); %Simplified equation by approximation
elseif Vds < (vgs - Vt)
current(1,i)=(mu*ceq/2)*(g)*(2*(vgs(i)-Vt)*Vds-Vds^2);%Added DIBL
end
end
plot(Vds,current(1,:),'b')
xlabel('Vds, V')
ylabel('Drain Current,A')
title('I-V Characteristics of a hemt')
1 个评论
nicholas
2023-8-9
Hello friend. Sorry its abit late but i belive your vth is negative giving you a straight line.
回答(1 个)
sai charan sampara
2023-10-3
Hello Nudrat,
I understand that you are trying to plot drain current vs gate voltage, but you are getting an erroneous curve.
The curve you are getting is not correct because the code has several errors.Here are some of the errors I could find out:
- The value of Vt is very absurdly large there might be a mistake in the formula and/or implementation.
- In line 25, the array is defined as “Vgs” and later used as “vgs”. Variable names are case sensitive.
- The variable “Vds” used in line 26 and the following lines has not been defined they should be replaced by “vds” or “vgs” correspondingly.
- Current can be defined as an array of size m need not be 2 dimensional.
- In the for loop, if conditionals while checking the conditions “vgs” should also be indexed as “vgs(i)” in all places as it is also an array.
- Some of the other parameter’s values are also incorrect, check the formulas and implementation for errors.
Hope this helps.
Thanks,
Charan.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Particle & Nuclear Physics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!