Friday, January 22, 2021

Aim- Define the following matrixes interpret the resuts-

 1. Find the eigen values and print the corresponding eigen vectors for


above matrix .

2. Are the eigen vector (c) normalized .

3. Show that for matrix ‘A’, sum of eigen value =trace of A and

product of eigen value=det of A .

4. Find and prove the nature of the above matrices or matrix (c) .

5. For matrix D show that eigen vectors are mutually orthogonal .

6. Show that for matrix D,inv(p)*D*p will give diagonal matrix with

diagonal element as eigen values .


Apparatus- Scilab software , Laptop .

Algorithm- 1. Input the all given matrix e.g.,A,B,C,D,E,F and

identity matrix .

2. Using the spec command for find the eigen values and

eigen vectors .

3. To normalized the eigen vectors of corresponding matrices

and display the values .

4. Using the sum and trace command for show sum of eigen

value is equal to trace of A.

5. Find the det of eigen value of A and det of A using the det

command .

6. Check the orthogonality of eigen vectors of matrix D.

7.Find the diagonal of the matrix D .

8. Tofind the nature of the matrices as determinant for

harmitian,orthogonal,symmetric and unitry etc.


INPUT-

A=[2 1 1;1 3 2;3 1 4]


B=[1 -%i 3+4*%i;%i 2 4;3-4*%i 4 3]

C=[2 -%i 2*%i;%i 4 3;-2*%i 3 5]

D=(1/3)*[1 2 2;2 1 -2;2 -2 1]

E=[-3 -7 -5;2 4 3;1 2 2]

F=1/sqrt(3)*[1 1+%i;1-%i -1]

I=[1 0 0;0 1 0;0 0 1]

[a,b]=spec(A)

disp(a,"eigen vector of A",b,"eigen values of A")

[c,d]=spec(B)

disp(c,"eigen vector of B",d,"eigen values of B")

[e,f]=spec(C)

disp(e,"eigen vector of C",f,"eigen values of C")

[g,h]=spec(D)

disp(g,"eigen vector of D",h,"eigen values of D")

[i,j]=spec(E)

disp(i,"eigen vector of E",j,"eigen values of E")

[k,l]=spec(F)

disp(k,"eigen vector of F",l,"eigen values of F")

for i=1:3

disp(norm(e(:,i)),"normalised of eigenvalue of C")

end

disp(trace(A),"trace of A")

disp(sum(b),"sum of eigen value of A")


disp(det(b),"det of eigen value of A")

disp(det(A),"det of A")

