What type of differential equation system is this ? And how to solve them?

190 Views Asked by At

I need to solve an equation system that is defining flows and pressures in cardiovascular system. As you can see 10 of them are algebraic and 14 of them are differential equations. I am planing to use scipy.odeint for numerical solution. I tried 2 different ways:

Firstly I differentiated the algebraic ones which are $\begin{align} x_2,x_4,x_6,x_8,x_9,x_{10},x_{11},x_{12},x_{18} \end{align}$ $\begin{align}x_{24}\end{align}$. But didn't pursue that way because $\begin{align} x'_9,x'_{10},x'_{11},x'_{12} \end{align}$ were piecewise functions and couldn't find out how to implement all those coupled equations.

Secondly some guy from stackoverflow told that those equations form a differential algebraic equation system. As far as I learned from internet, in a dae system you must have algebraic constraint equations for all unknown variables. From $\begin{align} x_2 \end{align}$ I can get a constraint equation for $\begin{align} x_1 \end{align}$ such that $\begin{align} x_1 &= V_{lv0} + ((x_2-P_{lv0})/(e_{lv}t))\end{align}$ But again I am not sure I would be succesfull if I follow that way. Because there are not constraints for all unknowns.

So , could someone suggest me a way to solve these equations? Or at least what kind of equations are those ? Or are there some explanatory sources for such problems ? Thanks in advance.

$\begin{align} x'_1 &= x'_2-x'_9 \\ x_2 &= P_{lv0}+e_{lv}(t)(x_1 -V_{lv0})\\ x'_3 &= x'_{11}-x'_{10} \\ x_4 &= P_{rv0}+e_{rv}(t)(x_3 -V_{rv0})\\ x'_5 &= x_{24}-x_{12}\\ x_6 &= P_{la0}+e_{la}(t)(x_5 -V_{la0})\\ x'_7 &= x_{18}-x_{11}\\ x_8 &= P_{ra0}+e_{ra}(t)(x_7 -V_{ra0})\\ x_9 &= \left\{ \begin{array}{ll} cqao(x_2-x_{13})^{(0.5)} & x_2\ge x_{13}\\ 0, & x_2\lt x_{13} \end{array} \right.\\ x_{10} &= \left\{ \begin{array}{ll} cqpo(x_2-x_{13})^{(0.5)} & x_4\ge x_{19}\\ 0, & x_4\lt x_{19} \end{array} \right.\\ x_{11} &= \left\{ \begin{array}{ll} cqti(x_8-x_4)^{(0.5)} & x_8\ge x_{4}\\ 0, & x_8\lt x_{4} \end{array} \right.\\ x_{12} &= \left\{ \begin{array}{ll} cqmi(x_6-x_{2})^{(0.5)} & x_6\ge x_{2}\\ 0, & x_6\lt x_{2} \end{array} \right.\\ x'_{13} &=csas^{-1}(x_9-x_{20})\\ x'_{14} &=lsas^{-1}(x_{13}-x_{15}-rsas(x_{14}))\\ x'_{15} &=csat^{-1}(x_{14}-x_{16})\\ x'_{16} &=lsat^{-1}(x_{15}-x_{17}-(rsat+rsar+rscp)(x_{16}))\\ x'_{17} &=csvn^{-1}(x_{16}-x_{18})\\ x_{18} &=rsvn^{-1}(x_{17}-x_{8})\\ x'_{19} &=cpas^{-1}(x_{10}-x_{22})\\ x'_{20} &=lpas^{-1}(x_{19}-x_{21}-rpas(x_{20}))\\ x'_{21} &=cpat^{-1}(x_{20}-x_{22})\\ x'_{22} &=lpat^{-1}(x_{21}-x_{23}-(rpat+rpar+rpcp)(x_{22}))\\ x'_{23} &=cpvn^{-1}(x_{22}-x_{24})\\ x_{24} &=rpvn^{-1}(x_{23}-x_{6})\\ \end{align}$

($\begin{align} e_{lv}(t),e_{rv}(t),e_{la}(t),e_{ra}(t) \end{align}$ are all well defined piecewise sinusoidal functions, four letters and variables with suffix 0 are all constants which are coefficients or values of model components)

The schematic of simplified model The model is comprised of 3 main modules: Heart, Systemic Circulation and Pulmonary Circulation. Each submodel has its own pressure and flow variables. In order to simplify them I changed all the unknown variable names with x. For example $\begin{align} x'_1 \end{align}$ is actually the differentiation of left ventricle volume according to time: $\begin{align} dV_{lv}(t)/dt \end{align}$