-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBase_Excitation_alt.m
130 lines (115 loc) · 3.09 KB
/
Base_Excitation_alt.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
load('d2y.mat'); %d2y is [Time Accelration] vector
m = 1.5; %mass of brain in kg; Skull= 3.5 kg see Analytical modelling of soccer heading
k = 156e3; %stiffness of the brain
c = 340; %damping coefficien of the brain
p = 300; %peak accel m/s2
f = 100; %frequency Hz
tend = 1/f; %full period
t=0:0.0001:tend;
d2y = @(t) p*(sin(pi*f*t).^2); %haversine formula
%solve d2z + (c/m)*dz + (k/m)*z = -d2y from: http://www.vibrationdata.com/tutorials_alt/base_sine.pdf
num=length(t);
yy=zeros(num,1);
for i=1:num
yy(i)=p*(sin(pi*f*t(i)).^2);
end
omegan=sqrt(k/m);
fn=omegan/(2*pi);
damp=c/(2*m*omegan);
dt=mean(diff(t));
fprintf('\n Natural Frequency = %8.4g Hz \n',fn);
fprintf('\n Damping ratio = %8.4g \n',damp);
%
% Initialize coefficients
%
[a1,a2,b1,b2,b3,rd_a1,rd_a2,rd_b1,rd_b2,rd_b3]=...
srs_coefficients(fn,damp,dt);
%
% SRS engine
%
% Calculate absolute acceleration response: a_resp
%
[a_resp,~,~]=arbit_engine(a1,a2,b1,b2,b3,yy);
%
% Calculate relative displacement response: rd_resp
%
[rd_resp,~,~]=arbit_engine(rd_a1,rd_a2,rd_b1,rd_b2,rd_b3,yy);
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% arbit_engine_.m ver 1.0 by Tom Irvine
function[a_resp,a_pos,a_neg]=arbit_engine(a1,a2,b1,b2,b3,yy)
forward=[ b1, b2, b3 ];
back =[ 1, -a1, -a2 ];
%
a_resp=filter(forward,back,yy);
a_pos= abs(max(a_resp));
a_neg= abs(min(a_resp));
a_resp=fix_size(a_resp);
end
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% srs_coefficients.m ver 1.6 by Tom Irvine
%
function[a1,a2,b1,b2,b3,rd_a1,rd_a2,rd_b1,rd_b2,rd_b3]=...
srs_coefficients(f,damp,dt)
%
% Smallwood ramp invariant digital recursive filitering relationship
%
tpi=2*pi;
%
num_fn=max(size(f));
%
a1=zeros(num_fn,1);
a2=zeros(num_fn,1);
b1=zeros(num_fn,1);
b2=zeros(num_fn,1);
b3=zeros(num_fn,1);
%
rd_a1=zeros(num_fn,1);
rd_a2=zeros(num_fn,1);
rd_b1=zeros(num_fn,1);
rd_b2=zeros(num_fn,1);
rd_b3=zeros(num_fn,1);
%
num_damp=length(damp);
%
for j=1:num_fn
%
omega=(tpi*f(j));
%
if(num_damp==1)
ddd=damp;
else
ddd=damp(j);
end
%
omegad=(omega*sqrt(1.-ddd^2));
%
cosd=(cos(omegad*dt));
sind=(sin(omegad*dt));
domegadt=(ddd*omega*dt);
%
rd_a1(j)=2.*exp(-domegadt)*cosd;
rd_a2(j)=-exp(-2.*domegadt);
rd_b1(j)=0.;
rd_b2(j)=-(dt/omegad)*exp(-domegadt)*sind;
rd_b3(j)=0;
%
E=(exp(-ddd*omega*dt));
K=(omegad*dt);
C=(E*cos(K));
S=(E*sin(K));
%
Sp=S/K;
%
a1(j)=(2*C);
a2(j)=(-(E^2));
%
b1(j)=(1.-Sp);
b2(j)=(2.*(Sp-C));
b3(j)=((E^2)-Sp);
%
end
end