Group Abstract Group Abstract

Message Boards Message Boards

0
|
84 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Is there any way to modify the integration domain in course of NDSolve operation?

Posted 4 days ago

Hello,

I need a method to modify (shorten) the initially specified integration interval, while using NDSolve for solving some very large set of first order ODEs. I have to stop calculations if the computational time or occupied memory exceed certain limits, in such a way so that a valid solution object is produced by NDSolve for the interval in which the solution is already obtained, instead of program crashing due to excessive time or memory requirements. Is there any way to achieve this? I tried to use the WhenEvent construct, according to the following test code:

timeused0=TimeUsed[];
sol=NDSolve[{odes,WhenEvent[TimeUsed[]-timeused0>200,"StopIntegration"]},{solfunctions},{t,tmin,tmax}];

but this does not seem to work. The integration is not stopped in the expected moment, and the "sol" object finally obtained contains the entire solution up to t=tmax. I would appreciate any help.

Lesław

POSTED BY: Leslaw Bieniasz
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard