# `daetools`::`reduceDifferentialOrder`

Reduce systems of higher-order differential equations to systems of first-order differential equations

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

## Syntax

```[`newEqs`,`newVars`,`R`] := daetools::reduceDifferentialOrder(`eqs`,`vars`)
```

## Description

`[newEqs,newVars,R] := daetools::reduceDifferentialOrder(eqs,vars)` rewrites a system of higher-order differential equations `eqs` as a system of first-order differential equations `newEqs` by substituting derivatives in `eqs` with new variables. It also returns the matrix `R` that expresses the new variables in `newVars` as derivatives of the original variables `vars`. Here, `newVars` consists of the original variables `vars` augmented with these new variables.

## Examples

### Example 1

Reduce a system containing a second- and a third-order expression to a system containing only first-order DAEs, and return a matrix that expresses the variables generated by `daetools::reduceDifferentialOrder` via the original variables of this system.

Create the following system of differential equations, which includes a second- and a third-order expression. Here, `x(t)` and `y(t)` are state variables of the system.

```eqs := [diff(x(t),t,t) = diff(f(t),t,t,t), diff(y(t),t,t,t) = diff(f(t),t,t)]; vars := [x(t), y(t)]```
` `
` `

Rewrite this system so that all equations become first-order differential equations. The `daetools::reduceDifferentialOrder` function replaces the higher-order DAE with first-order equations by introducing the new variables `Dxt(t)`, `Dyt(t)`, and `Dytt(t)`. This function returns a nested list containing the following three lists: a list of new equations, a list of new variables, and a list of relations between the new and the original variables. Display `newEqs`, `newVars`, and `R` separately.

```[newEqs, newVars, R] := daetools::reduceDifferentialOrder(eqs, vars): newEqs; newVars; R```
` `
` `
` `

## Parameters

 `eqs` A list or a vector of equations or expressions in the state variables `vars` and their derivatives. Expressions represent equations with `0` right side. `vars` A list or a vector of identifiers or expressions, such as ```[x1(t), x2(t)]```.

## Return Values

A nested list containing the following three lists: a list of new equations, a list of new variables, and a list of relations between the new and the original variables.

#### Mathematical Modeling with Symbolic Math Toolbox

Get examples and videos