JacquesCarette / Drasil

Generate all the things (focusing on research software)
https://jacquescarette.github.io/Drasil
BSD 2-Clause "Simplified" License
143 stars 26 forks source link

Add ODE Solvers to Julia #3918

Open B-rando1 opened 3 months ago

B-rando1 commented 3 months ago

Most of the examples in Drasil require an ODE solver. In Drasil we don't have information set up about an ODE library for Julia. Thus, enabling Bundled inputs in Julia (via structs) isn't actually enough to get these examples up and working - we also need the ODE libraries working.

There doesn't seem to be much documentation that I could find on how ODEs are represented in Drasil. I found a wiki page giving a theory recap and a few issues discussing them (e.g. #394), but I still don't really know how they work.

I have two main questions:

smiths commented 3 months ago

@B-rando1, you should have a look at Dong's report on solving ODEs in Drasil. I only did a quick google, but DifferentialEquations.jl looks pretty good. They have translations of standard libraries, which probably look like the code we already have for Python.

Don't worry about anything clever for the algorithms. Our current ODEs examples are well-behaved and not likely to require any numerical tricks for stiff systems.

B-rando1 commented 3 months ago

I created a case study for Julia's ODE solver with swhsnopcm, viewable here. It's not exactly the same as Python's, but it's pretty close.

B-rando1 commented 3 months ago

I did some work getting us as close as we currently can to generating ODE solver code in Julia. Unfortunately, we need structs in GProc to finish it off.

For more details, see my PR draft #3931.