# How to solve a matrix PDE and stop solving when solution becomes singular?

My question consists of two parts:

1. How do I get mathematica to solve a PDE Matrix system and plot the result? See below for the PDE matrix system. (By plot the result I mean plot the region where the solution $$\Theta$$ is nonsingular.)
2. How do I stop the integration when the solution matrix becomes singular? I know that away from $$(x_1,x_2)=(0,0)$$ the solution matrix $$\Theta$$ will become singular how do I stop Mathematica from trying to solve pass this point?

The PDE matrix system I am trying to solve is \begin{align} \lambda \Theta(x_1,x_2)&=\dot{\Theta}(x_1,x_2)+\Theta(x_1,x_2)A &\quad \text{Equation}\\ \Theta(0,0)&=\begin{pmatrix} 1 & -\frac{1}{2} -\frac{\sqrt{3}}{2} \\ 1 & -\frac{1}{2}-\frac{1}{2\sqrt{3}}+\frac{2}{\sqrt{3}} \end{pmatrix} &\quad \text{Initial condition} \end{align} I have specified the values of $$\dot{\Theta}(x_1,x_2),A,\lambda$$ in the block below:

(* Definitions *)
A = {{-(x1^2 - 1), -2 x2 x1 - 1}, {1, 0}}
lambda = {{1/2, -Sqrt/2}, {Sqrt/2, 1/2}}
(*Value of theta for x1=x2=0 *)
ThetaInit = {{1, -1/2 - Sqrt/2}, {1, -1/2 - 1/(2 Sqrt) +
2/Sqrt}}
(*Derative of Theta in terms of t. Note \
\frac{dtheta}{dt}=x1'(t)\frac{\partial theta}{\partial x1}+x2'(t) \
\frac{\partial theta}{\partial x2} *)
ThetaDot = ( -(x1^2 - 1) x2 - x1) D[Theta[x1, x2], x1] +
x2 D[Theta[x1, x2], x2]


Note the initial condition is satisfied as

lambda.ThetaInit == ThetaDot + ThetaInit.A /. {x1 -> 0, x2 -> 0}


yields true.

Notes

• Because people where confused $$\dot{\Theta}(x_1,x_2)=( -(x_1^2 - 1) x_2 - x_1) \frac{\partial \Theta}{\partial x_1}+ x_2 \frac{\partial \Theta}{\partial x_2}$$
• How do you calculate $x_1'(t)\frac{\partial \theta}{\partial x_1}+x_2'(t) \ \frac{\partial \theta}{\partial x_2}$? – xzczd Dec 3 at 6:00
• Over what region in {x1, x2}do you wish a solution, and what are the boundary conditions for this region? It seems unlikely that specifying Theta[0, 0] is sufficient. – bbgodfrey Dec 3 at 6:24
• Unless, that is, you wish only solutions lying along a characteristic curve passing through {0, 0}. Please clarify. – bbgodfrey Dec 3 at 6:36
• lambda.ThetaInit == (ThetaDot + A) /. {x1 -> 0, x2 -> 0} yields False. In other words, ThetaInit does not satisfy the matrix PDE at {0, 0}. – bbgodfrey Dec 3 at 15:11
• @xzczd $x'_1(t),x'_2(t)$ are given in my post. $\frac{\partial \Theta}{\partial x_1}$ is a matrix. $\Theta$ is what needs to be solved. – AzJ Dec 3 at 16:03