level 2
贴吧用户_5CEtyyQ
楼主
smo[x_,y_]=β[y]S*[x]-0.03-α[y]-a[y,x]I*[x]-0.5;
S*[x_]=(0.03+α[x]+0.5)/β[x];
I*[x_]=(10.25β[x]-0.03(0.03+α[x]+0.5))/(β[x](0.03+α[x]+0.5));
α[x_]= (20x2)/(0.3+x4);
β[X_]:=(200x)/(10+x) (1-0.34*Exp[-((x-6)2/100)]);
a[x_,y_]=10*(1-(1+v)/(1+v*Exp[-4.5(x-y)]));
dsmo[x_]:=()/.{y->x};
driftmo[x_]:=1/2*0.001*I*[x]*dsmo[x];
S*[{x1_,x2_}]=1/(2 (-a[x1,x2] β[x1] β[x2]-a[x2,x1]β[x1]β[x2])) (-γ a[x1,x2] β[x1]-μ a[x1,x2] β[x1]-a[x1,x2] α[x2] β[x1]-γ a[x2,x1] β[x2]-μ a[x2,x1]β[x2]-a[x2,x1] α[x1] β[x2]+a[x2,x1] μa[x1,x2]-\[Sqrt](-4 a[x2,x1] (-a[x1,x2] β[x1] β[x2]-a[x2,x1] β[x1]β[x2]) λa[x1,x2]+(γ a[x1,x2]β[x1]+μ a[x1,x2]β[x1]+a[x1,x2] α[x2] β[x1]+γ a[x2,x1] β[x2]+μ a[x2,x1] β[x2]+a[x2,x1] α[x1] β[x2]-a[x2,x1] μa[x1,x2])2));
n1[{x1_,x2_}]=( β[x2]*S*[x1,x2]-μ-α[x2]-γ )/a[x2,x1];
n2[{x1_,x2_}]=( β[x1]*S*[x1,x2]-μ-α[x1]-γ )/a[x1,x2];
sdi[{x1_,x2_},y_]:=β[y]S*[{x1,x2}]-0.03-α[y]-a[y,x1]n1[{x1,x2}]-a[y,x2]n2[{x1,x2}]-0.5;
x1dsdi[{x1_,x2_}]:=()/.{y->x1};
x2dsdi[{x1_,x2_}]:=()/.{y->x2};
driftdi[{x1_,x2_}]:={1/2*0.001*n1[{x1,x2}]*x1dsdi[{x1,x2}],1/2*0.001*n2[{x1,x2}]*x2dsdi[{x1,x2}]};
b=1;σ=0.001;γ=0.5;μ=0.03;v=2.5;λ=10.25;
x0=1.5;(* starting point of tree *)
t0=0;(* start time *)
t∞=6000000;(* stop time *)
Δt=50000;
data={};
(* monomorphic part of the deterministic tree; notice the extra stopping condition *)
x=x0;
t=t0;
While[t<=t∞&&dsmo[x-0.01σ]dsmo[x+0.01σ]>0,
data=Join[data,{{x,t}}];
x=x+Δt driftmo[x];
t=t+Δt;
];
(* dimorphic part of the deterministic tree *)
x={x-0.1σ,x+0.1σ};
While[t<=t∞,
data=Join[data,{{x[[1]],t},{x[[2]],t}}];
x=x+Δt driftdi[x];
t=t+Δt;
];
CEtree=ListPlot[data,PlotStyle->{Red,PointSize[0.005]},Joined->False,AxesOrigin->{0,0},PlotRange->{{0,3},All},AxesLabel->{"x","time"}, BaseStyle->{FontWeight->"Bold",FontSize->16},LabelStyle->{Style["x",Italic,FontSize->16],Style["time",Italic,FontSize->16]}
];
Show[CEtree]







2023年04月11日 05点04分
1
S*[x_]=(0.03+α[x]+0.5)/β[x];
I*[x_]=(10.25β[x]-0.03(0.03+α[x]+0.5))/(β[x](0.03+α[x]+0.5));
α[x_]= (20x2)/(0.3+x4);
β[X_]:=(200x)/(10+x) (1-0.34*Exp[-((x-6)2/100)]);
a[x_,y_]=10*(1-(1+v)/(1+v*Exp[-4.5(x-y)]));
dsmo[x_]:=()/.{y->x};
driftmo[x_]:=1/2*0.001*I*[x]*dsmo[x];
S*[{x1_,x2_}]=1/(2 (-a[x1,x2] β[x1] β[x2]-a[x2,x1]β[x1]β[x2])) (-γ a[x1,x2] β[x1]-μ a[x1,x2] β[x1]-a[x1,x2] α[x2] β[x1]-γ a[x2,x1] β[x2]-μ a[x2,x1]β[x2]-a[x2,x1] α[x1] β[x2]+a[x2,x1] μa[x1,x2]-\[Sqrt](-4 a[x2,x1] (-a[x1,x2] β[x1] β[x2]-a[x2,x1] β[x1]β[x2]) λa[x1,x2]+(γ a[x1,x2]β[x1]+μ a[x1,x2]β[x1]+a[x1,x2] α[x2] β[x1]+γ a[x2,x1] β[x2]+μ a[x2,x1] β[x2]+a[x2,x1] α[x1] β[x2]-a[x2,x1] μa[x1,x2])2));
n1[{x1_,x2_}]=( β[x2]*S*[x1,x2]-μ-α[x2]-γ )/a[x2,x1];
n2[{x1_,x2_}]=( β[x1]*S*[x1,x2]-μ-α[x1]-γ )/a[x1,x2];
sdi[{x1_,x2_},y_]:=β[y]S*[{x1,x2}]-0.03-α[y]-a[y,x1]n1[{x1,x2}]-a[y,x2]n2[{x1,x2}]-0.5;
x1dsdi[{x1_,x2_}]:=()/.{y->x1};
x2dsdi[{x1_,x2_}]:=()/.{y->x2};
driftdi[{x1_,x2_}]:={1/2*0.001*n1[{x1,x2}]*x1dsdi[{x1,x2}],1/2*0.001*n2[{x1,x2}]*x2dsdi[{x1,x2}]};
b=1;σ=0.001;γ=0.5;μ=0.03;v=2.5;λ=10.25;
x0=1.5;(* starting point of tree *)
t0=0;(* start time *)
t∞=6000000;(* stop time *)
Δt=50000;
data={};
(* monomorphic part of the deterministic tree; notice the extra stopping condition *)
x=x0;
t=t0;
While[t<=t∞&&dsmo[x-0.01σ]dsmo[x+0.01σ]>0,
data=Join[data,{{x,t}}];
x=x+Δt driftmo[x];
t=t+Δt;
];
(* dimorphic part of the deterministic tree *)
x={x-0.1σ,x+0.1σ};
While[t<=t∞,
data=Join[data,{{x[[1]],t},{x[[2]],t}}];
x=x+Δt driftdi[x];
t=t+Δt;
];
CEtree=ListPlot[data,PlotStyle->{Red,PointSize[0.005]},Joined->False,AxesOrigin->{0,0},PlotRange->{{0,3},All},AxesLabel->{"x","time"}, BaseStyle->{FontWeight->"Bold",FontSize->16},LabelStyle->{Style["x",Italic,FontSize->16],Style["time",Italic,FontSize->16]}
];
Show[CEtree]






