creates a Modelica SystemModel from the systems model sys.


creates a model for the system equations eqns with independent variable t.


creates a model with type specification tspec for variables and parameters.


creates a model with spec for parameter values, initial values and model relations.

Details and Options

  • CreateSystemModel returns SystemModel[].
  • CreateSystemModel["NewModel",] gives the created model the name "NewModel".
  • CreateSystemModel["PackageA.NewModel"] inserts "NewModel" into "PackageA".
  • Possible systems models sys include TransferFunctionModel and StateSpaceModel. »
  • Possible equations eqns include ordinary differential equations (ODE), differential algebraic equations (DAE), initial value equations and event specifications given by WhenEvent. »
  • Parameters in eqns and sys are taken to be variables that do not explicitly depend on t.
  • Type specifications tspecs for variables and parameters {tspec1,}, where each tspeci has the form:
  • paritypeiparameter type typei
    varitypeivariable type typei
  • The types typei can be basic Reals, Integers and Booleans, or any Modelica type including units. »
  • SystemModels["Modelica.SIunits.*","type"] can be used to find built-in standard units.
  • Modelica models are typically built by combining many models into a larger system. The interaction between these models is described by the Modelica concept connector. »
  • A connector consists of effort and flow variables. When connecting multiple connectors, flow variables are summed to 0, while effort variables are set equal.
  • As an example, an electrical circuit connector, commonly called a pin, consists of a voltage variable v and a current variable i.
  • Connecting pins n and p sums the flow variables, in this case currents i, to 0 and sets the efforts, in this case voltages v, equal:
  • All flow variables are positive in the direction flowing into a component.
  • Effort and flow variables for different domains include:
  • DomainEffort VariablesFlow Variables
    electrical circuitsvoltagecurrent
    magnetic circuitsmagnetic potentialmagnetic flux
    translational mechanicspositionforce
    rotational mechanicsangletorque
    3D mechanicsposition vector, orientation objectcut force vector, cut torque vector
    fluid flow systemspressure, specific enthalpymass flow rate, enthalpy flow rate
    heat transfer systemstemperatureheat flow rate
    block diagramsreal, integer, Boolean-
  • Possible connectors conni for a domain are usually defined in an "Interfaces" package. For example, SystemModels["Modelica.Electrical.Analog.Interfaces.*","connector"] can be used to find connectors for the built-in electrical library.
  • The specification variconni can be used to specify that a variable vari refers to a connector of type conni.
  • Variables vi in a connector c can be referred to in eqns with cvi, where the "" character is input as \[UpPointer].
  • The variables defined by a connector conn can be listed with SystemModel[conn,"SystemVariables"].
  • In CreateSystemModel[,spec], spec is an Association with the following keys:
  • "ParameterValues"{p1val1,}start values
    "InitialValues"{v1val1,}parameter values
    "Extends"{partial1,}partial models to build on
  • Libraries often contain partial models called interfaces for building new component models. These interfaces usually consist of connectors and equations describing the basic relationships between them.
  • With CreateSystemModel[,"Extends"partial], the new model is combined with the existing partial SystemModel defined in Modelica. »
  • A model can extend multiple models using "Extends"{"partial1",}.
  • Partial models to build on are usually defined in an Interfaces package. For example, SystemModels["Modelica.Electrical.Analog.Interfaces.*","model"|"block"] can be used to find partial models for the built-in electrical library.
  • "InitialValues" correspond to the start property in the Modelica model.


open all close all

Basic Examples  (3)

Create a model based on a StateSpaceModel:

Click for copyable input

Create a model based on a TransferFunctionModel:

Click for copyable input

Build a model around an existing interface using equations:

Click for copyable input
Click for copyable input

Scope  (31)

Applications  (5)

Properties & Relations  (3)

Possible Issues  (3)

Introduced in 2018