Schématiser un ensemble de courbe sur le même graphique
Fermé
étudiante1988
Messages postés1Date d'inscriptiondimanche 5 mai 2013StatutMembreDernière intervention 6 mai 2013
-
Modifié par étudiante1988 le 6/05/2013 à 19:48
j'ai besoin juste de quelque ligne à la fin pour schématiser la courbe de la variation du niveau d'energie en fonction de la variation de l'épaisseur du puits. j'ai trouvé la solution écrit mais j'aime la voir schématisée.
je serai très contant si quelqu'un m'aide et merci d'avance...
voila le code
clc,clear
q=1.59e-19;
hbar=6.626e-34/2/pi;
Lw=[10e-10,100e-10,200e-10];
field=0e7;
DBc=0.697;
for k=1:3
Z1=-8*Lw(k);
Z2=-9*(Lw(k)/2);
Z3=9*(Lw(k)/2);
Z4=8*Lw(k);
n1=100;
n2=300;
n3=100;
h1=(Z2-Z1)/n1;
h2=(Z3-Z2)/n2;
h3=(Z4-Z3)/n3;
N=n1+n2+n3+1;
h=[h1*ones(1,n1) h2*ones(1,n2) h3*ones(1,n3)];
z(1)=Z1;
for i=2:N
z(i)=Z1+sum(h(1:i-1));
end
zchrod=z;
for i=1:N
if (z(i)<-Lw(k)/2)|(z(i)>Lw(k)/2)
m(i)=0.067*9.111e-31;
V(i)=q*(DBc-field*z(i));
else
m(i)=0.027*9.111e-31;
V(i)=q*(0-field*z(i));
end
end
for i=2:N-1
L(i)=sqrt(0.5*(h(i)+h(i-1)));
end
L(1)=sqrt(h(1));
L(N)=sqrt(h(N-1));
for i=1:N
for j=1:N
if j==i+1
A(i,j)=-0.5*hbar^2*(1/(0.5*(m(i)+m(i+1)))/h(i))*(1/L(i)^2);
end
end
end
for i=1:N
for j=1:N
if j==i-1
A(i,j)=-0.5*hbar^2*(1/(0.5*(m(i)+m(i-1)))/h(i-1))*(1/L(i)^2);
end
end
end
for i=2:N-1
for j=1:N
if j==i
A(i,j)=-A(i,i+1)-A(i,i-1)+V(i);
end
end
end
A(1,1)=-A(2,1)-A(1,2)+V(1);
A(N,N)=A(N-1,N-1);
La=diag((L.^2));
M=La*La;
B=M*A;
invLa=inv(La);
H=invLa*B*invLa;
options.disp=0;
% [Vp,D1]=eigs(H,20,'sm',options);
ff=triu(H)+triu(H)'-diag(diag(H));
[Vp2,D2]=eig(ff);
Vp=invLa*Vp2;
D=diag(D2)./q;
for i=1:N
psi(:,i)=1*(sign(Vp(max(find(abs(Vp(:,i))==max(abs(Vp(:,i))))),i)))*Vp(:,i)/trapz(z,Vp(:,i).^2);
end
np=0;
E1=min(V(max(find(z<-Lw(k)/2))+1)/q,V(min(find(z>Lw(k)/2))-1)/q);
E2=min(V(max(find(z<-Lw(k)/2)))/q,V(min(find(z>Lw(k)/2)))/q);
for i=1:N
if (D(i)>E1)&(D(i)<E2)
ind=find((psi(:,i).^2)==max(psi(:,i).^2));
if(z(ind)>-Lw(k)/2)&(z(ind)<Lw(k)/2)
np=np+1;
Psi(:,np)= psi(:,i);
DD(np)=D(i);
end
end
end
fprintf('pour Lw%d=%g m\n',k,Lw(k))
for i=1:length(DD)
fprintf('E%d = %f eV\n',i,DD(i))
end
fprintf('-----------------\n')
end
A voir également:
Schématiser un ensemble de courbe sur le même graphique