2
$\begingroup$

While trying to solve a system of coupled ODEs (for EVE[t] and FTZ[t]) with Manipulate, I keep getting a tremendous amount of errors, but I can't figure out why... among them, I get "NDSolve::ndnum: Encountered non-numerical value for a derivative at t == 0.", "ReplaceAll::reps: (...) is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing." and "NDSolve::dsvar: 0.004085714285714286 cannot be used as a variable.".

I don't understand why I get these errors since the time range I have seems to be reasonable, just as the initial conditions.

> (*** Initial conditions + free parameters ***)
tMax = 200;
eve0 = 2.0;
EVE0 = 2.0;
ftz0 = 2.0;
FTZ0 = 2.0;
d0 = 0.009; d1 = 2; d2 = 1; d3 = 4; d4 = 2; d5 = 4.0; d6 = 2.0; d7 = \
2.0; d8 = 2.0; 
(*Solving the system*)
Clear[sol2]
Manipulate[
 sol2 = NDSolve[{
    Derivative[1][EVE][t] == 
     d7 + E^(-t Subscript[k, 
        3]) (-d0 + d0 E^(t Subscript[k, 3]) + 
         eve0 Subscript[k, 3]) - (d3 EVE[t] Subscript[k, 13])/(
      d4 + FTZ[t] Subscript[k, 4] + EVE[t] Subscript[k, 13]) - (
      d5 EVE[t] Subscript[k, 1])/(
      d6 + EVE[t] Subscript[k, 1] + FTZ[t] Subscript[k, 15]),
    Derivative[1][FTZ][t] == 
     d8 + (E^(-d1 t) (-d2 + d2 E^(d1 t) + d1 ftz0) Subscript[k, 6])/
      d1 - (d3 FTZ[t] Subscript[k, 4])/(
      d4 + FTZ[t] Subscript[k, 4] + EVE[t] Subscript[k, 13]) - (
      d5 FTZ[t] Subscript[k, 15])/(
      d6 + EVE[t] Subscript[k, 1] + FTZ[t] Subscript[k, 15]),
    EVE[0] == EVE0, FTZ[0] == FTZ0}, {EVE, FTZ}, {t, 0, tMax}, 
   MaxSteps -> Infinity];

 Plot[{EVE[t], FTZ[t]} /. sol2, {t, 0, tMax}, PlotRange -> Full, 
  PlotStyle -> {Black}],
 {{k3, 0.01}, 0.00, 1.00}, {{k13, 0.01}, 0.00, 1.00}, {{k15, 0.01}, 
  0.00, 1.00}, {{k4, 0.01}, 0.00, 1.00}, {{k1, 0.01}, 0.00, 
  1.00}, {{k6, 0.01}, 0.00, 1.00}]

Thanks in advance! :)

$\endgroup$

1 Answer 1

2
$\begingroup$

Remove the Subscripts!!!

Manipulate[sol2 = NDSolve[{Derivative[1][EVE][t] == d7 + E^(-t k3) (-d0 + d0 E^(t k3) + eve0 k3) - (d3 EVE[t] k13)/(d4 + FTZ[t] k4 + EVE[t] k13) - (d5 EVE[t] k1)/(d6 + EVE[t] k1 + FTZ[t] k15), Derivative[1][FTZ][t] == d8 + (E^(-d1 t) (-d2 + d2 E^(d1 t) + d1 ftz0) k6)/d1 - (d3 FTZ[t] k4)/(d4 + FTZ[t] k4 + EVE[t] k13)- (d5 FTZ[t] k15)/(d6 + EVE[t] k1 + FTZ[t] k15), EVE[0] == EVE0,FTZ[0] == FTZ0}, {EVE, FTZ}, {t, 0, tMax}, MaxSteps -> Infinity];
Plot[{EVE[t], FTZ[t]} /. sol2, {t, 0, tMax}, PlotRange -> Full,PlotStyle -> {Black}], 
{{k3, 0.01}, 0.00, 1.00}, {{k13, 0.01}, 0.00,1.00}, {{k15, 0.01}, 0.00, 1.00}, {{k4, 0.01}, 0.00, 1.00}, {{k1, 0.01}, 0.00,1.00}, {{k6, 0.01}, 0.00, 1.00}]

enter image description here

$\endgroup$
1
  • $\begingroup$ that solved the problem, thank you!! $\endgroup$
    – Beatriz A
    Jul 29, 2019 at 15:02

Your Answer

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

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