Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pygwinc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gwinc
pygwinc
Commits
442ac0b7
Commit
442ac0b7
authored
6 years ago
by
Christopher Wipf
Committed by
Christopher Wipf
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Include sus TF generating code -- now we're ready for the quintuple pendulum
parent
cc89719d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!31
Speed up quad sus tf calculation 10x, by pre-solving the system symbolically
Pipeline
#28484
passed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gwinc/suspension.py
+29
-10
29 additions, 10 deletions
gwinc/suspension.py
with
29 additions
and
10 deletions
gwinc/suspension.py
+
29
−
10
View file @
442ac0b7
...
...
@@ -15,16 +15,34 @@ FIBER_TYPES = [
]
# quad pendulum equation of motion matrix A =
# [[k0+k1-m0*w**2, -k1, 0, 0],
# [ -k1, k1+k2-m1*w**2, -k2, 0],
# [ 0, -k2, k2+k3-m2*w**2, -k3],
# [ 0, 0, -k3, k3-m3*w**2]])
# diagonal elements: mass and restoring forces
# off-diagonal: coupling to stages above and below
# want TM equations of motion, so index 4
# b = [[0], [0], [0], [1]]
# sympy.linsolve((A, b), x) yields the following two functions
def
generate_symbolic_tfs
(
stages
=
4
):
import
sympy
as
sp
# construct quad pendulum equation of motion matrix
ksyms
=
sp
.
numbered_symbols
(
'
k
'
)
msyms
=
sp
.
numbered_symbols
(
'
m
'
)
w
=
sp
.
symbols
(
'
w
'
)
k
=
[
next
(
ksyms
)
for
n
in
range
(
stages
)]
m
=
[
next
(
msyms
)
for
n
in
range
(
stages
)]
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
):
...
...
@@ -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
)))
return
X3
def
top_displ_to_tst_displ
(
k
,
m
,
f
):
"""
transfer function for quad pendulum
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment