-
Notifications
You must be signed in to change notification settings - Fork 6
/
ps5.tex
112 lines (90 loc) · 4.37 KB
/
ps5.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
\documentclass[12pt, letterpaper]{article}
\title{Problem Set 5: Adaptive Runge-Kutta}
\author{Ken Sheedlo}
\usepackage[pdftex]{graphicx}
\usepackage{fullpage}
\usepackage{verbatim}
\usepackage{amsfonts}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\maketitle{}
\section*{1. Adaptive Runge-Kutta Integrator}
For this lab, I implemented a timestep adaptive Runge-Kutta integrator. Dealing
with the complexity of having to change the timestep on the fly was a challenge.
For safety, I implemented the second hack discussed in class. This scaled my
timestep by a safe factor and helped keep me inside the tolerance. I found that
occasionally, the difference $\Delta$ between steps of size $h$ and $\frac{h}{2}$
was approximately 0 to within machine epsilon. This would cause a divide by 0
and undefined behavior in my program. To work around this problem, I implemented
a solution where the program would double the timestep up to 10 times or until
$\Delta > 0$.
\section*{2. Lorenz System}
\subsection*{A. Chaotic Attractor}
Figure 1 shows a trajectory in the Lorenz system with tolerance 0.01. The
adaptive solver makes large jumps in time and appears a bit jagged, but follows
the trajectory accurately.
\newpage
\begin{center}
\includegraphics[scale=0.6]{ps5_2a_cropped.png}
\\
Figure 1: Lorenz trajectory generated with adaptive Runge-Kutta.
\end{center}
\subsection*{B. RK4 vs. ARK4}
The jagged trajectory generated by ARK4 is particularly obvious in contrast to
the smooth RK4 trajectory using a consistently smaller timestep. Figure 2 plots
a section of the Lorenz trajectory, overlaying RK4 and ARK4 to bring out the
contrast.
\begin{center}
\includegraphics[scale=0.6]{ps5_2b_cropped.png}
\\
Figure 2: Section of the Lorenz trajectory in RK4 and ARK4.
\end{center}
The trajectory mapped out by ARK4 is consistently near the trajectory generated
by RK4 with timestep 0.001. The points produced by the adaptive solver are closer
together in time where the curve is tighter, and farther apart where the curve
widens out. On the far end of the curve, the ARK4 curve diverges slightly away
from the RK4 curve. This is most likely a function of the points in time being
spaced farther apart and causing errors to compound.
\subsection*{C. r-value Dynamics}
Keeping $a$ and $b$ fixed and changing $r$ changes the shape of the attractor.
For $0 < r < 1$, the system converges to a fixed point at the origin. At $r=1$,
there is a bifurcation above which there are two stable fixed points. At
approximately $r = 13.63$ the system crosses a boundary between the two basins of
attraction. For $r$-values below 13.63, the system spirals into one fixed point,
and for $r$-values above 13.63 it spirals into the other. As $r$ increases past
29.5, the chaotic attractor becomes visible.
\section*{3. Rossler System}
Figure 3 shows the chaotic attractor in the Rossler system with $a=0.398$, $b=2$,
$c=4$. I used a tolerance of $10^{-5}$ and ran the simulation until time
$t=20000$, using fine dot markers to bring out the structure of the attractor.
\begin{center}
\includegraphics[scale=0.6]{xrossler6_cropped.png}
\\
Figure 3: Chaotic attractor in the Rossler system.
\end{center}
\section*{4. Error Bound Effects}
Increasing the tolerance from 0.01 at first causes a gradual degradation of the
system dynamics. Figure 4 shows the system rendered with tolerance 0.15.
\begin{center}
\includegraphics[scale=0.6]{ps5_4a_cropped.png}
\\
Figure 4: Lorenz attractor drawn with tolerance 0.15.
\end{center}
The chaotic attractor is still visible, although it appears very rough and
jagged. As the tolerance increases to 0.3 and larger, the dynamics break down
completely. Figure 5 shows the attractor at tolerance 0.3.
\begin{center}
\includegraphics[scale=0.6]{ps5_4b_cropped.png}
\\
Figure 5: Lorenz attractor with tolerance 0.3.
\end{center}
At tolerance 0.3, the shape of the attractor is completely gone. Instead, we see
a jagged spiral towards an apparent fixed point. This is very similar to the
timestep experiment from the last problem set in that it demonstrates
compounding errors in an ODE integrator by relaxing the parameters. With RK4, we
increased the timestep until the dynamics of the system broke down. This caused
the error in the approximation to grow and compound. Likewise with ARK4,
increasing tolerance past a safe upper bound causes errors to grow and compound
to an unacceptable degree.
\end{document}