Skip to main content
Tweeted twitter.com/#!/StackMma/status/518702739959083009
Reformatted
Source Link
Sektor
  • 3.3k
  • 7
  • 27
  • 36

Problems with parametric plot! (ticks don't work!) ParametricPlot: Can't use Ticks

So, basically I'm trying to plot the phase portrait of a 2x22x2 diff system, but the parameters are a pain. I'm trying to get a good picture of the orbits, but even if I use FrameTicksFrameTicks, mathematicaMathematica just ignoreignores 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])) - (([Alpha]12n2[t])/(k1 + L[t]))) - (c1* i[t]n1[t]), D[n2[t], t] == (r2n2[t])(1 - (n2[t]/k2) - (([Alpha]21n1[t])/k2)), D[i[t], t] == s - (d1*i[t]) + (([Rho]*i[t]n1[t])/([Gamma] + n1[t])) - (c2 i[t]*n1[t]), D[L[t], t] == ([Sigma]*L[t]) + ([Phi]*n1[t]) - ([Omega]n1[t] L[t])};$

L[t_] = 0; [Phi] = 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);

[Alpha]12 = 9*(10^(-5));

c1 = 10^(-9);

r2 = 10 ^(-3);

k2 = 10^(12);

[Alpha]21 = 9*(10^(-2));

s = 0;

d1 = .2;

[Gamma] = 100;

c2 = 10^(-10);

[Rho] = .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]; #############################

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 sol2sol2 vs sol1;sol1; Axes from 00 to 10^710^7, pref using the ticks 0,10,10^2,..10^5,10^6,10^70,10,10^2,..10^5,10^6,10^7, and both sol1, sol2 dependssol1 and sol2 depend on tt, I want to run tt form 00 to 100,000100 000.

Help please! Do you have any suggestions ?

Problems with parametric plot! (ticks don't work!)

So, basically I'm trying to plot the phase portrait of a 2x2 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 ignore 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])) - (([Alpha]12n2[t])/(k1 + L[t]))) - (c1* i[t]n1[t]), D[n2[t], t] == (r2n2[t])(1 - (n2[t]/k2) - (([Alpha]21n1[t])/k2)), D[i[t], t] == s - (d1*i[t]) + (([Rho]*i[t]n1[t])/([Gamma] + n1[t])) - (c2 i[t]*n1[t]), D[L[t], t] == ([Sigma]*L[t]) + ([Phi]*n1[t]) - ([Omega]n1[t] L[t])};$

L[t_] = 0; [Phi] = 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);

[Alpha]12 = 9*(10^(-5));

c1 = 10^(-9);

r2 = 10 ^(-3);

k2 = 10^(12);

[Alpha]21 = 9*(10^(-2));

s = 0;

d1 = .2;

[Gamma] = 100;

c2 = 10^(-10);

[Rho] = .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, sol2 depends on t, I want to run t form 0 to 100,000.

Help please!

ParametricPlot: Can't use Ticks

So, basically I'm trying to plot the phase portrait of a 2x2 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 ?

added 81 characters in body
Source Link

So, basically I'm trying to plot the phase portrait of a 2x2 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 ignore me. So this is the code:

Clear[n1, n2, i, L] system4

system4 = {D[n1[t], t] == (r1* n1[t])(1 - (n1[ t]/(k1 + L[t])) - (([Alpha]12n2[t])/(k1 + L[t]))) - (c1* i[t]n1[t]), D[n2[t], t] == (r2n2[t])(1 - (n2[t]/k2) - (([Alpha]21n1[t])/k2)), D[i[t], t] == s - (d1*i[t]) + (([Rho]*i[t]n1[t])/([Gamma] + n1[t])) - (c2 i[t]*n1[t]), D[L[t], t] == ([Sigma][Sigma]*L[t]) + ([Phi]*n1[t]) - ([Omega]L[t]) + ([Phi]n1[t]) - ([Omega]n1[t] L[t])}; L[t_] = 0; [Phi] = 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); [Alpha]12 = 9(10^(-5)); c1 = 10^(-9); r2 = 10 ^(-3); k2 = 10^(12); [Alpha]21 = 9n1[t] L[t])};$

