Runge-Kutta methods with discontinuity

numerical methodsrunge-kutta-methods

Would Runge_Kutta methods (especially Dormand-Prince) pair be affected by step-like nature of the derivative function $\dot{y} = f(t,y)$.

I mean if we take it $\dot{y}=f(u(t),y)$ and $u(t)$ is step-wise inputs (discrete + Zero order hold).

Thanks

Best Answer

Taking the question text from your other question at SO on this topic (that you deleted as suggested, but did not transfer to enhance this question).

Q: I want to simulate continuous system with zero order hold inputs (piece-wise constant). Actually we can change $f$, as it is a function of time, according to some external input.

A: In $$y'(t)=f(t,y(t),u(t)),$$ each constant segment $u(t)=u_k$ on $t\in[t_k,t_{k+1})$ can be considered to generate an independent ODE system $$y'(t)=f_k(t,y(t))~\text{ where }~f_k(t,y)=f(t,y,u_k).$$ Each of these systems on their own is smooth, thus perfectly solvable with reasonable step sizes, as long as it does not diverge to infinity.

Then you can construct a composite function that is the solution of the original equation, $$y(t)=y_k(t) ~\text{ for }~ t\in[t_k,t_{k+1}]$$ where $y_k$ is a solution to $$ y_k'(t)=f_k(t,y_k(t)),~~y_k(t_k)=y_{k-1}(t_k). $$

Q: However, the problem that arises in this case is the integrator uses some adaptive step size and when you ask it to find output until some time $t$ it may also make use of some future values of the $f(t,y)$ which would be wrong, because after that time our input and hence the $f(t,y)$ changes.

A: That is not really a problem if you compute the solutions separately. On the segment $[t_k,t_{k+1}]$, the solution is equal to the solution of the $k$th equation. That the solver uses points outside this interval does not change its exactness inside the interval, to the contrary, it allows the solver to keep using relatively large step sizes.

Changing the equation exactly at $t_{k+1}$ would introduce a discontinuity in the equation or one of its derivatives which throws off the step size controller, leading to excessively small step sizes and the corresponding large number of function evaluations to pass over that point.

Related Question