# State variable

A **state variable** is an element of the set of variables that describe the state of a dynamical system.

In case of simple mechanical systems, position coordinates and their derivates are typical state variables. Temperature, pressure, internal energy, enthalpy, entropy are examples of state variables in a thermodynamics system.

## Control Systems Engineering

In Control Engineering and other areas of science and engineering, state variables are used to represent the states of a general system. The state variables can be used to describe the state space (controls) of the system. The equations relating the current state and output of a system to its current input and past states are called the state equations. The state equations for a linear time invariant system are expressed with Coefficient matrices:

<math>A\,\!</math> existing in dimension **R**^{N*N}

<math>B\,\!</math> existing in dimension **R**^{N*L}

<math>C\,\!</math> existing in dimension **R**^{M*N}

<math>D\,\!</math> existing in dimension **R**^{M*L}

#### Discrete-Time Systems

The state variable representing the current state of a discrete-time system (i.e. digital systems) is <math>x(n)\,</math>, where n is the discrete point at which the system is being evaluated. The discrete-time state equations are

- <math> x(n+1) = Ax(n) + Bu(n)\,\!</math> , which describes the next state of the system (x(n+1)) with respect to current state and inputs u(n) of the system.

- <math> Y(n) = Cx(n) + Du(n)\,\!</math> , which describes the output Y(n) with respect to current states and inputs u(n) to the system.

#### Continuous Time Systems (Analog)

The state variable representing the current state of a continuous-time system (i.e. analog systems) is <math>x(t)\,</math>, and the continuous time state equations are

- <math> \frac{dx(t)}{dt} \ = Ax(t) + Bu(t)\,\!</math> , which describes the next state of the system <math> \frac{dx(t)}{dt} \,\!</math> with respect to current state x(t) and inputs u(t) of the system.

- <math> Y(t) = Cx(t) + Du(t)\,\!</math> , which describes the output Y(t) with respect to current states x(t) and inputs u(t) to the system.