I have a matrix equation in the form $$ \begin{bmatrix} A(x)\ \end{bmatrix}_{,x} =\frac{\begin{bmatrix} A(x)\ \end{bmatrix}^2}{\begin{bmatrix} B_o\ \end{bmatrix}} +\begin{bmatrix} A(x)\ \end{bmatrix} x+\begin{bmatrix} C_0\ \end{bmatrix} $$
where $A$ is a 2*2 matrix, and $B_0$ & $C_0$ are constant 2*2 matrices. I want to integrate it using Matlab, for the period $$ x_0<x<x_1 $$ where $A(x_1)$ is known, and I want to find $A(x_0)$
I'm using ode45
[xx,A_list]=ode45(@(x,A)(A^2/B0+A*x+C0,[x1 x2],A1);
which has always worked for a scaler equation, but I seem to be missing something when integrating matrix equations. Any suggestions?
This is really a matlab programming problem.
ode45and all the other solvers only work for flat arrays. You will need to wrap your formula in a duo of reshaping operations.(untested) should work or at least give more interesting error messages.