필터 지우기
필터 지우기

will you please tell me why am i not getting the graph?

조회 수: 4 (최근 30일)
ARTI
ARTI 2014년 1월 6일
답변: kajal sharma 2022년 3월 5일
if true
hfin=1;
tsi=20
W=2*hfin*tsi;
Vth=1;
Leff=180;
DIBL=1.127*(W\Leff);
vth=Vth-DIBL;
lambda=25*10^-5;
un=100;
Cox=1;
ld=0.1;
Ec=1;
vgs=2;
for vds=1:4;
Ids(vds)=(2*W*un*Cox/Leff-ld+(vds/Ec))+(lambda*2*W*Cox/(Leff-ld)^2)*((vgs-Vth)*vds-0.5*vds^2);
end
plot(Ids,vds)
xlabel('Vds, V')
ylabel('Drain Current,A')
title('I-V Characteristics of a MOSFET')
end
  댓글 수: 2
ES
ES 2014년 1월 6일
and the reason why your code does not give a plot is because you have used vds in the loop variable. when the loop exits, vds is = 4. so the plot is essentially (Ids,4) which is not something you want. You want plot of (Ids, 1:4).
make it this way,
if true
hfin=1;
tsi=20
W=2*hfin*tsi;
Vth=1;
Leff=180;
DIBL=1.127*(W\Leff);
vth=Vth-DIBL;
lambda=25*10^-5;
un=100;
Cox=1;
ld=0.1;
Ec=1;
vgs=2;
for vds=1:4;
Ids(vds)=(2*W*un*Cox/Leff-ld+(vds/Ec))+(lambda*2*W*Cox/(Leff-ld)^2)*((vgs-Vth)*vds-0.5*vds^2);
end
vds=1:4;%New line for making vds=[1,2,3,4] instead of vds=4;
plot(Ids,vds)
xlabel('Vds, V')
ylabel('Drain Current,A')
title('I-V Characteristics of a MOSFET')
end
ARTI
ARTI 2014년 1월 6일
The graph obtained by running the above program is a straight line which is not the actual one. it must me same as that of Ids vs Vds characteristics of n mosfet or p mosfet

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

답변 (2개)

ES
ES 2014년 1월 6일
TRY THIS:
%n-channel enhancement mode MOSFET output characteristics
clear all;
%kn=un*cox = 100 microA/Volts
kn=1e-4;
%Let W/L= 2
W=360*(10^(-9));
L=180*(10^(-9));
beta=kn*W/L;
%Vth is the threshold voltage
Vth=1;
%lambda is the inverse of early voltage in voltage inverse
lambda=1/1000;
%Sweep drain to source voltge from 0 to 10V
vds=0:0.5:10;
%Ask the user to enter gate to source voltage
vgs=input('ENTER THE Vgs in volts');
%Estimate length of the array
m=length(vds);
for i=1:m
if vgs < Vth
current(1,i)=0;
current1(1,i)=0;
elseif vds(i) >= (vgs - Vth)
current(1,i)=0.5* beta * ((vgs - Vth)^2)*(1+lambda*vds(i));
current1(1,i)=0.5* beta * ((vgs - Vth)^2);
elseif vds(i) < (vgs - Vth)
current(1,i)= beta*((vgs-Vth)*vds(i) - 0.5*(vds(i)^2))*(1+lambda*vds(i));
current1(1,i)=beta*((vgs-Vth)*vds(i) - 0.5*(vds(i)^2));
end
end
plot(vds,current(1,:),'b',vds,current1(1,:),'r')
xlabel('Vds, V')
ylabel('Drain Current,A')
title('I-V Characteristics of a MOSFET')
or THIS
%n-channel enhancement mode MOSFET output characteristics
clear all;
%kn=un*cox = 100 microA/Volts
kn=1e-4;
%Let W/L= 2
W=360*(10^(-9));
L=180*(10^(-9));
beta=kn*W/L;
%Vth is the threshold voltage
Vth=1;
%Sweep drain to source voltge from 0 to 10V
vds=0:0.5:10;
%Ask the user to enter gate to source voltage
vgs=input('ENTER THE Vgs in volts');
%Estimate length of the array
m=length(vds);
for i=1:m
if vgs < Vth
current(1,i)=0;
elseif vds(i) >= (vgs - Vth)
current(1,i)=0.5* beta * (vgs - Vth)^2;
elseif vds(i) < (vgs - Vth)
current(1,i)= beta*((vgs-Vth)*vds(i) - 0.5*(vds(i)^2));
end
end
plot(vds,current(1,:),'b')
xlabel('Vds, V')
ylabel('Drain Current,A')
title('I-V Characteristics of a MOSFET')
  댓글 수: 3
ES
ES 2014년 1월 6일
I have modified your code at the top too.. Please have a look at it.. It is a small change anyway..
ARTI
ARTI 2014년 1월 6일
The graph obtained by running the above program is a straight line which is not the actual one. it must me same as that of Ids vs Vds characteristics of n mosfet or p mosfet

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


kajal sharma
kajal sharma 2022년 3월 5일
this program is not run it showing the error in enter the vgs value

Community Treasure Hunt

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

Start Hunting!

Translated by