disp(g'*g,"eigen vector of D are mutually orthogonal")

disp(inv(g)*D*g,"digonal matrix of D")

Y1=B'

disp(B'


,"dagger of matrix B")


disp(B,"matrix of B")

disp("if B dagger is equal to B so it harmitian")

Y2=C'

disp(C'


,"dagger of matrix B")


disp(C,"matrix of B")

disp("if C dagger is equal to C so it harmitian")

Y3=D'

disp(D'


,"dagger of matrix B")


disp(D,"matrix of B")

disp("if D dagger is equal to D and D is real so it symmetric")

Y4=D'*D

disp("if transpose is equal to its inverse so D is also orthogonal

matrix")

disp(Y4)

Y5=F'

disp(F'


,"dagger of matrix F")


disp(F,"matrix of F")

disp("if F dagger is equal F so it harmitian")

Y6=F'*F

disp(Y6)

disp("dagger is equal to its inverse so F is also unitary matrix")


OUTPUT-

eigen values of A


6.095824 0. 0.

0. 1.452088 + 0.4336988i 0.

0. 0. 1.452088 - 0.4336988i


eigen vector of A

0.3243216 0.3899937 - 0.1875413i 0.3899937 + 0.1875413i

0.5849985 0.5379993 + 0.2718959i 0.5379993 - 0.2718959i

0.7433655 -0.6703451 -0.6703451


eigen values of B

-4.746829 0. 0.

0. 2.3968018 0.

0. 0. 8.3500273


eigen vector of B

-0.3404771 - 0.5212558i -0.2734105 + 0.5541666i -0.3192331 - 0.3586139i

-0.4539695 + 0.0504648i -0.3645474 - 0.6890355i -0.4256442 - 0.0502727i


0.6353997 0.1023784 -0.7653665


eigen values of C

-0.3871996 0. 0.

0. 3.6916109 0.

0. 0. 7.6955887


eigen vector of C

0.6662617i -0.7255184i 0.1723904i

0.5184148 0.6168052 0.5922816

-0.5360424 -0.3052448 0.7870731


eigen values of D

-1. 0. 0.

0. 1. 0.

0. 0. 1.


eigen vector of D

-0.5773503 -0.7634414 0.2895237

0.5773503 -0.1309858 0.8059214

0.5773503 -0.6324555 -0.5163978


eigen values of E

1.0000075 + 0.000013i 0. 0.

0. 1.0000075 - 0.000013i 0.

0. 0. 0.9999849


eigen vector of E

-0.9045338 -0.9045338 -0.9045344

0.3015128 + 0.0000026i 0.3015128 - 0.0000026i 0.3015085

0.3015105 - 0.0000013i 0.3015105 + 0.0000013i 0.301513


eigen values of F

-1. 0.

0. 1.

eigen vector of F

0.3250576 + 0.3250576i 0.627963 + 0.627963i

-0.8880738 0.4597008

normalised of eigenvalue of C

1.

normalised of eigenvalue of C

1.

normalised of eigenvalue of C

1.


trace of A

9.

sum of eigen value of A

9.

det of eigen value of A

14. + 4.441D-16i

det of A

14.

eigen vector of D are mutually orthogonal

1. 0. 1.244D-16

0. 1. 0.

1.244D-16 0. 1.


digonal matrix of D

-1. 0. -1.244D-16

0. 1. 0.

1.330D-16 0. 1.


dagger of matrix B

1. -i 3. + 4.i

i 2. 4.

3. - 4.i 4. 3.


matrix of B

1. -i 3. + 4.i

i 2. 4.

3. - 4.i 4. 3.


if B dagger is equal to B so it harmitian


dagger of matrix C

2. -i 2.i

i 4. 3.

-2.i 3. 5.


matrix of C

2. -i 2.i

i 4. 3.

-2.i 3. 5.

if C dagger is equal to C so it harmitian


dagger of matrix D


0.3333333 0.6666667 0.6666667

0.6666667 0.3333333 -0.6666667

0.6666667 -0.6666667 0.3333333


matrix of D

0.3333333 0.6666667 0.6666667

0.6666667 0.3333333 -0.6666667

0.6666667 -0.6666667 0.3333333

if D dagger is equal to D and D is real so it symmetric


if transpose is equal to its inverse so D is also orthogonal matrix

1. 0. 0.

0. 1. 0.

0. 0. 1.


dagger of matrix F

0.5773503 0.5773503 + 0.5773503i

0.5773503 - 0.5773503i -0.5773503


matrix of F

0.5773503 0.5773503 + 0.5773503i

0.5773503 - 0.5773503i -0.5773503


if F dagger is equal F so it harmitian

1. 0.

0. 1.

dagger is equal to its inverse so F is also unitary matrix

Aim :- Compute the first three normal modes and normal mode frequency of N mass ,N+1 spring system fixed at end points .plot the normal modes show that-Wn=nW1.

please share with friends.








 





Apparatus:- laptop with installed scilab.

Algorithm-
1.input all the values of k,m,N etc.

2.define the zero matrix ‘a’ of order (n,n).
3.use the for-loop (i=2:N-1)
4.define matrix A and end-up the loop
5.write the equation for b=(k/m)a , where ‘a’ is
the matrix defined above.
6.Using the ‘spec’ command find the eigen value
and eigen vector of b.
7.Display the eigen value as frequency.
8.Plot the graph for normal modes and graph
between N and amplitude.

Input:-
1. clf
2. clc
3. k=2
4. m=0.02
5. N=100
6. r=1:N
7. a=zeros(N,N)
8. a(1,[1:2])=[2,-1]
9. a(N,[N-1,N])=[-1,2]
10. for j=2:N-1
11. a(j,[j-1:j+1])=[-1,2,-1]
12. end
13. b=(k/m)*(a)
14. [X,Y]=spec(b)
15. for i=1:3
16. disp(sqrt(Y(i,i)),"frequency(Hz)=")
17. subplot(2,2,i)
18. plot(r',X(:,i))
19. xlabel("N")
20. ylabel("amplitude")
21. title(""+string(i)+"normal mode")
22. end

output:-
frequency(Hz)=
0.3110362
frequency(Hz)=
0.6219972
frequency(Hz)=
0.9328078


Aim-Consider an electron trapped on 1D infinite square well of width 1Angstrom compute the first two energy eigen values in ev and plot the normalized eigen function and their probability densities .

if you really like our post please share it with your friends.






 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 .

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=1973//eV Angstrom


k=100//eV/Angstrom.^2

m=0.511e6//eV/c.^2

e=3.795//(eV Angstrom).^1/2

r0=0

rm=1 // A

n=200

a=1//Angstrom

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

V1(i)=0

end

H=(((-h^2)/(2*m*d.^2)*A))+V

[y,V1]=spec(H)

disp(V1(1,1),"ground state energy")

disp(V1(2,2),"first state energy")

subplot(2,2,1)

plot(r,y(:,1)','b+')

xlabel('r -->','fontsize',3)

ylabel('$\psi (x)$','fontsize',3)

title('graph b/w psi(:,1) v/s r')

subplot(2,2,2)

plot(r,y(:,2)','r+')


xlabel('r -->','fontsize',3)

ylabel('$\psi (x)$','fontsize',3)

title('graph b/w psi(:,2) v/s r')

subplot(2,2,3)

plot(r,((y(:,1)).^2)','y+')

xlabel('r -->','fontsize',3)

ylabel('$\psi^{2} (x)$','fontsize',3)

title('graph b/w psi(:,1)^2 v/s r')

subplot(2,2,4)

plot(r,((y(:,2)).^2)','g+')

xlabel('r -->','fontsize',3)

ylabel('$\psi^{2} (x)$','fontsize',3)

title('graph b/w psi(:,2)^2 v/s r')


OUTPUT-

ground state energy

37.218773

first state energy

148.866





Aim-calculate the principle moment of intertia 0f a ring(2D) by evaluating the moment of inertia tensor,further show that- Also,plot the corresponds of a ring in 2D space and principle moment

 if you like our post please support by sharing with friends 🔥🔥






Apparatus- 

Scilab software, Laptop .


Algorithm- 

1. Give the value of number of points .

2. Give the value of radius of the ring and mass of the ring .

4. Using the ‘for loop’ on the equation of mass .

5. write the identity matrix (3,3), repreoentating ‘d’ in inertia tensor .

6. Using the ‘linspace’ command for show the maximum value between 0 to n .

7. write the polar equation .

8. show the value of x1,y1,z1 represent all x,y,z coordinates respectably .

9. Give the equation of ‘r2’ which represent r2=(x1.*x1)+(y1.*y1)+(z1.*z1 ) .

10. Again using the 2 ‘for loop’ representing index ‘ab’ of I(a,b) .

11. write the equation of inertia tensor matrix .

12. Display the inertia tensor matrix .

13. Using the ‘spec’ command for find the eigen value of principle axis .

14. Display the value of first,second and third principle axis .

15. Using the for loop and plot the graph .

16. Plot the graph in the four coordinates .

17. Using the ‘xgrid’ command .

18. label the graph by using the label command .


INPUT-

n=100


r=1//in cm

M=1//in gm

for i=1:n

m(i)=M/n

end

d=eye(3,3)

c=linspace(0,2*%pi,n)

X=r*cos(c)

Y=r*sin(c)

for i=1:n

x(i,1)=X(i)

x(i,2)=Y(i)

x(i,3)=0

end

x1=x(:,1)

y1=x(:,2)

z1=x(:,3)

r2=(x1.*x1)+(y1.*y1)+(z1.*z1)

for a=1:3

for b=1:3

I(a,b)=0

for i=1:n

I(a,b)=I(a,b)+(m(i)*(d(a,b)*r2(i)-x(i,a)*x(i,b)))

end

end

end

disp(I,'moment of inertia')

[pa,mpa]=spec(I)

disp(pa(:,1),'first principal value')

disp(pa(:,2),'second principal value')

disp(pa(:,3),'third principal value')

for s=1:n

plot(X(s),Y(s),'+')

end

disp(I)

xa=[-pa(1,1), pa(1,1)]

yb=[-pa(2,1), pa(2,1)]


plot(xa,yb)

xa=[-pa(1,2), pa(1,2)]

yb=[-pa(2,2), pa(2,2)]

plot(xa,yb)

xgrid

xlabel("X-AXIS")

ylabel("Y-AXIS")


OUTPUT-

moment of inertia


0.495 0. 0.

0. 0.505 0.

0. 0. 1.

first principal value

1.

0.

0.

second principal value

0.

1.

0.

third principal value

0.

0.

1.



Aim-solve the schrodinger wave equation for a proton as a Harmonic oscillator with amplitude (+1,-1) for using finite difference method.find their first ‘3’ energy eigen states in Mev and plot the first two normalized eigen function and their probability densities (with proper labeling ). K=100Mev/fm^2.

 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


Aim- Define the following matrixes interpret the resuts-

 1. Find the eigen values and print the corresponding eigen vectors for above matrix . 2. Are the eigen vector (c) normalized . 3. Show that...