Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pygwinc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
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
Jameson Rollins
pygwinc
Commits
d7fc219a
Commit
d7fc219a
authored
6 years ago
by
Jameson Graef Rollins
Browse files
Options
Downloads
Patches
Plain Diff
suspension: break out helper functions
don't need to be defined inside of the suspQuad function
parent
879a1010
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gwinc/suspension.py
+36
-74
36 additions, 74 deletions
gwinc/suspension.py
with
36 additions
and
74 deletions
gwinc/suspension.py
+
36
−
74
View file @
d7fc219a
...
...
@@ -5,6 +5,42 @@ import scipy.constants
from
scipy.io.matlab.mio5_params
import
mat_struct
def
construct_eom_matrix
(
k
,
m
,
f
):
"""
construct matrix for equations of motion.
`k` is the array for the spring constants and `f` is the freq
vector.
"""
w
=
2
*
pi
*
f
A
=
zeros
((
4
,
4
,
f
.
size
),
dtype
=
complex
)
A
[
0
,
1
,:]
=
-
k
[
1
,:];
A
[
1
,
0
,:]
=
A
[
1
,
2
,:]
A
[
1
,
2
,:]
=
-
k
[
2
,:];
A
[
2
,
1
,:]
=
A
[
1
,
2
,:]
A
[
2
,
3
,:]
=
-
k
[
3
,:];
A
[
3
,
2
,:]
=
A
[
2
,
3
,:]
A
[
0
,
0
,:]
=
k
[
0
,:]
+
k
[
1
,:]
-
m
[
0
]
*
w
**
2
A
[
1
,
1
,:]
=
k
[
1
,:]
+
k
[
2
,:]
-
m
[
1
]
*
w
**
2
A
[
2
,
2
,:]
=
k
[
2
,:]
+
k
[
3
,:]
-
m
[
2
]
*
w
**
2
A
[
3
,
3
,:]
=
k
[
3
,:]
-
m
[
3
]
*
w
**
2
return
A
def
calc_transfer_functions
(
A
,
B
,
k
,
f
):
"""
calculate transfer function from A/B matrices
"""
X
=
zeros
([
B
.
size
,
A
[
0
,
0
,:].
size
],
dtype
=
complex
)
for
j
in
range
(
A
[
0
,
0
,:].
size
):
X
[:,
j
]
=
np
.
linalg
.
solve
(
A
[:,:,
j
],
B
)
# transfer function from the force on the TM to TM motion
hForce
=
zeros
(
f
.
shape
,
dtype
=
complex
)
hForce
[:]
=
X
[
3
,:]
# transfer function from the table motion to TM motion
hTable
=
zeros
(
f
.
shape
,
dtype
=
complex
)
hTable
[:]
=
X
[
0
,:]
hTable
=
hTable
*
k
[
0
,:]
return
hForce
,
hTable
def
suspQuad
(
f
,
ifo
):
"""
Suspension for quadruple pendulum
...
...
@@ -34,43 +70,6 @@ def suspQuad(f, ifo):
modification for the different temperatures between the stages
K.Arai Mar 1., 2012
"""
# helper functions
def
construct_eom_matrix
(
k
,
m
,
f
):
"""
construct a matrix for eq of motion
k is the array for the spring constants
f is the freq vector
"""
w
=
2
*
pi
*
f
A
=
zeros
((
4
,
4
,
f
.
size
),
dtype
=
complex
)
A
[
0
,
1
,:]
=
-
k
[
1
,:];
A
[
1
,
0
,:]
=
A
[
1
,
2
,:]
A
[
1
,
2
,:]
=
-
k
[
2
,:];
A
[
2
,
1
,:]
=
A
[
1
,
2
,:]
A
[
2
,
3
,:]
=
-
k
[
3
,:];
A
[
3
,
2
,:]
=
A
[
2
,
3
,:]
A
[
0
,
0
,:]
=
k
[
0
,:]
+
k
[
1
,:]
-
m
[
0
]
*
w
**
2
A
[
1
,
1
,:]
=
k
[
1
,:]
+
k
[
2
,:]
-
m
[
1
]
*
w
**
2
A
[
2
,
2
,:]
=
k
[
2
,:]
+
k
[
3
,:]
-
m
[
2
]
*
w
**
2
A
[
3
,
3
,:]
=
k
[
3
,:]
-
m
[
3
]
*
w
**
2
return
A
def
calc_transfer_functions
(
A
,
B
,
k
,
f
):
X
=
zeros
([
B
.
size
,
A
[
0
,
0
,:].
size
],
dtype
=
complex
)
for
j
in
range
(
A
[
0
,
0
,:].
size
):
X
[:,
j
]
=
np
.
linalg
.
solve
(
A
[:,:,
j
],
B
)
# transfer function from the force on the TM to TM motion
hForce
=
zeros
(
f
.
shape
,
dtype
=
complex
)
hForce
[:]
=
X
[
3
,:]
# transfer function from the table motion to TM motion
hTable
=
zeros
(
f
.
shape
,
dtype
=
complex
)
hTable
[:]
=
X
[
0
,:]
hTable
=
hTable
*
k
[
0
,:]
return
hForce
,
hTable
# default arguments
fiberType
=
0
...
...
@@ -357,43 +356,6 @@ def suspBQuad(f, ifo):
modification for the different temperatures between the stages
K.Arai Mar 1., 2012
"""
# helper functions
def
construct_eom_matrix
(
k
,
m
,
f
):
"""
construct a matrix for eq of motion
k is the array for the spring constants
f is the freq vector
"""
w
=
2
*
pi
*
f
A
=
zeros
((
4
,
4
,
f
.
size
),
dtype
=
complex
)
A
[
0
,
1
,:]
=
-
k
[
1
,:];
A
[
1
,
0
,:]
=
A
[
1
,
2
,:]
A
[
1
,
2
,:]
=
-
k
[
2
,:];
A
[
2
,
1
,:]
=
A
[
1
,
2
,:]
A
[
2
,
3
,:]
=
-
k
[
3
,:];
A
[
3
,
2
,:]
=
A
[
2
,
3
,:]
A
[
0
,
0
,:]
=
k
[
0
,:]
+
k
[
1
,:]
-
m
[
0
]
*
w
**
2
A
[
1
,
1
,:]
=
k
[
1
,:]
+
k
[
2
,:]
-
m
[
1
]
*
w
**
2
A
[
2
,
2
,:]
=
k
[
2
,:]
+
k
[
3
,:]
-
m
[
2
]
*
w
**
2
A
[
3
,
3
,:]
=
k
[
3
,:]
-
m
[
3
]
*
w
**
2
return
A
def
calc_transfer_functions
(
A
,
B
,
k
,
f
):
X
=
zeros
([
B
.
size
,
A
[
0
,
0
,:].
size
],
dtype
=
complex
)
for
j
in
range
(
A
[
0
,
0
,:].
size
):
X
[:,
j
]
=
np
.
linalg
.
solve
(
A
[:,:,
j
],
B
)
# transfer function from the force on the TM to TM motion
hForce
=
zeros
(
f
.
shape
,
dtype
=
complex
)
hForce
[:]
=
X
[
3
,:]
# transfer function from the table motion to TM motion
hTable
=
zeros
(
f
.
shape
,
dtype
=
complex
)
hTable
[:]
=
X
[
0
,:]
hTable
=
hTable
*
k
[
0
,:]
return
hForce
,
hTable
# default arguments
fiberType
=
0
...
...
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