I'm trying to run the following code as
clc%--------Define Constants all are in MKS-------%
q=1.602e-19;h=8.85e-12;Eox=3.9*h;Esi=11.8*h;Ni=1.1e16;Na=1e16;Vgs=0.4;L=36e-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;syms x y;for n=1:1:20kn=n*pi/L;X1=((cosh(kn*(tox+tsi-y)))+(cosh(kn*(tox-y))))/(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:10k1=(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)));endDsf=((d1+d2-d3))/d4;phi=phi+2*((sin(kn*x))*X1*Dsf)/(kn*Esi*L);d1=0;endphi1=phi+Vbi+(x/L)*Vds+(Q*(x*L-(power(x,2))))/(2*Esi);integration=double(int(1/(int(exp((phi1)/t1),y,tox,tox+tsi)),x,0,L));
but this is taking too much time to simulate as n goes higher for n=10 it will take some minutes after that time increases so much here also I tried to analyze the terms in Dsf which have d1,d2 d3,d4 a file attached as constants2.pdf I hope this will help. this shows the how different terms converges w.r.t n and m
what I observed that m=10 would be enough but for n I have doubt
If this is possible then kindly tell how much minimum n requires? for get a good answer my meaning is answer should not be change at least one place after decimal for example for n=10 if answer is 1.56e-8 then for n=20 if answer is 1.5e-8 then this is okay
if any other way possible to evaluate the integration then that would be great which take less time and answer is also correct currently I'm using Matlab-2015 version
Best Answer