Skip to main content
edited tags
Link
Verbeia
  • 34.5k
  • 10
  • 110
  • 225
deleted 24 characters in body
Source Link
Sjoerd C. de Vries
  • 66.1k
  • 15
  • 189
  • 327
Manipulate[solution[t_] = NDSolve[{
     Derivative[1][w][t] == - k1  S w[t] + k2   x[t] - 
              k7 H  w[t] + k8  y[t], 
     Derivative[1][x][t] == - k2  x[t] + k1 S w[t] - k3 H x[t] + 
              k4  z[t], 
     Derivative[1][y][t] == -k8  y[t] + k7 H w[t] - k5  S y[t] + 
              k6 z[t], 
     Derivative[1][z][t] == - k4  z[t] + k3 H  x[t] - k6  z[t] + 
              k5 S y[t], w[0] == 1, x[0] == 0, y[0] == 0, 
     z[0] == 0}, {w [t],
           x [t], y [t], z [t]}, {t, 0, 10}][[1, All, 2]]; 
  Plot[solution[t], {t, 0, 10}], {{k1, 1}, 0.01, 5, 
    Appearance -> "Labeled"}
   , {{k2, 1}, 0.01, 5, Appearance -> "Labeled"}
   , {{k3, 1}, 0.01, 5, Appearance -> "Labeled"}
   , {{k4, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k5, 1}, 0.01, 5, 
    Appearance -> "Labeled"} , {{k6, 1}, 0.01, 5, 
    Appearance -> "Labeled"} , {{k7, 1}, 0.01, 5, 
    Appearance -> "Labeled"} , {{k8, 1}, 0.01, 5, 
    Appearance -> "Labeled"} , {{H, 1}, 0.1, 5, 
    Appearance -> "Labeled"}, {{S, 1}, 0.01, 5, 
    Appearance -> "Labeled"} , 
  TrackedSymbols :> {k1, k2, k3, k4, k5, k6,  k7, k8, H, S}]

!(*SuperscriptBox["w", "[Prime]", MultilineFunction->None])[t] == - k1 S w[t] + k2 x[t] - k7 H w[t] + k8 y[t], !(*SuperscriptBox["x", "[Prime]", MultilineFunction->None])[t] == - k2 x[t] + k1 S w[t] - k3 H x[t] + k4 z[t], !(*SuperscriptBox["y", "[Prime]", MultilineFunction->None])[t] == -k8 y[t] + k7 H w[t] - k5 S y[t] + k6 z[t], !(*SuperscriptBox["z", "[Prime]", MultilineFunction->None])[t] == - k4 z[t] + k3 H x[t] - k6 z[t] + k5 S y[t], w[0] == 1, x[0] == 0, y[0] == 0, z[0] == 0}, {w [t], x [t], y [t], z [t]}, {t, 0, 10}][[1, All, 2]]; Plot[solution[t], {t, 0, 10}], {{k1, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k2, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k3, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k4, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k5, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k6, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k7, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k8, 1}, 0.01, 5, Appearance -> "Labeled"} , {{H, 1}, 0.1, 5, Appearance -> "Labeled"}, {{S, 1}, 0.01, 5, Appearance -> "Labeled"} , TrackedSymbols :> {k1, k2, k3, k4, k5, k6, k7, k8, H, S}]

Manipulate[solution[t_] = NDSolve[{

!(*SuperscriptBox["w", "[Prime]", MultilineFunction->None])[t] == - k1 S w[t] + k2 x[t] - k7 H w[t] + k8 y[t], !(*SuperscriptBox["x", "[Prime]", MultilineFunction->None])[t] == - k2 x[t] + k1 S w[t] - k3 H x[t] + k4 z[t], !(*SuperscriptBox["y", "[Prime]", MultilineFunction->None])[t] == -k8 y[t] + k7 H w[t] - k5 S y[t] + k6 z[t], !(*SuperscriptBox["z", "[Prime]", MultilineFunction->None])[t] == - k4 z[t] + k3 H x[t] - k6 z[t] + k5 S y[t], w[0] == 1, x[0] == 0, y[0] == 0, z[0] == 0}, {w [t], x [t], y [t], z [t]}, {t, 0, 10}][[1, All, 2]]; Plot[solution[t], {t, 0, 10}], {{k1, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k2, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k3, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k4, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k5, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k6, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k7, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k8, 1}, 0.01, 5, Appearance -> "Labeled"} , {{H, 1}, 0.1, 5, Appearance -> "Labeled"}, {{S, 1}, 0.01, 5, Appearance -> "Labeled"} , TrackedSymbols :> {k1, k2, k3, k4, k5, k6, k7, k8, H, S}]

Manipulate[solution[t_] = NDSolve[{
     Derivative[1][w][t] == - k1  S w[t] + k2   x[t] - 
              k7 H  w[t] + k8  y[t], 
     Derivative[1][x][t] == - k2  x[t] + k1 S w[t] - k3 H x[t] + 
              k4  z[t], 
     Derivative[1][y][t] == -k8  y[t] + k7 H w[t] - k5  S y[t] + 
              k6 z[t], 
     Derivative[1][z][t] == - k4  z[t] + k3 H  x[t] - k6  z[t] + 
              k5 S y[t], w[0] == 1, x[0] == 0, y[0] == 0, 
     z[0] == 0}, {w [t],
           x [t], y [t], z [t]}, {t, 0, 10}][[1, All, 2]]; 
  Plot[solution[t], {t, 0, 10}], {{k1, 1}, 0.01, 5, 
    Appearance -> "Labeled"}
   , {{k2, 1}, 0.01, 5, Appearance -> "Labeled"}
   , {{k3, 1}, 0.01, 5, Appearance -> "Labeled"}
   , {{k4, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k5, 1}, 0.01, 5, 
    Appearance -> "Labeled"} , {{k6, 1}, 0.01, 5, 
    Appearance -> "Labeled"} , {{k7, 1}, 0.01, 5, 
    Appearance -> "Labeled"} , {{k8, 1}, 0.01, 5, 
    Appearance -> "Labeled"} , {{H, 1}, 0.1, 5, 
    Appearance -> "Labeled"}, {{S, 1}, 0.01, 5, 
    Appearance -> "Labeled"} , 
  TrackedSymbols :> {k1, k2, k3, k4, k5, k6,  k7, k8, H, S}]
Source Link

Use Results from Manipulate Plot NDSolve to create another plot versus variable used in DE

I created my plot using using this input:

Manipulate[solution[t_] = NDSolve[{

!(*SuperscriptBox["w", "[Prime]", MultilineFunction->None])[t] == - k1 S w[t] + k2 x[t] - k7 H w[t] + k8 y[t], !(*SuperscriptBox["x", "[Prime]", MultilineFunction->None])[t] == - k2 x[t] + k1 S w[t] - k3 H x[t] + k4 z[t], !(*SuperscriptBox["y", "[Prime]", MultilineFunction->None])[t] == -k8 y[t] + k7 H w[t] - k5 S y[t] + k6 z[t], !(*SuperscriptBox["z", "[Prime]", MultilineFunction->None])[t] == - k4 z[t] + k3 H x[t] - k6 z[t] + k5 S y[t], w[0] == 1, x[0] == 0, y[0] == 0, z[0] == 0}, {w [t], x [t], y [t], z [t]}, {t, 0, 10}][[1, All, 2]]; Plot[solution[t], {t, 0, 10}], {{k1, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k2, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k3, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k4, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k5, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k6, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k7, 1}, 0.01, 5, Appearance -> "Labeled"} , {{k8, 1}, 0.01, 5, Appearance -> "Labeled"} , {{H, 1}, 0.1, 5, Appearance -> "Labeled"}, {{S, 1}, 0.01, 5, Appearance -> "Labeled"} , TrackedSymbols :> {k1, k2, k3, k4, k5, k6, k7, k8, H, S}]

I now want to plot the solutions function versus S. Any suggestions?