Zajęcia drugie, modelowanie matematyczne, 27 lutego

(* F[λ_,x_]:=λ x(1-x) definujmy ja czytelniej: *)
F=#1 #2 (1-#2)&

N[2/5]

AbsoluteTiming[NestList[F[4,#]&,2/5,25];]
AbsoluteTiming[NestList[F[4,#]&,0.4,25000000];]

Manipulate[
Grid@{{Plot[{y,F[λ,y],F[λ,F[λ,y]](*,F[λ,F[λ,F[λ,F[λ,y]]]]*)},{y,0,1},PlotRange->{0,1},AspectRatio->1,GridLines->Automatic,Frame->True,PlotStyle->Thick],
ListPlot[NestList[F[λ,#]&,x0,n],PlotRange->{0,1},Joined->True,Mesh->Automatic,GridLines->Automatic,Frame->True,PlotStyle->Thick,MeshStyle->Directive[PointSize[Medium],Red]]}},

{{λ,2},0,4},{{x0,0.2},0,1},{{n,25},10,500,1}]

Diagram bifurkacyjny

t=Table[i,{i,50}]
t[[-20;;-1]]
(* szczegoly - patrz dokumentacja funkcji Part *)

ListPlot[Flatten[Table[Partition[Riffle[NestList[F[λ,#]&,0.3,500][[-10;;-1]],λ,{1,-2,2}],2],{λ,0,4,0.5}],1]]

{0.`,0.`,0.`,0.`,0.`,0.`,0.`,0.`,0.`,0.`} "->"  {{0,0},{0,0}

pierwsze zero to λ, drugie to wartosc orbity

Riffle[{0.`,0.`,0.`,0.`,0.`,0.`,0.`,0.`,0.`,0.`},λ,{1,-2,2}]
Partition[%,2]

Partition[Riffle[{0.`,0.`,0.`,0.`,0.`,0.`,0.`,0.`,0.`,0.`},λ,{1,-2,2}],2]

Flatten

ListPlot[Flatten[Table[Partition[Riffle[NestList[F[λ,#]&,0.3,200][[-40;;-1]],λ,{1,-2,2}],2],{λ,3,4,0.005}],1]]