Skip to main content
added ecology tag
Link
Chris K
  • 20.4k
  • 3
  • 39
  • 75
edited tags
Link
Michael E2
  • 245k
  • 18
  • 351
  • 775
added 6 characters in body; edited title
Source Link
user64494
  • 29.1k
  • 4
  • 29
  • 56

Numerically solve DDEdelay ODE

I am trying to numerically solve a simple DDEdelay ODE in mma for the first time. I think this is likely a simple fix.

I first tried to solve system as ordinary differential equation system for up to 𝑡=l. And then use these solutions as history functions for the delay differential equation system. I keep getting the error: NDSolve::dvnoarg The function na appears with no arguments

ClearAll["Global`*"]
c = 200; Q = 4; P = 1.92*10^-6; ea = 2.6*10^-6; ga = 
6.24*10^-8; l = 0.5; ba = 98; pr = 0.2;
sol0 = NDSolve[{
 r'[t] == pr (c - r[t]) - P r[t]/(Q + r[t]) (na[t] + ma[t]),
 na'[t] == P r[t]/(ea (Q + r[t])) na[t] - pr na[t] - ga 
 na[t] p[t],
 ma'[t] == ga na[t] p[t] - pr ma[t],
 p'[t] == -pr p[t] - p[t] ga na[t] ,
 r[0] == 1000, ma[0] == 0, na[0] == 100, p[0] == 1000},
 {r, na, ma, p}, {t, 0, l}][[1]];

sol = NDSolve[{
 r'[t] == pr (c - r[t]) - P r[t]/(Q + r[t]) (na[t] + ma[t]),
 na'[t] == P r[t]/(ea (Q + r[t])) na[t] - pr na[t] - ga 
 na[t] p[t],
 ma'[t] == ga na[t] p[t] - pr ma[t] - 
   Exp[-pr l] ga na[t - l] p[t - l],
 p'[t] == ba Exp[-pr l] ga na[t - l] p[t - l] - pr p[t] - 
   p[t] ga na[t] ,
 r[0] == 1000, na[t /; t <= l] == sol0[[2]], ma[0] == 0, 
 p[t /; t <= l] == sol0[[4]]},
{r, na, ma, p}, {t, 0, 100}][[1]];

Any suggestions are much appreciated.

Numerically solve DDE

I am trying to numerically solve a simple DDE in mma for the first time. I think this is likely a simple fix.

I first tried to solve system as ordinary differential equation system for up to 𝑡=l. And then use these solutions as history functions for the delay differential equation system. I keep getting the error: NDSolve::dvnoarg The function na appears with no arguments

ClearAll["Global`*"]
c = 200; Q = 4; P = 1.92*10^-6; ea = 2.6*10^-6; ga = 
6.24*10^-8; l = 0.5; ba = 98; pr = 0.2;
sol0 = NDSolve[{
 r'[t] == pr (c - r[t]) - P r[t]/(Q + r[t]) (na[t] + ma[t]),
 na'[t] == P r[t]/(ea (Q + r[t])) na[t] - pr na[t] - ga 
 na[t] p[t],
 ma'[t] == ga na[t] p[t] - pr ma[t],
 p'[t] == -pr p[t] - p[t] ga na[t] ,
 r[0] == 1000, ma[0] == 0, na[0] == 100, p[0] == 1000},
 {r, na, ma, p}, {t, 0, l}][[1]];

sol = NDSolve[{
 r'[t] == pr (c - r[t]) - P r[t]/(Q + r[t]) (na[t] + ma[t]),
 na'[t] == P r[t]/(ea (Q + r[t])) na[t] - pr na[t] - ga 
 na[t] p[t],
 ma'[t] == ga na[t] p[t] - pr ma[t] - 
   Exp[-pr l] ga na[t - l] p[t - l],
 p'[t] == ba Exp[-pr l] ga na[t - l] p[t - l] - pr p[t] - 
   p[t] ga na[t] ,
 r[0] == 1000, na[t /; t <= l] == sol0[[2]], ma[0] == 0, 
 p[t /; t <= l] == sol0[[4]]},
{r, na, ma, p}, {t, 0, 100}][[1]];

Any suggestions are much appreciated.

Numerically solve delay ODE

I am trying to numerically solve a simple delay ODE in mma for the first time. I think this is likely a simple fix.

I first tried to solve system as ordinary differential equation system for up to 𝑡=l. And then use these solutions as history functions for the delay differential equation system. I keep getting the error: NDSolve::dvnoarg The function na appears with no arguments

ClearAll["Global`*"]
c = 200; Q = 4; P = 1.92*10^-6; ea = 2.6*10^-6; ga = 
6.24*10^-8; l = 0.5; ba = 98; pr = 0.2;
sol0 = NDSolve[{
 r'[t] == pr (c - r[t]) - P r[t]/(Q + r[t]) (na[t] + ma[t]),
 na'[t] == P r[t]/(ea (Q + r[t])) na[t] - pr na[t] - ga 
 na[t] p[t],
 ma'[t] == ga na[t] p[t] - pr ma[t],
 p'[t] == -pr p[t] - p[t] ga na[t] ,
 r[0] == 1000, ma[0] == 0, na[0] == 100, p[0] == 1000},
 {r, na, ma, p}, {t, 0, l}][[1]];

sol = NDSolve[{
 r'[t] == pr (c - r[t]) - P r[t]/(Q + r[t]) (na[t] + ma[t]),
 na'[t] == P r[t]/(ea (Q + r[t])) na[t] - pr na[t] - ga 
 na[t] p[t],
 ma'[t] == ga na[t] p[t] - pr ma[t] - 
   Exp[-pr l] ga na[t - l] p[t - l],
 p'[t] == ba Exp[-pr l] ga na[t - l] p[t - l] - pr p[t] - 
   p[t] ga na[t] ,
 r[0] == 1000, na[t /; t <= l] == sol0[[2]], ma[0] == 0, 
 p[t /; t <= l] == sol0[[4]]},
{r, na, ma, p}, {t, 0, 100}][[1]];

Any suggestions are much appreciated.

Source Link
Loading