1
$\begingroup$

I solve the following set of ODE and plot solution of S1 vs k2 (Figure 1).

k1 = 1;
k3 = 5;
n = 3;
c = 1;
v0 = 15.0;
dk = -0.0005;
s = NDSolve[{
    S1'[t] == v0 - k2[t]*S1[t]*(1 + c*S2[t]^n) - k1*S1[t],
    S2'[t] == k2[t]*S1[t]*(1 + c*S2[t]^n) - k3*S2[t],
    k2'[t] == dk,
    S1[0] == 1,
    S2[0] == 1,
    k2[0] == 0.5}, {S1, S2, k2}, {t, 2100}];

ParametricPlot[Evaluate[{k2[t], S1[t]} /. s], {t, 300, 450}, 
AspectRatio -> 0.5, PlotStyle -> Black, AxesLabel -> {k2, S1}, 
AxesOrigin -> {0.275, 0.0}]

Figure 1

I would like k2 to be displayed from high to low values (basically, to revere X-axis, like in Figure 2). I tried Reverse and Sort, but did not manage them to work with Evaluate.

Figure 2

$\endgroup$
1
$\begingroup$

Well, it is not clear whether or not you like to shift the x-axis too, to make it appear in almost the same place, but here is a start:

ParametricPlot[Evaluate[{0.625 - k2[t], S1[t]} /. s], {t, 300, 450}, 
 AspectRatio -> 0.5, PlotStyle -> Black, AxesLabel -> {k2, S1}, 
 AxesOrigin -> {0.275, 0.0}]

Mathematica graphics

If you like to have correct ticks that match your original function, then you need to manually adjust them too. Basically, you the same thing to your ticks that you did to the function: you negate it. I supply two lists of ticks, because I want to have smaller sub-ticks that don't have a label too.

ticks[min_, max_] := Join[
   Table[{i, NumberForm[-i, 2], {-0.01, 0}}, {i, min, max, 0.01}],
   Table[{i, , {-0.005, 0}}, {i, min, max, 0.0025}]];

ParametricPlot[Evaluate[{-k2[t], S1[t]} /. s], {t, 300, 450}, 
 AspectRatio -> 0.5, PlotStyle -> Black, AxesLabel -> {k2, S1}, 
 Ticks -> {ticks, Automatic}]

Mathematica graphics

$\endgroup$
  • $\begingroup$ Thank you very much! This is exactly what I was looking for. $\endgroup$ – Alex Ivanov Aug 9 '15 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.