47 this =
this@solvers.BaseSolver;
48 this.
Name=
" Base Custom Solver ";
56 [times, outidx] = this.getCompTimes(t);
59 ed = solvers.SolverEventData(times);
60 notify(
this,
" PreSolve ",ed);
66 notify(
this,
" PostSolve ",ed);
92 function [times , rowvec<integer>outidx ] = getCompTimes(
rowvec<double> t) {
95 if any(abs(
sort(t) - t) > 100*eps)
96 error(" The time vector must be strictly monotoneously increasing. ");
101 outidx = 1:length(t);
105 times = t(1):this.
MaxStep:t(2);
107 outidx = [1,length(times)];
110 n = max(round((t(2:len)-t(1:len-1))/this.
MaxStep),1);
114 m(2:len) = cumsum(n) + m(2:len);
116 times = zeros(1,m(len));
119 times(m(i):m(i+1))= t(i):(t(i+1)-t(i))/(n(i)):t(i+1);
125 outidx(end) = length(times);
notify
Broadcast a notice that a specific event is occurring on a specified handle object or array of handle...
BaseCustomSolver: Base class for all self-implemented solvers.
sort
ort the handle objects in any array in ascending or descending order.
A MatLab function handle.
EVENT PostSolve
Gets fired after the solver has finished.
double MaxStep
Maximum time step for solver.
virtual function colvec< double > x = customSolve(odefun, t, x0, outputtimes)
The abstract solve function for custom ODE solver implementations.
Base class for all KerMor ODE solvers.
EVENT PreSolve
Gets fired before the solver starts.
function [ rowvec t , matrix x ] = solve(function_handle odefun,rowvec t,colvec x0)
Solves the ode and wraps the actual solving method.