GithubHelp home page GithubHelp logo

gallleo / modia.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from modiasim/modia.jl

1.0 1.0 0.0 1.01 MB

Domain Specific Extension of Julia for Modeling and Simulation

License: MIT License

modia.jl's Introduction

Modia

Modia is a domain specific extension of Julia for modeling and simulation of physical systems. The first version of Modia is planned to be uploaded in Summer 2017. Papers about Modia:

Modia is designed to model and simulate physical systems (electrical, mechanical, thermo-dynamical, etc.) described by differential and algebraic equations. A user defines a model on a high level with model components (like a mechanical body, an electrical resistance, or a pipe) that are physically connected together. A model component is constructed by "expression = expression" equations. The defined model is symbolically processed (for example, equations might be analytically differentiated), JIT compiled and simulated with Sundials IDA solver with the KLU sparse matrix package. By this approach it's possible and convenient to build models with hundred thousands of equations describing the dynamics of a car, an airplane, a power plant, etc. and simulate them. The authors used previous experience from the design of the modeling language Modelica. Modia will also be used to design and evaluate features for future Modelica versions.

Component models are defined by @model macros. Such models contain definition of variables with various attributes such as start values, min, max, SI unit, etc. An @equations macro is used to define the equations of such a component. Coupling between components is expressed using a connect statement involving groups of variables. The semantics is either to constrain connected variables to be equal or to constrain a set of variables to sum to zero, for example to model Kirchhoff's current law.

"Hello world" Modia model:

# T*dx/dt + x = u(t)
#
using Modia
@model FirstOrder begin
   x = Variable(start=1)
   T = Parameter(0.5, "Time constant")
   u = 2.0 # Same as Parameter(2.0)
@equations begin
   T*der(x) + x = u
   end
end
result = simulateModel(FirstOrder, linspace(0,2,500))

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.