Frame
Frame
A CALCPAD PROGRAM
FOR ANALYSIS OF PLANE FRAMES
WITH ARBITRARY CROSS-SECTIONS
─◊─◊──◊───◊────⧫────◊───◊──◊─◊─
by
Page 1 / 22
Table of Contents
I. Introduction....................................................................................................................2
II. Calcpad source code.......................................................................................................3
III. Output........................................................................................................................13
IV. Comparison with Stadyps 6.0 software.........................................................................20
I. Introduction
This Calcpad program calculates plane frames with arbitrary sections using the finite
element method. The input data is entered in text format as vectors and matrices as fol-
lows:
joint coordinates;
joint numbers at the ends of the elements;
material properties;
dimensions and types of cross-sections;
support conditions;
load values.
As a result, diagrams of internal forces and deflections of structural elements are ob-
tained. The schemes are automatically generated by the program, using the SVG graphi-
cal format.
Page 2 / 22
II.Calcpad source code
1 #include svg_drawing.cpd
2 "Analysis of plane frames with arbitrary cross-sections
3 '<h4>Joint coordinates - xJ; yJ</h4>
4 #hide
5 #deg
6 δz = 10^-12
7 Precision = 10^-9
8 x_J = [0; 0; 8; 16; 16]*m
9 y_J = [0; 8; 10; 8; 0]*m
10 #show
11 x_J','y_J
12 n_J = len(x_J)
13 '<h4>Elements - [J1; J2]</h4>
14 #hide
15 e_J = [1; 2|2; 3|3; 4|4; 5]
16 #show
17 transp(e_J)
18 n_E = n_rows(e_J)
19 'Element endpoint coordinates
20 x_1(e) = x_J.e_J.(e; 1)','y_1(e) = y_J.e_J.(e; 1)
21 x_2(e) = x_J.e_J.(e; 2)','y_2(e) = y_J.e_J.(e; 2)
22 'Element length - 'l(e) = sqrt((x_2(e) - x_1(e))^2 + (y_2(e) - y_1(e))^2)
23 'Element direction
24 c(e) = (x_2(e) - x_1(e))/l(e)','s(e) = (y_2(e) - y_1(e))/l(e)
25 'Transformation matrix
26 'Diagonal 3x3 block -'t(e) = [c(e); s(e); 0|-s(e); c(e); 0|0; 0; 1]
27 'Generation of the full transformation matrix
28 T(e) = add(t(e); add(t(e); matrix(6; 6); 1; 1); 4; 4)
29 '<h4>Supports - [Joint; cx; cy; cr]</h4>
30 #hide
31 c = [1; 10^20kN/m; 10^20kN/m; 0kNm|5; 10^20kN/m; 10^20kN/m; 10^20kNm]
32 #show
33 c
34 n_c = n_rows(c)
35 '<h4>Loads - [Element, qx, qy]</h4>
36 #hide
37 q = [1; 10kN/m; 0kN/m|2; 0kN/m; -20kN/m|3; 0kN/m; -10kN/m]
38 n_q = n_rows(q)
39 q_x = vector(n_E)*kN/m
40 q_y = vector(n_E)*kN/m
41 $Repeat{q_x.(q.(i; 1)) = q_x.(q.(i; 1)) + q.(i; 2) @ i = 1 : n_q}
42 $Repeat{q_y.(q.(i; 1)) = q_y.(q.(i; 1)) + q.(i; 3) @ i = 1 : n_q}
43 #show
44 q
45 'Load values on elements
46 q_x
47 q_y
Page 3 / 22
48 '<h4>Scheme of the structure</h4>
49 #hide
50 w = max(x_J)
51 h = max(y_J)
52 W = 240
53 H = h*W/w
54 k = W/w
55 #def svg$ = '<svg viewbox="'-3m*k' '-2m*k' '(w + 6m)*k' '(h + 4m)*k'"
xmlns="http://www.w3.org/2000/svg" version="1.1" style="font-family:
Georgia Pro; font-size:4pt; width:'W + 150'pt; height:'H + 200*H/W'pt">
56 #def thin_style$ = style = "stroke:green; stroke-width:1; fill:none"
57 #def thick_style$ = style = "stroke:green; stroke-width:2; fill:none"
58 k_q = m/kN
59 #show
60 #val
61 svg$
62 #for i = 1 : n_E
63 #hide
64 x1 = x_1(i)*k
65 y1 = (h - y_1(i))*k
66 x2 = x_2(i)*k
67 y2 = (h - y_2(i))*k
68 q_xi = q_x.i
69 q_yi = q_y.i
70 α = atan2(c(i); s(i))
71 #if α ≥ 135
72 α = α - 180
73 #end if
74 #if α < -45
75 α = α + 180
76 #else if α < 0
77 α = 360 + α
78 #end if
79 #if q_xi ≠ 0kN/m
80 #hide
81 x3 = x2 - q_xi*k_q','y3 = y2
82 x4 = x1 - q_xi*k_q','y4 = y1
83 x = (x3 + x4)/2 - 5*sign(q_xi)
84 y = (y3 + y4)/2
85 #show
86 '<polygon points="'x1','y1' 'x2','y2' 'x3','y3' 'x4','y4'"
style="stroke:magenta; stroke-width:1; stroke-opacity:0.3; fill:magenta;
fill-opacity:0.1;" />
87 text$(x;y;α;qx='abs(q_xi)')
88 #end if
89 #if q_yi ≠ 0kN/m
90 #hide
91 x3 = x2','y3 = y2 + q_yi*k_q
92 x4 = x1','y4 = y1 + q_yi*k_q
93 x = (x3 + x4)/2
Page 4 / 22
94 y = (y3 + y4)/2 + 5*sign(q_yi)
95 #show
96 '<polygon points="'x1','y1' 'x2','y2' 'x3','y3' 'x4','y4'"
style="stroke:dodgerblue; stroke-width:1; stroke-opacity:0.4;
fill:dodgerblue; fill-opacity:0.15;" />
97 text$(x;y;α;qy='abs(q_yi)')
98 #end if
99 #show
100 line$(x1; y1; x2; y2; main_style$)
101 #loop
102 '<g id="frame">
103 #for i = 1 : n_E
104 #hide
105 x1 = x_1(i)*k
106 y1 = (h - y_1(i))*k
107 x2 = x_2(i)*k
108 y2 = (h - y_2(i))*k
109 #show
110 line$(x1; y1; x2; y2; main_style$)
111 #loop
112 #for i = 1 : n_c
113 #hide
114 j = c.(i; 1)
115 x1 = x_J.j*k
116 y1 = (h - y_J.j)*k
117 δ = w/30*k*sign(x1 - w/2*k)
118 x2 = x1 - δ
119 y2 = y1 - abs(δ)
120 x3 = x1 + δ
121 y3 = y1 + abs(δ)
122 #show
123 #if c.(i; 2) ≠ 0kN/m
124 #if c.(i; 3) ≠ 0kN/m
125 #if c.(i; 4) ≠ 0kNm
126 line$(x1; y1; x1; y3; thin_style$)
127 line$(x2; y3; x3; y3; thick_style$)
128 #else
129 line$(x2; y3; x3; y3; thick_style$)
130 line$(x2; y3; x1; y1; thin_style$)
131 line$(x3; y3; x1; y1; thin_style$)
132 #end if
133 #else
134 #if c.(i; 4) ≠ 0kNm
135 line$(x1; y1; x2; y1; thin_style$)
136 line$(x2; y2; x2; y3; thick_style$)
137 line$(x2 - δ/2; y2; x2 - δ/2; y3; thick_style$)
138 #else
139 line$(x2; y2; x1; y1; thin_style$)
140 line$(x2; y3; x1; y1; thin_style$)
141 line$(x2; y2; x2; y3; thin_style$)
Page 5 / 22
142 line$(x2 - δ/2; y2; x2 - δ/2; y3; thick_style$)
143 #end if
144 #end if
145 #else
146 #if c.(i; 3) ≠ 0kN/m
147 #if c.(i; 4) ≠ 0kNm
148 line$(x1; y1; x1; y3; thin_style$)
149 line$(x2; y3; x3; y3; thick_style$)
150 line$(x2; y3 + abs(δ)/2; x3; y3 + abs(δ)/2; thick_style$)
151 #else
152 line$(x2; y3; x3; y3; thin_style$)
153 line$(x2; y3; x1; y1; thin_style$)
154 line$(x3; y3; x1; y1; thin_style$)
155 line$(x2; y3 + abs(δ)/2; x3; y3 + abs(δ)/2; thick_style$)
156 #end if
157 #else
158 line$(x2; y2; x3; y3; thick_style$)
159 #end if
160 #end if
161 #loop
162 '</g>
163 #for i = 1 : n_E
164 #hide
165 x = (x_1(i) + x_2(i))*k/2
166 y = (h - (y_1(i) + y_2(i))/2)*k
167 #show
168 texth$(x + 0.8m*sign(W/2 - x)*k; y + 0.6m*k; e'i')
169 #loop
170 #for i = 1 : n_J
171 point$(x_J.i*k; (h - y_J.i)*k; point_style$)
172 texth$((x_J.i - 0.7m*sign(w/2 - x_J.i))*k; (h - y_J.i - 0.4m)*k;
J'i')
173 #loop
174 dimv$((w + 2m)*k; (h - y_J.4)*k; h*k; 'y_J.4')
175 dimv$((w + 2m)*k; 0; (h - y_J.4)*k; 'h - y_J.4')
176 dimh$(0; w*k; (h + 1.5m)*k; 'w')
177 '</svg>
178 #equ
179 '<h4>Materials</h4>
180 'Modules of elasticity -'E = [45; 35]*GPa
181 'Poisson coefficients -'ν = [0.2; 0.2]
182 'Shear modules -'G = E/(2*(1 + ν))
183 'Assignment on elements -'e_M = [1; 2; 2; 1]
184 '<h4>Cross-sections</h4>
185 #hide
186 b = vector(2)','h = vector(2)
187 #show
188 'Section S1 -'h.1 = 500mm'- circular - 'b_C(z) = 2*sqrt((h.1/2)^2 - (z -
h.1/2)^2)
189 'Section S2 -'b.2 = 250mm','h.2 = 700mm'- rectangular -'b_R(z) = b.2
Page 6 / 22
190 'General representation -'b(z; s) = take(s; b_C(z); b_R(z))
191 '<h4>Cross section properties</h4>
192 'Equations
193 'Area -'A(s) = $Integral{b(z; s) @ z = 0mm : h.s}
194 'First moment of area -'S(s) = $Integral{b(z; s)*z @ z = 0mm : h.s}|cm^3
195 'Centroid -'z_c(s) = S(s)/A(s)|mm
196 'Second moment of area -'I(s) = $Integral{b(z; s)*(z - z_c(s))^2 @ z =
0mm : h.s}
197 'First moment of area below z -'S_1(z; s) = $Integral{b(ζ; s)*(z_c(s) -
ζ) @ ζ = 0mm : z}
198 'Shear area -'A_s(s) = I(s)^2/$Integral{S_1(z; s)^2/b(z; s) @ z = 0mm :
h.s}
199 'Calculated results
200 'Centroids -'z_c = [z_c(1); z_c(2)]
201 'Areas -'A = [A(1); A(2)]
202 'Shear areas -'A_s = [A_s(1); A_s(2)]
203 'Second moments of area -'I = [I(1); I(2)]
204 'Assignment on elements -'e_S = [1; 2; 2; 1]
205 '<h4>Element stiffness matrix</h4>
206 'Elastic properties for element "e"
207 EA(e) = E.e_M.e*A.e_S.e
208 EI(e) = E.e_M.e*I.e_S.e
209 GA_s(e) = G.e_M.e*A_s.e_S.e
210 k_s(e) = 12*EI(e)/(GA_s(e)*l(e)^2)
211 α(e) = EA(e)/l(e)','β(e) = EI(e)/(l(e)^3*(1 + k_s(e)))
212 'Stiffness matrix coefficients for element "e"
213 k_11(e) = α(e)*(m/kN)','k_22(e) = 12*β(e)*(m/kN)','k_23(e) =
6*β(e)*l(e)*(1/kN)
214 k_33(e) = (4 + k_s(e))*β(e)*l(e)^2*(1/kNm)
215 k_36(e) = (2 - k_s(e))*β(e)*l(e)^2*(1/kNm)
216 'Assembling the 3x3 stiffness matrix blocks for element "e"
217 k_ii(e) = [k_11(e)|0; k_22(e); k_23(e)|0; k_23(e); k_33(e)]
218 k_ij(e) = [-k_11(e)|0; -k_22(e); k_23(e)|0; -k_23(e); k_36(e)]
219 k_ji(e) = transp(k_ij(e))
220 k_jj(e) = [k_11(e)|0; k_22(e); -k_23(e)|0; -k_23(e); k_33(e)]
221 'Full 6x6 element stiffness matrix
222 k_E(e) = stack(augment(k_ii(e); k_ij(e)); augment(k_ji(e); k_jj(e)))
223 'Stiffness matrices obtained in local coordinates
224 k_E(1)
225 k_E(2)
226 'Stiffness matrices obtained in global coordinates
227 transp(T(1))*k_E(1)*T(1)
228 transp(T(2))*k_E(2)*T(2)
229 '<h4>Global stiffness matrix</h4>
230 #hide
231 K = symmetric(3*n_J)
232 'Add element stiffness matrices
233 #for e = 1 : n_E
234 i = 3*e_J.(e; 1) - 2','j = 3*e_J.(e; 2) - 2
235 t = t(e)','tT = transp(t)
Page 7 / 22
236 add(tT*k_ii(e)*t; K; i; i)
237 #if j > i
238 add(tT*k_ij(e)*t; K; i; j)
239 #else
240 add(tT*k_ji(e)*t; K; j; i)
241 #end if
242 add(tT*k_jj(e)*t; K; j; j)
243 #loop
244 'Add supports
245 #for i = 1 : n_c
246 j = 3*c.(i; 1) - 2
247 add(vec2diag(last(row(c; i); 3)/[kN/m; kN/m; kNm]); K; j; j)
248 #loop
249 #show
250 K
251 '<h4>Element load vector</h4>
252 'Lateral load in local CS -'q_E(e) = -q_x.e*s(e) + q_y.e*c(e)
253 'Axial load in local CS -'n_E(e) = q_x.e*c(e) + q_y.e*s(e)
254 'Equivalent loads at element endpoints
255 F_Ex(e) = q_x.e*l(e)/2*(1/kN)','F_Ey(e) = q_y.e*l(e)/2*(1/kN)
256 M_E(e) = q_E(e)*l(e)^2/12*(1/kNm)
257 'Load vector -'F_E(e) = [F_Ex(e); F_Ey(e); M_E(e); F_Ex(e); F_Ey(e); -
M_E(e)]
258 #novar
259 'Results for elements
260 #for e = 1 : n_E
261 'Element Е'e' -'F_E(e)
262 #loop
263 #varsub
264 '<h4>Global load vector</h4>
265 #hide
266 F = vector(3*n_J)
267 #for i = 1 : n_q
268 e = q.(i; 1)
269 #for jj = 1 : 2
270 j = 3*e_J.(e; jj) - 3
271 F.(j + 1) = F.(j + 1) + take(3*jj - 2; F_E(e))
272 F.(j + 2) = F.(j + 2) + take(3*jj - 1; F_E(e))
273 F.(j + 3) = F.(j + 3) + take(3*jj; F_E(e))
274 #loop
275 #loop
276 #show
277 F
278 '<h4>Results</h4>
279 '<p><strong>Solution of the system of equations by Cholesky decomposition
</strong></p>
280 Z = clsolve(K; F)
281 '<p><strong>Joint displacements</strong></p>
282 z_J(j) = slice(Z; 3*j - 2; 3*j)
283 z(j) = round(z_J(j)/δz)*δz*1000*[mm; mm; 1]
Page 8 / 22
284 #novar
285 #for j = 1 : n_J
286 z(j)
287 #loop
288 #varsub
289 '<p><strong>Support reactions</strong></p>
290 r(i) = row(c; i)','j(i) = take(1; r(i))
291 R(i) = -z_J(j(i))*[m; m; 1]*last(r(i); 3)
292 #novar
293 #for i = 1 : n_c
294 #val
295 '<p>Joint <b>J'j(i)' -
296 #equ
297 '</b>'R(i)'</p>
298 #loop
299 #varsub
300 '<p><strong>Element end forces</strong></p>
301 z_E(e) = [z_J(e_J.(e; 1)); z_J(e_J.(e; 2))]
302 R_E(e) = col(k_E(e)*T(e)*z_E(e) - T(e)*F_E(e); 1)*[1; 1; m; 1; 1; m]*kN
303 #novar
304 #for e = 1 : n_E
305 R_E(e)
306 #loop
307 #varsub
308 '<p><strong>Element internal forces</strong></p>
309 N(e; x) = -take(1; R_E(e)) - n_E(e)*x
310 Q(e; x) = take(2; R_E(e)) + q_E(e)*x
311 M(e; x) = -take(3; R_E(e)) + take(2; R_E(e))*x + q_E(e)*x^2/2
312 #hide
313 w = max(x_J)
314 h = max(y_J)
315 W = 240
316 H = h*W/w
317 k = W/w
318 #def red_style$ = style = "stroke:red; stroke-width:1; fill:red"
319 #deg
320 #for i = 1 : 3
321 #hide
322 R(e; x) = take(i; N(e; x); Q(e; x); M(e; x))
323 sgn = take(i; 1; 1; -1)
324 tol = 0.01*take(i; kN; kN; kNm)
325 R_max = $Sup{$Sup{R(e; x) @ x = 0m : l(e)} @ e = 1 : n_E}
326 R_min = $Sup{abs($Inf{R(e; x) @ x = 0m : l(e)}) @ e = 1 : n_E}
327 k_R = sgn*1m*k/max(R_min; R_max)
328 #show
329 #if i ≡ 1
330 '<p><strong>Axial forces diagram, kN</strong></p>
331 #else if i ≡ 2
332 '<p><strong>Shear forces diagram, kN</strong></p>
333 #else
Page 9 / 22
334 '<p><strong>Bending moments diagram, kNm</strong></p>
335 #end if
336 #val
337 svg$
338 '<use href="#frame"/>
339 #for e = 1 : n_E
340 #hide
341 x1 = x_1(e)*k
342 y1 = (h - y_1(e))*k
343 x2 = x_2(e)*k
344 y2 = (h - y_2(e))*k
345 c_e = c(e)
346 s_e = s(e)
347 l_e = l(e)
348 st = l_e/10
349 xd2 = x1
350 yd2 = y1
351 #show
352 #for j = 0 : 10
353 #hide
354 xd1 = xd2
355 yd1 = yd2
356 x = j*st*k
357 v = R(e; j*st)
358 y = v*k_R
359 xd2 = x1 + x*c_e - y*s_e
360 yd2 = y1 - x*s_e - y*c_e
361 α = 90 + atan2(c_e; s_e)
362 #if α ≥ 135
363 α = α - 180
364 #end if
365 #if α < -45
366 α = α + 180
367 #else if α < 0
368 α = 360 + α
369 #end if
370 d = -15*sign(v*sgn)
371 #show
372 line$(xd1; yd1; xd2; yd2; red_style$)
373 #if (j ≡ 0 ∨ j ≡ 10) ∧ abs(v) > tol
374 text$(xd2 + s_e*d; yd2 + d*c_e; α; 'v')
375 #end if
376 line$(xd1; yd1; xd2; yd2; red_style$)
377 #loop
378 #hide
379 xd1 = x2
380 yd1 = y2
381 #show
382 line$(xd1; yd1; xd2; yd2; red_style$)
383 #loop
Page 10 / 22
384 '</svg>
385 #loop
386 #equ
387 '<p><strong>Deformed shape</strong></p>
388 'Shape function in relative coordinates ξ = x/l (with account to shear
deflections)
389 Φ_1(e; ξ) = 1/(1 + k_s(e))*(1 + k_s(e) - k_s(e)*ξ - 3*ξ^2 + 2*ξ^3)
390 Φ_2(e; ξ) = ξ*l(e)*m^-1/(1 + k_s(e))*(1 + k_s(e)/2 - (2 + k_s(e)/2)*ξ +
ξ^2)
391 Φ_3(e; ξ) = ξ/(1 + k_s(e))*(k_s(e) + 3*ξ - 2*ξ^2)
392 Φ_4(e; ξ) = ξ*l(e)*m^-1/(1 + k_s(e))*(-k_s(e)/2 - (1 - k_s(e)/2)*ξ + ξ^2)
393 'Element endpoint displacements and rotations
394 z_E,loc(e) = T(e)*z_E(e)
395 u_1(e) = take(1; z_E,loc(e))','v_1(e) = take(2; z_E,loc(e))','φ_1(e) =
take(3; z_E,loc(e))
396 u_2(e) = take(4; z_E,loc(e))','v_2(e) = take(5; z_E,loc(e))','φ_2(e) =
take(6; z_E,loc(e))
397 'Displacement functions
398 u(e; ξ) = u_1(e)*(1 - ξ) + u_2(e)*ξ
399 v(e; ξ) = v_1(e)*Φ_1(e; ξ) + φ_1(e)*Φ_2(e; ξ) + v_2(e)*Φ_3(e; ξ) +
φ_2(e)*Φ_4(e; ξ)
400 'Deformed shape, mm
401 #val
402 #hide
403 tol = 0.00001
404 k_R = 1200
405 #show
406 svg$
407 '<use href="#frame" style="opacity:0.4;"/>
408 #for e = 1 : n_E
409 #hide
410 x1 = x_1(e)*k
411 y1 = (h - y_1(e))*k
412 x2 = x_2(e)*k
413 y2 = (h - y_2(e))*k
414 c_e = c(e)
415 s_e = s(e)
416 l_e = l(e)
417 u = u(e; 0)
418 v = v(e; 0)
419 x = u*k_R
420 y = v*k_R
421 xd2 = x1 + x*c_e - y*s_e
422 yd2 = y1 - x*s_e - y*c_e
423 #show
424 #for j = 0 : 10
425 #hide
426 xd1 = xd2
427 yd1 = yd2
428 ξ = j/10
Page 11 / 22
429 u = u(e; ξ)
430 v = v(e; ξ)
431 x = ξ*l_e*k + u*k_R
432 y = v*k_R
433 xd2 = x1 + x*c_e - y*s_e
434 yd2 = y1 - x*s_e - y*c_e
435 d = -15*sign(v)
436 #show
437 line$(xd1; yd1; xd2; yd2; red_style$)
438 #loop
439 #loop
440 #for j = 1 : n_J
441 #hide
442 z_J = z_J(j)
443 u = z_J.1
444 v = z_J.2
445 x = x_J.j*k + u*k_R
446 y = (h - y_J.j)*k - v*k_R
447 dx = 15*sign(u)
448 dy = -15*sign(v)
449 #show
450 #if abs(u) > tol
451 texth$(x + dx; y; 'u*1000')
452 #end if
453 #if abs(v) > tol
454 textv$(x; y + dy; 'v*1000')
455 #end if
456 #loop
457 '</svg>
458 #equ
Page 12 / 22
III. Output
Analysis of plane frames with arbitrary cross-sections
[ ]
⃗x J = [ 0 m 0 m 8 m 16 m 16 m ] 1 2
2 3
eJ =
⃗y J = [ 0 m 8 m 10 m 8 m 0 m ] 3 4
4 5
Number of joints - n J =len ( ⃗x J ) =5
Number of elements - n E =nrows ( e J ) =4
Supports Loads
J cx cy cr е qx qy
[ 1 10 20 kN/m 10 20 kN/m
] [ ]
0 kNm 1 10 kN/m 0 kN/m
c= q= 2 0 kN/m - 20 kN/m
5 10 kN/m 10 kN/m 10 20 kNm
20 20
3 0 kN/m - 10 kN/m
Number of supports - nc =n rows ( c ) =2 Load values on elements
E1 E2 E3 E4
⃗q x =[10 kN/m 0 kN/m 0 kN/m 0 kN/m ]
⃗q y =[0 kN/m - 20 kN/m - 10 kN/m 0 kN/m ]
x 2 ( e ) =⃗x J . e , y 2 ( e ) =⃗y J . e J . e 2
J.e2
Element length - l ( e )= √ ( x ( e ) − x ( e )) + ( y ( e ) − y ( e ))
2 1
2
2 1
2
x 2 ( e ) − x1 ( e ) y2 ( e )− y1 (e )
Element direction - c ( e )= , s (e )=
l (e) l (e )
Transformation matrix
Diagonal 3x3 block - t (e)= [ c (e) ; s (e) ; 0 | − s (e); c (e) ; 0 | 0 ; 0 ; 1 ]
Generation of the full transformation matrix
T (e)=add ( t (e) ; add ( t (e) ; matrix (6 ; 6) ; 1 ; 1 ) ; 4 ; 4 )
Page 13 / 22
Scheme of the structure
Materials
Modules of elasticity - ⃗
E =[45 GPa 35 GPa ]
Poisson coefficients - ⃗ν =[0.2 0.2]
⃗
E
Shear modules - ⃗
G= =[18.75 GPa 14.58 GPa]
2 · (1+ ⃗ν )
Assignment on elements - ⃗e M =[1 2 2 1]
Cross-sections
√( ) (
⃗h ⃗h
)
2 2
Section S1 - ⃗h1 =500 mm - circular - b ( z ) =2 · 1
− z−
1
C
2 2
Area - A (s)= ∫ b ( z ; s) d z
0 mm
⃗h
s
S ( s)
Centroid - z c ( s ) =
A ( s)
⃗h
s
Page 14 / 22
z
I ( s)2
Shear area - A s (s)= ⃗h
s
S 1 ( z ; s)2
∫ b ( z ; s)
dz
0 mm
Calculated results
Centroids - ⃗z c =[ z c (1) ; z c (2)]=[250 mm 350 mm ]
Areas - ⃗
A=[ A(1) ; A(2)]=[196350 mm 2 175000 mm 2 ]
Shear areas - ⃗
A s =[ A s (1) ; As (2)]=[176715 mm 2 145833 mm 2 ]
EA ( e ) β ( e ) = EI ( e )
α ( e )= , 3
l (e ) l ( e ) · ( 1+k s ( e ) )
k ji ( e ) = transp ( k ij ( e ))
Page 15 / 22
[ ]
1104466 0 0 −1104466 0 0
0 3210.66 12842.6 0 −3210.66 12842.6
0 12842.6 68627.8 0 −12842.6 34113.2
k E ( 1) =
−1104466 0 0 1104466 0 0
0 −3210.66 −12842.6 0 3210.66 −12842.6
0 12842.6 34113.2 0 −12842.6 68627.8
[ ]
742765 0 0 −742765 0 0
0 5243.46 21619.3 0 −5243.46 21619.3
0 21619.3 119468 0 −21619.3 58809.3
k E ( 2)=
−742765 0 0 742765 0 0
0 −5243.46 −21619.3 0 5243.46 −21619.3
0 21619.3 58809.3 0 −21619.3 119468
[ ]
3210.66 0 - 12842.6 - 3210.66 0 - 12842.6
0 1104466 0 0 - 1104466 0
- 12842.6 0 68627.8 12842.6 0 34113.2
transp ( T (1)) · k E (1) · T (1)=
- 3210.66 0 12842.6 3210.66 0 12842.6
0 - 1104466 0 0 1104466 0
- 12842.6 0 34113.2 12842.6 0 68627.8
[ ]
699382 173535 - 5243.46 - 699382 - 173535 - 5243.46
173535 48627.1 20973.8 - 173535 - 48627.1 20973.8
- 5243.46 20973.8 119468 5243.46 - 20973.8 58809.3
transp ( T (2)) · k E (2) · T (2)=
- 699382 - 173535 5243.46 699382 173535 5243.46
- 173535 - 48627.1 - 20973.8 173535 48627.1 - 20973.8
- 5243.46 20973.8 58809.3 5243.46 - 20973.8 119468
[ ]
1020 0 - 12842.6 - 3210.66 0 - 12842.6 0 0 0 0 0 0 0 0 0
0 1020 0 0 - 1104466 0 0 0 0 0 0 0 0 0 0
- 12842.6 0 68627.8 12842.6 0 34113.2 0 0 0 0 0 0 0 0 0
- 3210.66 0 12842.6 702592 173535 7599.17 -699382 - 173535 - 5243.46 0 0 0 0 0 0
0 - 1104466 0 173535 1153093 20973.8 -173535 - 48627.1 20973.8 0 0 0 0 0 0
- 12842.6 0 34113.2 7599.17 20973.8 188096 5243.46 - 20973.8 58809.3 0 0 0 0 0 0
0 0 0 - 699382 - 173535 5243.46 1398763 0 10486.9 -699382 173535 5243.46 0 0 0
K= 0 0 0 - 173535 - 48627.1 - 20973.8 0 97254.2 0 173535 - 48627.1 20973.8 0 0 0
0 0 0 - 5243.46 20973.8 58809.3 10486.9 0 238937 - 5243.46 -20973.8 58809.3 0 0 0
0 0 0 0 0 0 -699382 173535 - 5243.46 702592 -173535 7599.17 - 3210.66 0 12842.6
0 0 0 0 0 0 173535 - 48627.1 - 20973.8 -173535 1153093 - 20973.8 0 - 1104466 0
0 0 0 0 0 0 5243.46 20973.8 58809.3 7599.17 -20973.8 188096 - 12842.6 0 34113.2
20
0 0 0 0 0 0 0 0 0 - 3210.66 0 - 12842.6 10 0 - 12842.6
0 0 0 0 0 0 0 0 0 0 -1104466 0 0 1020 0
0 0 0 0 0 0 0 0 0 12842.6 0 34113.2 - 12842.6 0 1020
Page 16 / 22
Element load vector
Lateral load in local CS - q E ( e ) =−⃗q x. e · s ( e ) +⃗q y. e · c ( e )
Element Е4 - F E ( 4 ) = [ 0 0 0 0 0 0 ]
Results
Solution of the system of equations by Cholesky decomposition
⃗
Z =clsolve ( K ; ⃗
F ) = [1.88×10 -19 -1.39×10 -18 -0.000928 0.00809 -0.000126
-5
-0.00274 0.0119 -0.0157 0.000699 0.0157 -9.84×10 0.000846 6.12×10 -19
-1.09×10 -18 -2.3×10 -18 ]
Joint displacements
The displacements for each joint are extracted from the global vector:
z J ( j ) =slice ( ⃗
Z ; 3 · j −2 ; 3 · j ), z ( j ) =round
z J ( j)
10 −12 ( )
· 10−9 · [ mm; mm; 1 ]
Page 17 / 22
Support reactions
They are determined by multiplying the joint displacements by the respective spring
constants.
r (i)=row (c ; i) , j (i)=take ( 1 ; r (i) ), R (i)=- z J ( j (i ) ) · [ m; m; 1] · last ( r (i ) ; 3 )
Endpoint forces are determined by multiplying the element stiffness matrix by the end-
point displacements in local CS and subtracting the element load vector values in local
CS.
R E ( e ) =col ( k E ( e ) · T ( e ) · z E ( e ) −T ( e ) · F E ( e ) ; 1 ) · [ 1 ; 1 ; m ; 1 ; 1 ; m ] · kN
Page 18 / 22
q E (e) · x 2
Bending moments- M (e ; x)=- take ( 3 ; R E (e)) +take ( 2 ; R E (e) ) · x+ , kNm
2
Deformed shape
Shape function in relative coordinates ξ = x/l (with account to shear deflections)
1
Φ 1 (e ; ξ )= · ( 1+ k s (e)−k s (e) · ξ −3 · ξ 2 +2 · ξ 3)
1+ k s (e)
Φ 2 (e ; ξ )=
ξ · l (e ) · m- 1
1+ k s (e) (· 1+
k s (e)
2 (
− 2+
k s (e)
2 )
· ξ +ξ2 )
ξ
Φ 3 (e ; ξ )= · ( k s (e)+3 · ξ −2 · ξ 2 )
1+ k s (e)
Φ 4 (e ; ξ )=
ξ·l (e) · m- 1
1+ k s (e) (
· -
k s (e)
2 (
− 1−
k s (e)
2 )
· ξ +ξ2 )
Element endpoint displacements and rotations
Page 19 / 22
z E , loc (e)=T (e ) · z E (e)
u1 (e)=take ( 1 ; z E , loc (e) ) , v 1 (e)= take ( 2 ; z E , loc (e) ) , φ 1 (e)=take ( 3 ; z E , loc (e))
Displacement functions
u (e ; ξ )=u 1 (e) · (1−ξ )+u 2 (e) · ξ
Deformed shape, mm
Materials
№ Е
1 45000000 0.200 0.000012
2 35000000 0.200 0.000012
Page 20 / 22
Cross-sections
Section S1 - CIRCULAR
Section R1 - RECTANGULAR
Elements
№ J1 J2 Type Material Section ISZ Winkl. Const.
1 1 2 3 1 S1 0 0.0
2 2 3 3 2 R1 0 0.0
3 3 4 3 2 R1 0 0.0
4 4 5 3 1 S1 0 0.0
Supports and springs
№ Kxm Kym Kz Kxy Kxz Kyz Joints
4 -1 -1 0 0 0 0 1
7 -1 -1 -1 0 0 0 5
Linearly distributed loads
№ Type q1 q2 A L Elements
1 qx 10.00 10.00 0.00 0.00 1
2 qy 10.00 10.00 0.00 0.00 2, 2, 3
Page 21 / 22
Results
Joint displacements
Joint Ux Uy Rz Joint Ux Uy Rz
1 0.000 0.000 0.001 2 0.008 0.000 0.003
3 0.012 0.016 -0.001 4 0.016 0.000 -0.001
5 0.000 0.000 0.000
Reactions in supports
Joint Fx Fy Mz Възел Fx Fy Mz
1 -18.839 -138.687 0.000 5 -61.161 -108.700 -230.046
Page 22 / 22