1
$\begingroup$

So I have a differential equation :

$\left\{\begin{split} & c'(t) = \alpha q(t) c(t)^{2/3} - \beta(1 - q(t))c(t)\\ &\chi'(t) = \kappa c(t) q(t) \\ & q(t) = \int_{-\infty}^t \Big( \frac{\chi(u)}{\chi(u) + \chi_c}e^{-(t-u)/t0}\Big)du\end{split} \right.$

I wrote the following DDE :

alpha = 0.1
beta = 0.1
kappa = 0.1
t0 = 0.5
chic = 1/2


sol = NDSolve[{c'[t] == alpha*c[t]^(2/3)*q[t] - beta*(1 - q[t])*c[t], 
   chi'[t] == kappa*c[t]*q[t], 
   q[t] == Integrate[
     chi[u]/((chi[u] + chic))*Exp[-(t - u)/t0], {u, -5, t}], 
   q[0] == 1/2, chi[t /; t <=  0] == 1/2*(Tanh[-t*10]), 
   c[t /; t <= 0] == 20}, {c, chi}, {t, 0, 14}]


But I'm getting those errors :

Item 2 requested in "Delayed time 1 = 2 computed at 3 = 4 did not evaluate to a real number." out of range; 1 items available.

General::stop: Further output of StringForm::sfr will be suppressed during this calculation.

NDSolve::rdelay: Delayed time u = 2 computed at 3 = 4 did not evaluate to a real number.

I don't understand what it means. Could you explain the erros plz ? And how to fix it ?

Thx

$\endgroup$

1 Answer 1

6
$\begingroup$

If you write the third integral equation as a differential equation, it will work:

sol = NDSolve[{
      c'[t] == alpha * c[t]^(2 / 3) * q[t] - beta * (1 - q[t]) * c[t], 
      chi'[t] == kappa * c[t] * q[t], 
      q'[t] + q[t] / t0 == chi[t] / ((chi[t] + chic)),
      q[0] == 1/2, 
      chi[t /; t <= 0] == 1 / 2 * (Tanh[- t * 10]),
      c[t /; t <= 0] == 20
      }, 
      {c, chi}, {t, 0, 14}
   ]
$\endgroup$
2
  • $\begingroup$ Thanks that's a good idea $\endgroup$
    – J.A
    Commented May 23, 2019 at 14:28
  • $\begingroup$ You're welcome! $\endgroup$
    – Louis Yu
    Commented May 23, 2019 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.