L[t_] = 0; [Phi] = 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);

[Alpha]12 = 9*(10^(-5));

c1 = 10^(-9);

r2 = 10 ^(-3);

k2 = 10^(12);

[Alpha]21 = 9*(10^(-2)); s

s = 0; d1

d1 = .2; [Gamma]

[Gamma] = 100; c2

c2 = 10^(-10); [Rho]

[Rho] = .206; tfinal

tfinal = 10000000; Module[

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_]

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

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, sol2 depends on t, I want to run t form 0 to 100,000.

Help please!

So, basically I'm trying to plot the phase portrait of a 2x2 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 ignore 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])) - (([Alpha]12n2[t])/(k1 + L[t]))) - (c1* i[t]n1[t]), D[n2[t], t] == (r2n2[t])(1 - (n2[t]/k2) - (([Alpha]21n1[t])/k2)), D[i[t], t] == s - (d1*i[t]) + (([Rho]*i[t]n1[t])/([Gamma] + n1[t])) - (c2 i[t]*n1[t]), D[L[t], t] == ([Sigma]L[t]) + ([Phi]n1[t]) - ([Omega]n1[t] L[t])}; L[t_] = 0; [Phi] = 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); [Alpha]12 = 9(10^(-5)); c1 = 10^(-9); r2 = 10 ^(-3); k2 = 10^(12); [Alpha]21 = 9(10^(-2)); s = 0; d1 = .2; [Gamma] = 100; c2 = 10^(-10); [Rho] = .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, sol2 depends on t, I want to run t form 0 to 100,000.

Help please!

So, basically I'm trying to plot the phase portrait of a 2x2 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 ignore 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])) - (([Alpha]12n2[t])/(k1 + L[t]))) - (c1* i[t]n1[t]), D[n2[t], t] == (r2n2[t])(1 - (n2[t]/k2) - (([Alpha]21n1[t])/k2)), D[i[t], t] == s - (d1*i[t]) + (([Rho]*i[t]n1[t])/([Gamma] + n1[t])) - (c2 i[t]*n1[t]), D[L[t], t] == ([Sigma]*L[t]) + ([Phi]*n1[t]) - ([Omega]n1[t] L[t])};$

L[t_] = 0; [Phi] = 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);

[Alpha]12 = 9*(10^(-5));

c1 = 10^(-9);

r2 = 10 ^(-3);

k2 = 10^(12);

[Alpha]21 = 9*(10^(-2));

s = 0;

d1 = .2;

[Gamma] = 100;

c2 = 10^(-10);

[Rho] = .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, sol2 depends on t, I want to run t form 0 to 100,000.

Help please!

Source Link

Problems with parametric plot! (ticks don't work!)

So, basically I'm trying to plot the phase portrait of a 2x2 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 ignore 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])) - (([Alpha]12n2[t])/(k1 + L[t]))) - (c1* i[t]n1[t]), D[n2[t], t] == (r2n2[t])(1 - (n2[t]/k2) - (([Alpha]21n1[t])/k2)), D[i[t], t] == s - (d1*i[t]) + (([Rho]*i[t]n1[t])/([Gamma] + n1[t])) - (c2 i[t]*n1[t]), D[L[t], t] == ([Sigma]L[t]) + ([Phi]n1[t]) - ([Omega]n1[t] L[t])}; L[t_] = 0; [Phi] = 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); [Alpha]12 = 9(10^(-5)); c1 = 10^(-9); r2 = 10 ^(-3); k2 = 10^(12); [Alpha]21 = 9(10^(-2)); s = 0; d1 = .2; [Gamma] = 100; c2 = 10^(-10); [Rho] = .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, sol2 depends on t, I want to run t form 0 to 100,000.

Help please!