This is a file from the Wikimedia Commons

File:Logphi comp.PNG

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Original file(1,072 × 621 pixels, file size: 24 KB, MIME type: image/png)

Summary

Description
English: Diagram of real potential coputed with 2 methods : simple and full
Source Own work
Author Adam majewski

Long description

This diagram is related with discrete dynamical system based on complex quadratic polynomials when c=0

What program does :

  • computes points of external ray for angle t=0 . See instruction zz:GiveRay(t,c)
  • for each point in zz computes potential using simple method and saves to list pair of real numbers : distance to boundary and potential
  • for each point in zz computes potential using full method and saves to list pair of real numbers : distance to boundary and potential
  • draws above 2 sets of points using distance on horizontal axis and potential on vertical axis

Maxima src code

 /* 
 Maxima CAS batch file 
 Distributed under the GNU Public License. 
 draws 2 diagrams of potential in basin of attraction
 in infinity for fc(z)=z*z+c
 tested on : 
 wxMaxima 0.7.6 http://wxmaxima.sourceforge.net
 Maxima 5.16.3 http://maxima.sourceforge.net
 Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL)
 */

 /* 
 gives a list of points ( complex numbers) 
 of external ray for angle 0 of unit circle 
 ( or f0(z) )
 */
 GiveRay(t,c):=
 block(
 [r], 
 /* range for drawing  R=2^r ; as r tends to 0 R tends to 1 */
 rMin:1E-10, /* 1E-4;  rMin > 0  ; if rMin=0 then program has infinity loop !!!!! */
 rMax:1, 
 caution:0.9330329915368074, /* r:r*caution ; it gives smaller r */
 /*  */
 R_max:200,
 /* */
 zz:[], /* array for z points of ray in fc plane */ 
 /*  some w-points of external ray in f0 plane  */
 r:rMax,
 while 2^r<R_max do r:2*r, /* find point w on ray near infinity (R>=R_max) in f0 plane */
 R:2^r,
 w:rectform(ev(R*exp(2*%pi*%i*t))), 
 z:w, /* near infinity z=w */
 zz:cons(z,zz),
 unless r<rMin do
 (	/* new smaller R */
 r:r*caution,  
 R:2^r,
 /* */
 z:rectform(ev(R*exp(2*%pi*%i*t))),
 zz:cons(z,zz)
 ),
 return(zz)
 )$

 /* gives distancve between 2 complex points */
 GiveDistance(c1,c2):=sqrt((realpart(c2)-realpart(c1))^2 +(imagpart(c2)-imagpart(c1))^2)$
 /* log(x) in Maxima is a natural (base e) logarithm of x  */
 log2(x) := log(x) / log(2);   

 /* returns floating point number 
 full definition
 */   
 GiveFLogPhi(z0,c,e_r,i_max):=
 block(
 [z:z0,
 logphi:log(cabs(z)),
 fac:1/2,
 i:0],
 while i<i_max and cabs(z)<e_r do
 (z:z*z+c,
 logphi:logphi+fac*log(cabs(1+c/(z*z))),
 i:i+1
 ),
 if i=iMax then logphi:0,
 return(float(logphi))
 )$

 /* returns floating point number 
 simple definition
 */   

 GiveSLogPhi(z0,c,e_r,i_max):=
 block(
 [z:z0,
 logphi,
 fac:1/2,
 i:0],
 while i<i_max and cabs(z)<e_r do
 (z:z*z+c,
 fac:fac/2,
 i:i+1
 ),
 if i=iMax 
 then logphi:0
 else logphi:fac*log(cabs(z)),
 return(float(logphi))
 )$

 /* ----------------------- main ----------------------------------------------------*/
 start:elapsed_run_time ();
 /* root point of period 2 component connected with period 1 component */
 c:0; /* hyperbolic */
 t:0;
 ER:3;
 iMax:1000;
 /* compute ray points & save to zz lists */
 zz:GiveRay(t,c)$
 /* landing points for external ray */
 /* landing point of ray  */
 zh:%e^(%i*t*2*%pi); 
 /* compute potential  = log(Phi)*/
 xy_FLogPhi:[];
 for z in zz do xy_FLogPhi:cons([GiveDistance(z,zh),GiveFLogPhi(z,c,ER,iMax)],xy_FLogPhi);
 xy_SLogPhi:[];
 for z in zz do xy_SLogPhi:cons([GiveDistance(z,zh),GiveSLogPhi(z,c,ER,iMax)],xy_SLogPhi);

 /* draw it using draw package by */
 x_max:1.0;
 y_max:20;

 load(draw); 
 draw2d(	terminal      = 'screen,
 /* */
 user_preamble =  "set grid;set key right bottom
 ",
 points_joined =true,
 point_size    =  0.6,
 point_type = filled_circle,
 xlabel = "distance to boundary",
 ylabel = "potential",
 /* */
 color         = green,
 key = " FullLogPhi",
 points(xy_FLogPhi),
 /* */
 color         = blue,
 key = " SimpleLogPhi",
 points(xy_SLogPhi)
 )$

Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
You may select the license of your choice.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current09:00, 25 October 2009Thumbnail for version as of 09:00, 25 October 20091,072 × 621 (24 KB)Soul windsurfer{{Information |Description={{en|1=Diagram of real potential coputed with 2 methods : simple and full}} |Source={{own}} |Author=Adam majewski |Date= |Permission= |other_versions= }}

The following page uses this file: