Ordinary Differential Equations – How to solve numerically ODE modeling tumor growth?

mathematical modelingnumerical methodsordinary differential equations

I am trying to reproduce an experiment on tumor growth using a model with a differential equation. I am following a paper that models the tumor growth as

$\frac{dx}{dt} = g(x)$

$x(0) = N_0$

They use for $g(x)$ the following function:

$g(x) = ax ln(\frac{b}{x})$ (1) (Gompertzian growth)

where $a$, $b$ and $N_0$ are some known and fixed values. $a$ is the growth rate constant, $b$ id the maximum size of the tumor and $N_0$ is the initial size of the tumor. In this case $N_0=1$.

So, they state that integrating equation $g(x)$ over x and applying boundary condition $x(0) = 1$ you get:

$x(t) = b(\frac{b}{N_0})^{-e^{-at}}$ (2)

that means the "number of cells (size) in tumor on time $t$".

Well, I am using numerical methods to solve Ordinary Differential Equations. For simplicity let us say Euler's Method. If I use Euler's method to solve the equation and compare it to exact solution (which I understand is Equation 1) I do not get close enough solutions.

Picture
(In BLUE the "exact solution they state", in GREEN solution of Euler's method, GREEN is not completely flat. But not close to the values of the BLUE)

Also, I used a MATLAB to integrate equation 1 and got

$x(t) = a (\frac{ln(\frac{b}{t})t^2}{2} + \frac{t^2}{4})$

And when compare this to my results they make sense. However the values of $y$ are not the one they mention on the paper, of course, they are using the Eq. 1.

enter image description here

Well. Am I not understanding correctly the differential equation? Is the Eq.2 a correct integration over Eq. 1?

Can someone explain what am I doing wrong? (if something)

What Should I Do?

Thanks in advance

Best Answer

You can derive their analytic expression by first taking the growth rate as a composite function of time, $(g\circ x)(t)$, and using this to derive the tumor cell number function, $x(t)$. I'm using this notation as opposed to $g(x)$ to emphasise that $x$ is also a function of time.

$$\begin{align}\frac{\mathrm{d}x(t)}{\mathrm{d}t}&=(g\circ x)(t) \\ \end{align}$$

Using the assumption that the growth rate is Gompertzian, $(g\circ x)(t)=ax(t)\ln\left(\frac{b}{x(t)}\right)$, with constants, $a,b\in\mathbb{R}$, we can plug this into the previous equation to get $\displaystyle \frac{\mathrm{d}x(t)}{\mathrm{d}t}=ax(t)\ln\left(\frac{b}{x(t)}\right)$. Shift all $x(t)$ terms to one side (LHS) and all $t$ terms to the other. Then integrate wrt. $t$ and use the fundamental theorem of calculus to deal with the derivative term.

$$ \begin{align}&\frac1{x(t)\ln\left(\frac{b}{x(t)}\right)}\frac{\mathrm{d}x(t)}{\mathrm{d}t}=a \\ &\int \frac1{x(t)\ln\left(\frac{b}{x(t)}\right)}\frac{\mathrm{d}x(t)}{\mathrm{d}t}\,\mathrm{d}t=\int a\,\mathrm{d}t \\ &\int \frac1{x(t)\ln\left(\frac{b}{x(t)}\right)}\,\mathrm{d}x(t)=at+C \end{align}$$

Then, since $\displaystyle \int \frac{1}{u\ln(b/u)}\,\mathrm{d}u=-\ln\ln\frac{b}{u}+C$, we have $\displaystyle -\ln\ln\frac{b}{x(t)}=at+C$ and therefore,

$$ x(t)=b\exp\left(-\exp\left(-\left(at+C\right)\right)\right)$$

setting $x(0)=N_0$ and solving for $C=-\ln\ln\left(\frac{b}{N_{0}}\right)$ shows that this agrees with the solution of the paper and intuitively makes sense since we'd expect the curve to be sigmoidal. The paper was slightly disingenuous when it suggested that you integrate wrt. $x$, since there was some preceding algebra that you'd have needed to do, and it's sort of an integration wrt. $t$ in disguise. Your solution of $a\left(\frac{\ln\left(\frac{b}{x}\right)x^{2}}{2}+\frac{x^{2}}{4}\right)$ suggests that you were integrating $g$ outright wrt. $x$ without taking this into account. If you do this, you get an expression for $\displaystyle \int \frac{\mathrm{d}x(t)}{\mathrm{d}t}\,\mathrm{d}x $, which doesn't help much since we essentially want the differentials to cancel. We can also see that it was intuitively wrong, since it exploded to $-\infty$ with large $t$.


To approach the problem numerically with Euler's method, we have a system defined by $\dfrac{\mathrm{d}x}{\mathrm{d}t}=g(x),\ x(0)=N_0$ with the Gompertz function mentioned earlier. This can be given an approximate solution $\big((0,N_0),(h,y_1),(2h,y_2),\ldots,(nh,y_n)\big)$ where $y_{n+1}=y_n+hg(y_n)$ and $y_0=N_0$. The error of the function at each point could be defined as $\varepsilon=|y_i-x(ih)|$ using the known solution $x(t)$. The figure below shows the approximate solution you'd get for the curve defined by the parameters $a=1,b=2,N_0=0.1$, using points of $h=1.5$.

enter image description here

Related Question