56 this =
this@solvers.BaseCustomSolver;
58 this.
Name=
" Explicit Heun "" s method ";
83 dt =
t(2:end)-
t(1:end-1);
95 ed = solvers.SolverEventData;
98 effsteps = length(outputtimes);
100 x = [x0 zeros(size(x0,1),effsteps-1)];
105 f = odefun(
t(idx-1),oldx);
106 hlp = (dt(idx-1)/2)*(f + odefun(
t(idx),oldx + dt(idx-1)*f));
111 [L,U] = this.
M.
getLU(
t(idx-1));
112 newx = U\(L\(this.
M.
evaluate(
t(idx-1))*oldx + hlp));
125 if outputtimes(outidx) == idx
130 this.
notify(
" StepPerformed ",ed);
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...
BaseCustomSolver: Base class for all self-implemented solvers.
Heun(double MaxStep)
Constructor for the explicit euler solver.
virtual function M = evaluate(double t,colvec< double > mu)
function matrix x = customSolve(function_handle odefun,rowvec t,colvec x0,rowvec< integer > outputtimes)
Solves the ode using Heuns method.
A MatLab function handle.
solvers.SolverTypes SolverType
The type of the solver.
double MaxStep
Maximum time step for solver.
dscomponents.AMassMatrix M
The mass matrix of the ODE .
virtual function [ L , U , Q , P ] = getLU(double t,colvec< double > mu)
ODE solver implementing the method of heun.