mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
added van der pol oscillator example
This commit is contained in:
parent
2caed65a9c
commit
07e4661c7e
@ -6,7 +6,7 @@
|
|||||||
* [forward Euler
|
* [forward Euler
|
||||||
* method](https://en.wikipedia.org/wiki/Numerical_methods_for_ordinary_differential_equations#Euler_method)
|
* method](https://en.wikipedia.org/wiki/Numerical_methods_for_ordinary_differential_equations#Euler_method)
|
||||||
*
|
*
|
||||||
* \description
|
* \details
|
||||||
* The ODE being solved is:
|
* The ODE being solved is:
|
||||||
* \f{eqnarray*}{
|
* \f{eqnarray*}{
|
||||||
* \dot{u} &=& v\\
|
* \dot{u} &=& v\\
|
||||||
@ -23,7 +23,16 @@
|
|||||||
* exact soltuion results in `exact.csv` for comparison.
|
* exact soltuion results in `exact.csv` for comparison.
|
||||||
* <img
|
* <img
|
||||||
* src="https://raw.githubusercontent.com/kvedala/C/docs/images/numerical_methods/ode_forward_euler.svg"
|
* 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
|
* \see ode_midpoint_euler.c, ode_semi_implicit_euler.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -22,7 +22,16 @@
|
|||||||
* The computation results are stored to a text file `midpoint_euler.csv` and
|
* The computation results are stored to a text file `midpoint_euler.csv` and
|
||||||
* the exact soltuion results in `exact.csv` for comparison. <img
|
* 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"
|
* 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
|
* \see ode_forward_euler.c, ode_semi_implicit_euler.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user