KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
solvers.ExplEuler Class Reference

Explicit forward euler ODE solver. More...

Detailed Description

Explicit forward euler ODE solver.

This solver uses the MaxStep property as timestep to be most efficient. Set small enough for precision.

Method description

\[ x_{i+1} = x_i + \Delta t f(t_i,x_i)\]

Author
Daniel Wirtz
Date
12.03.2011
Change in 0.5:
(Daniel Wirtz, 2011-10-16) Adopted to the new BaseSolver.RealTimeMode flag.
Change in 0.5:
(Daniel Wirtz, 2011-09-29) Added step-wise event implementation for real time plotting.
Change in 0.4:
(Daniel Wirtz, 2011-05-31) Added a new middle class solvers.BaseCustomSolver which extracts the getCompTimes into a new abstraction layer.
New in 0.3:
(Daniel Wirtz, 2011-04-21) Integrated this class to the property default value changed supervision system Property classes and levels. This class now inherits from KerMorObject and has an extended constructor registering any user-relevant properties using KerMorObject.registerProps.
New in 0.2:
(Daniel Wirtz, 2011-03-11) Added a c/mex implementation of the algorithm. Turns out it is double the times slower than the matlab native code version, so leaving it only in there for speed test purposes (solvers.ExplEuler.test_solveMex).
See Also
solvers BaseSolver BaseCustomSolver Heun

This class is part of the framework

KerMor - Model Order Reduction using Kernels

Definition at line 18 of file ExplEuler.m.

Public Member Functions

 ExplEuler (double MaxStep)
 Constructor for the explicit euler solver. More...
 
- Public Member Functions inherited from solvers.BaseCustomSolver
 BaseCustomSolver ()
 
function [ rowvec t , matrix x ] = solve (function_handle odefun,rowvec t,colvec x0)
 Solves the ode and wraps the actual solving method. More...
 
- Public Member Functions inherited from solvers.BaseSolver
 BaseSolver ()
 
virtual function [
rowvec t ,
matrix x ] = 
solve (odefun,rowvec t,colvec x0)
 The abstract solve function for the ODE solver. More...
 
- Public Member Functions inherited from KerMorObject
 KerMorObject ()
 Constructs a new KerMor object. More...
 
function  display ()
 disp(object2str(this)); More...
 
function bool = eq (B)
 Checks equality of two KerMor objects. More...
 
function bool = ne (B)
 Checks if two KerMorObjects are different. More...
 
function cn = getClassName ()
 Returns the simple class name of this object without packages. More...
 
- Public Member Functions inherited from DPCMObject
 DPCMObject ()
 Creates a new DPCM object. More...
 
 DPCMObject ()
 

Protected Member Functions

function matrix x = customSolve (function_handle odefun,rowvec t,colvec x0,rowvec< integer > outputtimes)
 Solves the ODE using the explicit Euler method. More...
 
- Protected Member Functions inherited from solvers.BaseCustomSolver
virtual function colvec< double > x = customSolve (odefun, t, x0, outputtimes)
 The abstract solve function for custom ODE solver implementations. More...
 
- Protected Member Functions inherited from KerMorObject
function  checkType (obj, type)
 Object typechecker. More...
 
- Protected Member Functions inherited from DPCMObject
function  registerProps (varargin)
 Call this method at any class that defines DPCM observed properties. More...
 
function  registerProps (varargin)
 

Additional Inherited Members

- Static Public Member Functions inherited from solvers.BaseSolver
static function res = test_SolverSpeedTest ()
 
- Public Attributes inherited from solvers.BaseCustomSolver
EVENT PreSolve
 Gets fired before the solver starts. More...
 
EVENT PostSolve
 Gets fired after the solver has finished. More...
 
- Public Attributes inherited from solvers.BaseSolver
double MaxStep = "[]"
 Maximum time step for solver. More...
 
double InitialStep = "[]"
 The initial step size for the solver. So far only used by the MLWrapper class for the native matlab solvers. More...
 
logical RealTimeMode = false
 Determines if the solver's StepPerformed event should be used upon solving instead of returning the full trajectory as one. More...
 
