Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Is it possible to break up ODEs and then piece back together
Date: Sat, 2 Apr 2011 20:03:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 20
Message-ID: <in7vdo$5f7$1@fred.mathworks.com>
References: <in7rg4$7gp$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-00-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1301774584 5607 172.30.248.45 (2 Apr 2011 20:03:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 2 Apr 2011 20:03:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:719701

"Keane Gonzalez" <keane_gonzalez@hotmail.com> wrote in message <in7rg4$7gp$1@fred.mathworks.com>...
>   I've got some basic Lorenz & Rossler chaos equations that I'm using ode45 (maybe some others) to solve. I'd like to run various cases with differing time steps, but I'm running into memory issues on my wimpy machine. As an example, solving a simple Lorenz for a time period of 0 to 20s is no problem and I get reasonable results from this, albeit at a lesser resolution (0.1 time step). 
>   The problem is if I try to go to a time period much longer than 200s at the same time step or smaller. I initially tried to split up the longer time period into sections, then run ode45 on each part and then piece the results back together. The basic method I used was:
> 1. select a large time period, say 0 to 2000s 
> 2. select a time step, such as 0.01s
> 3. select an initial set of points, x0,y0,z0
> 4. Depending on the size of the run period, split it up into sections. For this example, I would run from 0 to 1000s for one ode, then 1000+ time step to 2000s for the next. 
> 5. For the second half, the last x,y, z value output from the first ode was used as the input x0,y0, and z0.
> 6. The results are put together
>   At first glance, this looked okay, but to check it out, I split up a run up to 1000s using this method and then ran a regular ode45run over 1000s to compare results. The results differed by more than I expected to see. Is splitting up ODE runs like this mathematically "wrong" or is there something else needed to make such a method sufficiently close to running a large ode45 run on a separate machine with more memory?
>   I realize there are other methods to use, but I was just hoping to see if I could stick with ode45 for the time being (or one of the other canned ode systems built-in).
>  
> Thanks,
> Keane Gonzalez
- - - - - - - - - - -
  If you haven't already done so, I would suggest you use 'odeset' to set the 'RelTol' and 'AbsTol' values to the accuracy you desire.  Note that the default value for 'RelTol' is  only 1e-3 which may not be accurate enough for your purposes.

  Of course with more accuracy the runs will take longer and perhaps use more memory.  (Sounds like "catch-22" doesn't it?)  Breaking up the runs into separate segments as you have done sounds valid to me provided the accuracy is set high enough, though a lot of extra work on your part.

Roger Stafford