Try!
(*First solve and store the symbolic data*)
val = LPL /.First@Solve[{K1*P*L == PL, K2*P*L == LP, K3*PL*L == LPL,
P0 == P + PL + LP + LPL, r*P0 == L + PL + LP + 2*LPL}, {P, L,LP, PL, LPL}];
(*
+ Define a function that evaluates the symbolic expression given
numerical value to the parameters.
+ We use DifInd with default value 0 we can compute the d-th derivative in
case of DifInd=d.
*)
complex[rVal_, K1Val_, K2Val_, K3Val_, P0Val_, DifInd_: 0] :=
Re@With[{r = rVal, K1 = K1Val, K2 = K2Val, K3 = K3Val, P0 = P0Val,
índex = DifInd}, (Evaluate@D[val, {r, índex}])];
Needs["PlotLegends`"];
Manipulate[Plot[Evaluate[{
complex[r, K1, K2, K3, P0],
complex[r, K1, K2, K3, P0, 1],
complex[r, K1, K2, K3, P0, 4]
}], {r, 0.1, 6},
ImageSize -> 600,
Frame -> True,
PlotStyle -> {Thick, {Red, Thick, Dashed}, Green},
PlotLegend -> {"f(x)", "f'(x)", "f''''(x)"},
LegendPosition -> {1.1, -0.4}],
{K1, 1001, 10000}, {K2, 1000,10000}, {K3, 1000, 10000}, {P0, 0.1, 1}]
![Manipulate[] interface](https://i.stack.imgur.com/WUZnR.png)
I use Re
to plot only the real part of complex
. I noticed that it also has an imaginary part with very small magnitude.
TrackedSymbols -> {K1, K2, K3, P0}
to prevent yourManipulate
from being busy all the time. $\endgroup$ – Sjoerd C. de Vries Nov 8 '12 at 20:15