Force Method - Truss
import ema as em
import matplotlib.pyplot as plt
import numpy as np
import sympy as sp
%config InlineBackend.figure_format = 'svg'
dm = em.Model(2,2) # create instance of model object
n = dm.dnodes
e = dm.delems
A1 = 10000
Ac = 20000
I = 1
dm.xsection('default', A1, I)
csec = dm.xsection('section-c', Ac, I)
n1 = dm.node('1', 0.0, 0.0)
n2 = dm.node('2', 16., 0.0)
n3 = dm.node('3', 8.0, 6.0)
n4 = dm.node('4', 0.0, 6.0)
a = dm.truss('a', n3, n4) # add truss element to model object
b = dm.truss('b', n1, n3)
c = dm.truss('c', n2, n3, xsec=csec)
dm.pin(n1)
dm.pin(n4)
dm.pin(n2)
dm.numDOF() # Automatically number model dofs
# em.utilities.export.FEDEAS(dm)
[[3, 4], [5, 6], [1, 2], [7, 8]]
prim = em.Model(2,2) # create instance of model object
np = prim.dnodes
ep = prim.delems
A1 = 10000
Ac = 20000
I = 1
prim.xsection('default', A1, I)
csec = prim.xsection('section-c', Ac, I)
prim.node('1', 0.0, 0.0)
prim.node('2', 16., 0.0)
prim.node('3', 8.0, 6.0)
prim.node('4', 0.0, 6.0)
prim.truss('a', np['3'], np['4']) # add truss element to model object
prim.truss('c', np['2'], np['3'], xsec=csec)
prim.pin(np['1'])
prim.pin(np['4'])
prim.pin(np['2'])
prim.numDOF() # Automatically number model dofs
np['3'].p['x'] = 30
np['3'].p['y'] = 50
# Establish redundant member force
dm.redundant(b, '1')
fig, ax = plt.subplots()
em.plot_structure(dm, ax)
Part 1 : Nodal Loading
Ufp = em.analysis.SolveDispl(prim)
A = em.A_matrix(dm)
A.f@Ufp
|
$V_{{fffffff}}$ |
$a_1$ |
0.077333 |
$b_1$ |
0.165400 |
$c_1$ |
0.041667 |
Uf = em.analysis.SolveDispl(dm)
A = em.A_matrix(dm)
A.f@Uf
|
$V_{{fffffffff}}$ |
$a_1$ |
-0.000361 |
$b_1$ |
-0.000718 |
$c_1$ |
-0.000141 |
# Create model matrices
B = em.B_matrix(dm)
P = em.P_vector(B)
# Define nodal loading
n['3'].p['x'] = 30
n['3'].p['y'] = 50
P.set_item('1', 50)
P.set_item('2', 30)
|
$a_1$ |
$b_1$ |
$c_1$ |
$1$ |
1.0 |
0.8 |
-0.8 |
$2$ |
-0.0 |
0.6 |
0.6 |
$3$ |
0.0 |
-0.8 |
0.0 |
$4$ |
0.0 |
-0.6 |
0.0 |
$5$ |
0.0 |
0.0 |
0.8 |
$6$ |
0.0 |
0.0 |
-0.6 |
$7$ |
-1.0 |
0.0 |
0.0 |
$8$ |
0.0 |
0.0 |
0.0 |
# Show portion of B matrix corresponding to free dofs
B.f
|
$a_1$ |
$b_1$ |
$c_1$ |
$1$ |
1.0 |
0.8 |
-0.8 |
$2$ |
-0.0 |
0.6 |
0.6 |
# Show portion of B matrix corresponding to primary system
B.i
|
$a_1$ |
$c_1$ |
$1$ |
1.0 |
-0.8 |
$2$ |
-0.0 |
0.6 |
Find \(Q_p\)
|
$Q_{{ffffff}}$ |
$a_1$ |
90.0 |
$c_1$ |
50.0 |
# create full 3x1 Qp vector from current 2x1 Qp vector
Qp = em.Q_vector(B, Qp)
Qp
|
$Q_{{0}}$ |
$a_1$ |
90.0 |
$b_1$ |
0.0 |
$c_1$ |
50.0 |
find \((V_h)_p\)
# Initialize structure matrices
A = em.A_matrix(dm)
Fs = em.Fs_matrix(dm)
Fs
|
$a_1$ |
$b_1$ |
$c_1$ |
$a_1$ |
0.0008 |
0.000 |
0.0000 |
$b_1$ |
0.0000 |
0.001 |
0.0000 |
$c_1$ |
0.0000 |
0.000 |
0.0005 |
Ve = Fs@Qp
Vhp = B.barx.T @ Ve
Vhp
C:\Users\claud\Anaconda3\lib\site-packages\IPython\core\formatters.py:371: FormatterWarning: text/html formatter returned invalid type <class 'ema.utilities.Structural_Vector'> (expected <class 'str'>) for object: Structural_Vector([-0.1402])
FormatterWarning
Structural_Vector([-0.1402])
find \((V_{h})_x\)
|
$b_1$ |
$a_1$ |
-0.00128 |
$b_1$ |
0.00100 |
$c_1$ |
-0.00050 |
C:\Users\claud\Anaconda3\lib\site-packages\IPython\core\formatters.py:371: FormatterWarning: text/html formatter returned invalid type <class 'ema.utilities.Structural_Vector'> (expected <class 'str'>) for object: Structural_Vector([[39.51521984]])
FormatterWarning
Structural_Vector([[39.51521984]])
Part 2 : Thermal Loading
Find \((V_h)_p\)
# e['a'].e0['1'] = 100*2e-5
# e['b'].e0['1'] = 100*2e-5
# e['c'].e0['1'] = 100*2e-5
|
$1$ |
$2$ |
$3$ |
$4$ |
$5$ |
$6$ |
$7$ |
$8$ |
$a_1$ |
1.0 |
-0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
-1.0 |
0.0 |
$b_1$ |
0.8 |
0.6 |
-0.8 |
-0.6 |
0.0 |
0.0 |
0.0 |
0.0 |
$c_1$ |
-0.8 |
0.6 |
0.0 |
0.0 |
0.8 |
-0.6 |
0.0 |
0.0 |
|
$V_{{ffffff}}$ |
$a_1$ |
0.0 |
$b_1$ |
0.0 |
$c_1$ |
0.0 |
C:\Users\claud\Anaconda3\lib\site-packages\IPython\core\formatters.py:371: FormatterWarning: text/html formatter returned invalid type <class 'ema.utilities.Structural_Vector'> (expected <class 'str'>) for object: Structural_Vector([0.])
FormatterWarning
Structural_Vector([0.])
Find \(Q_x\)
C:\Users\claud\Anaconda3\lib\site-packages\IPython\core\formatters.py:371: FormatterWarning: text/html formatter returned invalid type <class 'ema.utilities.Structural_Vector'> (expected <class 'str'>) for object: Structural_Vector([[-0.]])
FormatterWarning
Structural_Vector([[-0.]])