## Solve Riccati Differential Equation (solve_riccati_ode)

version 3.1.0 (240 KB) by
Solves the Riccati differential equation for the finite-horizon linear quadratic regulator.

Updated 8 Dec 2022

From GitHub

# solve_riccati_ode

Solves the Riccati differential equation for the finite-horizon linear quadratic regulator.

NOTE: This function requires the IVP Solver Toolbox.

## Syntax

[t,P] = solve_riccati_ode(A,B,Q,R,[],PT,tspan)
[t,P] = solve_riccati_ode(A,B,Q,R,S,PT,tspan)

## Description

[t,P] = solve_riccati_ode(A,B,Q,R,[],PT,tspan) solves the Riccati differential equation for , given the state matrix , input matrix , state weighting matrix , input weighting matrix , terminal condition , and the time span tspan over which to solve. tspan can be specified either as the 1×2 double [t0,T] where is the initial time and is the final time, or as a 1×(N+1) vector of times [t0,t1,...,tNminus1,T] at which to return the solution for . It is assumed that the cross-coupling weighting matrix is .

[t,P] = solve_riccati_ode(A,B,Q,R,S,PT,tspan) does the same as the syntax above, but this time the cross-coupling weighting matrix is specified.

## Time Vector and Solution Array

The time vector, , is defined as

The ith "layer" of P (i.e. P(:,:,i)) stores , where is the time stored in the ith element of the time vector, .

• See "EXAMPLES.mlx" or the "Examples" tab on the File Exchange page for examples.

### Cite As

Tamas Kis (2022). Solve Riccati Differential Equation (solve_riccati_ode) (https://github.com/tamaskis/solve_riccati_ode-MATLAB/releases/tag/v3.1.0), GitHub. Retrieved .

##### MATLAB Release Compatibility
Created with R2021b
Compatible with any release
##### Platform Compatibility
Windows macOS Linux