Matalb 2012 compatibility how to tun Matlab 2015 code at Matlab 2012
2 ビュー (過去 30 日間)
古いコメントを表示
I had a code for Matlab 2015 version for some reason I have to run it at Matlab 2012 Version but when I ran this code Matlab 2012 version gives errors
can someone provide an alternate way for executing this code at Matlab 2012 version also for double integration please don't use symbolic toolbox double int command that takes too much time that's why I switched my code for 2015 version
here is the code
%--------Define Constants all are in MKS-------%
%----------in green t1 means thermal voltage 0.02586--------%
clc
q=1.602e-19;
h=8.85e-12;
Eox=3.9*h;
Esi=11.8*h;
Ni=1.1e16;
Na=1e25;
for Vgs=0:0.1:0.5
L=20e-9;
tox=3e-9;
tsi=10e-9;
Vds=1;
Q=-q*Na;
V=Vgs;
t1=0.02586;%thermal voltage in V%
Vbi=0.56;%source side potential%
phi=0;
d1=0;
phi_1=0;
syms x y;
for n=1:1:20
kn=n*pi/L;
X1=((cosh(kn*(tox+tsi-y)))+(cosh(kn*(tox-y))))/(sinh(kn*tsi));
%X_1=((cosh(kn*(tox+tsi-y_1)))+(cosh(kn*(tox-y_1))))/(sinh(kn*tsi));
d2=L*(V*(1-(-1)^n))/((cosh(kn*tox))*pi*n);
d4=1/(kn*Esi*tanh(kn*tsi))+1/(kn*Esi*sinh(kn*tsi))+tanh(kn*tox)/(kn*Eox) ;
d3=Vbi*(1-(- 1)^n)/kn+(Vds*(-1)^(n+1))/kn+Q*(1-(-1)^n)/(Esi*kn*kn*kn);;
for m=1:1:10
k1=(2*m-1)*pi/(2*tox);
A1=V/k1+(sin(k1*tox)*(Vbi-Vgs))/(tox*k1^2);
A2=(V)/k1+(sin(k1*tox)*(Vbi+Vds-Vgs))/(tox*k1^2);
d1=d1+(2*(sin(k1*(tox)))*kn*(A1+A2*((-1)^(n+1)))/(tox*(kn^2+k1^2)));
end
Dsf=((d1+d2-d3))/d4;
phi=phi+2*((sin(kn*x))*X1*Dsf)/(kn*Esi*L);
d1=0;
end
phi1=phi+Vbi+(x/L)*Vds+(Q*(x*L-(power(x,2))))/(2*Esi);
phi1_fcn = matlabFunction(phi1);
int_y = @(x) 1./integral(@(y) exp(phi1_fcn(x,y)./t1), tox,tox+tsi, 'Array',true);
integration = integral(int_y, 0,L)
ue=0.02;
W=1e-6;
ff=W/L;
cons_2=ue*q*t1*W*Ni*(1-exp(-Vds/t1));
Id_double_integration=cons_2/integration;
Id_double_integration_norm=(Id_double_integration)/ff;
disp(Id_double_integration_norm);
Vgs;
end
2 件のコメント
Walter Roberson
2017 年 12 月 28 日
What problem are you observing? I ran your code unchanged in R2017b and it appears to produce answers.
(Well, to be more accurate, I did not put in the clc from the beginning, as you should seldom erase the screen since the user might have put useful information on the screen that they need for various reasons.)
回答 (1 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!