MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

NDSolve and memory usage

  • To: mathgroup at
  • Subject: [mg131674] NDSolve and memory usage
  • From: Paolo Pani <paolopani at>
  • Date: Thu, 19 Sep 2013 01:21:44 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:

Hi all,

After some googling, i've found similar problems around, but didn't find a 100% satisfactory answer, so let me ask here:

I'd like to solve a 1+1 problem using the method of lines. In spherical symmetry, I discretize the radial direction and end up with a system of ODEs that I'd like to solve with NDSolve. Problem is, the original 1+1 problem is a system of ~10 first-order PDEs and eventually I need to solve ~10*N first-order ODEs, where N are the radial grid points. To achieve enough resolution, N ranges from O(10^3) to O(10^4).

My problem is that NDSolve requires a lot of memory to solve the system. Also, I need the solution at any time, not only at the final time. What I would like to do is having NDSolve storing intermediate values at each time step in a data file, thus leaving the memory free. Is that possible? Is there any other solution to this problem? Frankly, I find this problem quite restrictive, given that a similar odeint in c would require essentially no memory to run, unless i'm doing some silly mistake of course.

Thanks in advance for the help!

  • Prev by Date: Quantity
  • Next by Date: Re: Writing numeric data to CSV does not write final EOL
  • Previous by thread: Re: Quantity
  • Next by thread: apply rule to Partition