-
Notifications
You must be signed in to change notification settings - Fork 0
/
Calculate_eigenfrequency.m
144 lines (123 loc) · 4.01 KB
/
Calculate_eigenfrequency.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
%% Parameter definition
Nf = 2; % Numer of evaluated eigenfrequencies
OrdPlt = 10; % Highest order for visualization
OrdStp = 0.5; % Order steps in diagram
% Moment of inertia [kg*m^2]
J1=0.0000199;
J2=0.0016958;
J3=0.0021595;
J4=0.0018157;
J5=0.0012602;
J6=0.0000154;
% Stiffness values [Nm/°]
c1_deg=3014;
c2_deg=2562;
c3_deg=2430;
c4_deg=2636;
c5_deg=2562;
% Convert to [Nm/rad]
c1=c1_deg/(pi/180);
c2=c2_deg/(pi/180);
c3=c3_deg/(pi/180);
c4=c4_deg/(pi/180);
c5=c5_deg/(pi/180);
%% Build six-mass-system
% Stiffnes matrix
C = [ c1 -c1 0 0 0 0;
-c1 (c1+c2) -c2 0 0 0;
0 -c2 (c2+c3) -c3 0 0;
0 0 -c3 (c3+c4) -c4 0;
0 0 0 -c4 (c4+c5) -c5;
0 0 0 0 -c5 c5];
% Mass matrix
M = [ J1 0 0 0 0 0;
0 J2 0 0 0 0;
0 0 J3 0 0 0;
0 0 0 J4 0 0;
0 0 0 0 J5 0;
0 0 0 0 0 J6];
% Damping matrix
D = [ 0 0 0 0 0 0;
0 0 0 0 0 0;
0 0 0 0 0 0;
0 0 0 0 0 0;
0 0 0 0 0 0;
0 0 0 0 0 0];
%% Solve eigenvalue problem
%e = Eigenvalues, x = Eigenvectors, s = Condition numbers
[x, e, s] = polyeig(C, D, M);
w0 = imag(e);
w0 = sort(w0(w0>0));
f0 = w0/(2*pi) % Convert to frequency [Hz]
%% Plot relative amplitudes
for i = 1:Nf
% Calculation of the relative amplitude
a1=1;
a2=a1-((a1*J1)/c1)*(w0(i,1))^2;
a3=a2-(((a1*J1)+(a2*J2))/c2)*(w0(i,1))^2;
a4=a3-(((a1*J1)+(a2*J2)+(a3*J3))/c3)*(w0(i,1))^2;
a5=a4-(((a1*J1)+(a2*J2)+(a3*J3)+(a4*J4))/c4)*(w0(i,1))^2;
a6=a5-(((a1*J1)+(a2*J2)+(a3*J3)+(a4*J4)+(a5*J5))/c5)*(w0(i,1))^2;
% Visualisation of the relative amplitude
a=[a1 a2 a3 a4 a5 a6]';
index = (1:6)';
subplot(Nf,1,i)
plot(index, a,'b-', 'LineWidth', 1)
grid on
xlabel('Mass No.');
ylabel('Rel. amplitude');
xticks(1:6)
legend (['Mode: ' num2str(i) ': ' num2str(round((w0(i,1)/(2*pi)),0)) ' Hz'])
set(gcf,'color','w');
hold on
end
%% Print order diagram
n = [0:15:15000]; % Define RPM range
f = n/60;
Modes=[];
for m = 1:Nf
mode = f0(m) * ones(1001, 1);
Modes = [ Modes, mode ];
end
v=figure;
set(v,'Color',[1 1 1]);
for i = 0 : OrdStp : OrdPlt
Ord=f*i;
plot(n,Ord,'Color', [0.35 0.35 0.35],'LineWidth',1.25)
title('Order diagram');
xlabel('RPM');
ylabel('Frequency in Hz');
text(15000,Ord(1,1001),[num2str(i) '.'])
xticks([0:1000:15000]);
yticks([0:250:2500]);
xtickangle(45)
grid on
hold on
end
hold on
for j=1:1:Nf
plot(n, Modes(:,j) ,'r', 'LineWidth',1.5)
text(1000, Modes(1,j), [num2str(Modes(1,j)) ' Hz'])
hold on
end
% MIT License
%
% Copyright (c) 2020 Philipp Biedenkopf
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the "Software"), to deal
% in the Software without restriction, including without limitation the rights
% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
% copies of the Software, and to permit persons to whom the Software is
% furnished to do so, subject to the following conditions:
%
% The above copyright notice and this permission notice shall be included in all
% copies or substantial portions of the Software.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
% SOFTWARE.