Skip to main content
added 676 characters in body
Source Link
thils
  • 3.3k
  • 2
  • 18
  • 36

This is an initial attempt to improve your answer. First eliminate errors in the first three lines, and focus on a small t up to 1.2. Beyond that there is a singularity/stiff system. This is for the small t range!

     Clear[x];
     r = 1; 
    sol = NDSolve[{Derivative[1][x][t] - 1 - r*x[t] - x[t]^2 == 0, 
       x[0] == 0}, x, {t, 0, 1.2}]
    Plot[Evaluate[x[t] /. sol], {t, 0, 1.2}]
    ParametricPlot[Evaluate[{x[t], Derivative[1][x][t]} /. sol], {t, 0, 1.2}]

enter image description here

First plot shown here.

Further to the singularity issue, one can explore the sensitivity of parameters for this specific differential equation using

Clear[x, r, s]; 
sol = ParametricNDSolve[{Derivative[1][x][t] - s - r*x[t] == x[t]^2, 
   x[0] == 0}, x, {t, 0, 5}, {r, s}]

Plot[Evaluate[Table[x[r, 0.02][t] /. sol, {r, 0.1, 0.6, 0.02}]], {t, 
  0, 5}, PlotRange -> All]

Plot[Evaluate[Table[x[0.2, s][t] /. sol, {s, 0.01, 0.06, 0.01}]], {t, 
  0, 5}, PlotRange -> All]

The plot (s fixed at 0.02) show how quickly the curve shoots up even for smaller r values

enter image description here

This is an initial attempt to improve your answer. First eliminate errors in the first three lines, and focus on a small t up to 1.2. Beyond that there is a singularity/stiff system. This is for the small t range!

     Clear[x];
     r = 1; 
    sol = NDSolve[{Derivative[1][x][t] - 1 - r*x[t] - x[t]^2 == 0, 
       x[0] == 0}, x, {t, 0, 1.2}]
    Plot[Evaluate[x[t] /. sol], {t, 0, 1.2}]
    ParametricPlot[Evaluate[{x[t], Derivative[1][x][t]} /. sol], {t, 0, 1.2}]

enter image description here

First plot shown here.

This is an initial attempt to improve your answer. First eliminate errors in the first three lines, and focus on a small t up to 1.2. Beyond that there is a singularity/stiff system. This is for the small t range!

     Clear[x];
     r = 1; 
    sol = NDSolve[{Derivative[1][x][t] - 1 - r*x[t] - x[t]^2 == 0, 
       x[0] == 0}, x, {t, 0, 1.2}]
    Plot[Evaluate[x[t] /. sol], {t, 0, 1.2}]
    ParametricPlot[Evaluate[{x[t], Derivative[1][x][t]} /. sol], {t, 0, 1.2}]

enter image description here

First plot shown here.

Further to the singularity issue, one can explore the sensitivity of parameters for this specific differential equation using

Clear[x, r, s]; 
sol = ParametricNDSolve[{Derivative[1][x][t] - s - r*x[t] == x[t]^2, 
   x[0] == 0}, x, {t, 0, 5}, {r, s}]

Plot[Evaluate[Table[x[r, 0.02][t] /. sol, {r, 0.1, 0.6, 0.02}]], {t, 
  0, 5}, PlotRange -> All]

Plot[Evaluate[Table[x[0.2, s][t] /. sol, {s, 0.01, 0.06, 0.01}]], {t, 
  0, 5}, PlotRange -> All]

The plot (s fixed at 0.02) show how quickly the curve shoots up even for smaller r values

enter image description here

added 117 characters in body
Source Link
thils
  • 3.3k
  • 2
  • 18
  • 36

This is an initial attempt to improve your answer. First eliminate errors in the first three lines, and focus on a small t up to 1.2. Beyond that there is a singularity/stiff system. This is for the small t range!

Clear[x];     Clear[x];
     r = 1; 
    sol = NDSolve[{Derivative[1][x][t] - 1 - r*x[t] - x[t]^2 == 0, 
       x[0] == 0}, x, {t, 0, 31.2}]
    Plot[Evaluate[x[t] /. sol], {t, 0, 31.2}]
    ParametricPlot[Evaluate[{x[t], Derivative[1][x][t]} /. sol], {t, 0, 31.2}]

enter image description hereenter image description here

First plot shown here.

This is an initial attempt to improve your answer. First eliminate errors in the first three lines, and focus on a small t range

Clear[x]; 
r = 1; 
sol = NDSolve[{Derivative[1][x][t] - 1 - r*x[t] - x[t]^2 == 0, 
   x[0] == 0}, x, {t, 0, 3}]
Plot[Evaluate[x[t] /. sol], {t, 0, 3}]
ParametricPlot[Evaluate[{x[t], Derivative[1][x][t]} /. sol], {t, 0, 3}]

enter image description here

First plot shown here.

This is an initial attempt to improve your answer. First eliminate errors in the first three lines, and focus on a small t up to 1.2. Beyond that there is a singularity/stiff system. This is for the small t range!

     Clear[x];
     r = 1; 
    sol = NDSolve[{Derivative[1][x][t] - 1 - r*x[t] - x[t]^2 == 0, 
       x[0] == 0}, x, {t, 0, 1.2}]
    Plot[Evaluate[x[t] /. sol], {t, 0, 1.2}]
    ParametricPlot[Evaluate[{x[t], Derivative[1][x][t]} /. sol], {t, 0, 1.2}]

enter image description here

First plot shown here.

edited body
Source Link
thils
  • 3.3k
  • 2
  • 18
  • 36

This is an initial attempt to improve your answer. First eliminate errors in the first three lines, and focus on a small t range

Clear[x]; 
r = 1; 
sol = NDSolve[{Derivative[1][x][t] - 1 - r*x[t] - x[t]^2 == 0, 
   x[0] == 0}, x, {t, 0, 13}]
Plot[Evaluate[x[t] /. sol], {t, 0, 3}]
ParametricPlot[Evaluate[{x[t], Derivative[1][x][t]} /. sol], {t, 0, 3}]

enter image description here

First plot shown here.

This is an initial attempt to improve your answer. First eliminate errors in the first three lines, and focus on a small t range

Clear[x]; 
r = 1; 
sol = NDSolve[{Derivative[1][x][t] - 1 - r*x[t] - x[t]^2 == 0, 
   x[0] == 0}, x, {t, 0, 1}]
Plot[Evaluate[x[t] /. sol], {t, 0, 3}]
ParametricPlot[Evaluate[{x[t], Derivative[1][x][t]} /. sol], {t, 0, 3}]

enter image description here

First plot shown here.

This is an initial attempt to improve your answer. First eliminate errors in the first three lines, and focus on a small t range

Clear[x]; 
r = 1; 
sol = NDSolve[{Derivative[1][x][t] - 1 - r*x[t] - x[t]^2 == 0, 
   x[0] == 0}, x, {t, 0, 3}]
Plot[Evaluate[x[t] /. sol], {t, 0, 3}]
ParametricPlot[Evaluate[{x[t], Derivative[1][x][t]} /. sol], {t, 0, 3}]

enter image description here

First plot shown here.

Source Link
thils
  • 3.3k
  • 2
  • 18
  • 36
Loading