-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCLT.m
375 lines (330 loc) · 10.9 KB
/
CLT.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
function opt = CLT(input)
core_opt = true;
material = 1;
if core_opt == true
t_core = input(end);
theta = input(1:end-1)*45;
stack = round(length(theta)/3);
else
t_core = 0;
material = 1;
theta = input*45;
stack = round(length(theta)/3);
end
%% Defining the material properties
if material == 1
load('Materials/Cycom 381 IM7 UD.mat')
else
load('Materials/Carbone TWILL 200 gsm.mat')
end
if t_core ~= 0
load("Materials\Rohacell.mat")
t_core_down = t_core*1e-3;
t_core_up = t_core_down*2;
end
%% Calculation of compliance and stiffness matrices
% Compliance matrix for unidirectional lamina
S11 = 1/E_1; % 1/Pa
S12 = -nu_12/E_1; % 1/Pa
S13 = -nu_13/E_1; % 1/Pa
S22 = 1/E_2; % 1/Pa
S23 = -nu_23/E_2; % 1/Pa
S33 = 1/E_3; % 1/Pa
S44 = 1/G_23; % 1/Pa
S55 = 1/G_31; % 1/Pa
S66 = 1/G_12; % 1/Pa
% Complete compliance matrix
S = [S11 S12 S13 0 0 0;
S12 S22 S23 0 0 0;
S13 S23 S33 0 0 0;
0 0 0 S44 0 0;
0 0 0 0 S55 0;
0 0 0 0 0 S66];
% Stiffness matrix
C = inv(S);
% Reduced compliance matrix
S = [S11 S12 0;
S12 S22 0;
0 0 S66]; % 1/Pa
% Reduced stiffness matrix
Q = inv(S); % Pa
%% Laminate Properties
if t_core ~= 0
theta_down = [theta(1:stack) 0 flip(theta(1:stack))]; % degree (Symmetric)
theta_up = [theta(stack+1:end) 0 flip(theta(stack+1:end))];
theta = [theta_up theta_down];
n = size(theta,2); % number of plies
H = (n-2)*t+t_core_down+t_core_up; % m % Total width of the lamimate
h = zeros(1,n);
h(1) = -H/2;
core_up_id = length(theta) - (length(theta_up) - 1)/2;
core_down_id = stack + 1;
for i = 1:length(theta)
if i == core_up_id
h(i+1) = h(i) + t_core_up;
elseif i == core_down_id
h(i+1) = h(i) + t_core_down;
else
h(i+1) = h(i) + t; % m
end
end
else
theta_down = [theta(1:stack) flip(theta(1:stack))]; % degree (Symmetric)
theta_up = [theta(stack+1:end) flip(theta(stack+1:end))];
theta = [theta_up theta_down];
n = size(theta,2); % number of plies
H = n*t; % m % Total width of the lamimate
for i = 0:length(theta)
h(i+1) = -H/2 + i*t; % m
end
core_up_id = -1;
core_down_id = -1;
end
%% Angle transformation
% Reuter matrix
R = [1 0 0;
0 1 0;
0 0 2]; % -
for i = 1:n
if (i == core_up_id || i == core_down_id) && t_core ~= 0
Qbar(:,:,i) = [1/E_core -nu_core/E_core 0;
-nu_core/E_core 1/E_core 0;
0 0 1/G_core];
Sbar(:,:,i) = inv(Qbar(:,:,i)); % 1/Pa
continue
end
s = sin(theta(i)*pi/180);
c = cos(theta(i)*pi/180);
% Transformation matrix
T = [c^2 s^2 2*s*c;
s^2 c^2 -2*s*c;
-s*c s*c c^2-s^2]; % -
Qbar(:,:,i) = inv(T)*Q*R*T*inv(R); % Pa
Sbar(:,:,i) = inv(Qbar(:,:,i)); % 1/Pa
end
%% Global laminate stiffness matrix
A = zeros(3,3); % Pa * m % Extensional stiffnes matrix
B = zeros(3,3); % Pa * m^2 % Coupling stiffness matrix
D = zeros(3,3); % Pa * m^3 % Bending stiffness matrix
for i = 1:3
for j = 1:3
for k = 1:n
A(i,j) = A(i,j) + Qbar(i,j,k) * (h(k+1)-h(k));
B(i,j) = B(i,j) + (1/2) * Qbar(i,j,k) * (h(k+1)^2-h(k)^2);
D(i,j) = D(i,j) + (1/3) * Qbar(i,j,k) * (h(k+1)^3-h(k)^3);
end
end
end
ABBD = [A B;
B D];
%% Loading
% Foot Dimensions
shoe_size = 42; % eu
L_data = 230e-3; % m % Total Lenght of the foot
% L_model = 206e-3; % m for proted design
L_model = ((shoe_size - 2 ) * 20 / 3)*1e-3;
b_rear = 0.311 * L_model; % Lenght of the front part of the foot
b_front = L_model - b_rear; % Lenght of the rear part of the foot
a = 0.31 * L_model; % Width of the foot
delta = 7.5; % deg % the angle between foot axis and the walking direction
Iy = (1/12) * a*H^3; % m^4
Iz = (1/12) * H*a^3; % m^4
% J = Iy + Iz; % m^4
J = 1/16*a*H^3*(16/3-3.36*H/a*(1-H^4/(12*a^4)));
% Curved Beam
R = 100/208*L_model;
rn = H/log((R + H)/R);
e = R + H/2 - rn;
%% Total Mass of the Foot
area = L_model * a;
if t_core ~= 0
mass = rho * area * (H-t_core_down-t_core_up) + rho_core * area * (t_core_down+t_core_up);
else
mass = rho * area * H;
end
%% Force Data
load('gait_forces.mat')
mass_data = 56.7;
design_mass = 110;
number_of_time_steps = length(spi);
nots = number_of_time_steps;
% Toe contact
Fz = -F_foot_ground_yp(spi)*design_mass/mass_data;
Fy = F_foot_ground_xp(spi) * sind(delta)*design_mass/mass_data;
Fx = F_foot_ground_xp(spi) * cosd(delta)*design_mass/mass_data;
b = CoP_xp(spi)*1e-3 * L_model / L_data - b_rear;
% b = abs(b);
%% OUTER FOOT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Loadings
Nx = Fx/(H*a)*H + Fy.*b*(a/2)*H/Iz + Fz.*b/(H*a*e)*(R*log((R+H/2+e)/(R-H/2+e)) - H); % N/m
Ny = Fy./(H*b)*H; % N/m
Nxy = Fy/(H*a)*H; %+ Fz*a^3/(8*J)*(H/a*sqrt(1+H^2/a^2) + 1/2*log(abs(H/a + sqrt(1+H^2/a^2))/abs(-H/a + sqrt(1+H^2/a^2)))); % N/m
N = [Nx Ny Nxy]';
Mx = Fz.*b/(2*H*a*e)*(2*H*R + 2*R*(R+e)*log((R-H/2+e)/(R+H/2+e))); % N*m/m
My = zeros(size(b)); % N*m/m
Mxy = Fz*a^4/(16*J)*(-1/4*(H/a*sqrt(1+H^2/a^2) + 1/2*log(abs(H/a + sqrt(1+H^2/a^2))/abs(-H/a + sqrt(1+H^2/a^2)))) + 1/2*H/a*(H^2/a^2 + 1)^(3/2)); % N*m/m
M = [Mx My Mxy]';
NM = [N;M];
%% Strains and curvatures
eps0kappa = ABBD\NM;
eps0 = eps0kappa(1:3,:); % m/m
kappa = eps0kappa(4:6,:); % 1/m
z = -H/2:100*1e-6:H/2; % z for whole laminate
for i = 1:nots
eps(:,:,i) = repmat(eps0(:,i), 1, length(z)) + z .* kappa(:,i);
end
%% Stresses
sigma = zeros(size(eps));
sigma_loc = zeros(size(eps));
for i = 1:length(z)
for j = 1:length(h)-1
if z(i)>=h(j) && z(i)<h(j+1)
ply = j;
break
end
end
if z(i)==h(end)
ply = length(h)-1;
end
for j = 1:nots
sigma(:,i,j) = Qbar(:,:,ply) * eps(:,i,j);
end
% Local stresses
s = sin(theta(ply)*pi/180);
c = cos(theta(ply)*pi/180);
% Transformation matrix
T = [c^2 s^2 2*s*c;
s^2 c^2 -2*s*c;
-s*c s*c c^2-s^2]; % -
for j = 1:nots
sigma_loc(:,i,j) = T * sigma(:,i,j);
end
end
%% Strength Ratio
SR = zeros(length(z),nots);
% Tsai-Wu Criterion
H1 = 1/sigma_1_T_ult - 1/sigma_1_C_ult; % 1/Pa
H11 = 1/(sigma_1_T_ult*sigma_1_C_ult); % 1/Pa^2
H2 = 1/sigma_2_T_ult - 1/sigma_2_C_ult; %
H22 = 1/(sigma_2_T_ult*sigma_2_C_ult);
H6 = 0;
H66 = 1/tau_12_ult^2;
H12 = -1/2 * sqrt(1/(sigma_1_T_ult*sigma_1_C_ult*sigma_2_T_ult*sigma_2_C_ult)); % Mises-Hencky Criterion
for i=1:length(z)
for j = 1:nots
p = [H11*sigma_loc(1,i,j)^2+H22*sigma_loc(2,i,j)^2+H66*sigma_loc(3,i,j)^2+...
H12*sigma_loc(1,i,j)*sigma_loc(2,i,j)...
H1*sigma_loc(1,i,j)+H2*sigma_loc(2,i,j)+H6*sigma_loc(3,i,j) -1];
SR(i,j) = max(roots(p));
end
end
SR_tw = SR;
%Tsai-Hill Criterion
SR = zeros(length(z),nots);
for i=1:length(z)
for j = 1:nots
FI = sigma_loc(1,i,j)^2/sigma_1_T_ult^2 - sigma_loc(1,i,j)*sigma_loc(2,i,j)/sigma_1_T_ult^2 + sigma_loc(2,i,j)^2/sigma_2_T_ult^2 + sigma_loc(3,i,j)^2/tau_12_ult^2;
SR(i,j) = 1/sqrt(FI);
end
end
SR_th = SR;
%Max Stress Criterion
FI_1 = reshape(max(sigma_loc(1,:,:),0)/sigma_1_T_ult,[length(z),nots]);
FI_2 = reshape(max(-sigma_loc(1,:,:),0)/sigma_1_C_ult,[length(z),nots]);
FI_3 = reshape(max(sigma_loc(2,:,:),0)/sigma_2_T_ult,[length(z),nots]);
FI_4 = reshape(max(-sigma_loc(2,:,:),0)/sigma_2_C_ult,[length(z),nots]);
FI_5 = reshape(abs(sigma_loc(3,:,:))/tau_12_ult,[length(z),nots]);
SR_ms = 1./max(cat(3,FI_1, FI_2, FI_3, FI_4, FI_5),[],3);
SR_out = min(cat(3,SR_ms, SR_th, SR_tw),[],3);
%% INNER FOOT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Loadings
Nx = Fx/(H*a)*H + Fy.*b*(a/2)*H/Iz + Fz.*b/(H*a*e)*(R*log((R+H/2+e)/(R-H/2+e)) - H); % N/m
Ny = -Fy./(H*b)*H; % N/m
Nxy = -Fy/(H*a)*H; %+ Fz*a^3/(8*J)*(H/a*sqrt(1+H^2/a^2) + 1/2*log(abs(H/a + sqrt(1+H^2/a^2))/abs(-H/a + sqrt(1+H^2/a^2)))); % N/m
N = [Nx Ny Nxy]';
Mx = Fz.*b/(2*H*a*e)*(2*H*R + 2*R*(R+e)*log((R-H/2+e)/(R+H/2+e))); % N*m/m
My = zeros(size(b)); % N*m/m
Mxy = -Fz*a^4/(16*J)*(-1/4*(H/a*sqrt(1+H^2/a^2) + 1/2*log(abs(H/a + sqrt(1+H^2/a^2))/abs(-H/a + sqrt(1+H^2/a^2)))) + 1/2*H/a*(H^2/a^2 + 1)^(3/2)); % N*m/m
M = [Mx My Mxy]';
NM = [N;M];
%% Strains and curvatures
eps0kappa = ABBD\NM;
eps0 = eps0kappa(1:3,:); % m/m
kappa = eps0kappa(4:6,:); % 1/m
z = -H/2:100*1e-6:H/2; % z for whole laminate
for i = 1:nots
eps(:,:,i) = repmat(eps0(:,i), 1, length(z)) + z .* kappa(:,i);
end
%% Stresses
sigma = zeros(size(eps));
sigma_loc = zeros(size(eps));
for i = 1:length(z)
for j = 1:length(h)-1
if z(i)>=h(j) && z(i)<h(j+1)
ply = j;
break
end
end
if z(i)==h(end)
ply = length(h)-1;
end
for j = 1:nots
sigma(:,i,j) = Qbar(:,:,ply) * eps(:,i,j);
end
% Local stresses
s = sin(theta(ply)*pi/180);
c = cos(theta(ply)*pi/180);
% Transformation matrix
T = [c^2 s^2 2*s*c;
s^2 c^2 -2*s*c;
-s*c s*c c^2-s^2]; % -
for j = 1:nots
sigma_loc(:,i,j) = T * sigma(:,i,j);
end
end
%% Strength Ratio
SR = zeros(length(z),nots);
% Tsai-Wu Criterion
H1 = 1/sigma_1_T_ult - 1/sigma_1_C_ult; % 1/Pa
H11 = 1/(sigma_1_T_ult*sigma_1_C_ult); % 1/Pa^2
H2 = 1/sigma_2_T_ult - 1/sigma_2_C_ult; %
H22 = 1/(sigma_2_T_ult*sigma_2_C_ult);
H6 = 0;
H66 = 1/tau_12_ult^2;
H12 = -1/2 * sqrt(1/(sigma_1_T_ult*sigma_1_C_ult*sigma_2_T_ult*sigma_2_C_ult)); % Mises-Hencky Criterion
for i=1:length(z)
for j = 1:nots
p = [H11*sigma_loc(1,i,j)^2+H22*sigma_loc(2,i,j)^2+H66*sigma_loc(3,i,j)^2+...
H12*sigma_loc(1,i,j)*sigma_loc(2,i,j)...
H1*sigma_loc(1,i,j)+H2*sigma_loc(2,i,j)+H6*sigma_loc(3,i,j) -1];
SR(i,j) = max(roots(p));
end
end
SR_tw = SR;
%Tsai-Hill Criterion
SR = zeros(length(z),nots);
for i=1:length(z)
for j = 1:nots
if sigma_loc(1,i,j) < 0 X1 = sigma_1_C_ult; else X1 = sigma_1_T_ult; end
if sigma_loc(2,i,j) < 0 X2 = sigma_2_C_ult; else X2 = sigma_2_T_ult; end
FI = sigma_loc(1,i,j)^2/X1^2 - sigma_loc(1,i,j)*sigma_loc(2,i,j)/X1^2 + sigma_loc(2,i,j)^2/X2^2 + sigma_loc(3,i,j)^2/tau_12_ult^2;
SR(i,j) = 1/sqrt(FI);
end
end
SR_th = SR;
%Max Stress Criterion
FI_1 = reshape(max(sigma_loc(1,:,:),0)/sigma_1_T_ult,[length(z),nots]);
FI_2 = reshape(max(-sigma_loc(1,:,:),0)/sigma_1_C_ult,[length(z),nots]);
FI_3 = reshape(max(sigma_loc(2,:,:),0)/sigma_2_T_ult,[length(z),nots]);
FI_4 = reshape(max(-sigma_loc(2,:,:),0)/sigma_2_C_ult,[length(z),nots]);
FI_5 = reshape(abs(sigma_loc(3,:,:))/tau_12_ult,[length(z),nots]);
SR_ms = 1./max(cat(3,FI_1, FI_2, FI_3, FI_4, FI_5),[],3);
SR_in = min(cat(3,SR_ms, SR_th, SR_tw),[],3);
%% Output
SR = min(min(SR_in,SR_out),[],'all');
if core_opt == true
opt = mass/SR;
else
opt = 1/SR;
end
end