Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Julia dependency optional with a pure Python simulator? #131

Closed
pierre-haessig opened this issue Nov 19, 2019 · 4 comments
Closed

Make Julia dependency optional with a pure Python simulator? #131

pierre-haessig opened this issue Nov 19, 2019 · 4 comments
Assignees

Comments

@pierre-haessig
Copy link
Contributor

Hello,

I just came across your package while searching for Python tools for bond-graphs. I'm starting a new course with a bit of bond graphs in the syllabus.

Besides Python, I'm also using Julia, so I'm not that bothered by the Julia dependency, except that it's the legacy 0.6 version. My main concern would be if I want to use it with a group of undergraduate students working on their own computer.

So my question is: would it be possible to implement a pure Python simulator (based on scipy.integrate) so that the dependency on Julia would become optional? Of course simulation performance would be lower, but for small toy models, this shouldn't be a problem.

What do you think?

For the reference, this question may have some links with the open issue of diffeqpy migration #124

@peter-cudmore
Copy link
Collaborator

peter-cudmore commented Nov 28, 2019

Hi Pierre.
Having a pure python simulator would definitely be ideal.

Unfortunately, last i checked SciPy does not have a functioning DAE solver, which is why we're using diffeqpy. However, if there is one floating around it would be great to replace the julia simulator with it.

I think the best approach here would be to see if the SciPy <-> Sundials interface is working, and fix that in SciPy if it's not.
Once that is working, it would be easy to completely remove the julia dependancies (which would be my preference) for simulation, whilst still allowing for julia code generation.

That being said, if someone wanted to write a quick-and-dirty DAE solver for internal use, that'd be great too.

@peter-cudmore peter-cudmore self-assigned this Mar 13, 2020
@peter-cudmore
Copy link
Collaborator

scikit-odes has sundials bindings..

https://github.com/bmcage/odes

We should port the simulation bindings to use this instead of Julia.

@pierre-haessig
Copy link
Contributor Author

OK, I had not in mind the ODE vs DAE issue. I've never used scikit.odes, but it sounds like a reasonable dependency. Their README claims a Python 3.3-3.5 compatibility which looks a bit outdated, but in common.py which feeds the setup.py, it's 3.5 - 3.7, so it's pretty up to date, with several fresh releases.

On my side, I've finished the Bond Graph course, and I ended up not doing BG simulations. I'll revisit this for the next iteration in November.

@peter-cudmore
Copy link
Collaborator

Release version 0.4 now uses scikits.odes for numerical integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants