Apparetus- Scilab software, Laptop .
Algorithm-
1. Input all the values of h,m,k,r0,rm etc.
2. Define the command of linspace .
3. Define the zeros matrix of A and v of order (n*n) .
4 write the equation of matrix A i.e,A(i,[i-1:i+1])=[1,-2,1] .
5. write the given equation of matrix v i.e., v(i,i)=0.5*k*r(i)^2 .
6. Find the value of H i.e., H=(((-h^2)/(2*m*d.^2)*A))+v
7. Find the eigen value of H using the spec(H) command .
8. Normalized the eigen function .
9. Using the subplot command and plot the graph .
INPUT-
h=197.3//Mev*fm/c
k=100//ev/fm^2
m=938.28//Mev
r0=-1//Angstrom
rm=1//Angstrom
n=200
r=linspace(r0,rm,n)
d=(rm-r0)/n
v=zeros(n,n)
A=zeros(n,n)
A(1,[1:2])=[-2,1]
A(n,[n-1:n])=[1,-2]
for i=2:n-1
A(i,[i-1:i+1])=[1,-2,1]
end
for i=1:n
v(i,i)=0.5*k*r(i)^2
v(1)=0.5*k*r(i)^2
end
H=(((-h^2)/(2*m*d.^2)*A))+v
[y,vl]=spec(H)
disp(vl(1,1),"ground state energy")
disp(vl(2,2),"first excited state energy")
disp(vl(3,3),"second excited state energy")
deff('z=f(r)','z=y(:,n).*y(:,n)')
nor=inttrap(r,f(r))
for i=1:3
psi(:,i)=y(:,i)/sqrt(nor)
end
subplot(2,2,1)
plot(r,psi(:,1),'b+')
xlabel('r -->','fontsize',3)
ylabel('$\psi (x)$','fontsize',3)
title('graph b/w psi(:,1) v/s r','fontsize',3)
subplot(2,2,2)
plot(r,psi(:,2),'r+')
xlabel('r -->','fontsize',3)
ylabel('$\psi (x)$','fontsize',3)
title('graph b/w psi(:,2) v/s r','fontsize',3)
subplot(2,2,3)
plot(r,(psi(:,1)).^2,'y+')
xlabel('r -->','fontsize',3)
ylabel('$\psi^{2} (x)$','fontsize',3)
title('graph b/w psi(:,1).^2 v/s r','fontsize',3)
subplot(2,2,4)
plot(r,(psi(:,2)).^2,'g+')
xlabel('r -->','fontsize',3)
ylabel('$\psi^{2} (x)$','fontsize',3)
title('graph b/w psi(:,2).^2 v/s r','fontsize',3)
OUTPUT-
ground state energy
57.194849
first excited state energy
216.96469
second excited state energy
471.87836
No comments:
Post a Comment