dscomponents.AMassMatrix M = "[]"
 The mass matrix \(M\) of the ODE \(M(t)x'(t) = \ldots\). More...
 
 Name = "KerMor BaseSolver class"
 The solver's name. More...
 
solvers.SolverTypes SolverType = solvers.SolverTypes.Unknown
 The type of the solver. More...
 
EVENT StepPerformed
 Gets fired when an ODE solver performs an intermediate step. More...
 
- Public Attributes inherited from DPCMObject
 WorkspaceVariableName = ""
 The workspace variable name of this class. Optional. More...
 
 ID = "[]"
 An ID that allows to uniquely identify this DPCMObject (at least within the current MatLab session/context). More...
 
 PropertiesChanged = "[]"
 The Dictionary containing all the property settings as key/value pairs. More...
 
- Public Attributes inherited from handle
 addlistener
 Creates a listener for the specified event and assigns a callback function to execute when the event occurs. More...
 
 notify
 Broadcast a notice that a specific event is occurring on a specified handle object or array of handle objects. More...
 
 delete
 Handle object destructor method that is called when the object's lifecycle ends. More...
 
 disp
 Handle object disp method which is called by the display method. See the MATLAB disp function. More...
 
 display
 Handle object display method called when MATLAB software interprets an expression returning a handle object that is not terminated by a semicolon. See the MATLAB display function. More...
 
 findobj
 Finds objects matching the specified conditions from the input array of handle objects. More...
 
 findprop
 Returns a meta.property objects associated with the specified property name. More...
 
 fields
 Returns a cell array of string containing the names of public properties. More...
 
 fieldnames
 Returns a cell array of string containing the names of public properties. See the MATLAB fieldnames function. More...
 
 isvalid
 Returns a logical array in which elements are true if the corresponding elements in the input array are valid handles. This method is Sealed so you cannot override it in a handle subclass. More...
 
 eq
 Relational functions example. See details for more information. More...
 
 transpose
 Transposes the elements of the handle object array. More...
 
 permute
 Rearranges the dimensions of the handle object array. See the MATLAB permute function. More...
 
 reshape
 hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape function. More...
 
 sort
 ort the handle objects in any array in ascending or descending order. More...
 
- Static Protected Member Functions inherited from DPCMObject
static function obj = loadobj (obj, from)
 Re-register any registered change listeners! More...
 
static function obj = loadobj (obj, from)
 

Constructor & Destructor Documentation

solvers.ExplEuler.ExplEuler ( double  MaxStep)

Constructor for the explicit euler solver.

Specifying the dt parameter is optional, though not specifying will generate a warning that it should be set manually for each case.

Parameters
MaxStepMaximum time step. Default: []

Definition at line 63 of file ExplEuler.m.

References solvers.SolverTypes.Explicit, solvers.BaseSolver.MaxStep, solvers.BaseSolver.Name, and solvers.BaseSolver.SolverType.

Member Function Documentation

function matrix x = solvers.ExplEuler.customSolve ( function_handle  odefun,
rowvec  t,
colvec  x0,
rowvec< integer outputtimes 
)
protected

Solves the ODE using the explicit Euler method.

There is a mex-implementation of the explicit euler scheme, unfortunately it is almost double the times slower than matlab! (So mexing files to get rid of for loops does not work well :-))

Parameters
odefunA function handle to the ode function, satisfying the interface also required by matlab's explicit ode solvers.
tThe desired times \(t_0,\ldots,t_N\) as row vector.
x0The initial value \(x(0) = x_0\) for \(t=0\)
outputtimesindex vector indicating at which of the times in t the output is actually desired. The solution will be returned at \(t_0,\ldots,t_N\) = t(outputtimes).
Return values
xThe solution of the ode at the time steps \(t_0,\ldots,t_N\) as matrix.
Note
This method has the MATLAB method attribute Sealed set to true. It cannot be overwritten.
matlab documentation of method attributes.

Definition at line 87 of file ExplEuler.m.

References dscomponents.AMassMatrix.evaluate(), solvers.BaseSolver.M, handle.notify, solvers.BaseSolver.RealTimeMode, and t.

Here is the call graph for this function:


The documentation for this class was generated from the following file: