APPARATUS- sci lab software,Laptop .
Algorithm-
1. Write the all given values of h,m,n,r0,e .
2.Use the linspace command .
3. Give the matrix of ‘A’and ‘V’ .
4. Using the for loop .
5. write the equation of v(i,i) .
6. write the equation of ‘H’ .
7. Using the ‘spec(H)’ command for eigen value .
8.Using the ‘subplot’ command and plot the potential graph and other
three graphs.
9.Dispaly the ground state energy for three value 0,10,3
INPUT-
h=197.3
m=940
k=100
b=0
n=100
r0=-5e-15
rm=5
r=linspace(r0,rm,n)
d=(rm-r0)/n
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,i)=(0.5*k*r(i)*r(i)+0.3*b*r(i)*r(i)*r(i))
v1(i)=(0.5*k*r(i)*r(i)+0.3*b*r(i)*r(i)*r(i))
end
H=((-h.^2)/(2*m*d*d)*A)+v
[y,eig]=spec(H)
subplot(2,2,1)
for i=1:n
plot(r(i),v1(i),'r+')
xlabel("X-AXIS")
ylabel("Y-AXIS")
end
disp(eig(1,1))
disp(eig(2,2))
disp(eig(3,3))
subplot(2,2,2)
plot(r,y(:,1)','r')
xlabel("X-AXIS")
ylabel("Y-AXIS")
subplot(2,2,3)
plot(r,y(:,2)','b')
xlabel("X-AXIS")
ylabel("Y-AXIS")
subplot(2,2,4)
plot(r,y(:,3)','g')
xlabel("X-AXIS")
ylabel("Y-AXIS")
OUTPUT-
for b=0;
1. 92.969987 (ground state energy)
2. 220.52532
3. 348.52647
for b=10
1. 96.080573 (ground state energy)
2. 231.55534
3. 370.15555
for b=30
1. 101.68673 (ground state energy)
2. 250.72637
3. 406.79431
No comments:
Post a Comment