Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Re: [mg4301] Problem with discontinuity in NDSolve[]
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Andrei Constantinescu

Posts: 1
Registered: 12/11/04
Re: [mg4301] Problem with discontinuity in NDSolve[]
Posted: Jul 17, 1996 1:38 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dear Axel,

there is a fundamental math problem with your system.

If you compute :

NDSolve[{y'[t] == 10 - y[t] * If[t-15 <= 0, 0, 1],
y[0] == 0}, y, {t,0,20}]

the solution is simple because the system has two behaviours
one for t < 0 and another one for t > 0. So everything is nice.

But if you write:


NDSolve[{y'[t] == 10 - y[t] * If[y[t]-15 <= 0, 0, 1],
y[0] == 0}, y, {t,0,20}]

then the system has also two behavoiurs one for y < 0 and
another one for y > 15 .

Unfortunately each time as the system reaches y = 15, its
switching to the second exponential behaviour, but then the solutions
also decreases so you arrive again at y < 0, and you switch again,

... which gives a neverendind story, and of course the computation
never converges !


In order to obtain a behaviour until y reaches 15 and another one
after (even if y < 15 again !), you have to introduce an internal
parameter, governing the swich:
alpha = 0 until y = 15
alpha = 1 if y was already been 15
... which means another equation to your problem of the sort:

alpha == If[ alpha == 1 || y == 15 , 1 , 0 ]


a + andrei

______________________________________________________________________
Andrei Constantinescu constant@athena.polytechnique.fr

LMS Ecole Polytechnique tel: (33)-1-69.33.33.30
91128 PALAISEAU cedex - FRANCE fax: (33)-1-69.33.30.26







Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.