From 7609cf11b45b37ea597039d680168b35d5e91517 Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Wed, 23 May 2012 22:30:11 +0200 Subject: [PATCH] completed examples list in docs --- .../integrate/detail/integrate_n_steps.hpp | 2 +- doc/index.html | 4 +- libs/numeric/odeint/doc/examples_table.qbk | 95 ++++++++++++++++--- .../odeint/examples/elliptic_functions.cpp | 2 - libs/numeric/odeint/examples/lorenz_point.cpp | 3 +- libs/numeric/odeint/examples/my_vector.cpp | 3 + 6 files changed, 87 insertions(+), 22 deletions(-) diff --git a/boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp b/boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp index 097e65ae..4d95eab2 100644 --- a/boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp +++ b/boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp @@ -120,7 +120,7 @@ Time integrate_n_steps( { stepper.do_step( system ); } - else + else if ( stepper.current_time() < end_time ) { // do the last step ending exactly on the end point stepper.initialize( stepper.current_state() , stepper.current_time() , end_time - stepper.current_time() ); stepper.do_step( system ); diff --git a/doc/index.html b/doc/index.html index 52cf60e0..0c2d3b48 100644 --- a/doc/index.html +++ b/doc/index.html @@ -24,7 +24,7 @@
-

+

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

@@ -94,7 +94,7 @@
- +

Last revised: May 21, 2012 at 21:01:33 GMT

Last revised: May 23, 2012 at 20:24:00 GMT


diff --git a/libs/numeric/odeint/doc/examples_table.qbk b/libs/numeric/odeint/doc/examples_table.qbk index 9dd941f3..1a20462f 100644 --- a/libs/numeric/odeint/doc/examples_table.qbk +++ b/libs/numeric/odeint/doc/examples_table.qbk @@ -1,18 +1,83 @@ [table Examples Overview [[File] [Brief Description]] - [[[github_link libs/numeric/odeint/examples/harmonic_oscillator.cpp harmonic_oscillator.cpp]] [The harmonic oscillator examples gives a brief introduction to odeint and shows the usage of the classical Runge-Kutta-solvers.]] - [[[github_link libs/numeric/odeint/examples/solar_system.cpp solar_system.cpp]] [The solar system example shows the usage of the symplectic solvers.]] - [[[github_link libs/numeric/odeint/examples/chaotic_system.cpp chaotic_system.cpp]] [The chaotic system examples integrates the Lorenz system and calculates the Lyapunov exponents.]] - [[[github_link libs/numeric/odeint/examples/stiff_system.cpp stiff_system.cpp]] [The stiff system example shows the usage of the stiff solvers using the Jacobian of the system function.]] - [[[github_link libs/numeric/odeint/examples/stuart_landau.cpp stuart_landau.cpp]] [The Stuart-Landau example shows how odeint can be used with complex state types.]] - [[[github_link libs/numeric/odeint/examples/fpu.cpp fpu.cpp]] [The Fermi-Pasta-Ulam (FPU) example shows how odeint can be used to integrate lattice systems.]] - [[[github_link libs/numeric/odeint/examples/phase_oscillator_ensemble.cpp phase_oscillator_ensemble.cpp]] [The phase oscillator ensemble example shows how globally coupled oscillators can be analyzed and how statistical measures can be computed during integration.]] - [[[github_link libs/numeric/odeint/examples/harmonic_oscillator_units.cpp harmonic_oscillator_units.cpp]] [This examples shows how __boost_units can be used with odeint.]] - [[[github_link libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp two_dimensional_phase_lattice.cpp]] [The 2D phase oscillator example shows how a two-dimensional lattice can used with odeint and how matrix types can be used as state types in odeint.]] - [[[github_link libs/numeric/odeint/examples/lorenz_gmpxx.cpp lorenz_gmpxx.cpp]] [This examples integrates the Lorenz system by means of an arbitrary precision type.]] - [[[github_link libs/numeric/odeint/examples/thrust/phase_oscillator_ensemble.cu phase_oscillator_ensemble.cu]] [The Thrust phase oscillator ensemble example shows how globally coupled oscillators can be analyzed with Thrust and CUDA, employing the power of modern graphic devices.]] - [[[github_link libs/numeric/odeint/examples/thrust/phase_oscillator_chain.cu phase_oscillator_chain.cu]] [The Thrust phase oscillator chain example shows how chains of nearest neighbor coupled oscillators can be integrated with Thrust and odeint.]] - [[[github_link libs/numeric/odeint/examples/thrust/lorenz_parameters.cu lorenz_parameters.cu]] [The Lorenz parameters examples show how ensembles of ordinary differential equations can be solved by means of Thrust to study the dependence of an ODE on some parameters.]] - [[[github_link libs/numeric/odeint/examples/mtl/gauss_packet.cpp gauss_packet.cpp]] [The MTL-Gauss-packet example shows how the MTL can be easily used with odeint.]] - [[[github_link libs/numeric/odeint/examples/stochastic_euler.cpp stochastic_euler.cpp]] [Implementation of a custom stepper - the stochastic euler - for solving stochastic differential equations.]] + [[[github_link libs/numeric/odeint/examples/harmonic_oscillator.cpp + harmonic_oscillator.cpp]] [The harmonic oscillator examples gives a brief + introduction to odeint and shows the usage of the classical + Runge-Kutta-solvers.]] + [[[github_link libs/numeric/odeint/examples/simple1d.cpp + simple1d.cpp]] [Integrating a simple, one-dimensional ODE showing the usage + of integrate- and generate-functions.]] + [[[github_link libs/numeric/odeint/examples/elliptic_functions.cpp + elliptic_functions.cpp]] [Example calculating the elliptic functions using + Bulirsch-Stoer and Runge-Kutta-Dopri5 Steppers with dense output.]] + [[[github_link libs/numeric/odeint/examples/solar_system.cpp + solar_system.cpp]] [The solar system example shows the usage of the + symplectic solvers.]] + [[[github_link libs/numeric/odeint/examples/chaotic_system.cpp + chaotic_system.cpp]] [The chaotic system examples integrates the Lorenz + system and calculates the Lyapunov exponents.]] + [[[github_link libs/numeric/odeint/examples/stiff_system.cpp + stiff_system.cpp]] [The stiff system example shows the usage of the stiff + solvers using the Jacobian of the system function.]] + [[[github_link libs/numeric/odeint/examples/van_der_pol_stiff.cpp + van_der_pol_stiff.cpp]] [This stiff system example again shows the usage of + the stiff solvers by integrating the van der Pol osscillator.]] + [[[github_link libs/numeric/odeint/examples/stuart_landau.cpp + stuart_landau.cpp]] [The Stuart-Landau example shows how odeint can be used + with complex state types.]] + [[[github_link libs/numeric/odeint/examples/fpu.cpp fpu.cpp]] [The + Fermi-Pasta-Ulam (FPU) example shows how odeint can be used to integrate + lattice systems.]] + [[[github_link libs/numeric/odeint/examples/phase_oscillator_ensemble.cpp + phase_oscillator_ensemble.cpp]] [The phase oscillator ensemble example shows + how globally coupled oscillators can be analyzed and how statistical + measures can be computed during integration.]] + [[[github_link libs/numeric/odeint/examples/stepper_details.cpp + stepper_details.cpp]] [Trivial example showing the usability of the several + stepper classes.]] + [[[github_link libs/numeric/odeint/examples/harmonic_oscillator_units.cpp + harmonic_oscillator_units.cpp]] [This examples shows how __boost_units can + be used with odeint.]] + [[[github_link + libs/numeric/odeint/examples/two_dimensional_phase_lattice.cpp + two_dimensional_phase_lattice.cpp]] [The 2D phase oscillator example shows + how a two-dimensional lattice works with odeint and how matrix types can + be used as state types in odeint.]] + [[[github_link libs/numeric/odeint/examples/resizing_lattice.cpp + resizing_lattice.cpp]] [Shows the strength of odeint's memory management by + simulating a Hamiltonian system on an expanding lattice.]] + [[[github_link libs/numeric/odeint/examples/list_lattice.cpp + list_lattice.cpp]] [Example of a phase lattice integration using `std::list` + as state type.]] + [[[github_link libs/numeric/odeint/examples/lorenz_point.cpp + lorenz_point.cpp]] [Alternative way of integrating lorenz by using a self + defined point3d data type as state type.]] + [[[github_link libs/numeric/odeint/examples/lorenz_gmpxx.cpp + lorenz_gmpxx.cpp]] [This examples integrates the Lorenz system by means of + an arbitrary precision type.]] + [[[github_link libs/numeric/odeint/examples/my_vector.cpp my_vector.cpp]] + [Simple example showing how to get odeint to work with a self-defined vector + type.]] + [[[github_link + libs/numeric/odeint/examples/thrust/phase_oscillator_ensemble.cu + phase_oscillator_ensemble.cu]] [The Thrust phase oscillator ensemble example + shows how globally coupled oscillators can be analyzed with Thrust and CUDA, + employing the power of modern graphic devices.]] + [[[github_link libs/numeric/odeint/examples/thrust/phase_oscillator_chain.cu + phase_oscillator_chain.cu]] [The Thrust phase oscillator chain example shows + how chains of nearest neighbor coupled oscillators can be integrated with + Thrust and odeint.]] + [[[github_link libs/numeric/odeint/examples/thrust/lorenz_parameters.cu + lorenz_parameters.cu]] [The Lorenz parameters examples show how ensembles of + ordinary differential equations can be solved by means of Thrust to study + the dependence of an ODE on some parameters.]] + [[[github_link libs/numeric/odeint/examples/mtl/gauss_packet.cpp + gauss_packet.cpp]] [The MTL-Gauss-packet example shows how the MTL can be + easily used with odeint.]] + [[[github_link libs/numeric/odeint/examples/stochastic_euler.cpp + stochastic_euler.cpp]] [Implementation of a custom stepper - the stochastic + euler - for solving stochastic differential equations.]] + [[[github_link libs/numeric/odeint/examples/generation_functions.cpp + generation_functions.cpp]] [Shows skeletal code on how to implemente own + factory functions.]] ] diff --git a/libs/numeric/odeint/examples/elliptic_functions.cpp b/libs/numeric/odeint/examples/elliptic_functions.cpp index c7d07788..8324b0df 100644 --- a/libs/numeric/odeint/examples/elliptic_functions.cpp +++ b/libs/numeric/odeint/examples/elliptic_functions.cpp @@ -13,8 +13,6 @@ #include -#include - #include #include #include diff --git a/libs/numeric/odeint/examples/lorenz_point.cpp b/libs/numeric/odeint/examples/lorenz_point.cpp index 4602eb56..49e32487 100644 --- a/libs/numeric/odeint/examples/lorenz_point.cpp +++ b/libs/numeric/odeint/examples/lorenz_point.cpp @@ -100,8 +100,7 @@ int main() { point3D x( 10.0 , 5.0 , 5.0 ); - //typedef runge_kutta4< point3D , double , point3D , - // double , vector_space_algebra > stepper; + // point type defines it's own operators -> use vector_space_algebra ! typedef runge_kutta_dopri5< point3D , double , point3D , double , vector_space_algebra > stepper; integrate_adaptive( make_controlled( 1E-8 , 1E-8 ) , lorenz , x , diff --git a/libs/numeric/odeint/examples/my_vector.cpp b/libs/numeric/odeint/examples/my_vector.cpp index 6c7e6a3b..b60d90ff 100644 --- a/libs/numeric/odeint/examples/my_vector.cpp +++ b/libs/numeric/odeint/examples/my_vector.cpp @@ -54,5 +54,8 @@ int main() state_type x(3); x[0] = 5.0 ; x[1] = 10.0 ; x[2] = 10.0; + // my_vector works with range_algebra as it's derived from std::vector + // no further work is required + integrate_const( runge_kutta4< state_type >() , lorenz , x , 0.0 , 10.0 , 0.1 ); }