System Dynamics packages

Continuing the discussion from this post in 1.0 adoption path?:

System dynamics ecosystem in julia needs coordination and development efforts. If anybody wants to discuss in this post I am kind of interested too. @jlperla @BLI @ChrisRackauckas

One question: Is Modia.jl still supposed to become available?

3 Likes

You should also bring in @Ronis_BR and @aytekinar who have already built packages in this direction

https://github.com/ronisbr/ControlToolbox.jl

https://github.com/JuliaSystems/LTISystems.jl

https://github.com/JuliaSystems/ControlToolbox.jl

I don’t plan on building system modeling packages, but like with those two I am willing to answer any questions and add features you need to DifferentialEquations.jl to get you where you need to go with any simulation aspects.

3 Likes

Sounds great. I am not the type to write the package (as my own research doesn’t use this stuff directly) , but can bring the relevant players from economics to the table for a discussion.

My guess is that it is better to wait for the v0.7 release (or at least a beta if it, if they was intended) before getting rallying the troops

Thank you @ChrisRackauckas , we should bring in evreybody that is interested in order to understand what is it possible to do.

My last usecase was simulating some closed loop control systems (non linear), but by connecting the differential equations of each part of the system the problem become easily a DAE to build manually. The process cannot be made automated/programmatic because we lack some tooling and algorithms (similar to what Modia.jl uses) like pantelides algorithm.
Does anybody know if there is an approach of handling this problem without going entirely in a modelica style environment?

I hope that DiffEqDSL, the next iteration of the DifferentialEquations.jl DSL, can represent DAEs and do the Pantelides algorithm (and I am trying to get a GSoC student for this). So if you can generate the DAEs then I plan to have the stuff related to simplification and solving.

1 Like

Last I heard, Modia is still being developed. See the end of this thread: https://github.com/ModiaSim/Modia.jl/pull/6

2 Likes

Good! I am very interested since I do a lot of dynamic simulation using julia.

Good initiative to collect discussion in “System Dynamics packages”. To me, tools such as the DifferentialEquations package is essential to “sell” Julia to control engineers (like myself :slight_smile: ). However, tools such as Modia would be great for reuse of models and building libraries.

Currently, many control engineers use MATLAB – which has a number of great and well documented toolboxes for control analysis/design. Python, on the other had is relatively starved with control packages, and because of that relatively few control engineers use Python. Mathematica and Maple have some packages.

A basic control package should probably include methods for extracting linear approximations of models (inputs are typically denoted “u”, states and more generally: descriptors are denoted “x”, and outputs are typically denoted “y” – don’t know whether there is a conflict with DifferentialEquations package and use of “u” for unknown…). In order to progress from the LTI model of MATLAB, why not generalize the LTI model to include linear DAEs and PDEs? (Time delay is simply the solution of the advection PDE – many more forms can be included by having general linear PDEs…). A basic package should then allow:

  • Block diagram manipulation (tricky with PDEs?)
  • Solution of the LTI (step response, impulse response – could use DifferentialEquations package)
  • Frequency response presentation (AFF, Nyquist, Nichols) from transfer matrices (elementwise, max singular value, etc.)
  • Model reduction (discretization of PDEs, order reduction, etc.)
  • Poles and zeros
  • Basic control design

In addition to extracting LTIs from DifferentialEquations and Modia type tools, why not automate the extraction of (di)graph representation? This is very useful for analysis of structured controllability and observability analysis – comes in handy for large scale problems (national energy grids, etc.).

Linear models can also be useful for more advanced control packages (Linear Systems Theory studies such as Smith/Smith-McMillan form, Kalman decomposition, etc., work on Matrices of Polynomials, etc., Geometric control theory, etc.).

OK – this is just a start of what can be done. Much can be done by integrating optimization tools. Linear Matrix Inequalities. Other robust design tools. Optimal Control is already utilizing integration with DifferentialEquations, I think (NLOptControl) – similar ideas exist in the Modelica community, with an extension of model classes with Optimica (could become part of Modia?) There is a lot of possibilities within nonlinear control theory. Can tools be developed based on macros, etc.? What about identifiability analysis? Etc.

What about good tools to handle time series/experimental data? I’m sure tools from other domains of Julia can be used. What about “LabVIEW”-like tools for presenting user interfaces? APIs for reading from instruments/logging cards? (Possibility to use National Instruments logging cards, connected to a computer via USB connectors? Etc.)

Anyway, it is encouraging to see several initiatives related to control packages. It is natural that these are partially “competing” at this early stage; I think this boosts creativity. At some stage, it is probably smart to end up with some LTI model form, and then use this as a platform for other tools. Of course, it is possible to use the tried and true MATLAB structure. But why not – at least – consider more general forms?

OK – these were some “rambling” thoughts. Myself, I’m an “engineer” and more of a user than a coder. But I’d be willing to contribute in development of ideas, testing of tools, and documentation. (And perhaps some development.)

1 Like

Systems.jl is an ongoing collaboration to define abstractions for mathematical models of systems. One goal is to handle uncertain parameters and non-deterministic inputs. Hybrid systems modeling is also high on the list albeit through more specific packages.

1 Like

In this sense, Modelon the company developing Jmodelica is actually seeking a student to work upon FMI integration with Julia.

I quote :

FMI bindings for the Julia language

The Functional Mockup Interface (FMI) represents a common language for model
exchange between many modelling and simulation environments. It describes how
FMUs, models that have been compiled into binary code, can be used to simulate
components within a larger system.

The aim of this thesis project is to implement initial support for working with
FMUs in the open source Julia programming language. Julia is a high-level, high-
performance dynamic programming language for technical computing, which is
gaining increasing attention for its execution speed and expressiveness. The
existing PyFMI Python package already provides similar functionality for working
with FMUs, and can inform the design, but there will be a need to rethink the
design in terms of Julia’s programming paradigm.

The basis of the project will be to create a Julia package with Julia bindings
(with the aid of a wrapper generator) to FMI Library, a C library for loading
and low level access to FMUs. These bindings will then be used to implement FMU
simulation functionality in Julia by interfacing to existing solvers. Developed
functionality will be hosted as one or more open source Julia packages on
github.com.

Student profile: Two skilled and highly motivated students with interest in
numerical algorithms, programming and new programming languages. Prior knowledge
of C, Python and Julia is considered a merit, but is not mandatory.

Contact: Labinot Polisi, Modelon AB

From http://www.modelon.com/fileadmin/user_upload/pdf/Modelon_SORD_Master_Theses_2017-11.pdf

2 Likes

It seems a prerelease of Modia is finally uploaded to https://github.com/ModiaSim/Modia.jl

5 Likes

Just tested the Modia package. It looks really nice! :smile:

Only little problem I found was the missing dependancy on SIUnits.

2 Likes

There is another package for control

https://github.com/JuliaControl/ControlSystems.jl