Skip to main content
15-Moonstone
July 16, 2021
Question

Differential Equations with Discontinuities

  • July 16, 2021
  • 8 replies
  • 4455 views

I am solving a system of odes with imposed discontinuites on the right hand side. I can do this by calling a solver up to the time of the discontinuity, imposing the jump condition, and then restarting the calculation (as in the attached worksheet). But I want to do this for a series of discontinuities. Since all the jumps are the same magnitude and occur at regular time intervals, it seemed like there should be a way to program it rather than doing it manually, but I could not see how to do it. Can anyone help?

8 replies

19-Tanzanite
July 18, 2021

Attached is a version using Odesolve (Mathcad 15).  For more than two sets of discontinuous jumps you should be able to modify it in an obvious way.

 

It produces the following sort of results

Jumps.png

 

 

Alan

 

15-Moonstone
July 18, 2021

Thanks for the reply. It seems like that should work but your plot does not show a discontinuity in theta (t) at t = 1000. I did not show the plot of this in my previous post, but it is shown below:

JohnRudnicki_0-1626632072379.png

Ultimately, I would like to do this for a staircase of discontinuties (with the same stepsize and time interval). BTW, I used dk=0 even though k is constant so I could change the value in the initial condition for different cases (though I think this is easier to do with Odesolve). I have not been using Odesolve because in looking at similar systems I have had a lot of trouble with convergence, the error "return value does not match...", and instabilities that is sometimes helped by fiddling with different solvers and tolerances.  

 

19-Tanzanite
July 20, 2021

A little more like this then, where I've kept k constant and only solved for v and theta (you should be able to extend the method to the others easily enough).  I've also added another step:

jumps03.png

Alan

 

15-Moonstone
July 21, 2021

Thanks. Looks good, but I will have to study a bit to make sure I understand.

1-Visitor
August 26, 2021

@JohnRudnicki wrote:

Thanks. Looks good, but I will have to study a bit to make sure I understand.


 
 

The conditions for the solution of the problem:

dxdt=F(t,x(t)),x(t0)=x0,dxdt=F(t,x(t)),x(t0)=x0,

to exist and to be unique is that FC0t,xF∈Ct,x0 and Lipschitz continuous for t>t0t>t0. Then, the solution of the problem is given by:

x(t)=x0+tt0F(t,x(t))dtx(t)=x0+∫t0tF(t,x(t))dt

Note that for the function FF to be integrable in t>t0t>t0, it must contain finitely many discontinuities so x(t)x(t) remains continuous in t>t0t>t0 whilst, otherwise, x(t)x′(t) may not, in general.

As an example, consider the problem:

x(t)=H(t1),x(0)=0,t>0.x′(t)=H(t−1),x(0)=0,t>0.

Its solution is then given by:

x(t)=(t1)H(t1)x(t)=(t−1)H(t−1)

which is continuous but not differentiable at t=1t=1.

Cheers!