# Modelling module¶

The main component of the HILO-MPC Modelling module is the `Model`

class. For a more detailed
description of the methods refer to the API.

Models are used to describe the dynamics of systems. The HILO-MPC `Model`

class supports the following system properties:

**linear/nonlinear**system dynamics**continuous/discrete**time dynamics**time-invariant/time-variant**systems

In addition to ordinary differential equations (ODEs), systems with continuous time dynamics can also be modelled using differential algebraic equations (DAEs). Systems with discrete time dynamics can be designed analogously. Optionally, measurement equations mapping the states of a model to some measurable quantity of the system can be supplied as well.

Note

Observers usually require measurement equations to be present. If no measurement equations were supplied during model setup the observers will assume that all states can be measured.

A general **time-invariant** **continuous**-time **nonlinear** system can be described by the following DAEs

where \(x\in\mathbb{R}^{n_x}\) is the state vector, \(z\in\mathbb{R}^{n_z}\) the vector of algebraic variables, \(u\in\mathbb{R}^{n_u}\) is the input vector and \(p\in\mathbb{R}^{n_p}\) is a vector of parameters. Since the system is time-invariant only the states \(x\), algebraic variables \(z\) and the input \(u\) depend on the time \(t\). Due to practical reasons the input \(u\) is assumed to be piecewise constant (hence the index \(k\)). The function \(f\colon\mathbb{R}^{n_x+n_z+n_u+n_p}\mapsto\mathbb{R}^{n_x}\) represents the ODEs of the model and the function \(g\colon\mathbb{R}^{n_x+n_z+n_u+n_p}\mapsto\mathbb{R}^{n_z}\) depicts the algebraic equations forming a semi-explicit DAE system overall.

Note

The HILO-MPC `Model`

class only supports semi-explicit DAE systems of index 1. The index of 1 indicates that the DAE system can be transformed into a pure ODE system by differentiating the algebraic equations once.

The function \(h\colon\mathbb{R}^{n_x+n_z+n_u+n_p}\mapsto\mathbb{R}^{n_y}\) describes the measurement equations mapping the states and algebraic variables to some measurable quantities.

In the **time-variant** case the functions \(f\), \(g\) and \(h\) additionally depend explicitly on the time as well

A general **time-invariant** **discrete**-time **nonlinear** system can be described by the following set of equations