Commit da8076a2 authored by Taddeüs Kroes's avatar Taddeüs Kroes

ModSim ass3: Added some nonsense about forced ,damped oscillator...

parent 145cde33
......@@ -25,10 +25,10 @@ int main(int argc, char **argv) {
y1[3] = {.0, .0, .0};
const double args_osc[1] = {1.0}, // {k}
args_forced_osc[3] = {1.0, 0.1, 2.0}, // {k, D, w}
args_forced_osc[3] = {1.0, 0.1, 0.5}, // {k, D, w}
args_lottka_volt[4] = {.5, 1.0, .1, .1}, // {a, b, c, d}
args_modified_pp[5] = {.5, 1.0, .1, .1, 100.0}, // {a, b, c, d, y_m}
args_pid_control[5] = {-2.0, -1.0, .1, 10.0, 0.1}, // {P, D, a, M, d}
args_pid_control[5] = {-2.0, -1.0, .1, 10.0, .1}, // {P, D, a, M, d}
*args_gilpin = NULL;
switch( atoi(argv[1]) ) {
......@@ -47,7 +47,7 @@ int main(int argc, char **argv) {
puts("Integrating Runge-Kutta 4 method...");
INTEGRATE(RungeKutta4, .0, 100.0, COMPARE_DT, 2, osc);
break;
case 1: INTEGRATE(RungeKutta4, .0, 30.0, DEFAULT_DT, 2, forced_osc); break;
case 1: INTEGRATE(RungeKutta4, .0, 200.0, DEFAULT_DT, 2, forced_osc); break;
case 2:
y0[0] = 0.5;
y0[1] = 1.0;
......
......@@ -96,7 +96,24 @@ $ sh ./compare_osc.sh
\subsection{Damped, forced harmonic oscillator}
\begin{figure}[H]
\includegraphics[scale=.5]{damped_osc_big.pdf}
\caption{$\omega = 2.0$}
\end{figure}
\begin{figure}[H]
\includegraphics[scale=.5]{damped_osc_medium.pdf}
\caption{$\omega = 1.2$}
\end{figure}
\begin{figure}[H]
\includegraphics[scale=.5]{damped_osc_small.pdf}
\caption{$\omega = 0.5$}
\end{figure}
We zien dat de grafiek nadert naar een stabiele periode, bij waardes aan de
buitenkant van het interval $[0.5, 2.0]$ heeft grafiek een redelijk stabiele
vorm, erbinnen zijn er vreemde fluctuaties.
\subsection{Lottka-Voltera}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment