Skip to main content

Development Status :: 3 - Alpha

Project description

A python software dedicated to the simulation of multiphysical systems in the Port-Hamiltonian Systems (PHS) formalism.

.. image::

.. image::

.. image::

.. image::

It is developped in the `project/team S3 <>`__ (Sound Signals and Systems) at `STMS Research Lab <>`__ (CNRS UMR 9912), hosted by `IRCAM <>`__.

It was initially developed between 2012 and 2016 as a part of the PhD project of `Antoine Falaize <>`__, under the direction of `Thomas Hélie <>`__, through a funding from French doctoral school `EDITE <>`__ (UPMC ED-130), and in connection with the French National Research Agency project `HaMecMoPSys <>`__.

.. image::

.. image::

.. image::

.. image::
:alt: issues

.. image::
:alt: Health

It is possible to install ``pyphs`` from package (if you just want to use it) or source (if you plan to
use it for development) by following the instructions below. Whichever variant
you choose, please make sure that all prerequisites are installed.


To install the ``pyphs`` package, you must have either Python 2.7 or Python
3.4 or newer and the following packages installed:

- `sympy <>`_
- `numpy <>`_
- `scipy <>`_
- `matplotlib <>`_
- `networkx <>`_
- `stopit <>`_
- `progressbar2 <>`_
- `nose <>`_ (to run the tests)

Please refer to the `requirements.txt <requirements.txt>`_ file for the minimum
required versions and make sure that these modules are up to date, otherwise it
can result in unexpected errors or false computations!

Additionally, `theano <>`_ is used if available for faster numerical evaluation of symbolic functions.

Finally, the generated `C++` code rely on the `Eigen library <>`_ (see **Configuration** below).

Install from package

The instructions given here should be used if you just want to install the
package, e.g. to run the bundled programs or use some functionality for your
own project. If you intend to change anything within the `pyphs` package,
please follow the steps in the next section.

The easiest way to install the package is via ``pip`` from the `PyPI (Python
Package Index) <>`_::

pip install pyphs

This includes the latest code and should install all
dependencies automatically. If this is not the case, each dependency can be install the same way with ``pip``.

You might need higher privileges (use su or sudo) to install the package globally. Alternatively you can install the package locally
(i.e. only for you) by adding the ``--user`` argument::

pip install --user pyphs

Install from source

If you plan to use the package as a developer, clone the Git repository::

git clone --recursive

Then you can simply install the package in development mode::

python develop --user

To run the included tests::

python test


After installation, it is recommanded to configure the ` </pyphs/>`_ to your needs. Particularily, this is where the local path to the `Eigen library <>`_ is specified (and then included in the generated C++ code).

Your local ` </pyphs/>`_ file is located at the root of the `pyphs` package, which can be recovered with:

>>> import pyphs
>>> help(pyph)

Upgrade of existing installations

To upgrade the package, please use the same mechanism (pip vs. source) as you
did for installation. If you want to change from package to source, please
uninstall the package first.

Upgrade a package

Simply upgrade the package via pip::

pip install --upgrade pyphs [--user]

If some of the provided programs or models changed (please refer to the
CHANGELOG) you should first uninstall the package and then reinstall::

pip uninstall pyphs
pip install pyphs [--user]

Upgrade from source

Simply pull the latest sources::

git pull

Package structure

The package has a very simple structure, divided into the following folders:

`/docs <docs>`_
package documentation
`/pyphs/tutorials </pyphs/tutorials>`_
tutorials programs for the main `pyphs classes
`/pyphs/examples </pyphs/examples>`_
additional examples (executable programs)
`/pyphs/core </pyphs/core>`_
define the core PHS structure class `PHSCore`
`/pyphs/graphs </pyphs/graphs>`_
define the classes `PHSNetlist` and `PHSGraph`
`/pyphs/dictionary </pyphs/dictionary>`_
components (`PHSGraph`)
`/pyphs/numerics </pyphs/numerics>`_
define the classes `PHSEval`, `PHSNumericalMethod` and `PHSNumericalCore` for the numerical evaluation of `PHSCore`
`/pyphs/simulations </pyphs/simulations>`_
define the classes `PHSSimulation` and `PHSData` for simulation
`/pyphs/latex </pyphs/latex>`_
LaTeX code generation
`/pyphs/cpp </pyphs/cpp>`_
C++ code generation
`/pyphs/tests </pyphs/tests>`_
test programs (withe `nose`)
`/pyphs/plots </pyphs/plots>`_
Plot tools
`/pyphs/misc </pyphs/misc>`_
Miscelaneous tools


* See the `website <>`__.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyphs, version
Filename, size File type Python version Upload date Hashes
Filename, size pyphs- (88.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page