riccati matrix - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

DEtools

 matrix_riccati
 solve a Matrix Riccati differential equation

 Calling Sequence matrix_riccati(A, K, Z0, t) matrix_riccati(A, K, Z0, t=t0) matrix_riccati(A, K, t) matrix_riccati(A, K, t=t0)

Parameters

 A, K - Matrix coefficients of the Riccati Matrix Equation Z0 - Matrix representing the initial conditions for t=t0 t - independent variable t0 - position of initial conditions

Description

 • The Matrix Riccati differential equation is

$Z\text{'}\left(t\right)=Z\left(t\right)·A\left(t\right)·Z\left(t\right)+Z\left(t\right)·K\left(t\right)+\mathrm{transpose}\left(K\left(t\right)\right)·Z\left(t\right)$

 with

$Z\left(\mathrm{t0}\right)=\mathrm{Z0}$

 where $Z,A,K$, and $\mathrm{Z0}$ are n by n matrices. matrix_riccati returns the solution, $Z$.
 • The command with(DEtools,matrix_riccati) allows the use of the abbreviated form of this command.

Examples

 > $\mathrm{with}\left(\mathrm{DEtools}\right):$

The unknowns are $x\left(t\right),y\left(t\right)$

 > $Z≔\mathrm{Matrix}\left(\left[\left[x\left(t\right),y\left(t\right)\right],\left[y\left(t\right),-x\left(t\right)\right]\right]\right)$
 ${Z}{≔}\left[\begin{array}{cc}{x}{}\left({t}\right)& {y}{}\left({t}\right)\\ {y}{}\left({t}\right)& {-}{x}{}\left({t}\right)\end{array}\right]$ (1)

A simple example would be

 > $A≔\mathrm{Matrix}\left(\left[\left[-t,1\right],\left[1,t\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{cc}{-}{t}& {1}\\ {1}& {t}\end{array}\right]$ (2)
 > $K≔\mathrm{Matrix}\left(\left[\left[c,0\right],\left[0,c\right]\right]\right)$
 ${K}{≔}\left[\begin{array}{cc}{c}& {0}\\ {0}& {c}\end{array}\right]$ (3)

The matrix with the initial values $x\left({t}_{0}\right)$ and $y\left({t}_{0}\right)$ is

 > $\mathrm{Z0}≔\mathrm{Matrix}\left(\left[\left[\mathrm{_C1},\mathrm{_C2}\right],\left[\mathrm{_C2},-\mathrm{_C1}\right]\right]\right)$
 ${\mathrm{Z0}}{≔}\left[\begin{array}{cc}{\mathrm{_C1}}& {\mathrm{_C2}}\\ {\mathrm{_C2}}& {-}{\mathrm{_C1}}\end{array}\right]$ (4)

The system of equations represented by these matrices is thus

 > $\mathrm{sys}≔\mathrm{map}\left(\mathrm{diff},Z,t\right)=Z·A·Z+Z·K+{K}^{\mathrm{%T}}·Z$
 ${\mathrm{sys}}{≔}\left[\begin{array}{cc}\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{x}{}\left({t}\right)& \frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({t}\right)\\ \frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({t}\right)& {-}\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{x}{}\left({t}\right)\end{array}\right]{=}\left[\begin{array}{cc}\left({-}{x}{}\left({t}\right){}{t}{+}{y}{}\left({t}\right)\right){}{x}{}\left({t}\right){+}\left({x}{}\left({t}\right){+}{y}{}\left({t}\right){}{t}\right){}{y}{}\left({t}\right){+}{2}{}{x}{}\left({t}\right){}{c}& \left({-}{x}{}\left({t}\right){}{t}{+}{y}{}\left({t}\right)\right){}{y}{}\left({t}\right){-}\left({x}{}\left({t}\right){+}{y}{}\left({t}\right){}{t}\right){}{x}{}\left({t}\right){+}{2}{}{y}{}\left({t}\right){}{c}\\ \left({-}{y}{}\left({t}\right){}{t}{-}{x}{}\left({t}\right)\right){}{x}{}\left({t}\right){+}\left({-}{x}{}\left({t}\right){}{t}{+}{y}{}\left({t}\right)\right){}{y}{}\left({t}\right){+}{2}{}{y}{}\left({t}\right){}{c}& \left({-}{y}{}\left({t}\right){}{t}{-}{x}{}\left({t}\right)\right){}{y}{}\left({t}\right){-}\left({-}{x}{}\left({t}\right){}{t}{+}{y}{}\left({t}\right)\right){}{x}{}\left({t}\right){-}{2}{}{x}{}\left({t}\right){}{c}\end{array}\right]$ (5)

The two coupled odes are

 > $\mathrm{ode}\left[1\right]≔\mathrm{lhs}\left(\mathrm{sys}\right)\left[1,1\right]=\mathrm{rhs}\left(\mathrm{sys}\right)\left[1,1\right]$
 ${{\mathrm{ode}}}_{{1}}{≔}\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{x}{}\left({t}\right){=}\left({-}{x}{}\left({t}\right){}{t}{+}{y}{}\left({t}\right)\right){}{x}{}\left({t}\right){+}\left({x}{}\left({t}\right){+}{y}{}\left({t}\right){}{t}\right){}{y}{}\left({t}\right){+}{2}{}{x}{}\left({t}\right){}{c}$ (6)
 > $\mathrm{ode}\left[2\right]≔\mathrm{lhs}\left(\mathrm{sys}\right)\left[1,2\right]=\mathrm{rhs}\left(\mathrm{sys}\right)\left[1,2\right]$
 ${{\mathrm{ode}}}_{{2}}{≔}\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({t}\right){=}\left({-}{x}{}\left({t}\right){}{t}{+}{y}{}\left({t}\right)\right){}{y}{}\left({t}\right){-}\left({x}{}\left({t}\right){+}{y}{}\left({t}\right){}{t}\right){}{x}{}\left({t}\right){+}{2}{}{y}{}\left({t}\right){}{c}$ (7)

The matrix solution to this matrix system of equations with initial conditions $\mathrm{Z0}$ at ${t}_{0}=0$ is computed as:

 > $\mathrm{matrix_sol}≔\mathrm{matrix_riccati}\left(A,K,\mathrm{Z0},t=0\right):$

Recalling the form of $Z$, the solution to the system of odes is constructed from $\mathrm{matrix_sol}$ as

 > $\mathrm{sol}≔\left\{x\left(t\right)=\mathrm{matrix_sol}\left[1,1\right],y\left(t\right)=\mathrm{matrix_sol}\left[1,2\right]\right\}$
 ${\mathrm{sol}}{≔}\left\{{x}{}\left({t}\right){=}\frac{{4}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}{}{\mathrm{_C1}}{}{{c}}^{{2}}{+}{4}{}{{\mathrm{_C1}}}^{{2}}{}{{c}}^{{2}}{+}{4}{}{{\mathrm{_C2}}}^{{2}}{}{{c}}^{{2}}{+}{16}{}{\mathrm{_C2}}{}{{c}}^{{3}}{+}{16}{}{{c}}^{{4}}{-}{2}{}{{ⅇ}}^{{2}{}{t}{}{c}}{}{{\mathrm{_C1}}}^{{2}}{-}{2}{}{{ⅇ}}^{{2}{}{t}{}{c}}{}{{\mathrm{_C2}}}^{{2}}{+}{8}{}{\mathrm{_C1}}{}{{c}}^{{2}}{+}{{\mathrm{_C1}}}^{{2}}{+}{{\mathrm{_C2}}}^{{2}}}\right\}$ (8)

This result can be verified with odetest

 > $\mathrm{odetest}\left(\mathrm{sol},\left[\mathrm{ode}\left[1\right],\mathrm{ode}\left[2\right]\right]\right)$
 $\left[{0}{,}{0}\right]$ (9)