We have a fairly large (maybe 1000 equations) differential-algebraic equation model written in ACSLX, an obsolete modelling environment similar to Modelica. The model represents the evolution of a biological system through time, with several forcing functions such as atmospheric temperature which are usually provided on a daily or sub-daily timestep. ACSLX translates the model, including a DAE solver, to C, which is then compiled into a DLL. We run this DLL inside a somewhat complex GUI, often in batch mode consisting of ~100 simulation years. We are in Windows.

We need to convert this model into a new language/environment for future-proofing reasons, and are debating the best option.

  • it should be free (to avoid the expense and licensing pain associated with things like Matlab).
  • it should be well supported and relatively popular
  • the model code should be able to be easily read by biological scientists
  • it would be advantageous if it were able to be run within a development environment such as RStudio or Spyder
  • it should be able to be called from our GUI (e.g. as a DLL)
  • it should be fast
  • it should facilitate model calibration, sensitivity analysis, etc.

We currently use C++, Fortran, Javascript, R, SmallTalk for various other projects. Other options seem to be Modelica, Python, C, Java, C#. It's not clear whether we need a strong DE solver like ODEPACK or whether we could write our own, simple time stepper, since the forcing function tends to negate the benefit of efficient ODE solvers.

We have a similar model which is written in Fortran 90 and compiles to a DLL which we run/calibrate from RStudio. This works quite well, although Fortran expertise is hard to come by and it's a little hard to debug. Spyder/Python would allow both sides to be done in a single language, including debugging, although the performance hit might be a problem. Although Cython or Dask might help there. Modelica seems like another option, although support seems patchy, and it might be slow to run.

We would really appreciate any suggestions/thoughts/experience from the SO community.

Thank you for your help.

  • You might consider Numba (numba.pydata.org) as a more modern and easier way of dramatically speeding up Python code. – Eric S Feb 4 '18 at 21:39
  • Thanks, that's a good suggestion. We decided to go with C++. – Simon Woodward Apr 5 '18 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.