1[/============================================================================ 2 Boost.odeint 3 4 Copyright 2011-2013 Karsten Ahnert 5 Copyright 2011 Mario Mulansky 6 Copyright 2012 Sylwester Arabas 7 8 Use, modification and distribution is subject to the Boost Software License, 9 Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 10 http://www.boost.org/LICENSE_1_0.txt) 11=============================================================================/] 12 13 14 15[section Error Stepper] 16 17This concepts specifies the interface an error stepper has to fulfill to be used within a ControlledErrorStepper. An error stepper must always fulfill the stepper concept. This can trivially implemented by 18 19`` 20template< class System > 21error_stepper::do_step( System sys , state_type &x , time_type t , time_type dt ) 22{ 23 state_type xerr; 24 // allocate xerr 25 do_step( sys , x , t , dt , xerr ); 26} 27`` 28 29[heading Description] 30 31An error stepper following this Error Stepper concept is capable of doing one step of the solution /x(t)/ of an ODE with step-size /dt/ to obtain /x(t+dt)/ and also computing an error estimate ['x[sub err]] of the result. 32Error Steppers can be Runge-Kutta steppers, symplectic steppers as well as implicit steppers. 33Based on the stepper type, the ODE is defined as __system, __symplectic_system, __simple_symplectic_system or __implicit_system. 34 35[heading Refinement of] 36 37* DefaultConstructable 38* CopyConstructable 39* Stepper 40 41[heading Associated types] 42 43* '''<para>'''[*state_type]'''</para>''' 44'''<para>'''`Stepper::state_type`'''</para>''' 45'''<para>'''The type characterizing the state of the ODE, hence ['x].'''</para>''' 46 47* '''<para>'''[*deriv_type]'''</para>''' 48'''<para>'''`Stepper::deriv_type`'''</para>''' 49'''<para>'''The type characterizing the derivative of the ODE, hence ['d x/dt].'''</para>''' 50 51* '''<para>'''[*time_type]'''</para>''' 52'''<para>'''`Stepper::time_type`'''</para>''' 53'''<para>'''The type characterizing the dependent variable of the ODE, hence the time ['t].'''</para>''' 54 55* '''<para>'''[*value_type]'''</para>''' 56'''<para>'''`Stepper::value_type`'''</para>''' 57'''<para>'''The numerical data type which is used within the stepper, something like `float`, `double`, `complex< double >`.'''</para>''' 58 59* '''<para>'''[*order_type]'''</para>''' 60'''<para>'''`Stepper::order_type`'''</para>''' 61'''<para>'''The type characterizing the order of the ODE, typically `unsigned short`.'''</para>''' 62 63* '''<para>'''[*stepper_category]'''</para>''' 64'''<para>'''`Stepper::stepper_category`'''</para>''' 65'''<para>'''A tag type characterizing the category of the stepper. This type must be convertible to `error_stepper_tag`.'''</para>''' 66 67 68[heading Notation] 69 70[variablelist 71 [[`ErrorStepper`] [A type that is a model of Error Stepper]] 72 [[`State`] [A type representing the state /x/ of the ODE]] 73 [[`Error`] [A type representing the error calculated by the stepper, usually same as `State`]] 74 [[`Time`] [A type representing the time /t/ of the ODE]] 75 [[`stepper`] [An object of type `ErrorStepper`]] 76 [[`x`] [Object of type `State`]] 77 [[`xerr`] [Object of type `Error`]] 78 [[`t`, `dt`] [Objects of type `Time`]] 79 [[`sys`] [An object defining the ODE, should be a model of either __system, __symplectic_system, __simple_symplectic_system or __implicit_system.]] 80] 81 82[heading Valid Expressions] 83 84[table 85 [[Name] [Expression] [Type] [Semantics]] 86 [[Get the stepper order] [`stepper.order()`] [`order_type`] [Returns the order of the stepper for one step without error estimation.]] 87 [[Get the stepper order] [`stepper.stepper_order()`] [`order_type`] [Returns the order of the stepper for one error estimation step which is used for error calculation.]] 88 [[Get the error order] [`stepper.errorr_order()`] [`order_type`] [Returns the order of the error step which is used for error calculation.]] 89 [[Do step] [`stepper.do_step( sys , x , t , dt )`] [`void`] [Performs one step of step size `dt`. The newly obtained state is written in-place to `x`.] ] 90 [[Do step with error estimation] [`stepper.do_step( sys , x , t , dt , xerr )`] [`void`] [Performs one step of step size `dt` with error estimation. The newly obtained state is written in-place to `x` and the estimated error to `xerr`.] ] 91 [/ [Do step with reference] [`stepper.do_step( boost::ref(sys) , x , t , dt , xerr )`] [`void`] [Performs one step of step size `dt`. The newly obtained state is written in-place to `x` and the estimated error to `xerr`.] ] 92] 93 94[heading Models] 95 96* `runge_kutta_cash_karp54` 97* `runge_kutta_dopri5` 98* `runge_kutta_fehlberg78` 99* `rosenbrock4` 100 101[endsect] 102