Semi-Monocoque Theory: corrective solutions


In [1]:
from pint import UnitRegistry
import sympy
import networkx as nx
#import numpy as np
import matplotlib.pyplot as plt
#import sys
%matplotlib inline
from IPython.display import display

Import Section class, which contains all calculations


In [2]:
from Section import Section

Initialization of sympy symbolic tool and pint for dimension analysis (not really implemented rn as not directly compatible with sympy)


In [3]:
ureg = UnitRegistry()
sympy.init_printing()

Define sympy parameters used for geometric description of sections


In [4]:
A, A0, t, t0, a, b, h, L, E, G = sympy.symbols('A A_0 t t_0 a b h L E G', positive=True)

We also define numerical values for each symbol in order to plot scaled section and perform calculations


In [5]:
values = [(A, 150 * ureg.millimeter**2),(A0, 250  * ureg.millimeter**2),(a, 80 * ureg.millimeter), \
          (b, 20 * ureg.millimeter),(h, 35 * ureg.millimeter),(L, 2000 * ureg.millimeter), \
          (t, 0.8 *ureg.millimeter),(E, 72e3 * ureg.MPa), (G, 27e3 * ureg.MPa)]
datav = [(v[0],v[1].magnitude) for v in values]

Third example: Simple rectangular section with 7 nodes

Define graph describing the section:

1) stringers are nodes with parameters:

  • x coordinate
  • y coordinate
  • Area

2) panels are oriented edges with parameters:

  • thickness
  • lenght which is automatically calculated

In [6]:
stringers = {1:[(3*a,h),A],
             2:[(2*a,h),A],
             3:[(a,h),A],
             4:[(sympy.Integer(0),h),A],
             5:[(sympy.Integer(0),sympy.Integer(0)),A],
             6:[(sympy.Rational(3,2)*a,sympy.Integer(0)),A],
             7:[(3*a,sympy.Integer(0)),A]}

panels = {(1,2):t,
          (2,3):t,
          (3,4):t,
          (4,5):t,
          (5,6):t,
          (6,7):t,
          (7,1):t}

Define section and perform first calculations


In [7]:
S1 = Section(stringers, panels)

In [8]:
S1.cycles


Out[8]:
$$\left [ \left [ 2, \quad 3, \quad 4, \quad 5, \quad 6, \quad 7, \quad 1, \quad 2\right ]\right ]$$

Plot of S1 section in original reference frame

Define a dictionary of coordinates used by Networkx to plot section as a Directed graph. Note that arrows are actually just thicker stubs


In [9]:
start_pos={ii: [float(S1.g.node[ii]['ip'][i].subs(datav)) for i in range(2)] for ii in S1.g.nodes() }

In [10]:
plt.figure(figsize=(12,8),dpi=300)
nx.draw(S1.g,with_labels=True, arrows= True, pos=start_pos)
plt.arrow(0,0,20,0)
plt.arrow(0,0,0,20)
#plt.text(0,0, 'CG', fontsize=24)
plt.axis('equal')
plt.title("Section in starting reference Frame",fontsize=16);


Plot of S1 section in inertial reference Frame

Section is plotted wrt center of gravity and rotated (if necessary) so that x and y are principal axes. Center of Gravity and Shear Center are drawn


In [11]:
positions={ii: [float(S1.g.node[ii]['pos'][i].subs(datav)) for i in range(2)] for ii in S1.g.nodes() }

In [12]:
x_ct, y_ct = S1.ct.subs(datav)

plt.figure(figsize=(12,8),dpi=300)
nx.draw(S1.g,with_labels=True, pos=positions)
plt.plot([0],[0],'o',ms=12,label='CG')
plt.plot([x_ct],[y_ct],'^',ms=12, label='SC')
#plt.text(0,0, 'CG', fontsize=24)
#plt.text(x_ct,y_ct, 'SC', fontsize=24)
plt.legend(loc='lower right', shadow=True)
plt.axis('equal')
plt.title("Section in pricipal reference Frame",fontsize=16);


Expression of inertial properties in principal reference frame


In [13]:
sympy.simplify(S1.Ixx), sympy.simplify(S1.Iyy), sympy.simplify(S1.Ixy), sympy.simplify(S1.θ)


Out[13]:
$$\left ( \frac{12 A}{7} h^{2}, \quad \frac{19 A}{2} a^{2}, \quad 0, \quad 0\right )$$

In [14]:
S1.symmetry


