112 this =
this@solvers.BaseSolver;
118 slvname =
char(solver);
119 if ~isempty(strfind(
" ode15s ",slvname))
127 function [doublet , matrix<double>y ] =
solve(odefun,
double t,x0) {
130 opts = odeset(opts,
" MaxStep ", this.
MaxStep);
133 opts = odeset(opts,
" InitialStep ", this.
InitialStep);
137 opts = odeset(opts,
" Jacobian ", this.
JacFun);
144 opts = odeset(opts,
" JPattern ", JP);
147 M = []; yp0 = odefun(0,x0); MS = [];
149 if ~this.M.TimeDependent
160 invertible = 1:size(Mt0,1);
161 invertible(algdims) = [];
162 yp0(invertible) = Mt0(invertible,invertible)\yp0(invertible);
172 odeset(opts,
" MassSingular ",
" yes ");
173 warning(
" off ",
" MATLAB:singularMatrix ");
177 warning(
" on ",
" MATLAB:singularMatrix ");
179 if any(isnan(yp0(:)))
180 error(
" Failed to automatically produce a consistent initial slope. ");
186 opts = odeset(opts,
" Mass ",
M,
" MStateDependence ",MS,...
187 " InitialSlope ",yp0);
193 ed = solvers.SolverEventData;
206 #if 0 //mtoc++: 'set.MLSolver'
208 if isa(value,
" function_handle ")
210 this.
Name= sprintf(" Matlab Solver wrapper using %s ",func2str(value));
212 error(" Invalid function
handle! ");
242 if ~strcmp(flag,
" init ")
246 this.fED.Times=
t(idx);
248 this.fED.States= y(:,idx);
249 this.
notify(
" StepPerformed ",this.fED);
AImplSolver: Base abstract class for solvers that can use Jacobian information for faster computation...
notify
Broadcast a notice that a specific event is occurring on a specified handle object or array of handle...
logical RealTimeMode
Determines if the solver's StepPerformed event should be used upon solving instead of returning the f...
virtual function M = evaluate(double t,colvec< double > mu)
Allows to wrap a MatLab ODE solver into the KerMor framework.
sparsematrix JPattern
The sparsity pattern of the jacobian .
function_handle JacFun
A function handle to compute the core function's jacobian.
function registerProps(varargin)
Call this method at any class that defines DPCM observed properties.
double InitialStep
The initial step size for the solver. So far only used by the MLWrapper class for the native matlab s...
A MatLab function handle.
function status = ODEOutputFcn(t, y, flag)
Wraps the OutputFcn of the Matlab ODE solver into the StepPerformed event.
function_handle MLSolver
The wrapped Matlab-Solver.
Matlab's base handle class (documentation generation substitute)
solvers.SolverTypes SolverType
The type of the solver.
double MaxStep
Maximum time step for solver.
dscomponents.AMassMatrix M
The mass matrix of the ODE .
function [ double t , matrix< double > y ] = solve(odefun,double t, x0)
Base class for all KerMor ODE solvers.
function varargout = solverCall(function_handle odefun,rowvec< double > t, x0,struct opts)
Default solver call for all builtin ode solvers except ode15i. This method gets overridden in MLode15...
struct odeopts
Additional ODE options.
A MatLab character array.
A variable number of output arguments.