Apparatus:- a laptop with installed scilab
Algorithm:-
1. Put all the given constants(eg.- h,m,n,r0,e)
2. Use linspace command for linearly spaced vectors
3. give the zero matrix of 'A' and 'v'.
4. apply the loop.
5. write the equation of v(i,i).
6. write the equation of H.
7. find the eigen value using 'spec(H)' command.
8. plot the potential graph.
9.show the eigen value by 'disp()' command.
Program:-
clc;
clear()
clf()
h=197.3;
m=940;
d=0.755501
k=100;
b=0;
a=1.44
q0=3.795
r0=0.131349;
rm=10;
n=500;
r=linspace(r0,rm,n)
d=(r-r0)/r
A=zeros(n,n)
v=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)=d*((exp(-2*a*(r(i)-r0)/r(i))))
-exp(-a*(r(i)-r0)/r(i))
end
H=-(((h^2)/(2*m*d*d))*A)+v;
[R,y]=spec(H)
w=find(H>>0.0)
disp(H(w(1)))
disp(y(3,3))
disp("energy first exited state=")
disp(H(w(2)))
R(1,:)=R(:,1)'
R(2,:)=R(:,2)'
plot(r,(R(1,:)),'red')
plot(r,(R(2,:)),'green')
xgrid()
output:-
energy first exited state=
0.0080949
It gives an error on w=find(H>>0.0)
ReplyDelete