Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nmm_2020_site
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
nmm_2020_site
Commits
b149738c
Commit
b149738c
authored
5 years ago
by
Erik Strand
Browse files
Options
Downloads
Patches
Plain Diff
Add something for 3.1 (d)
parent
81cc843f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
_code/pset_02_math.py
+48
-0
48 additions, 0 deletions
_code/pset_02_math.py
_psets/02.md
+125
-0
125 additions, 0 deletions
_psets/02.md
with
173 additions
and
0 deletions
_code/pset_02_math.py
0 → 100644
+
48
−
0
View file @
b149738c
from
sympy
import
*
from
sympy.assumptions.assume
import
global_assumptions
#from sympy.abc import x, y
#expr = spy.sin(x) / spy.cos(x)
#spy.pprint(expr)
#expr = spy.simplify(expr)
#spy.pprint(expr)
alpha
,
omega_1
,
t
,
A
,
B
=
symbols
(
'
alpha omega_1 t A B
'
)
x
=
exp
(
-
alpha
*
t
)
*
(
A
*
exp
(
I
*
omega_1
*
t
)
+
B
*
exp
(
-
I
*
omega_1
*
t
))
dx
=
simplify
(
diff
(
x
,
t
))
ddx
=
simplify
(
diff
(
dx
,
t
))
pprint
(
x
)
print
(
""
)
pprint
(
dx
)
print
(
""
)
pprint
(
ddx
)
m
,
k
=
symbols
(
'
m k
'
)
global_assumptions
.
add
(
Q
.
real
(
m
))
global_assumptions
.
add
(
Q
.
positive
(
m
))
global_assumptions
.
add
(
Q
.
real
(
k
))
global_assumptions
.
add
(
Q
.
positive
(
k
))
omega_0
,
gamma
=
symbols
(
'
omega_0 gamma
'
)
E
=
simplify
(
Rational
(
1
,
2
)
*
(
m
*
dx
**
2
+
k
*
x
**
2
))
E_0
=
simplify
(
E
.
subs
(
t
,
0
))
#E_0 = simplify(E.subs([(t, 0), (omega_1, sqrt(omega_0**2 - alpha**2))]))
#E_0 = simplify(E_0.subs([(omega_0, sqrt(k / m)), (alpha, gamma / (2 * m))]))
print
(
""
)
pprint
(
E
)
print
(
""
)
pprint
(
E_0
)
dE
=
-
gamma
*
dx
delta_E
=
simplify
(
integrate
(
dE
,
(
t
,
0
,
2
*
pi
/
omega_1
)))
print
(
""
)
pprint
(
delta_E
)
Q
=
2
*
pi
*
E_0
/
delta_E
Q
=
Q
.
subs
(
omega_1
,
sqrt
(
omega_0
**
2
-
alpha
**
2
))
Q
=
Q
.
subs
([
(
omega_0
,
sqrt
(
k
/
m
)),
(
alpha
,
gamma
/
(
2
*
m
))
])
Q
=
simplify
(
Q
)
print
(
""
)
pprint
(
Q
)
This diff is collapsed.
Click to expand it.
_psets/02.md
+
125
−
0
View file @
b149738c
...
@@ -134,6 +134,17 @@ $$
...
@@ -134,6 +134,17 @@ $$
A =
\f
rac{1}{-m
\o
mega^2 + i
\g
amma
\o
mega + k}
A =
\f
rac{1}{-m
\o
mega^2 + i
\g
amma
\o
mega + k}
$$
$$
Thus the general solution to the inhomogeneous problem (assuming distinct roots) is
$$
x(t) = e^{-
\f
rac{
\g
amma}{2m} t}
\l
eft(
A e^{
\f
rac{
\s
qrt{
\g
amma^2 - 4mk}}{2m} t} +
B e^{-
\f
rac{
\s
qrt{
\g
amma^2 - 4mk}}{2m} t}
\r
ight) +
\f
rac{1}{-m
\o
mega^2 + i
\g
amma
\o
mega + k} e^{i
\o
mega t}
$$
Here are plots of the magnitude and phase of the particular solution.




...
@@ -149,12 +160,126 @@ to the energy lost per radian (one cycle is $$2\pi$$ radians). Show that these t
...
@@ -149,12 +160,126 @@ to the energy lost per radian (one cycle is $$2\pi$$ radians). Show that these t
equal, assuming that the damping is small. How long does it take the amplitude of a 100 Hz
equal, assuming that the damping is small. How long does it take the amplitude of a 100 Hz
oscillator with a Q of 109 to decay by $$1/e$$?
oscillator with a Q of 109 to decay by $$1/e$$?
#### Undamped
As we found previously, the general solution is
$$
x(t) = e^{-
\f
rac{
\g
amma}{2m} t}
\l
eft( A e^{
\f
rac{
\s
qrt{
\g
amma^2 - 4mk}}{2m} t} + B e^{-
\f
rac{
\s
qrt{
\g
amma^2 - 4mk}}{2m} t}
\r
ight)
$$
To get rid of a symbol, let's define $$
\o
mega_0 =
\s
qrt{k/m}$$ and $$
\a
lpha =
\g
amma / (2 m)$$.
Then
$$
\f
rac{
\s
qrt{
\g
amma^2 - 4mk}}{2m} =
\s
qrt{
\a
lpha^2 -
\o
mega_0^2}
$$
Since we're assuming low damping, $$
\a
lpha^2 -
\o
mega_0^2$$ is negative. So we'll use
$$
\s
qrt{
\a
lpha^2 -
\o
mega_0^2} = i
\s
qrt{
\o
mega_0^2 -
\a
lpha^2}
$$
Finally, to be as lazy as possible, we'll define $$
\o
mega_1^2 =
\o
mega_0^2 -
\a
lpha^2$$ (which
is a positive real number). All together this compresses our general solution to
$$
\b
egin{aligned}
x(t)
&= e^{-
\a
lpha t}
\l
eft( A e^{
\s
qrt{
\a
lpha^2 -
\o
mega_0^2} t} + B e^{-
\s
qrt{
\a
lpha^2 -
\o
mega_0^2} t}
\r
ight)
\\
&= e^{-
\a
lpha t}
\l
eft( A e^{i
\s
qrt{
\o
mega_0^2 -
\a
lpha^2} t} + B e^{-i
\s
qrt{
\o
mega_0^2 -
\a
lpha^2} t}
\r
ight)
\\
&= e^{-
\a
lpha t}
\l
eft( A e^{i
\o
mega_1 t} + B e^{-i
\o
mega_1 t}
\r
ight)
\\
\e
nd{aligned}
$$
The energy in the system is
$$
E =
\f
rac{1}{2} m
\d
ot{x}^2 +
\f
rac{1}{2} k x^2
$$
It's easy enough to see that
$$
x^2(t) = e^{-2
\a
lpha t}
\l
eft( A e^{i
\o
mega_1 t} + B e^{-i
\o
mega_1 t}
\r
ight)^2
$$
Applying the product rule to the general form as written above, and doing some tedious bookkeeping,
we can compute the $$
\d
ot{x}$$ terms we need for the energy of the system.
$$
\b
egin{aligned}
\d
ot{x}(t) &=
-
\a
lpha e^{-
\a
lpha t}
\l
eft( A e^{i
\o
mega_1 t} + B e^{-i
\o
mega_1 t}
\r
ight)
+
i
\o
mega_1 e^{-
\a
lpha t}
\l
eft( A e^{i
\o
mega_1 t} - B e^{-i
\o
mega_1 t}
\r
ight)
\\
\d
ot{x}(t)^2 &=
e^{-2
\a
lpha t}
\b
ig[
\a
lpha^2
\l
eft( A e^{i
\o
mega_1 t} + B e^{-i
\o
mega_1 t}
\r
ight)^2
\\
&- i
\a
lpha
\o
mega_1
\l
eft( A e^{i
\o
mega_1 t} + B e^{-i
\o
mega_1 t}
\r
ight)
\l
eft( A e^{i
\o
mega_1 t} - B e^{-i
\o
mega_1 t}
\r
ight)
\\
&-
\o
mega_1^2
\l
eft( A e^{i
\o
mega_1 t} - B e^{-i
\o
mega_1 t}
\r
ight)^2
\b
ig]
\e
nd{aligned}
$$
So at time $$t = 0$$ the energy in the system is
$$
\b
egin{aligned}
E &=
\f
rac{1}{2} m
\b
ig[
\a
lpha^2 (A + B)^2 - i
\a
lpha
\o
mega_1 (A + B)(A - B) -
\o
mega_1^2 (A - B)^2
\b
ig]
\\
&+
\f
rac{1}{2} k (A + B)^2
\\
&=
\f
rac{1}{2}
\b
ig[ (m
\a
lpha^2 + k) (A + B)^2 - i m
\a
lpha
\o
mega_1 (A + B)(A - B) - m
\o
mega_1^2 (A - B)^2
\b
ig]
\e
nd{aligned}
$$
To compute the change in the energy of the system, we'd like to integrate $$dE/dt$$. Note that
$$
\b
egin{aligned}
E &=
\f
rac{1}{2} m
\d
ot{x}^2 +
\f
rac{1}{2} k x^2
\\
\f
rac{dE}{dt} &= m
\d
ot{x}
\d
dot{x} + k x
\d
ot{x}
\\
&=
\d
ot{x} (m
\d
dot{x} + k x)
\\
&= -
\g
amma
\d
ot{x}^2
\e
nd{aligned}
$$
The last line follows because the ODE governing the system says $$m
\d
dot{x} + k x = -
\g
amma
\d
ot{x}$$.
...and I got caught in a sympy rabbit hole. Think it'll be valuable for future problem sets but
cost me too much time on this one.
### (e)
### (e)
{:.question}
{:.question}
Now find the solution to equation (3.58) by using Laplace transforms. Take the initial condition as
Now find the solution to equation (3.58) by using Laplace transforms. Take the initial condition as
$$x(0) =
\d
ot{x}(0) = 0$$.
$$x(0) =
\d
ot{x}(0) = 0$$.
Using the table in the book, and keeping in mind the initial conditions, I found the following
transforms.
$$
\b
egin{aligned}
\m
athcal{L}[m
\d
dot{x}(t)]
&= m
\l
eft( s^2 X(s) - s x(0) -
\d
ot{x}(0)
\r
ight)
\\
&= m s^2 X(s)
\\
\m
athcal{L}[
\g
amma
\d
ot{x}(t)]
&=
\g
amma
\l
eft( s X(s) - x(0)
\r
ight)
\\
&=
\g
amma s X(s)
\\
\m
athcal{L}[k x(t)]
&= k X(s)
\\
\m
athcal{L}[e^{i
\o
mega t}] &=
\f
rac{1}{s - i
\o
mega}
\e
nd{aligned}
$$
So our transformed ODE is
$$
m s^2 X(s) +
\g
amma s X(s) + k X(x) =
\f
rac{1}{s - i
\o
mega}
\\
X(s) =
\f
rac{1}{(s - i
\o
mega) (m s^2 +
\g
amma s + k)}
$$
Now it's just a bunch of algebra and an inverse transform...
### (f)
### (f)
{:.question}
{:.question}
...
...
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