Git Product home page Git Product logo

PyPi Version

PyPI - Python Version

GitHub

Build Documentation Build Code Coverage

Code Quality Score

Code Grade

MoDyPy (rhymes with "modify") is a Python framework for Modelling dynamic systems in Python. The framework provides methods for describing continuous-time linear and non-linear systems in state-space representation. It was originally inspired by simupy developed by Ben Margolis, but has a completely different philosophy and architecture than simupy.

The basic components of a dynamic system in MoDyPy are states and signals. States represent the internal state of the system, and signals represent the values calculated based on the state. Ports can be connected to signals, so that reusable blocks with input and output ports can be easily built. For more details refer to the documentation or check out the video tutorial.

Main Features

  • Simple architecture based on states, signals and connectible ports
  • Enables hierarchical modelling
  • Allows the establishment of reusable building blocks
  • Simulator for linear and non-linear continuous- and discrete-time systems
  • Clock system to model periodic events and discrete-time components
  • Steady state determination and linearization
  • Library of standard blocks, including 6-degree-of-freedom rigid body motion
  • Tested for 100% statement and branch coverage

Installation

MoDyPy is available via the pip installer:

$ pip install modypy

To install the development version,

$ git clone https://github.com/modypy/modypy.git
$ pip install -e modypy

Examples

Simulation of a DC-motor with propeller

Simulation of a DC-motor with propeller

Check out the examples in the examples directory and the User's Guide. These include:

dcmotor.py
A simple example using a DC-motor driving a propeller and sampling the thrust using a zero-order hold.
rigidbody.py
Some rigid-body simulation using moments and forces showing an object moving in a circle with constant velocity and turn-rate.
bouncing_ball.py
An example modelling a bouncing ball, demonstrating the use of events and event-handler functions.
quadcopter_trim.py
A larger example showcasing the steady-state-determination and linearisation of complex systems, in this case for a quadrocopter frame with four DC-motors with propellers.

They can be run from the sources using, e.g.,

$ pip install matplotlib
$ python examples/bouncing_ball.py

Note that some of the examples require matplotlib to run and display the results.

Contributing

Contributions are welcome! Check out the GitHub Project Page for issues and ideas on how to add to the project.

Contributions must adhere to the following conditions:

  • New features must be accompanied by appropriate pytest tests (ensure 100% statement and branch coverage!)
  • New features should at least carry Python Docstrings for API documentation following the general style of the existing API documentation.
  • Use black with a line-length of 80 to format your code. We are successively moving the project to the black style.
  • Contributors must accept publishing their contribution under the licensing conditions laid out in the LICENSE file.

MoDyPy's Projects

docs icon docs

HTML documentation for all releases

modypy icon modypy

A framework for hierarchical modelling, simulation and analysis of dynamic systems

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.