%Lecture38_analysis.m

clc

m=sym('m');
k=sym('k');
omega2=sym('omega2');

M=[m 0; 0 2/3*m]
K=[2*k -k; -k k]

%N=[-m*omega2+2*k -k; -k -2/3*m*omega2+k];
N=-omega2*M+K

%[V,D]=eig(M)
%V=simplify(V)
%D=simplify(D)

determinant=det(N);
determinant=simplify(determinant)

x=solve('2/3*m^2*x^2-7/3*m*x*k+k^2=0')

pause

omega2=3*k/m
N1=[-m*omega2+2*k -k; -k -2/3*m*omega2+k]

[x1,x2]=solve('-k*x1-k*x2=0','-k*x1-k*x2=0')

v1=[x1;x2]

omega2=1/2*k/m
N2=[-m*omega2+2*k -k; -k -2/3*m*omega2+k]

[x1,x2]=solve('3/2*k*x1-k*x2=0','-k*x1+2/3*k*x2=0')

v2=[x1;x2]

pause

P=[-1 1; 1 3/2]

P'*N*P
P'*M*P
P'*K*P
