added van der pol oscillator example

This commit is contained in:
Krishna Vedala 2020-06-10 14:32:40 -04:00
parent 2caed65a9c
commit 07e4661c7e
No known key found for this signature in database
GPG Key ID: BA19ACF8FC8792F7
2 changed files with 21 additions and 3 deletions

View File

@ -6,7 +6,7 @@
* [forward Euler
* method](https://en.wikipedia.org/wiki/Numerical_methods_for_ordinary_differential_equations#Euler_method)
*
* \description
* \details
* The ODE being solved is:
* \f{eqnarray*}{
* \dot{u} &=& v\\
@ -23,7 +23,16 @@
* exact soltuion results in `exact.csv` for comparison.
* <img
* src="https://raw.githubusercontent.com/kvedala/C/docs/images/numerical_methods/ode_forward_euler.svg"
* alt="Implementation solution"/>
* alt="Implementation solution" width="350"/>
*
* To implement [Van der Pol
* oscillator](https://en.wikipedia.org/wiki/Van_der_Pol_oscillator), change the
* ::problem function to:
* ```cpp
* const double mu = 2.0;
* dy[0] = y[1];
* dy[1] = mu * (1.f - y[0] * y[0]) * y[1] - y[0];
* ```
* \see ode_midpoint_euler.c, ode_semi_implicit_euler.c
*/

View File

@ -22,7 +22,16 @@
* The computation results are stored to a text file `midpoint_euler.csv` and
* the exact soltuion results in `exact.csv` for comparison. <img
* src="https://raw.githubusercontent.com/kvedala/C/docs/images/numerical_methods/ode_midpoint_euler.svg"
* alt="Implementation solution"/>
* alt="Implementation solution" width="350"/>
*
* To implement [Van der Pol
* oscillator](https://en.wikipedia.org/wiki/Van_der_Pol_oscillator), change the
* ::problem function to:
* ```cpp
* const double mu = 2.0;
* dy[0] = y[1];
* dy[1] = mu * (1.f - y[0] * y[0]) * y[1] - y[0];
* ```
* \see ode_forward_euler.c, ode_semi_implicit_euler.c
*/