clear all; clc; close all;

%TUHOSTI PRUŽIN ki[N/m]:

kz1=1376903;
kz2=649775;
kys=1;
kyp=1;

%VZDÁLENOSTI[m]:
u1=8.5;
u2=8.5;
b=3.8;
h=3;
d1=1.3;
d2=0.5;
p=1.4;


%---------------------------------------------------
% DEFINICE KONSTANT HMOTNOSTÍ[kg] a MOMENTÙ SETRVAÈNOSTI[kg.m^2]

ms=21000;

Jsy=1/12*ms*((b^2)+(h^2));
mp1=4100;
Jp1=5500;
Jp2=5500;
kys=150000;
kyp=1232800;
o=0.5;
gamas=1;
gamap=1;

%--------------------------------------------------
%#####  2. VÝPOÈET VLASTNÍCH FREKVENCÍ

M = [ ms        0           0           0         0         0;
       0        ms          0           0         0         0;
       0        0           Jsy         0         0         0;
       0        0           0           mp1       0         0;
       0        0           0           0        mp1        0;
       0        0           0           0         0         Jp1;
] 

   
K = [ kz2               0                0             -kz2             0               0;
       0               kys             -kys*o            0            -kys           kys*o;
       0             -kys*o          gamas+o*o*kys       0             kyp*o          -gamas;
      -kz2              0                0          (kz1+kz2)          0               0;
       0              -kys               kyp*o           0           kyp+kys           -kyp*o;
       0              kys*o             -gamas           0            -kyp*o    gamap-gamas+o*o*kyp;
]   


%VLASTNÍ ÈÍSLA:


[U,V]=eig(K,M)

om1=sqrt(V(1,1))
om2=sqrt(V(2,2))
om3=sqrt(V(3,3))
om4=sqrt(V(4,4))
om5=sqrt(V(5,5))
om6=sqrt(V(6,6))


FREKVENCE=(1/(2*pi))*sqrt(V)

FREKVENCE1=FREKVENCE(1,1)
FREKVENCE2=FREKVENCE(2,2)
FREKVENCE3=FREKVENCE(3,3)
FREKVENCE4=FREKVENCE(4,4)
FREKVENCE5=FREKVENCE(5,5)
FREKVENCE6=FREKVENCE(6,6)

U1norm=U(:,1)/U(1,1)
U2norm=U(:,2)/U(1,2)
U3norm=U(:,3)/U(1,3)
U4norm=U(:,4)/U(1,4)
U5norm=U(:,5)/U(1,5)
U6norm=U(:,6)/U(1,6)

%GRAFY:

x=1:1:6;

figure
plot(U1norm)
grid

figure
plot(U2norm)
grid

figure
plot(U3norm)
grid

figure
plot(U4norm)
grid

figure
plot(U5norm)
grid

figure
plot(U6norm)
grid


