|
Introduction to the Chaos library Calling Sequence:
readlib(chaos) Description: To use a chaos function, you must first execute the readlib(chaos) command. Most of the terminology used can be found in Devaney's undergraduate text, Chaotic Dynamical Systems (ISBN: 0-201-55406-2), Frame and Peak's Chaos Under Control (ISBN:0-7167-2429-4), or Barnsley's Fractals Everywhere (ISBN: 0-12-079062-9).
The functions available are: Basic Dynamics Orbit( f:function,x:initial value,n:positive integer )
Orbitf( f:function , x:initial value , n:number of iterations )
GraphicalAnalysis( f:function,a:lower bound,b:upper bound, :seed,n:iterations )
AnimatedGraphicalAnalysis(same arguments as GraphicalAnalysis)
FixedPointAnalysis ( F:polynomial function )
Bifurcation Bifurcation ( f:function, :lower limit, :upper limit,hpoints:horizontal points, n:number of points, :real number )
Bif3d ( , , , , xgrid,ygrid,toss,keep )
Data Analysis TimeSeriesPlot ( f , t , n )
ShowMixing ( f , t , n )
FirstDelayPlot ( List )
ClosePairsPlot ( DATA , tolerance )
ChaosGameTest ( DATA )
CircleChaosGameTest ( DATA )
BarnsInt ( DATA,d )
Particular Maps Dbl ( x:real )
LogisticChart ( :real,n:pos. integer )
LogisticGrowthPlot ( c , , n , L )
BoxLogisticGrowthPlot ( c)
ChaosGame ( PtList:List of Points,Start:starting point,NumPts:number of points,Ratio:ratio to move )
IFS's and AFFINE maps In the following routines, we define two data types: AFFINE and IFS.
These are inert forms representing the following maps:
IFS routines `convert\affine`(A::AFFINE) - converts an AFFINE or IFS object to its affine() form `convert\Affine`(A::AFFINE) - converts an AFFINE or IFS object to its Affine() form `convert\affineC`(A::AFFINE) - converts an AFFINE or IFS object to its affineC() form `convert\affineM`(A::AFFINE) - converts an AFFINE or IFS object to its affineM() form
affineFromPoints ( , , , , , )
IFSFromList ( List )
Map (IFS)
Transform(IFS)
DrawDetIFS( figure,IFS,n )
DrawIFS( IFS,n )
IFScurve ( t,IFS )
DrawIFScurve ( IFS,n )
ContractionFactor ( a,b,c,d,e,f )
Built-in IFS's The following IFS data types are built-in:
In addition IFS's can be quickly produced with the following routine:
GridIFS()
The following plot structures are built-in, and can be used as the starting figure for plotting the iterations of the deterministic method for an IFS (see DrawDetIFS()).
Mandelbrot and Julia type fractals
MandelFractal( Fx,Fy,a..b,c..d,options )
MakePalette( n,rate,scheme )
ViewPalette( palette )
ComplexToRealFunc( F )
MandComplexToRealFunc( F )
QuadraticFunc( c )
JuliaSet( c )
MandelbrotSet()
Other Useful Utilities Table()
BaseN ( t,n )
FatPoint ( x:real,y:real,n:pos. integer,siz:pos. real,col:color constant )
Examples restart; readlib(chaos); #assuming you have installed it in your library
f:=x->x^2-2;
Orbit(f,1/2,10);
Orb:=Orbitf(f,1/2,6);
Table(Orb,numbered); 1 .50 2 -1.75 3 1.06 4 -.87 5 -1.24 6 -.46 7 -1.79
Orb:=Orbit(x->Q(x,-0.78+0.04*I),0,10): 0 0 -.78+.4e-1*I .78 -.1732-.224e-1*I .17 -.75050352+.4775936e-1*I .75 -.2190254229-.3168713559e-1*I .22 -.7330319387+.5388057655e-1*I .74 -.2455672934-.3899236697e-1*I .25 -.7212171091+.5915050004e-1*I .72 -.2633446632-.4532070528e-1*I .27 -.7127035547+.6386993174e-1*I .72 -.2761330113-.5104065478e-1*I .28GraphicalAnalysis(f,-2,2,.65,250);
AnimatedGraphicalAnalysis(f,-2,2,.65,50);
FixedPointAnalysis(x->x^2-1); ******************************************************************************* x^2-1 ------------------------------------------------------------------------------- Fixed Point F'(p) F''(p) F'''(p) Classification -------------- -------------- -------------- -------------- ------------------- 1.618034 3.236068 2.000000 0.000000 repelling -.618034 -1.236068 2.000000 0.000000 repelling (x^2-1)^2-1 ------------------------------------------------------------------------------- 2-cycle F'(p) F''(p) F'''(p) Classification -------------- -------------- -------------- -------------- ------------------- 0.000000 0.000000 -4.000000 0.000000 attracting -1.000000 0.000000 8.000000 -24.000000 attracting 1.618034 10.472136 27.416408 38.832816 repelling -.618034 1.527864 .583592 -14.832816 repelling *******************************************************************************Bifurcation(Q,-2,0.25,500,100,0);
Bif3d(-2,-2,2,2,40,40,150,10);
TimeSeriesPlot(x->x^2-0.75,0,100);
ShowMixing(x->3.95*x*(1-x),0.5,200);
n:=1000: # output omitted: Table(List1,List2,numbered): FirstDelayPlot(List1);
FirstDelayPlot(List2);
ClosePairsPlot(List1[1..100],0.05);
ClosePairsPlot(List2[1..100],0.05);
ChaosGameTest(List1);
ChaosGameTest(List2);
CircleChaosGameTest(List1);
CircleChaosGameTest(List2);
mb:=BarnsInt([[1,2],[2,3],[3,1],[4,2]],[.4,.4,.4]);
IFSCurve(0,mb);
IFSCurve(0.5,mb);
DrawIFSCurve(mb,400);
plot(Dbl(x),x=0..1,discont=true);
LogisticChart(3.2,25): Iter: 0 0.000 .100 .200 .300 .400 .500 .600 .700 .800 .900 1.000 Iter: 1 0.000 .288 .512 .672 .768 .800 .768 .672 .512 .288 0.000 Iter: 2 0.000 .656 .800 .705 .570 .512 .570 .705 .800 .656 0.000 Iter: 3 0.000 .722 .513 .665 .784 .800 .784 .665 .513 .722 0.000 Iter: 4 0.000 .642 .799 .713 .541 .513 .541 .713 .799 .642 0.000 Iter: 5 0.000 .735 .513 .655 .795 .799 .795 .655 .513 .735 0.000 Iter: 6 0.000 .623 .799 .723 .522 .513 .522 .723 .799 .623 0.000 Iter: 7 0.000 .752 .513 .641 .798 .799 .798 .641 .513 .752 0.000 Iter: 8 0.000 .598 .799 .737 .515 .513 .515 .737 .799 .598 0.000 Iter: 9 0.000 .770 .513 .621 .799 .799 .799 .621 .513 .770 0.000 Iter:10 0.000 .567 .799 .753 .513 .513 .513 .753 .799 .567 0.000 Iter:11 0.000 .785 .513 .595 .799 .799 .799 .595 .513 .785 0.000 Iter:12 0.000 .539 .799 .771 .513 .513 .513 .771 .799 .539 0.000 Iter:13 0.000 .795 .513 .565 .799 .799 .799 .565 .513 .795 0.000 Iter:14 0.000 .521 .799 .787 .513 .513 .513 .787 .799 .521 0.000 Iter:15 0.000 .799 .513 .537 .799 .799 .799 .537 .513 .799 0.000 Iter:16 0.000 .515 .799 .796 .513 .513 .513 .796 .799 .515 0.000 Iter:17 0.000 .799 .513 .520 .799 .799 .799 .520 .513 .799 0.000 Iter:18 0.000 .513 .799 .799 .513 .513 .513 .799 .799 .513 0.000 Iter:19 0.000 .799 .513 .515 .799 .799 .799 .515 .513 .799 0.000 Iter:20 0.000 .513 .799 .799 .513 .513 .513 .799 .799 .513 0.000 Iter:21 0.000 .799 .513 .513 .799 .799 .799 .513 .513 .799 0.000 Iter:22 0.000 .513 .799 .799 .513 .513 .513 .799 .799 .513 0.000 Iter:23 0.000 .799 .513 .513 .799 .799 .799 .513 .513 .799 0.000 Iter:24 0.000 .513 .799 .799 .513 .513 .513 .799 .799 .513 0.000 Iter:25 0.000 .799 .513 .513 .799 .799 .799 .513 .513 .799 0.000LogisticGrowthPlot(3.5,.3,100,lines);
BoxLogisticGrowthPlot(3.5);
ChaosGame([[0,0],[0,1],[1,0]],[0,0],10000,0.5);
ChaosGame([[0,0],[1,1],[1,0],[0,1]],[0.3,0.3],10000,.55);
T:=affineFromPoints([0,0],[1,0],[0,1],[0,1],[0,1/2],[1/2,1/2]);
convert(T,Affine);
convert(T,affineC);
convert(T,affineM);
Map(T);
Mapf(T);
P:=plot(sin(x),x=-6..6):P;
display(Transform(T)(P));
ContractionFactor(T);
MyIFS:=GridIFS(
Map(MyIFS);
Map(MyIFS)[1];
Map(MyIFS)[1](2,3);
convert(MyIFS,affine);
convert(MyIFS,affineC);
convert(MyIFS,affineM);
ContractionFactor(MyIFS);
DrawDetIFS(MrFace,MyIFS,1);
DrawDetIFS(MrFace,MyIFS,2);
DrawIFS(MyIFS,20000);
NiceCurveIFS:=IFSFromList(
IFSCurve(0.5,NiceCurveIFS);
DrawIFSCurve(NiceCurveIFS,3^6);
DrawIFS(SierpinskiCarpet,30000);
DrawIFS(SierpinskiTriangle,20000);
DrawIFS(SierpinskiTriangle2,20000);
DrawIFS(KochCurve,10000);
DrawIFS(CantorSet,5000);
DrawDetIFS(MrFace,GridIFS(Up,none,-Up,none,Lt,none,Rt,none,Lt),1,scaling=constrained);
DrawDetIFS(MrGrid,GridIFS(Up,none,-Up,none,Lt,none,Rt,none,Lt),1,scaling=constrained);
DrawDetIFS(MrPoint,GridIFS(Up,none,-Up,none,Lt,none,Rt,none,Lt),1,axes=none,scaling=constrained);
DrawDetIFS(MrLine,GridIFS(Up,none,-Up,none,Lt,none,Rt,none,Lt),1,axes=none,scaling=constrained);
DrawDetIFS(MrSquare,GridIFS(Up,none,-Up,none,Lt,none,Rt,none,Lt),1,scaling=constrained);
DrawDetIFS(MrTriangle,GridIFS(Up,none,-Up,none,Lt,none,Rt,none,Lt),1,scaling=constrained);
DrawDetIFS(MrsTriangle,GridIFS(Up,none,-Up,none,Lt,none,Rt,none,Lt),1,scaling=constrained);
JuliaSet(-1);
JuliaSet(-1,scheme=6,rate=2);
JuliaSet(-1,1.3..1.75,-0.15..0.15,maxiter=50,grid=[50,50],scheme=2,timer=true);
JuliaSet(-1,1.3..1.75,-0.15..0.15,maxiter=400,grid=[150,150],scheme=2,timer=true);
JuliaSet(-0.7519+0.03523*I);
ComplexToRealFunc(z->sin(z));
JuliaFractal(ComplexToRealFunc(z->sin(z)),-6..6,-6..6,radius=20,maxiter=200,grid=[150,150],scheme=6,rate=15,timer=true);
MandelbrotSet();
MandelbrotSet(timer=true);
MandelbrotSet(-0.7519..-0.75158,0.03523..0.035563,maxiter=10000,grid=[300,300],scheme=1,rate=1000,timer=true,axes=normal);
MandComplexToRealFunc(z->sin(z)+c0+c1*I);
MandelFractal(MandComplexToRealFunc(z->sin(z)+c0+c1*I),-6..6,-6..6,radius=20,maxiter=400,grid=[150,150],scheme=6,timer=true,axes=framed);
MakePalette(10,10,1);
ViewPalette(MakePalette(10,10,1));
BaseN(1/5,4);
The next three commands are not part of the chaos library but are useful for saving fractals images to postscript or jpeg files instead of displaying them on the screen. #plotsetup(ps,plotoptions="colour=rgb,width=8in,height=6in",plotoutput="C:/testpic.ps"); #plotsetup(jpeg,plotoptions="width=800,height=600",plotoutput="C:/testpic.jpg"); #plotsetup(default,plotoutput=default);
See Also: utils |
Many mathematics files on this site are in pdf format.
If your browser does not display pdf files, click here for
assistance. |