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
81cc843f
Commit
81cc843f
authored
Feb 20, 2020
by
Erik Strand
Browse files
Options
Downloads
Patches
Plain Diff
Answer 3.1 (f)
parent
f3317095
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
_code/pset_02.py
+25
-3
25 additions, 3 deletions
_code/pset_02.py
_psets/02.md
+98
-0
98 additions, 0 deletions
_psets/02.md
assets/img/02_perturbed_oscillator.png
+0
-0
0 additions, 0 deletions
assets/img/02_perturbed_oscillator.png
with
123 additions
and
3 deletions
_code/pset_02.py
+
25
−
3
View file @
81cc843f
...
...
@@ -5,9 +5,10 @@ m = 1
k
=
1
gamma
=
0.1
n_points
=
1000
w_min
=
0
w_max
=
2
n_points
=
1000
w
=
np
.
linspace
(
w_min
,
w_max
,
n_points
)
A
=
1
/
(
-
w
**
2
*
m
+
w
*
1j
*
gamma
+
k
)
...
...
@@ -15,14 +16,35 @@ fig1 = plt.figure()
left
,
bottom
,
width
,
height
=
0.1
,
0.1
,
0.8
,
0.8
ax1
=
fig1
.
add_axes
([
left
,
bottom
,
width
,
height
])
ax1
.
plot
(
w
,
np
.
absolute
(
A
))
ax1
.
set_ylabel
(
"
magnitude
"
)
ax1
.
set_xlabel
(
'
ω
'
)
ax1
.
set_ylabel
(
"
magnitude
"
)
fig1
.
savefig
(
"
../assets/img/02_amplitude.png
"
,
transparent
=
True
)
fig2
=
plt
.
figure
()
left
,
bottom
,
width
,
height
=
0.1
,
0.1
,
0.8
,
0.8
ax2
=
fig2
.
add_axes
([
left
,
bottom
,
width
,
height
])
ax2
.
plot
(
w
,
np
.
angle
(
A
))
ax2
.
set_ylabel
(
"
phase
"
)
ax2
.
set_xlabel
(
'
ω
'
)
ax2
.
set_ylabel
(
"
phase
"
)
fig2
.
savefig
(
"
../assets/img/02_phase.png
"
,
transparent
=
True
)
t_min
=
0
t_max
=
12
*
np
.
pi
t
=
np
.
linspace
(
t_min
,
t_max
,
n_points
)
w
=
1.5
eps
=
0.5
x_0
=
np
.
exp
(
1j
*
w
*
t
)
x_1
=
(
(
1
-
eps
/
(
3
*
w
**
3
)
-
eps
/
(
6
*
w
**
2
))
*
np
.
exp
(
1j
*
w
*
t
)
+
(
eps
/
(
3
*
w
**
3
)
-
eps
/
(
6
*
w
**
2
))
*
np
.
exp
(
-
1j
*
w
*
t
)
+
(
eps
/
(
3
*
w
**
2
))
*
np
.
exp
(
1j
*
2
*
t
)
)
fig3
=
plt
.
figure
(
figsize
=
[
7.4
,
4.8
])
left
,
bottom
,
width
,
height
=
0.15
,
0.1
,
0.8
,
0.9
ax3
=
fig3
.
add_axes
([
left
,
bottom
,
width
,
height
])
ax3
.
plot
(
t
,
np
.
real
(
x_0
),
label
=
"
x_0
"
)
ax3
.
plot
(
t
,
np
.
real
(
x_1
),
label
=
"
x_0 + ε x_1
"
)
ax3
.
set_xlabel
(
'
t
'
)
ax3
.
set_ylabel
(
"
real part
"
)
ax3
.
legend
()
fig3
.
savefig
(
"
../assets/img/02_perturbed_oscillator.png
"
,
transparent
=
True
)
This diff is collapsed.
Click to expand it.
_psets/02.md
+
98
−
0
View file @
81cc843f
...
...
@@ -160,3 +160,101 @@ $$x(0) = \dot{x}(0) = 0$$.
{:.question}
For an arbitrary potential minimum, work out the form of the lowest-order correction to simple
undamped unforced harmonic motion.
First we add a small quadratic term to the harmonic oscillator ODE.
$$
m
\d
dot{x} + kx +
\e
psilon x^2 = 0
$$
Though to push around one less symbol, let's define $$
\o
mega =
\s
qrt{k / m}$$ and absorb a factor of
$$1/m$$ into $$
\e
psilon$$.
$$
\d
dot{x} +
\o
mega^2 x +
\e
psilon x^2 = 0
$$
We'll express our solution as
$$
x(t) = x_0(t) +
\e
psilon x_1(t) +
\m
athcal{O}(
\e
psilon^2)
$$
Plugging this into the ODE above, and dropping $$
\m
athcal{O}(
\e
psilon^2)$$ terms, we find that
$$
\b
egin{aligned}
\d
dot{x_0} +
\e
psilon
\d
dot{x_1} +
\o
mega^2 x_0 +
\o
mega^2
\e
psilon x_1 +
\e
psilon (x_0 +
\e
psilon x_1)^2 &= 0
\\
\d
dot{x_0} +
\e
psilon
\d
dot{x_1} +
\o
mega^2 x_0 +
\o
mega^2
\e
psilon x_1 +
\e
psilon x_0^2 &= 0
\e
nd{aligned}
$$
So we recover the original harmonic motion ODE, and gain a second ODE at first order in
$$
\e
psilon$$.
$$
\d
dot{x_0} +
\o
mega^2 x_0 = 0
\\
\d
dot{x_1} +
\o
mega^2 x_1 + x_0^2 = 0
$$
Again using the ansatz $$x_0(t) = e^{rt}$$ for the first equation, we find that $$r^2 = -
\o
mega^2$$.
So the two roots are $$r = i
\o
mega$$ and $$r = -i
\o
mega$$, and the general solution is
$$
x_0(t) = A e^{i
\o
mega t} + B e^{-i
\o
mega t}
$$
To simply algebra I'm going to assume that $$A = 1$$ and $$B = 0$$, so $$x_0(t) = e^{i
\o
mega t}$$.
This just amounts to choosing some initial conditions: $$x_0(0) = 1$$ and $$
\d
ot{x_0}(0) = i
\o
mega$$. The second equation becomes
$$
\d
dot{x_1} +
\o
mega^2 x_1 + e^{i 2
\o
mega t} = 0
$$
The general solution is the same as before. For the particular solution, use the ansatz $$x_1(t) = C
e^{i 2
\o
mega t}$$.
$$
-4
\o
mega^2 C +
\o
mega^2 C + 1 = 0
\\
C =
\f
rac{1}{3
\o
mega^2}
$$
So
$$
x_1(t) = A e^{i
\o
mega t} + B e^{-i
\o
mega t} +
\f
rac{1}{3
\o
mega^2} e^{i 2 t}
$$
Thus our full solution is
$$
\b
egin{aligned}
x(t)
&= x_0(t) +
\e
psilon x_1(t)
\\
&= (
\e
psilon A + 1) e^{i
\o
mega t} +
\e
psilon B e^{-i
\o
mega t} +
\f
rac{
\e
psilon}{3
\o
mega^2} e^{i 2 t}
\e
nd{aligned}
$$
To facilitate comparison of $$x$$ and $$x_0$$, let's solve for the same initial conditions we
imposed earlier.
$$
\b
egin{aligned}
1 &= x(0)
\\
&=
\e
psilon A + 1 +
\e
psilon B +
\f
rac{
\e
psilon}{3
\o
mega^2}
\\
B &= -A -
\f
rac{1}{3
\o
mega^2}
\\
i
\o
mega &=
\d
ot{x}(0)
\\
&= i
\o
mega (
\e
psilon A + 1) - i
\o
mega
\e
psilon ( 1 - A -
\f
rac{1}{3
\o
mega^2}) +
\f
rac{2 i
\e
psilon}{3
\o
mega^2}
\\
A &= -
\f
rac{1}{6
\o
mega^2} -
\f
rac{1}{3
\o
mega^3}
\\
B &= -
\f
rac{1}{6
\o
mega^2} +
\f
rac{1}{3
\o
mega^3}
\\
x(t) &=
\l
eft( 1 -
\f
rac{
\e
psilon}{3
\o
mega^3} -
\f
rac{
\e
psilon}{6
\o
mega^2}
\r
ight) e^{i
\o
mega t}
+
\l
eft(
\f
rac{
\e
psilon}{3
\o
mega^3} -
\f
rac{
\e
psilon}{6
\o
mega^2}
\r
ight) e^{-i
\o
mega t}
+
\f
rac{
\e
psilon}{3
\o
mega^2} e^{i 2 t}
\e
nd{aligned}
$$
Now we can compare the two. In this plot $$
\o
mega = 1.5$$ and $$
\e
psilon = 0.5$$ (which is rather
large for the model to be quantitatively valid, but qualitatively helps accentuate the difference).

This diff is collapsed.
Click to expand it.
assets/img/02_perturbed_oscillator.png
0 → 100644
+
0
−
0
View file @
81cc843f
68.8 KiB
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