Commit 442ac0b7 authored by Christopher Wipf's avatar Christopher Wipf Committed by Christopher Wipf

Include sus TF generating code -- now we're ready for the quintuple pendulum

parent cc89719d
Pipeline #28484 passed with stage
in 45 seconds
...@@ -15,16 +15,34 @@ FIBER_TYPES = [ ...@@ -15,16 +15,34 @@ FIBER_TYPES = [
] ]
# quad pendulum equation of motion matrix A = def generate_symbolic_tfs(stages=4):
# [[k0+k1-m0*w**2, -k1, 0, 0], import sympy as sp
# [ -k1, k1+k2-m1*w**2, -k2, 0],
# [ 0, -k2, k2+k3-m2*w**2, -k3], # construct quad pendulum equation of motion matrix
# [ 0, 0, -k3, k3-m3*w**2]]) ksyms = sp.numbered_symbols('k')
# diagonal elements: mass and restoring forces msyms = sp.numbered_symbols('m')
# off-diagonal: coupling to stages above and below w = sp.symbols('w')
# want TM equations of motion, so index 4 k = [next(ksyms) for n in range(stages)]
# b = [[0], [0], [0], [1]] m = [next(msyms) for n in range(stages)]
# sympy.linsolve((A, b), x) yields the following two functions A = sp.zeros(stages)
for n in range(stages-1):
# mass and restoring forces (diagonal elements)
A[n, n] = k[n] + k[n+1] - m[n] * w**2
# couplings to stages above and below
A[n, n+1] = -k[n+1]
A[n+1, n] = -k[n+1]
# mass and restoring force of bottom stage
A[-1, -1] = k[-1] - m[-1] * w**2
# want TM equations of motion, so index 4
b = sp.zeros(stages, 1)
b[-1] = 1
# solve linear system
xsyms = sp.numbered_symbols('x')
x = [next(xsyms) for n in range(stages)]
ans = sp.linsolve((A, b), x)
return ans
def tst_force_to_tst_displ(k, m, f): def tst_force_to_tst_displ(k, m, f):
...@@ -37,6 +55,7 @@ def tst_force_to_tst_displ(k, m, f): ...@@ -37,6 +55,7 @@ def tst_force_to_tst_displ(k, m, f):
X3 = (k2**2*(k0 + k1 - m0*w**2) + (k1**2 - (k0 + k1 - m0*w**2)*(k1 + k2 - m1*w**2))*(k2 + k3 - m2*w**2))/(-k3**2*(k1**2 - (k0 + k1 - m0*w**2)*(k1 + k2 - m1*w**2)) + (k3 - m3*w**2)*(k2**2*(k0 + k1 - m0*w**2) - (-k1**2 + (k0 + k1 - m0*w**2)*(k1 + k2 - m1*w**2))*(k2 + k3 - m2*w**2))) X3 = (k2**2*(k0 + k1 - m0*w**2) + (k1**2 - (k0 + k1 - m0*w**2)*(k1 + k2 - m1*w**2))*(k2 + k3 - m2*w**2))/(-k3**2*(k1**2 - (k0 + k1 - m0*w**2)*(k1 + k2 - m1*w**2)) + (k3 - m3*w**2)*(k2**2*(k0 + k1 - m0*w**2) - (-k1**2 + (k0 + k1 - m0*w**2)*(k1 + k2 - m1*w**2))*(k2 + k3 - m2*w**2)))
return X3 return X3
def top_displ_to_tst_displ(k, m, f): def top_displ_to_tst_displ(k, m, f):
"""transfer function for quad pendulum """transfer function for quad pendulum
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment