Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

NAME : DIVYA SINGH

clc
clf
k=100
m=940
hc=197.3
function y=v(r)
y=(1/2)*k*((r)^2)+(1/3)*b*((r)^2)
endfunction
b=input('enter the value of b')
n=input('enter value of n')
H=zeros(n-1,n-1)
h=10/n;
r=0
for i=1:n-1
r=r+h;
H(i,i)=2*(1+(m*v(r)*h*h)/(hc*hc));
if i<(n-1) then
H(i,i+1)=-1
H(i+1,i)=-1
end
end
disp('hermition polynomial H')
disp(H(1:5,1:5))
[a,b]=spec(H)
r=linspace(h,10,n-1)
disp('eigenvalue')
disp(b(1:5))
E=b*hc*hc/(2*h*h*m)
disp('energy E')
disp(E(1:5))
disp('eigenvector')
disp(a(1:5,1:5))
u=a(:,1)*hc*hc/(2*h*h*m);
d=u'./r
plot(r,d)
xlabel('position')
ylabel('energy')
xtitle('graph between energy and position')

enter the value of b0


enter value of n250

hermition polynomial H

2.0000062 - 1. 0. 0. 0.
- 1. 2.0000247 - 1. 0. 0.
0. - 1. 2.0000556 - 1. 0.
0. 0. - 1. 2.0000989 - 1.
0. 0. 0. - 1. 2.0001545

eigenvalue

0.0074570
0.
0.
0.
0.

energy E

96.50324
0.
0.
0.
0.

eigenvector

0.0167140 0.0204497 - 0.0228403 0.0246453 0.0261137


0.0333035 0.0405438 - 0.0450566 0.0483727 0.0509958
0.0496455 0.0599337 - 0.0660428 0.0702993 0.0734736
0.0656200 0.0782844 - 0.0852280 0.0896111 0.0924898
0.0811117 0.0952811 - 0.1020927 0.1055937 0.1071524

graph

2nd STATE B= 10

enter the value of b10


enter value of n250
hermition polynomial H

2.0000066 - 1. 0. 0. 0.
- 1. 2.0000264 - 1. 0. 0.
0. - 1. 2.0000593 - 1. 0.
0. 0. - 1. 2.0001055 - 1.
0. 0. 0. - 1. 2.0001648

eigenvalue

0.0077015
0.
0.
0.
0.

energy E
99.66727
0.
0.
0.
0.
eigenvector
- 0.0171230 - 0.0209494 0.0233977 0.0252459 - 0.0267492
- 0.0341143 - 0.0415227 0.0461352 0.0495207 - 0.0521954
- 0.0508438 - 0.0613511 0.0675719 0.0718916 - 0.0751004
- 0.0671847 - 0.0800809 0.0871057 0.0915011 - 0.0943513
- 0.0830152 - 0.0973806 0.1041904 0.1076001 - 0.1090159

GRAPH
3RD SET
B= 30

enter the value of b30


enter value of n250
hermition polynomial H
2.0000074 - 1. 0. 0. 0.
- 1. 2.0000297 - 1. 0. 0.
0. - 1. 2.0000668 - 1. 0.
0. 0. - 1. 2.0001187 - 1.
0. 0. 0. - 1. 2.0001855
eigenvalue
0.0081686
0.
energy E
105.71139
0.
0.
eigenvector
- 0.0178954 0.0218931 0.02445 0.0263796 - 0.0279486
- 0.0356448 0.0433691 0.0481684 0.0516831 - 0.0544535
- 0.0531041 0.0640201 0.0704464 0.0748794 - 0.0781467
- 0.0701332 0.0834556 0.0906205 0.0950254 - 0.0978076
- 0.0865977 0.1013108 0.1080930 0.1113055 - 0.1124270
GRAPH

You might also like