This is a file from the Wikimedia Commons

File:Julia iteration data.png

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Julia_iteration_data.png(640 480 pixels, file size: 3 KB, MIME type: image/png)

Summary[edit]

Description

Last iteration for Julia set with c=0

Date
Source Own work
Author Adam majewski

In c data.txt file was created. Gnuplot was used to create png image file. One can see some things:

Lissajous small.svg
This diagram was created with gnuplot:

Gnuplot code

# saves image to png file and code to plt file
 reset
 set term png
 set output "data.png"
 set yrange [0:52]
 set title "Last iteration for X(n+1)=X(n)*X(n) for iMax=50 ER=400" 
 set xlabel "X0" 
 set ylabel "Last iteration" 
 plot "data.txt" 
 save "data.plt"

C code

#include <stdio.h>
 #include <stdlib.h>
 int main(void)
 {
 int i,iMax=50,
     iX,iXmin=0,iXmax=1000;
 double X,
        X0,
        Xmin=0.9,
        Xmax=1.5,
        dX=(Xmax-Xmin)/(iXmax-iXmin),
         Y,
        ER=400, ER2=ER*ER;
 FILE *output_file;
 output_file = fopen("data.txt", "w");
 if (output_file  == NULL) 
     {fprintf(stderr, "Cannot open %s\n", "output_file");
     exit(911);
      }                
    else {
          fprintf(output_file,"%s %s        %s \n","#","X0","i");
          X0 = Xmin;
           for(iX=iXmin;iX<=iXmax;iX++)
          {
          X=X0;
          for (i=0;i<=iMax && (X<=ER2);i++) X*=X;
          fprintf(output_file,"%f  %d \n",X0,i);
           X0+=dX;
          }; // for(iX
        }; // if ((output_file ... else
 fclose(output_file);
 printf("file closed\n");
 getchar();	
 return 0;
 }

Text code

One can do all of it in Maxima without data file : 

 /* batch file = script for Maxima */
 /* global variables */
 xMin:0.0;
 xMax:3.0;
 iMax:10;
 ER:2.0;
 /* definition of function  */
 LastIteration(x):=
 block
 (
 i:0,
 if (x>ER) then return(i),
 loop,
 x:x*x,
 i:i+1,
 if ((x<ER) and (i<iMax)) then go(loop),
 return(i)
 );
 /* drawing */
 my_preamble: "set xzeroaxis; set arrow 1 from 2,4 to 2,2 lw 3 lt 1; set arrow 2 from 1,1 to 1,3 lw 3 lt 1; set ytics (0,1,2,3,4,5,'iMax' 10); set xtics (0,1,'ER' 2,3); set title 'Last iteration for X(n+1)=X(n)*X(n) for iMax=10 ER=2'";
 /* pass to plot2d the function name ( for example f ), not a call to the function, for example f(x)  */
 plot2d(LastIteration,[x,xMin,xMax],[y,-1,iMax+1],[ylabel, "Last Iteration"],[gnuplot_preamble, my_preamble]);

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following licenses:
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.
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International, 3.0 Unported, 2.5 Generic, 2.0 Generic and 1.0 Generic 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 attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
  • share alike If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

You may select the license of your choice.

File history

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

Date/TimeThumbnailDimensionsUserComment
current20:21, 13 April 2008Thumbnail for version as of 20:21, 13 April 2008640 480 (3 KB)Adam majewski{{Information |Description=Last iteration for Julia set with c=0 |Source=self-made |Date= |Author= Adam majewski |Permission= |other_versions= }}
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):

Global file usage

The following other wikis use this file: