ANNOUNCE: Runge-Kutta library -- solve ODEs

Hello, all, I'm pleased to announce a small Runge-Kutta library for numerically solving ordinary differential equations, which I'm hereby unleashing upon an unsuspecting world. The README is as follows: This is a small module collecting about a dozen Runge-Kutta methods of different orders, along with a couple of programs to exercise them. Build and run testrk, volterra, volterra2, and arenstorf: o testrk exercises all of the methods in a non-adaptive way, solving a test problem with a known analytic solution, to check convergence. (This was what first indicated that there was a problem with the Fehlberg 7(8) listing in HNW.) o volterra uses a non-adaptive method to solve the Lotka-Volterra equations from t=0 to t=40: either from a built-in starting point, or from a starting point specified on the command line. o volterra2 does the same, except it uses an adaptive solver o arenstorf solves the restricted 3-body problem (earth+moon+satellite) using an adaptive solver with some specific initial conditions which yield periodic orbits The volterra2 and arenstorf examples use an "oracle" function to decide what is a good step size. Right now that oracle function is in each test file; arguably it should be in the RungeKutta module. Eventually it will be, but I haven't spent much time yet on making that oracle especially good. I have so far only tested it with ghc 6.8.3 on MacOS 10.3.9 (powerPC), but I know of no reason why it wouldn't work with other versions and OSs. It's BSD licensed, in fact I stole the LICENSE file from ghc (and filed off the serial numbers). I'm afraid I haven't messed with cabal much yet, so it's not cabalized; neither is it uploaded to hackage, as I have no account there. If someone wants to do either of those, please feel entirely free to do so. In addition to attaching a tarball to this message, I'm also putting this onto my (sadly neglected) web site: it will live at http://www.korgwal.com/software/rk-1.0.0.tar.gz. Enjoy! Uwe

Hi Uwe, Uwe Hollerbach wrote:
I have so far only tested it with ghc 6.8.3 on MacOS 10.3.9 (powerPC), but I know of no reason why it wouldn't work with other versions and OSs.
It works fine on 6.10.1 on Leopard Intel as well.
I'm afraid I haven't messed with cabal much yet, so it's not cabalized; neither is it uploaded to hackage, as I have no account there. If someone wants to do either of those, please feel entirely free to do so.
It's really easy to do this, and I strongly suggest you do. To save you some work, here's a cabal file you can use that directly allows you to 'cabal install' your package: (filename: rungekutta.cabal)
Name: rungekutta Version: 0.1
Cabal-Version: >= 1.2 Build-Type: Simple License: BSD3 License-File: LICENSE
Library Build-Depends: base < 5 Exposed-Modules: RungeKutta
All you need to do is find a nice category for it (with matching module name), change the cabal file accordingly, create an account at hackage (see http://hackage.haskell.org/packages/accounts.html) and upload it. Hope this helps, Martijn.

Thanks, Martijn, glad to hear it's working for you too. I'll see what
I can do about cabal+hackage...
Uwe
On 4/19/09, Martijn van Steenbergen
Hi Uwe,
Uwe Hollerbach wrote:
I have so far only tested it with ghc 6.8.3 on MacOS 10.3.9 (powerPC), but I know of no reason why it wouldn't work with other versions and OSs.
It works fine on 6.10.1 on Leopard Intel as well.
I'm afraid I haven't messed with cabal much yet, so it's not cabalized; neither is it uploaded to hackage, as I have no account there. If someone wants to do either of those, please feel entirely free to do so.
It's really easy to do this, and I strongly suggest you do. To save you some work, here's a cabal file you can use that directly allows you to 'cabal install' your package:
(filename: rungekutta.cabal)
Name: rungekutta Version: 0.1
Cabal-Version: >= 1.2 Build-Type: Simple License: BSD3 License-File: LICENSE
Library Build-Depends: base < 5 Exposed-Modules: RungeKutta
All you need to do is find a nice category for it (with matching module name), change the cabal file accordingly, create an account at hackage (see http://hackage.haskell.org/packages/accounts.html) and upload it.
Hope this helps,
Martijn.

I have so far only tested it with ghc 6.8.3 on MacOS 10.3.9 (powerPC), but I know of no reason why it wouldn't work with other versions and OSs.
It breaks on Linux (and all unices) because name of file in tarball is 'rungekutta.hs' not 'RungeKutta.hs' as required. In other words: god blame case-insensitive file systems. After renaming everything works just fine.

Damn, I never thought of that. Sorry! Guess I've only been
haskell-hacking on my little old iMac...
A new version is attached, with the version number bumped up by 0.0.1
and rungekutta.hs renamed to RungeKutta.hs. Hopefully it should work
out-of-the-box now. Off to patch my repository...
Uwe
On 4/19/09, Alexey Khudyakov
I have so far only tested it with ghc 6.8.3 on MacOS 10.3.9 (powerPC), but I know of no reason why it wouldn't work with other versions and OSs.
It breaks on Linux (and all unices) because name of file in tarball is 'rungekutta.hs' not 'RungeKutta.hs' as required. In other words: god blame case-insensitive file systems.
After renaming everything works just fine. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

It would also be nice if you could plug it into the hierarchical
module system somewhere, perhaps renaming the module to
"Data.Algorithm.RungeKutta" or "Numeric.RungeKutta" or
"Math.RungeKutta". This is pretty much the standard practice now, I
think.
Alex
On Sun, Apr 19, 2009 at 4:04 PM, Uwe Hollerbach
Damn, I never thought of that. Sorry! Guess I've only been haskell-hacking on my little old iMac...
A new version is attached, with the version number bumped up by 0.0.1 and rungekutta.hs renamed to RungeKutta.hs. Hopefully it should work out-of-the-box now. Off to patch my repository...
Uwe
On 4/19/09, Alexey Khudyakov
wrote: I have so far only tested it with ghc 6.8.3 on MacOS 10.3.9 (powerPC), but I know of no reason why it wouldn't work with other versions and OSs.
It breaks on Linux (and all unices) because name of file in tarball is 'rungekutta.hs' not 'RungeKutta.hs' as required. In other words: god blame case-insensitive file systems.
After renaming everything works just fine. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

That sounds fine... I think I'll pick "Numeric. RungeKutta". I'll
change it when I've cabalized & hackage-ized this puppy...
Uwe
On 4/20/09, Alexander Dunlap
It would also be nice if you could plug it into the hierarchical module system somewhere, perhaps renaming the module to "Data.Algorithm.RungeKutta" or "Numeric.RungeKutta" or "Math.RungeKutta". This is pretty much the standard practice now, I think.
Alex
participants (4)
-
Alexander Dunlap
-
Alexey Khudyakov
-
Martijn van Steenbergen
-
Uwe Hollerbach