I have a weird equation that I want to solve,
$$\frac{d M} {dt} = \kappa \hspace{1mm} \max(0,(M_1-M) -\gamma I )$$
where, $M, M_1, I$ are all $2 \times 2$ matrices. With the $\max$ function I want to make sure the matrix $M$ does not shrink or become smaller, so the $\max$ condition I am imagining is that the condition for the argument matrix to be positive definite.
We have a matrix differential equation in $\mathrm X \in \mathbb R^{m \times n}$
$$\dot{\mathrm X} = \kappa \cdot \max \left( \mathrm O_{m \times n}, \mathrm Y - \mathrm X\right)$$
where $\mathrm Y \in \mathbb R^{m \times n}$ is given. Thus, we have $m n$ ODEs of the form
$$\dot{x}_{ij} = \kappa \cdot \max \left( 0, y_{ij} - x_{ij} \right)$$
or,
$$\dot{x}_{ij} = \begin{cases} \kappa \left( y_{ij} - x_{ij} \right) & \text{if } x_{ij} < y_{ij}\\ 0 & \text{if } x_{ij} \geq y_{ij}\end{cases}$$
If $\color{blue}{x_{ij} (0) < y_{ij}}$, then
$$x_{ij} (t) = y_{ij} + \left( x_{ij} (0) - y_{ij} \right) \, \exp(- \kappa \,t)$$
If $\color{blue}{x_{ij} (0) \geq y_{ij}}$, then
$$x_{ij} (t) = x_{ij} (0)$$