Out[14]:
[{'edges': [((1, 2), (3, 4)), (2, 3), ((4, 5), (7, 1)), ((5, 6), (6, 7))],
  'nodes': [(1, 4), (2, 3), (5, 7), (6, 6)]},
 {'edges': [], 'nodes': []}]

In [15]:
S1.compute_L()

In [16]:
S1.L


Out[16]:
$$\left[\begin{matrix}-1 & 0 & 1 & - \frac{1}{3}\\1 & 0 & 0 & 1\\1 & 0 & 0 & -1\\-1 & 0 & -1 & \frac{1}{3}\\0 & - \frac{1}{2} & 1 & 0\\0 & 1 & 0 & 0\\0 & - \frac{1}{2} & -1 & 0\end{matrix}\right]$$

In [17]:
S1.compute_H()

In [18]:
S1.H.subs(datav)


Out[18]:
$$\left[\begin{matrix}1 & 0 & - \frac{1}{2} & \frac{1}{3}\\0 & 0 & - \frac{1}{2} & - \frac{2}{3}\\-1 & 0 & - \frac{1}{2} & \frac{1}{3}\\0 & 0 & \frac{1}{2} & 0\\0 & \frac{1}{2} & - \frac{1}{2} & 0\\0 & - \frac{1}{2} & - \frac{1}{2} & 0\\0 & 0 & \frac{1}{2} & 0\end{matrix}\right]$$

In [19]:
S1.compute_KM(A,h,t)

In [20]:
S1.Ktilde


Out[20]:
$$\left[\begin{matrix}4 & 0 & 0 & 0\\0 & \frac{3}{2} & 0 & 0\\0 & 0 & 4 & - \frac{2}{3}\\0 & 0 & - \frac{2}{3} & \frac{20}{9}\end{matrix}\right]$$

In [21]:
S1.Mtilde.subs(datav)


Out[21]:
$$\left[\begin{matrix}\frac{32}{7} & 0 & 0 & 0\\0 & \frac{12}{7} & 0 & 0\\0 & 0 & \frac{55}{14} & 0\\0 & 0 & 0 & \frac{32}{21}\end{matrix}\right]$$

In [22]:
sol_data = (S1.Ktilde.inv()*(S1.Mtilde.subs(datav))).eigenvects()
sol_data


Out[22]:
$$\left [ \left ( \frac{8}{7}, \quad 2, \quad \left [ \left[\begin{matrix}1\\0\\0\\0\end{matrix}\right], \quad \left[\begin{matrix}0\\1\\0\\0\end{matrix}\right]\right ]\right ), \quad \left ( - \frac{\sqrt{17449}}{532} + \frac{467}{532}, \quad 1, \quad \left [ \left[\begin{matrix}0\\0\\- \frac{16}{\frac{83}{4} + \frac{\sqrt{17449}}{4}}\\1\end{matrix}\right]\right ]\right ), \quad \left ( \frac{\sqrt{17449}}{532} + \frac{467}{532}, \quad 1, \quad \left [ \left[\begin{matrix}0\\0\\- \frac{16}{- \frac{\sqrt{17449}}{4} + \frac{83}{4}}\\1\end{matrix}\right]\right ]\right )\right ]$$

In [23]:
β2 = [sol[0] for sol in sol_data]
β2


Out[23]:
$$\left [ \frac{8}{7}, \quad - \frac{\sqrt{17449}}{532} + \frac{467}{532}, \quad \frac{\sqrt{17449}}{532} + \frac{467}{532}\right ]$$

In [24]:
X = []
for sol in sol_data:
    for i in range(len(sol[2])):
        X.append(sympy.N(sol[2][i]/sol[2][i].norm()))
X


Out[24]:
$$\left [ \left[\begin{matrix}1.0\\0\\0\\0\end{matrix}\right], \quad \left[\begin{matrix}0\\1.0\\0\\0\end{matrix}\right], \quad \left[\begin{matrix}0\\0\\-0.285186998575641\\0.958471896219924\end{matrix}\right], \quad \left[\begin{matrix}0\\0\\0.793438739738669\\0.608650118115418\end{matrix}\right]\right ]$$

In [25]:
λ = [sympy.N(sympy.sqrt(E*A*h/(G*t)*βi).subs(datav)) for βi in β2]
λ


Out[25]:
$$\left [ 141.42135623731, \quad 104.960101594703, \quad 140.381841004298\right ]$$

In [ ]: