Semi-Monocoque Theory


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 = sympy.symbols('A A_0 t t_0 a b h L', positive=True)

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


In [5]:
values = [(A, 450 * ureg.millimeter**2),(A0, 250  * ureg.millimeter**2),(a, 130 * ureg.millimeter), \
          (b, 300 * ureg.millimeter),(h, 150 * ureg.millimeter),(L, 650 * ureg.millimeter)]
datav = [(v[0],v[1].magnitude) for v in values]

Multiconnected Section

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:[(sympy.Integer(0),h),A],
             2:[(sympy.Integer(0),sympy.Integer(0)),A],
             3:[(a,sympy.Integer(0)),A],
             4:[(a+b,sympy.Integer(0)),A],
             5:[(a+b,h),A],
             6:[(a,h),A]}

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

Define section and perform first calculations


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

As we need to compute $x_{sc}$, we have to perform

$$A \cdot q_{ext} = T$$

where:

  • A is a matrix with number of nodes + number of loops rows and number of edges +1 columns (it is square)
  • q is a column vector of unknowns: #edges fluxes and shear center coordinate
  • T is the vector of known terms: $-\frac{T_y}{J_x} \cdot S_{x_i}$ or $-\frac{T_x}{J_y} \cdot S_{y_i}$ for n-1 nodes and the rest are 0

Expression of A


In [8]:
sympy.simplify(S3.A)


Out[8]:
$$\left[\begin{matrix}1 & 0 & 0 & 0 & 0 & 0 & -1 & 0\\-1 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\0 & -1 & 1 & 1 & 0 & 0 & 0 & 0\\0 & 0 & -1 & 0 & 1 & 0 & 0 & 0\\0 & 0 & 0 & 0 & -1 & 1 & 0 & 0\\\frac{h}{3} \left(2 a + b\right) & \frac{a h}{2} & \frac{b h}{2} & \frac{h}{3} \left(a - b\right) & \frac{h}{3} \left(a + 2 b\right) & \frac{b h}{2} & \frac{a h}{2} & -1\\\frac{h}{t} & \frac{a}{t} & 0 & \frac{h}{t} & 0 & 0 & \frac{a}{t} & 0\\0 & 0 & \frac{b}{t} & - \frac{h}{t} & \frac{h}{t} & \frac{b}{t} & 0 & 0\end{matrix}\right]$$

Expression of T


In [9]:
sympy.simplify(S3.T)


Out[9]:
$$\left[\begin{matrix}- \frac{1}{3 h}\\\frac{1}{3 h}\\\frac{1}{3 h}\\\frac{1}{3 h}\\- \frac{1}{3 h}\\0\\0\\0\end{matrix}\right]$$

Resulting fluxes and coordinate


In [10]:
sympy.simplify(S3.tempq)


Out[10]:
$$\left[\begin{matrix}- \frac{1}{3 h}\\0\\0\\\frac{1}{3 h}\\\frac{1}{3 h}\\0\\0\\0\end{matrix}\right]$$

Plot of S3 section in original reference frame


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

In [12]:
plt.figure(figsize=(12,8),dpi=300)
nx.draw(S3.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);


Expression of Inertial properties wrt Center of Gravity in with original rotation


In [13]:
S3.Ixx0, S3.Iyy0, S3.Ixy0, S3.α0


Out[13]:
$$\left ( \frac{3 A}{2} h^{2}, \quad \frac{4 A}{3} \left(a^{2} + a b + b^{2}\right), \quad 0, \quad 0\right )$$

Plot of S3 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 [14]:
positions={ii: [float(S3.g.node[ii]['pos'][i].subs(datav)) for i in range(2)] for ii in S3.g.nodes() }

In [15]:
x_ct, y_ct = S3.ct.subs(datav)

plt.figure(figsize=(12,8),dpi=300)
nx.draw(S3.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 [16]:
S3.Ixx, S3.Iyy, S3.Ixy, S3.θ


Out[16]:
$$\left ( \frac{3 A}{2} h^{2}, \quad \frac{4 A}{3} \left(a^{2} + a b + b^{2}\right), \quad 0, \quad 0\right )$$

Shear center expression


In [17]:
S3.ct


Out[17]:
$$\left[\begin{matrix}0\\0\end{matrix}\right]$$

Loops detection


In [18]:
S3.cycles


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

Compute axial loads in Stringers in S3

Set loads on the section:

Example 1: shear in y direction and bending moment in x direction


In [19]:
Tx, Ty, Nz, Mx, My, Mz, F, ry, ry, mz = sympy.symbols('T_x T_y N_z M_x M_y M_z F r_y r_x m_z')
S3.set_loads(_Tx=0, _Ty=Ty, _Nz=0, _Mx=Mx, _My=0, _Mz=0)

Compute axial loads in stringers and shear flows in panels


In [20]:
S3.compute_stringer_actions()
S3.compute_panel_fluxes();

Expression of matrix A:

  • second to last row: Mz equilibrium
  • last row: equivalence of rotations in the form: $\dot{\theta_1} - \dot{\theta_2} = 0$

In [21]:
sympy.simplify(S3.A)


Out[21]:
$$\left[\begin{matrix}1 & 0 & 0 & 0 & 0 & 0 & -1\\-1 & 1 & 0 & 0 & 0 & 0 & 0\\0 & -1 & 1 & 1 & 0 & 0 & 0\\0 & 0 & -1 & 0 & 1 & 0 & 0\\0 & 0 & 0 & 0 & -1 & 1 & 0\\\frac{h}{3} \left(2 a + b\right) & \frac{a h}{2} & \frac{b h}{2} & \frac{h}{3} \left(a - b\right) & \frac{h}{3} \left(a + 2 b\right) & \frac{b h}{2} & \frac{a h}{2}\\- \frac{1}{2 a t} & - \frac{1}{2 h t} & \frac{1}{2 h t} & - \frac{a + b}{2 a b t} & \frac{1}{2 b t} & \frac{1}{2 h t} & - \frac{1}{2 h t}\end{matrix}\right]$$

Expression of T


In [22]:
sympy.simplify(S3.T)


Out[22]:
$$\left[\begin{matrix}- \frac{T_{y}}{3 h}\\\frac{T_{y}}{3 h}\\\frac{T_{y}}{3 h}\\\frac{T_{y}}{3 h}\\- \frac{T_{y}}{3 h}\\0\\0\end{matrix}\right]$$

Axial loads


In [23]:
S3.N


Out[23]:
$$\left \{ 1 : \frac{M_{x}}{3 h}, \quad 2 : - \frac{M_{x}}{3 h}, \quad 3 : - \frac{M_{x}}{3 h}, \quad 4 : - \frac{M_{x}}{3 h}, \quad 5 : \frac{M_{x}}{3 h}, \quad 6 : \frac{M_{x}}{3 h}\right \}$$

Shear flows


In [24]:
sympy.simplify(S3.q)


Out[24]:
$$\left \{ \left ( 1, \quad 2\right ) : - \frac{T_{y}}{3 h}, \quad \left ( 2, \quad 3\right ) : 0, \quad \left ( 3, \quad 4\right ) : 0, \quad \left ( 3, \quad 6\right ) : \frac{T_{y}}{3 h}, \quad \left ( 4, \quad 5\right ) : \frac{T_{y}}{3 h}, \quad \left ( 5, \quad 6\right ) : 0, \quad \left ( 6, \quad 1\right ) : 0\right \}$$

Example 2: twisting moment in z direction


In [25]:
S3.set_loads(_Tx=0, _Ty=0, _Nz=0, _Mx=0, _My=0, _Mz=Mz)
S3.compute_stringer_actions()
S3.compute_panel_fluxes();

In [26]:
S3.N


Out[26]:
$$\left \{ 1 : 0, \quad 2 : 0, \quad 3 : 0, \quad 4 : 0, \quad 5 : 0, \quad 6 : 0\right \}$$

In [27]:
S3.q


Out[27]:
$$\left \{ \left ( 1, \quad 2\right ) : \frac{M_{z} \left(2 a b + 2 a h + b h\right)}{4 h \left(a^{2} b + a^{2} h + a b^{2} + a b h + b^{2} h\right)}, \quad \left ( 2, \quad 3\right ) : \frac{M_{z} \left(2 a b + 2 a h + b h\right)}{4 h \left(a^{2} b + a^{2} h + a b^{2} + a b h + b^{2} h\right)}, \quad \left ( 3, \quad 4\right ) : \frac{M_{z} \left(2 a b + a h + 2 b h\right)}{4 h \left(a^{2} b + a^{2} h + a b^{2} + a b h + b^{2} h\right)}, \quad \left ( 3, \quad 6\right ) : \frac{M_{z} \left(a - b\right)}{4 a^{2} b + 4 a^{2} h + 4 a b^{2} + 4 a b h + 4 b^{2} h}, \quad \left ( 4, \quad 5\right ) : \frac{M_{z} \left(2 a b + a h + 2 b h\right)}{4 h \left(a^{2} b + a^{2} h + a b^{2} + a b h + b^{2} h\right)}, \quad \left ( 5, \quad 6\right ) : \frac{M_{z} \left(2 a b + a h + 2 b h\right)}{4 h \left(a^{2} b + a^{2} h + a b^{2} + a b h + b^{2} h\right)}, \quad \left ( 6, \quad 1\right ) : \frac{M_{z} \left(2 a b + 2 a h + b h\right)}{4 h \left(a^{2} b + a^{2} h + a b^{2} + a b h + b^{2} h\right)}\right \}$$

Set loads on the section:

Example 3: shear in x direction and bending moment in y direction


In [28]:
S3.set_loads(_Tx=Tx, _Ty=0, _Nz=0, _Mx=0, _My=My, _Mz=0)
S3.compute_stringer_actions()
S3.compute_panel_fluxes();

In [29]:
S3.N


Out[29]:
$$\left \{ 1 : - \frac{3 M_{y} \left(- \frac{2 a}{3} - \frac{b}{3}\right)}{4 a^{2} + 4 a b + 4 b^{2}}, \quad 2 : - \frac{3 M_{y} \left(- \frac{2 a}{3} - \frac{b}{3}\right)}{4 a^{2} + 4 a b + 4 b^{2}}, \quad 3 : - \frac{3 M_{y} \left(\frac{a}{3} - \frac{b}{3}\right)}{4 a^{2} + 4 a b + 4 b^{2}}, \quad 4 : - \frac{3 M_{y} \left(\frac{a}{3} + \frac{2 b}{3}\right)}{4 a^{2} + 4 a b + 4 b^{2}}, \quad 5 : - \frac{3 M_{y} \left(\frac{a}{3} + \frac{2 b}{3}\right)}{4 a^{2} + 4 a b + 4 b^{2}}, \quad 6 : - \frac{3 M_{y} \left(\frac{a}{3} - \frac{b}{3}\right)}{4 a^{2} + 4 a b + 4 b^{2}}\right \}$$

In [30]:
S3.q


Out[30]:
$$\left \{ \left ( 1, \quad 2\right ) : 0, \quad \left ( 2, \quad 3\right ) : \frac{T_{x} \left(2 a + b\right)}{4 a^{2} + 4 a b + 4 b^{2}}, \quad \left ( 3, \quad 4\right ) : \frac{T_{x} \left(a + 2 b\right)}{4 a^{2} + 4 a b + 4 b^{2}}, \quad \left ( 3, \quad 6\right ) : 0, \quad \left ( 4, \quad 5\right ) : 0, \quad \left ( 5, \quad 6\right ) : - \frac{T_{x} \left(a + 2 b\right)}{4 a^{2} + 4 a b + 4 b^{2}}, \quad \left ( 6, \quad 1\right ) : - \frac{T_{x} \left(2 a + b\right)}{4 a^{2} + 4 a b + 4 b^{2}}\right \}$$

Verify that $$q_i \cdot l_i = T_x$$


In [31]:
sympy.simplify(S3.q[(2,3)]*a+S3.q[(3,4)]*b-S3.q[(5,6)]*b-S3.q[(6,1)]*a)


Out[31]:
$$T_{x}$$

Torsional moment of inertia


In [32]:
S3.compute_Jt()
S3.Jt


Out[32]:
$$\left[\begin{matrix}\frac{8 h^{2} t \left(a^{2} b + a^{2} h + a b^{2} + a b h + b^{2} h\right)}{4 a b + 4 a h + 4 b h + 3 h^{2}}\end{matrix}\right]$$

In [ ]: