Skip to main content
more descriptive title
Link
Chris K
  • 20.4k
  • 3
  • 39
  • 75

How to solve an ODE system with specific initial conditions?that periodically increases in size

added ecology tag
Link
Chris K
  • 20.4k
  • 3
  • 39
  • 75
added 129 characters in body
Source Link
SAC
  • 1.3k
  • 8
  • 17

I have an ODE system that increases in size according to the rules

n = 5;
T = 50;
nu = 0.05;
vars = Table[Subscript[x, j][t], {i, n}, {j, i}];
eqns = Table[{Subscript[x, j]'[t] == 
    Subscript[x, j][
      t] (1 - Subscript[x, j][t] - 
       nu (Sum[ Subscript[x, k][t] Boole[k != j], {k, i}]) ), 
   Subscript[x, j][0] == 
    If[j == 1 && i == 1, 0.7, 
     If[j == i, 
      0.01 Subscript[x, RandomInteger[{1, j - 1}]][t] /. t -> T, 
      Subscript[x, j][t] /. t -> T]]}, {i, n}, {j, i}]

This codeI want solve the systemdifferential equation of accordingn variables, with interpolation structure

{{x1},{x1,x2},{x1,x2,x3},{x1,x2,x3,x4,},{x1,x2,x3,x4,x5}}initial conditions defined using the previous differential equation solution of n-1 variables and with an initial condition for the last variable (which randomly depends on one of the previous variables).

I'm having trouble building the initial conditions, present in the code above

 Subscript[x, j][0] == 
        If[j == 1 && i == 1, 0.7, 
         If[j == i, 
          0.01 Subscript[x, RandomInteger[{1, j - 1}]][t] /. t -> T, 
          Subscript[x, j][t] /. t -> T]]

Where the first initial condition {x1[0]=0.7}

The next {x1[0]=x1[Last time in j past],x2[0]=[Last time in j past]}

.

   .

   .

{{x1[0]=[Last time in j past],x2[0]=x2[Last time in j past],x3[0]==x3[Last time in j past],x4[0]=x4[Last time in j past],x5=0.01xSubscript[RandomInteger[1,j-1]][Last time in j past]}

can anybody help me?

I have an ODE system that increases in size according to the rules

n = 5;
T = 50;
nu = 0.05;
vars = Table[Subscript[x, j][t], {i, n}, {j, i}];
eqns = Table[{Subscript[x, j]'[t] == 
    Subscript[x, j][
      t] (1 - Subscript[x, j][t] - 
       nu (Sum[ Subscript[x, k][t] Boole[k != j], {k, i}]) ), 
   Subscript[x, j][0] == 
    If[j == 1 && i == 1, 0.7, 
     If[j == i, 
      0.01 Subscript[x, RandomInteger[{1, j - 1}]][t] /. t -> T, 
      Subscript[x, j][t] /. t -> T]]}, {i, n}, {j, i}]

This code solve the system of according with interpolation structure

{{x1},{x1,x2},{x1,x2,x3},{x1,x2,x3,x4,},{x1,x2,x3,x4,x5}}

I'm having trouble building the initial conditions, present in the code above

 Subscript[x, j][0] == 
        If[j == 1 && i == 1, 0.7, 
         If[j == i, 
          0.01 Subscript[x, RandomInteger[{1, j - 1}]][t] /. t -> T, 
          Subscript[x, j][t] /. t -> T]]

Where the first initial condition {x1[0]=0.7}

The next {x1[0]=x1[Last time in j past],x2[0]=[Last time in j past]}

.

 .

 .

{{x1[0]=[Last time in j past],x2[0]=x2[Last time in j past],x3[0]==x3[Last time in j past],x4[0]=x4[Last time in j past],x5=0.01xSubscript[RandomInteger[1,j-1]][Last time in j past]}

can anybody help me?

I have an ODE system that increases in size according to the rules

n = 5;
T = 50;
nu = 0.05;
vars = Table[Subscript[x, j][t], {i, n}, {j, i}];
eqns = Table[{Subscript[x, j]'[t] == 
    Subscript[x, j][
      t] (1 - Subscript[x, j][t] - 
       nu (Sum[ Subscript[x, k][t] Boole[k != j], {k, i}]) ), 
   Subscript[x, j][0] == 
    If[j == 1 && i == 1, 0.7, 
     If[j == i, 
      0.01 Subscript[x, RandomInteger[{1, j - 1}]][t] /. t -> T, 
      Subscript[x, j][t] /. t -> T]]}, {i, n}, {j, i}]

I want solve the differential equation of n variables, with initial conditions defined using the previous differential equation solution of n-1 variables and with an initial condition for the last variable (which randomly depends on one of the previous variables).

I'm having trouble building the initial conditions, present in the code above

 Subscript[x, j][0] == 
        If[j == 1 && i == 1, 0.7, 
         If[j == i, 
          0.01 Subscript[x, RandomInteger[{1, j - 1}]][t] /. t -> T, 
          Subscript[x, j][t] /. t -> T]]

Where the first initial condition {x1[0]=0.7}

The next {x1[0]=x1[Last time in j past],x2[0]=[Last time in j past]}

.  .  .

{{x1[0]=[Last time in j past],x2[0]=x2[Last time in j past],x3[0]==x3[Last time in j past],x4[0]=x4[Last time in j past],x5=0.01xSubscript[RandomInteger[1,j-1]][Last time in j past]}

can anybody help me?

Source Link
SAC
  • 1.3k
  • 8
  • 17
Loading