108 this =
this@solvers.MLWrapper(@ode15i);
109 this.
Name=
" MatLab ode15i implicit solver wrapper ";
120 opts = odeset(opts,
" RelTol ", this.
RelTol,
" AbsTol ", this.
AbsTol);
122 if isempty(opts.InitialSlope)
123 error(
" The ode15i solver must be provided with an initial slope. ");
128 if ~isempty(this.
JacFun) || ~isempty(this.
M)
129 opts = odeset(opts,
" Jacobian ", @this.FJAC);
142 JP[2] = speye(size(x0,1));
144 opts = odeset(opts,
" JPattern ", JP);
151 implfun = @(
t,x,xp)this.
M.
evaluate(t)*xp - odefun(t,x);
154 implfun = @(
t,x,xp)
M*xp - odefun(t,x);
157 implfun = @(
t,x,xp)xp - odefun(t,x);
161 initialnorm = norm(implfun(0,x0,opts.InitialSlope));
162 if initialnorm > 1e-11
163 warning(
" Initial conditions possibly inconsistent. ||f(0,x0,dx0)|| = %g ",initialnorm);
189 function [dfdx , dfdxp ] = FJAC(
t,x,xp) {
194 dfdx = -this.
JacFun(t, x);
197 dfdxp = this.
M.evaluate(t);
199 dfdxp = speye(size(x,1));
double RelTol
Relative error tolerance for solver.
double AbsTol
Absolute error tolerance for solver.
logical TimeDependent
Flag that indicates time-dependency of the Mass Matrix.
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.
A MatLab function handle.
function_handle MLSolver
The wrapped Matlab-Solver.
solvers.SolverTypes SolverType
The type of the solver.
double MaxStep
Maximum time step for solver.
dscomponents.AMassMatrix M
The mass matrix of the ODE .
MLode15i: Wrapper for MatLab's ode15i builtin implicit solver.
function varargout = solverCall(function_handle odefun,rowvec< double > t, x0,struct opts)
Solves the ode specified by odefun implicitly.
sparsematrix SparsityPattern
The sparsity pattern for the mass matrix.
A variable number of output arguments.