So, basically I’m trying to plot the phase portrait of a 2×2 diff system, but the parameters are a pain. I’m trying to get a good picture of the orbits, but even if I use FrameTicks, Mathematica just ignores me.

So this is the code:

Clear[n1, n2, i, L]

system4 = {D[n1[t], t] == (r1*n1[t])*(1 – (n1[t]/(k1 + L[t])) –

((Î±12*n2[t])/(k1 + L[t]))) – (c1*i[t]*n1[t]),

D[n2[t], t] == (r2*n2[t])*(1 – (n2[t]/k2) – ((Î±21*n1[t])/k2)),

D[i[t], t] == s – (d1*i[t]) + ((Ï*i[t]*n1[t])/(Î³ + n1[t])) –

(c2*i[t]*n1[t]),

D[L[t], t] == (Ïƒ*L[t]) + (Ï•*n1[t]) – (Ï‰*n1[t]*L[t])};

L[t_] = 0; Ï• = 0;

n2[t_] = 10^12;

system2 = Table[system4[[m]], {m, {1, 3}}];

incognitas2 = {n1[t], i[t]};

incognitas4 = {n1[t], n2[t], i[t], L[t]};

ci2 = {n1[0] == 100, i[0] == 10};

r1 = 10^(-2);

k1 = 10^(8);

Î±12 = 9*(10^(-5));

c1 = 10^(-9);

r2 = 10^(-3);

k2 = 10^(12);

Î±21 = 9*(10^(-2));

s = 0;

d1 = .2;

Î³ = 100;

c2 = 10^(-10);

Ï = .206;

tfinal = 10000000;

Module[{c = 0},

sol = NDSolve[Join[system2, ci2], incognitas2, {t, 0, tfinal},

MaxSteps -> Infinity, Method -> {StiffnessSwitching,

Method -> {ExplicitRungeKutta, Automatic}}, PrecisionGoal -> 15,

StepMonitor :> c++]; c];

sol1[t_] = First[n1[t] /. sol];

sol2[t_] = First[i[t] /. sol];

And I want to plot sol2 vs sol1; Axes from 0 to 10^7, pref using the ticks 0,10,10^2,..10^5,10^6,10^7, and both sol1 and sol2 depend on t, I want to run t form 0 to 100 000.

Do you have any suggestions ?

=================

=================

1 Answer

1

=================

I suggest using ScalingFunctions to get logarithmic scaling:

ParametricPlot[{sol1[t], sol2[t]}, {t, 0, 100000},

AspectRatio -> 1, ScalingFunctions -> {“Log”, “Log”},

Frame -> True, Axes -> False]

+1 How can I find about the usage of option ScalingFunctions.

– Junho Lee

Oct 5 ’14 at 13:16

@JunhoLee, there is a page in the documentation for it. Officially it’s only supported for charting functions but it seems to work for ParametricPlot too.

– Simon Woods

Oct 5 ’14 at 15:05