petercorke / petercorke/bdsim

Example of integrator of hybrid system on a Python project

Open
#2 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
267
Forks
39
Avg merge
11d 18h
Merged PRs (30d)
6

Description

Hi @petercorke,
thanks a lot for sharing such a tool, it seems to be quite interesting.

I saw that in the README it is written that:

The biggest is that bdsim is based on a very standard variable-step integrator from the scipy library. For discontinuous inputs (step, square wave, triangle wave, piecewise constant) the transitions get missed. This also makes it inaccurate to simulate hybrid discrete-continuous time systems. We really need a better integrator, perhaps odedc from SciLab could be integrated.

Unfortunately I do not have a lot of time on working on this, but if anyone is interested in working on this, a good example of an integration of an advanced integrator that support for example hybrid system can be found in the FMPy project. In particular, the fmpy.sundials.cvode contains a Python interface to the Sundials' CVODE integrator. An example of use of such interface for integrating a hybrid system (bouncing ball) can be found in https://github.com/CATIA-Systems/FMPy/blob/e1927a128a9552f20304587c54c716750e73b05f/tests/test_cvode.py .

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README section describing the scipy variable-step integrator and review the referenced FMPy example in fmpy.sundials.cvode and tests/test_cvode.py. Determine the project’s integration entry points and how a hybrid-system integrator could fit them. Done would mean a supported integrator that handles discontinuous inputs and hybrid systems, with coverage comparable to the bouncing-ball example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.