I have a system of three coupled differential equations that can be pretty readily solved by NDSolve:
sol = NDSolve[{x'[t] == (x[t]*1.99*(x[t] + y[t] + z[t]))/(1.99*x[t] + 2.13*y[t] + 2.34*z[t]) - x[t], y'[t] == (y[t]*2.13*(x[t] + y[t] + z[t]))/(1.99*x[t] +2.13*y[t] + 2.34*z[t]) - y[t], z'[t] == (z[t]*2.34*(x[t] + y[t] + z[t]))/(1.99*x[t] + 2.13*y[t] + 2.34*z[t]) - z[t], x[0] == 1900, y[0] == 90 , z[0] == 10}, {x, y, z}, {t, 0, 10}]; Plot[x[t] /. sol, {t, 0, 10}] and this works fine. But I'd like to change the constant 1.99 to a variable "a" and see how this affects the solution. In principle, I should be able to do this in the manipulate environment, but I'm having issues getting it to work. Initially, I tried a simple approach:
Manipulate[Plot[z[t] /. NDSolve[{x'[ t] == (x[t]*a*(x[t] + y[t] + z[t]))/(a*x[t] + 2.13*y[t] + 2.34*z[t]) - x[t], y'[t] == (y[t]*2.13*(x[t] + y[t] + z[t]))/(a*x[t] + 2.13*y[t] + 2.34*z[t]) - y[t], z'[t] == (z[t]*2.34*(x[t] + y[t] + z[t]))/(a*x[t] + 2.13*y[t] + 2.34*z[t]) - z[t], x[0] == 1900, y[0] == 90 , z[0] == 10}, {x, y, z}, {t, 0, 10}], {t, 0, 10}], {a, 0, 5}] But this yields an error of the form that a constant value cannot be used as a variable. I tried using ParametricNDSolve and got the same error. I've seen a few threads on using NDSolve with manipulate but none of them is directly helping me here. Any ideas on where I'm going wrong, or how I might be able to rewrite this? And should NDSolve or Parametric NDSolve be employed?