#hw11.txt, February 27, 2014, Frank Wagner #################### #####Problem 2###### #################### #old things needed for this problem# #Orb(g,x0,K1,K2,d1): running the logistic map #x->g*x*(1-x) K1+K2 times, starting at x0, and displaying #the last K2 terms #For example: #Orb(2.5,.5,10000,1000); Orb:=proc(g,x0,K1,K2,d1) local L,i,x1: x1:=x0: L:=[]: for i from 1 to K1+K2+1 do L:=[op(L),x1]: x1:=g*x1*(1-x1): od: evalf(L[K1+1..K1+K2],d1): end: #OrbF(f,x,g,x0,K1,K2,d1): running the general logistic map #x->g*f K1+K2 times and displaying #the last K2 terms #For example: #OrbF(2.5,.5,10000,1000); OrbF:=proc(f,x,g,x0,K1,K2,d1) local L,i,x1: x1:=x0: L:=[]: for i from 1 to K1+K2+1 do L:=[op(L),x1]: x1:=g*subs(x=x1,f): od: evalf(L[K1+1..K1+K2],d1): end: #end old things needed# BisectOrb:=proc(f,x,x0,K1,K2,d1,z,eps) local a,b: a:=0: while nops({op(OrbF(f,x,a,x0,K1,K2,d1))})<=z do a:=a+1: od: if nops({op(OrbF(f,x,a,x0,K1,K2,d1))})>nops({op(OrbF(f,x,a+1,x0,K1,K2,d1))}) then a:=a+1: while nops({op(OrbF(f,x,a,x0,K1,K2,d1))})<=z do a:=a+1: od: fi: a:=a-1: b:=a: while nops({op(OrbF(f,x,b,x0,K1,K2,d1))})<=z do b:=b+1: od: while b-a>=eps do if nops({op(OrbF(f,x,(a+b)/2,x0,K1,K2,d1))})<=z then a:=(a+b)/2: else b:=(a+b)/2: fi: od: [a,b]: end: NumerBifOrbF:=proc(f,x,x0,K1,K2,d1,n,eps) local i,L,l: L:=[]: for i from 1 to n do l:=BisectOrb(f,x,x0,K1,K2,d1,2^(i-1),eps): L:=[op(L),l]: od: evalf(L): end: #The function NumerBifOrbF(x^2*(1-x),x,.5,10000,1000,10,4,.02) returned: # [[4.941406250, 4.960937500], [5.703125000, 5.718750000], [5.828125000, 5.843750000], [5.875000000, 5.890625000]] # #The function NumerBifOrbF(x*(1-x)^2,x,.5,10000,1000,10,4,.02) returned: # [[4., 4.015625000], [4.750000000, 4.765625000], [4.984375000, 5.], [4.984375000, 5.]] # *This one was a problem because, for some reason, nops({op(OrbF(x*(1-x)^2,x,1,.5,10000,1000,10))})=1000 instead of 1 # #The function NumerBifOrbF(x^2*(1-x)^2,x,.5,10000,1000,10,4,.02) returned: # [[8.546875000, 8.562500000], [11.56250000, 11.57812500], [12.12500000, 12.14062500], [12.20312500, 12.21875000]] #################### #####Problem 3###### #################### #I attempted to do this problem using the previous problem's function, #but there were clear problems, such as what to use for K1,K2,x0,etc. #I tried to use general values for these and figure it out from there, #but that took far too long and gave no answers. # #Using brute force, I can see that approximate answers for the problems below are: # FirstBif(x^2*(1-x))=4.95 # FirstBif(x*(1-x)^2)=4.01 # FirstBif(x^2*(1-x)^2)=8.55 # FirstBif(x^3*(1-x)^3)=32.71 #################### #####Problem 4###### #################### with(plots): PlotMS:=proc(reso,K) local z,x,y,L,i,j,f,Lp: z:=0: L:=[0]: for i from 1 to K-1 do z:=z^2+x+y*I: L:=[op(L),z]: od: f:=abs(L[K]): Lp:=[]: for i from -5 to 5 by .1 do for j from -5 to 5 by .1 do if evalf(subs(x=i,y=j,f))<2 then Lp:=[op(Lp),[i,j]]: fi: od: od: pointplot(Lp,resoultion=reso): end: #Clearly, this is not an ideal way of doing this. #However, I was unable to find helpful sources on Maple's #abilities to plot a set of points, instead finding only #instructions on how to input a finite set and plot that one. #If there were a way to tell it "plot the point c such that..." #that would be perfect.