Re: [Yanl-develop] Stepper Design
Brought to you by:
karstenahnert
|
From: Karsten A. <kar...@gm...> - 2009-11-22 20:54:33
|
Hi everyone, just one short notes: maybe people are confused if the controlled step is a stepper. It does not perform one step it tries one step. Maybe we should call the method try_step(). We can also clarify the method names for the the Stepper and ErrorStep by chaning next_step() to do_step(). Regards, Karsten Mario Mulansky wrote: > Hi everyone, > > I have just reorganized the code of the stepsize_controller and created > controlled_stepper on its behalf. So I want to take the opportunity to give > a short review on current status of the stepper design: > > There are three different types (you may say concepts) of stepper classes: > - Stepper: fixed step size, no error estimation, examples: stepper_euler, > stepper_rk4 > > - ErrorStepper: fixed step size, with error estimation, examples: > stepper_half_step, stepper_rk5_ck > > - ControlledStepper: variable step size, uses error estimation for adjusting > the stepsize, example: controlled_stepper_standard > > As you might imagine, they have the following purposes: Steppers are for > simple, fixed step size, straight forward integration without thinking about > errors at all. ErrorSteppers give you the opportunity to check the errors > while integrating. They are hardly used alone, but serves as a basis for > ControlledSteppers. The ControlledSteppers can control the error of a step > and adjust step size (and maybe also order) of the individual integration > steps. This enables you to ensure that the error of each step is below a > certain threshold, for example. ControlledSteppers require some underlying > ErrorStepper which actually does the step and estimates the error. > > The respective steppers provide the following methods: > > Stepper: > > order_type order() Returns the order of the method. that is the error of hte > method scales as dt^(order+1). order_type is typically unsigned short > > void next_step( system, x, t, dt ) Applies one integration step of size dt > using x as starting point at time t. system represents the rhs of the > equation x' = f(x,t). The result of the step is stored in x (in-place step). > > void next_step( system, x, dxdt, t, dt ) Same as above, but additionally > x'(x,t) is provided in dxdt, which might reduce calls of the system function. > > > ErrorStepper: > > order_type order() > Returns the order of the method. that is the error of hte method scales as > dt^(order+1). order_type is typically unsigned short > > order_type order_error() > Returns the order of the error estimation, that is the error of the error > estimation scales as dt^(order_error+1) > > next_step( system, x, t, dt, xerr ) > Applies one integration step of size dt using x as starting point at time t. > system represents the rhs of the equation x' = f(x,t). The result of the step > is stored in x (in-place step). An additional error estimation is performed > and the result is stored in xerr. > > next_step( system, x, dxdt, t, dt, xerr ) > Same as above, but with dxdt = x'(x,t) provided as an additional parameter. > > > ControlledStepper: > > order_type order() > Returns the order of the last step(!) performed by this class. > > controlled_step_result next_step( system, x, t, dt ) > Performs a controlled step starting with x at t using system to define the rhs > of x' = f(x,t). This means to try a step with dt and check the error (usually > by using an ErrorStepper). If the error is too large, the result of the step > is discarded, an appropriate step size dt is set (dt is an In/Out parameter > here) and the value step_size_decreased is returned. If the error was too > small, the step is applied (result stored in x), t is increased t+=dt (t is > also In/Out), dt is set to a better stepsize and step_size_increased is > returned. If the error was ok, the result of the step is stored in x, t is > increased t += dt and success is returned. > > Regards, Mario > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Yanl-develop mailing list > Yan...@li... > https://lists.sourceforge.net/lists/listinfo/yanl-develop > |