diff --git a/doc/boost_sandbox_numeric_odeint/odeint_in_detail/generation_functions.html b/doc/boost_sandbox_numeric_odeint/odeint_in_detail/generation_functions.html index 6674f1ab..463be088 100644 --- a/doc/boost_sandbox_numeric_odeint/odeint_in_detail/generation_functions.html +++ b/doc/boost_sandbox_numeric_odeint/odeint_in_detail/generation_functions.html @@ -21,7 +21,30 @@ functions

- tba. + In the tutorial we have learned how we can use the generation functions + make_controlled and make_dense_output to create controlled + and dense output stepper from a simple stepper or an error stepper. The syntax + of these two functions is very simple: +

+

+

+
auto stepper1 = make_controlled( 1.0e-6 , 1.0e-6 , stepper_type() );
+auto stepper2 = make_dense_output( 1.0e-6 , 1.0e-6 , stepper_type() );
+
+

+

+

+ The first two parameters are the absolute and the relative error tolerances + and the third parameter is the stepper. Of course you can also infer the + type from the classical result_of + mechanism: +

+

+

+
result_of::make_controlled< stepper_type >::type stepper3 = make_controlled( 1.0e-6 , 1.0e-6 , stepper_type() );
+result_of::make_dense_output< stepper_type >::type stepper4 = make_dense_output( 1.0e-6 , 1.0e-6 , stepper_type() );
+
+

explain the mechanis and how your own steppers can be used with the generation diff --git a/doc/boost_sandbox_numeric_odeint/odeint_in_detail/using_boost__range.html b/doc/boost_sandbox_numeric_odeint/odeint_in_detail/using_boost__range.html index d67fa17e..908503b2 100644 --- a/doc/boost_sandbox_numeric_odeint/odeint_in_detail/using_boost__range.html +++ b/doc/boost_sandbox_numeric_odeint/odeint_in_detail/using_boost__range.html @@ -32,17 +32,25 @@ One use case for Boost.Range in odeint has been shown in Chaotic system where the state consists of two parts: one for the original - state and one for the perturbations. The ranges are used to initialize (solve) - only the system part where the perturbation part is not touched. After that - the complete state including also the perturbations is solved. Another use - case is a system consisting of coupled units where you want to initialize - each unit separately with the ODE of the uncoupled unit. An example is a - chain of coupled van-der-Pol-oscillators which are initialized uniformily + system and one for the perturbations. The ranges are used to initialize (solve) + only the system part where the perturbation part is not touched, that is + a range consisting only of the system part is used. After that the complete + state including the perturbations is solved. +

+

+ Another use case is a system consisting of coupled units where you want to + initialize each unit separately with the ODE of the uncoupled unit. An example + is a chain of coupled van-der-Pol-oscillators which are initialized uniformily from the uncoupled van-der-Pol-oscillator. Then you can use Boost.Range to solve only one individual oscillator in the chain.

- An example was given in Chaotic + In short, you can Boost.Range + to use one state within two system functions which expect states with different + sizes. +

+

+ An example was given in the Chaotic system tutorial. Using Boost.Range usually means that your system function needs to adapt to the iterators of Boost.Range. That is, your function is called with a range and you need to get the iterators from that range. diff --git a/doc/index.html b/doc/index.html index caef9ab9..00e170b7 100644 --- a/doc/index.html +++ b/doc/index.html @@ -125,7 +125,7 @@ - +

Last revised: April 03, 2012 at 11:27:53 GMT

Last revised: April 04, 2012 at 06:30:00 GMT


