Evaluation of the Lyapunov exponents

Ex: The Lorenz attractor

Clear[t,tmax,Tmax,x,y,z]
Tmax=40;xlimit=22;ylimit=25;zlimit=62;
d=10;r=28;b=8/3;
x0=-2;y0=2;z0=19;
dx0=0.0000017725543;dy0=0.0000014992;dz0=-0.000000143877725;
lambda=0.9; (*Lyapunov exponent*)

IC={{x0,y0,z0}};
dIC={{x0+dx0,y0+dy0,z0+dz0}};
int[ic__]:=NDSolve[{
x'[t]==d (y[t]-x[t]),
y'[t]==r x[t]-y[t]-x[t] z[t],
z'[t]==x[t] y[t]-b z[t],
x[0]==ic[[1]],y[0]==ic[[2]],z[0]==ic[[3]]},
{x,y,z},{t,0,Tmax},MaxSteps->Infinity]

Row[{Plot[{Evaluate[x[t]/.int/@IC],Evaluate[x[t]/.int/@dIC]},{t,0,Tmax},AxesLabel->{t,x[t]},PlotRange->All,ImageSize->250,LabelStyle->18],
Plot[{Evaluate[y[t]/.int/@IC],Evaluate[y[t]/.int/@dIC]},{t,0,Tmax},AxesLabel->{t,y[t]},PlotRange->All,ImageSize->250,LabelStyle->18],
Plot[{Evaluate[z[t]/.int/@IC],Evaluate[z[t]/.int/@dIC]},{t,0,Tmax},AxesLabel->{t,z[t]},PlotRange->All,ImageSize->250,LabelStyle->18]}]

xorig=Evaluate[x[t]/.int/@IC];xprim=Evaluate[x[t]/.int/@dIC];
Plot[{Log[Abs[xorig-xprim]],Log[Exp[lambda t]]-13},{t,0,Tmax},AxesLabel->{t,Log[Abs[x[t]-x'[t]]]},PlotRange->{-15,5},LabelStyle->18,PlotStyle->{Thickness[0.004],{Red,Thickness[0.008]}}]

yorig=Evaluate[y[t]/.int/@IC];yprim=Evaluate[y[t]/.int/@dIC];
Plot[{Log[Abs[yorig-yprim]],Log[Exp[lambda t]]-12},{t,0,Tmax},AxesLabel->{t,Log[Abs[y[t]-y'[t]]]},PlotRange->{-15,5},LabelStyle->18,PlotStyle->{Thickness[0.004],{Red,Thickness[0.008]}}]

zorig=Evaluate[z[t]/.int/@IC];zprim=Evaluate[z[t]/.int/@dIC];
Plot[{Log[Abs[zorig-zprim]],Log[Exp[lambda t]]-12},{t,0,Tmax},AxesLabel->{t,Log[Abs[z[t]-z'[t]]]},PlotRange->{-15,5},LabelStyle->18,PlotStyle->{Thickness[0.004],{Red,Thickness[0.008]}}]

Plot[{Log[Abs[(Sqrt[(((xorig-xprim))^2)+(((yorig-yprim))^2)+(((zorig-zprim))^2)])]],Log[Exp[lambda t]]-12},{t,0,Tmax},AxesLabel->{t,"Ln|(OverVector[δ])|"},PlotRange->{-15,5},LabelStyle->18,PlotStyle->{Thickness[0.004],{Red,Thickness[0.008]}}]

ParametricPlot3D[Evaluate[{x[t],y[t],z[t]}/.int/@IC],{t,0,Tmax},AxesLabel-> {x[t],y[t],z[t]},BoxRatios->{1,1,1},PlotPoints->100,ImageSize->430,LabelStyle->18]

Creation of this notebook was supported by IT Academy program of Information Technology Foundation for Education (HITSA).