Trzecie laboratoria z modelowania matematycznego

cl=Table[{(3^(-n)),(2^n)},{n,0,10}];

ListLogLogPlot[cl]

FindFit[cl,a (l^(-dd)),{a,dd},l]

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

Log[2]/Log[3.]

LogLogPlot[Evaluate[a (l^(-dd))/.FindFit[cl,a (l^(-dd)),{a,dd},l]],{l,(10^(-20)),1}]

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

π
%

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[{Pink,Rectangle[{0,0},{1,1/2}],Gray,Rectangle[{1/3,0},{2/3,1/2}]}]

{1/3,2/3};
{{1/9,2/9},{3/9,4/9},{5/9,6/9},{7/9,8/9}}

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

Graphics[{Pink,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,0},{#2,1/2}]&@@@Table[{(k/27),((k+1)/27)},{k,1,27,2}]

Graphics[{Pink,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[{Pink,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,7}]]]

Manipulate[Graphics[Join[{Pink,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,r}]]],{r,1,7,1}]

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

ImageTrim[kontur,{{20,30},{50,80}}]

d=20;
Table[ImageTrim[kontur,{{i d,j d},{(i+1)d,(j+1)d}}],{j,Floor[dim[[2]]/d],0,-1},{i,0,dim[[1]]/d}]
%//MatrixForm

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

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

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

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

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

tab=Table[{d,Length@Select[Times@@@(ImageMeasurements[#,"Mean"]&/@Flatten@Table[ImageTrim[kontur,{{i d,j d},{(i+1)d,(j+1)d}}],{j,Floor[dim[[2]]/d],0,-1},{i,0,dim[[1]]/d}]),#≠1.&]},{d,{8,10,12,15,18,20,25,30}}]

ListLogLogPlot[tab]

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

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

kontur=Graphics[{White,Rectangle[{0,0}],Black,Rectangle[{0.1,0.2},{0.5,0.6}]}]
dim=ImageDimensions[kontur]

tab=Table[{d,Length@Select[Times@@@(ImageMeasurements[#,"Mean"]&/@Flatten@Table[ImageTrim[kontur,{{i d,j d},{(i+1)d,(j+1)d}}],{j,Floor[dim[[2]]/d],0,-1},{i,0,dim[[1]]/d}]),#≠1.&]},{d,{20,30,40,50,60,70,80}}]

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

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

ArrayPlot[Table[If[#>2,4,#]&@Abs@Nest[((#)^2)+1/5+I/5&,x+I y,12],{y,-1.5,1.5,0.01},{x,-1.5,1.5,0.01}],ColorFunction->"ValentineTones"]

ArrayPlot[Table[If[#>2,4,#]&@Abs@Nest[((#)^2)+x+I y&,0,15],{y,-1.25,1.25,0.005},{x,-2,.75,0.005}],ColorFunction->"BeachColors"]