diff --git a/libs/numeric/odeint/doc/details_boost_range.qbk b/libs/numeric/odeint/doc/details_boost_range.qbk index 0d910063..5b8d7731 100644 --- a/libs/numeric/odeint/doc/details_boost_range.qbk +++ b/libs/numeric/odeint/doc/details_boost_range.qbk @@ -2,11 +2,13 @@ Most steppers in odeint also accept the state give as a range. A range is sequence of values modelled by a range concept. See __boost_range for an overview over existing concepts and examples of ranges. This means that the `state_type` of the stepper must not necessarily used to call the `do_step` method. -One use case for __boost_range in odeint has been shown in __tut_chaotic_system where the state consists of two parts: one for the original state and one for the perturbations. The ranges are used to initialize (solve) only the system part where the perturbation part is not touched, that is a range consisting only of the system part is used. After that the complete state including also the perturbations is solved. +One use case for __boost_range in odeint has been shown in __tut_chaotic_system where the state consists of two parts: one for the original system and one for the perturbations. The ranges are used to initialize (solve) only the system part where the perturbation part is not touched, that is a range consisting only of the system part is used. After that the complete state including the perturbations is solved. Another use case is a system consisting of coupled units where you want to initialize each unit separately with the ODE of the uncoupled unit. An example is a chain of coupled van-der-Pol-oscillators which are initialized uniformily from the uncoupled van-der-Pol-oscillator. Then you can use __boost_range to solve only one individual oscillator in the chain. -An example was given in __tut_chaotic_system tutorial. Using Boost.Range usually means that your system function needs to adapt to the iterators of Boost.Range. That is, your function is called with a range and you need to get the iterators from that range. This can easily be done. You have to implement your system as a class or a struct and you have to templatize the `operator()`. Then you can use the `range_iterator`-meta function and `boost::begin` and `boost::end` to obtain the iterators of your range: +In short, you can __boost_range to use one state within two system functions which expect states with different sizes. + +An example was given in the __tut_chaotic_system tutorial. Using Boost.Range usually means that your system function needs to adapt to the iterators of Boost.Range. That is, your function is called with a range and you need to get the iterators from that range. This can easily be done. You have to implement your system as a class or a struct and you have to templatize the `operator()`. Then you can use the `range_iterator`-meta function and `boost::begin` and `boost::end` to obtain the iterators of your range: `` class sys diff --git a/libs/numeric/odeint/doc/details_generation_functions.qbk b/libs/numeric/odeint/doc/details_generation_functions.qbk index e6856dda..ebeeb4d8 100644 --- a/libs/numeric/odeint/doc/details_generation_functions.qbk +++ b/libs/numeric/odeint/doc/details_generation_functions.qbk @@ -1,6 +1,14 @@ [section Generation functions] -tba. +[import ../examples/generation_functions.cpp] + +In the tutorial we have learned how we can use the generation functions `make_controlled` and `make_dense_output` to create controlled and dense output stepper from a simple stepper or an error stepper. The syntax of these two functions is very simple: + +[generation_functions_syntax_auto] + +The first two parameters are the absolute and the relative error tolerances and the third parameter is the stepper. In C++03 you can infer the type from the classical `result_of` mechanism: + +[generation_functions_syntax_result_of] explain the mechanis and how your own steppers can be used with the generation functions diff --git a/libs/numeric/odeint/examples/Jamfile b/libs/numeric/odeint/examples/Jamfile index 319a1d86..579dd478 100644 --- a/libs/numeric/odeint/examples/Jamfile +++ b/libs/numeric/odeint/examples/Jamfile @@ -31,6 +31,7 @@ exe lorenz_point : lorenz_point.cpp ; exe bs_bug : bs_bug.cpp ; exe van_der_pol_stiff : van_der_pol_stiff.cpp ; exe stochastic_euler : stochastic_euler.cpp : : -std=c++0x ; +exe generation_functions : generation_functions.cpp : : -std=c++0x ; # build-project mtl ; # build-project ublas ; diff --git a/libs/numeric/odeint/examples/stochastic_euler.cpp b/libs/numeric/odeint/examples/stochastic_euler.cpp index 5bf6b6f4..02980c02 100644 --- a/libs/numeric/odeint/examples/stochastic_euler.cpp +++ b/libs/numeric/odeint/examples/stochastic_euler.cpp @@ -1,3 +1,17 @@ +/* + libs/numeric/odeint/examples/stochastic_euler.hpp + + Copyright 2009 Karsten Ahnert + Copyright 2009 Mario Mulansky + + Stochastic euler stepper example and Ornstein-Uhlenbeck process + + 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) + */ + + #include #include #include