Trzecie laboratoria z modelowania matematycznego

cantorlist=Table[{(2^(i-1)),(3^(1-i))},{i,10}]
cantorlist=Reverse/@cantorlist

ListLogLogPlot[cantorlist]

FindFit[cantorlist,a (l^(-d)),{a,d},l]

d/.FindFit[cantorlist,a (l^(-d)),{a,d},l]

Log[3]/Log[2.]

a (l^(-d))/.FindFit[cantorlist,a (l^(-d)),{a,d},l]

Plot[Evaluate[a (l^(-d))/.FindFit[cantorlist,a (l^(-d)),{a,d},l]],{l,(10^(-6)),1}]

LogLogPlot[Evaluate[a (l^(-d))/.FindFit[cantorlist,a (l^(-d)),{a,d},l]],{l,(10^(-6)),1}]

Show[ListLogLogPlot[cantorlist],LogLogPlot[Evaluate[a (l^(-d))/.FindFit[cantorlist,a (l^(-d)),{a,d},l]],{l,(10^(-6)),1}]]

Graphics

Graphics[{Thick,Green,Rectangle[{0,-1},{2,1}],Red,Disk[],Blue,Circle[{2,0}],Yellow,Polygon[{{2,0},{4,1},{4,-1}}],Purple,Arrowheads[Large],Arrow[{{4,3/2},{0,3/2},{0,0}}],Black,Dashed,Line[{{-1,0},{4,0}}]}]

Graphics[{Yellow,Rectangle[{0,0},{1,1/2}]}]

Table[{(2^(i-1)),(3^(1-i))},{i,10}]

{1/3,2/3}

Graphics[{Yellow,Rectangle[{0,0},{1,1/2}],Black,Rectangle[{1/3,0},{2/3,1/2}]}]

{{1/9,2/9},{3/9,4/9},{5/9,6/9},{7/9,8/9}}
Rectangle[{#1,0},{#2,1}]&@@@%

Graphics[{Yellow,Rectangle[{0,0},{1,1/2}],Black,Rectangle[{1/3,0},{2/3,1/2}],Rectangle[{(1/9),0},{(2/9),1/2}],Rectangle[{(1/3),0},{(4/9),1/2}],Rectangle[{(5/9),0},{(2/3),1/2}],Rectangle[{(7/9),0},{(8/9),1/2}]}]

Table[{(k/27),((k+1)/27)},{k,1,27,2}]
Rectangle[{#1,0},{#2,1/2}]&@@@%

Graphics[{Yellow,Rectangle[{0,0},{1,1/2}],Black,Rectangle[{1/3,0},{2/3,1/2}],Rectangle[{(1/9),0},{(2/9),1/2}],Rectangle[{(1/3),0},{(4/9),1/2}],Rectangle[{(5/9),0},{(2/3),1/2}],Rectangle[{(7/9),0},{(8/9),1/2}],Rectangle[{(1/27),0},{(2/27),(1/2)}],Rectangle[{(1/9),0},{(4/27),(1/2)}],Rectangle[{(5/27),0},{(2/9),(1/2)}],Rectangle[{(7/27),0},{(8/27),(1/2)}],Rectangle[{(1/3),0},{(10/27),(1/2)}],Rectangle[{(11/27),0},{(4/9),(1/2)}],Rectangle[{(13/27),0},{(14/27),(1/2)}],Rectangle[{(5/9),0},{(16/27),(1/2)}],Rectangle[{(17/27),0},{(2/3),(1/2)}],Rectangle[{(19/27),0},{(20/27),(1/2)}],Rectangle[{(7/9),0},{(22/27),(1/2)}],Rectangle[{(23/27),0},{(8/9),(1/2)}],Rectangle[{(25/27),0},{(26/27),(1/2)}],Rectangle[{1,0},{(28/27),(1/2)}]}]

Graphics[Join[{Yellow,Rectangle[{0,0},{1,1/2}],Black},
Table[Rectangle[{#1,0},{#2,1/2}]&@@@Table[{(k/(3^p)),((k+1)/(3^p))},{k,1,(3^p)-1,2}],{p,6}]]]

kontur=CountryData["Poland","Shape"]
konturdim=ImageDimensions[kontur]

d=20;
Table[ImageTrim[kontur,{{i d,j d },{(i+1)d,(j+1)d}}],{i,0,konturdim[[1]]/d},{j,0,konturdim[[2]]/d}]
(Transpose@%)[[Reverse@Range[Length[%[[1]]]],All]]//MatrixForm

d=20;
Table[ImageTrim[kontur,{{i d,j d },{(i+1)d,(j+1)d}}],{i,0,konturdim[[1]]/d},{j,0,konturdim[[2]]/d}]

ImageMeasurements[,"Mean"]
ImageMeasurements[,"Mean"]

d=20;
Flatten[Table[ImageTrim[kontur,{{i d,j d },{(i+1)d,(j+1)d}}],{i,0,konturdim[[1]]/d},{j,0,konturdim[[2]]/d}]]

d=20;
ImageMeasurements[#,"Mean"]&/@Flatten[Table[ImageTrim[kontur,{{i d,j d },{(i+1)d,(j+1)d}}],{i,0,konturdim[[1]]/d},{j,0,konturdim[[2]]/d}]]

d=20;
Times@@@(ImageMeasurements[#,"Mean"]&/@Flatten[Table[ImageTrim[kontur,{{i d,j d },{(i+1)d,(j+1)d}}],{i,0,konturdim[[1]]/d},{j,0,konturdim[[2]]/d}]])

d=20;
Select[Times@@@(ImageMeasurements[#,"Mean"]&/@Flatten[Table[ImageTrim[kontur,{{i d,j d },{(i+1)d,(j+1)d}}],{i,0,konturdim[[1]]/d},{j,0,konturdim[[2]]/d}]]),#≠1&]

d=20;
Length@Select[Times@@@(ImageMeasurements[#,"Mean"]&/@Flatten[Table[ImageTrim[kontur,{{i d,j d },{(i+1)d,(j+1)d}}],{i,0,konturdim[[1]]/d},{j,0,konturdim[[2]]/d}]]),#≠1&]

lista=Table[{d,
Length@Select[Times@@@(ImageMeasurements[#,"Mean"]&/@Flatten[Table[ImageTrim[kontur,{{i d,j d },{(i+1)d,(j+1)d}}],{i,0,konturdim[[1]]/d},{j,0,konturdim[[2]]/d}]]),#≠1&]},{d,{5,10,15,20,25,30}}]

ListLogLogPlot[{{10,125},{20,36},{30,17},{40,11},{50,9}}]

Show[ListLogLogPlot[lista],LogLogPlot[Evaluate[a (l^(-dd))/.FindFit[lista,a (l^(-dd)),{a,dd},l]],{l,1,50}]]

Evaluate[a (l^(-dd))/.FindFit[lista,a (l^(-dd)),{a,dd},l]]

Table[x+I y,{x,-3,3,0.2},{y,-3,3,0.2}];
ArrayPlot@Table[If[Abs[#]>2,4,Abs[#]]&@Nest[((#)^2)-I/2&,x+I y,5],{x,-3,3,0.01},{y,-3,3,0.01}]

ArrayPlot@Table[If[Abs[#]>2,4,Abs[#]]&@Nest[((#)^2)+x+I y&,0,5],{x,-2.5,0.75,0.01},{y,-1.5,1.5,0.01}]