Class Scalemap

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----ChaosDemos.dynamicGraph
                                           |
                                           +----Scalemap

public class Scalemap
extends dynamicGraph
Iterates and plots the quadratic and sine maps, and demonstrates functional composition and rescaling.
Uses the "Java Graph Class Library" by Leigh Brrokshaw

Version:
3 August, 1997
Author:
Michael Cross

Variable Index

 o a
map parameter
 o atext
string value of a: used because of string truncation
 o buttons
 o delay
sleep delay in ms in dynamic iteration
 o f
iterate of x
 o iterateCurve
index of iteration curve
 o ncurve
number of curves
 o nf
compositions -> nit
 o nfun
function: 0=Quadratic; 1=Sine
 o nit
nit = 2^nf -> functional composition
 o np
Number of points in plot of f(x)
 o nsc
scaling factor: f and x are rescaled by (-alpha)^nsc
 o trans
iterations to eliminate transients
 o x
map variable
 o x0
starting value of x
 o xmin
initial value of x - scale
 o xscale
rescaled value of x- scale

Constructor Index

 o Scalemap(startMap)

Method Index

 o disableAll()
Disables text input and choice contorls
 o enableAll()
Enables text input and choice contorls
 o function(int)
Returns map function of class variable x
 o handleEvent(Event)
Event handler: Stops iteration on minimising and handles close window event
(May fail under Windows95)
 o iterate()
Iterates class variables via map functions x->f f->f(x)
 o movieStart()
Start movie thread
 o movieStop()
Stop movie thread
 o respondToButtons(int)
Respond to buttonControls
 o respondToMouse(double, boolean, double, boolean)
Restarts iteration on mouse click
 o respondToText()
Responds to textControls
 o restart()
Resets plot by deleting all curves and restarting
 o seta(double, int)
Resets the parameter a and function number.
 o stop()
Stop thread
 o updateParameters()
Updates parameters from the text controls

Variables

 o np
 int np
Number of points in plot of f(x)

 o nit
 int nit
nit = 2^nf -> functional composition

 o ncurve
 int ncurve
number of curves

 o iterateCurve
 int iterateCurve
index of iteration curve

 o trans
 int trans
iterations to eliminate transients

 o nf
 int nf
compositions -> nit

 o nsc
 int nsc
scaling factor: f and x are rescaled by (-alpha)^nsc

 o delay
 int delay
sleep delay in ms in dynamic iteration

 o nfun
 int nfun
function: 0=Quadratic; 1=Sine

 o x
 double x
map variable

 o f
 double f
iterate of x

 o a
 double a
map parameter

 o atext
 String atext
string value of a: used because of string truncation

 o xmin
 double xmin
initial value of x - scale

 o xscale
 double xscale
rescaled value of x- scale

 o x0
 double x0
starting value of x

 o buttons
 buttonControls buttons

Constructors

 o Scalemap
 Scalemap(startMap target)
Parameters:
target - starting class
See Also:
startMap

Methods

 o respondToButtons
 public void respondToButtons(int buttonIndex)
Respond to buttonControls

Parameters:
buttonIndex - index of button pushed
Overrides:
respondToButtons in class dynamicGraph
See Also:
buttonControls
 o respondToText
 public void respondToText()
Responds to textControls

Overrides:
respondToText in class dynamicGraph
See Also:
textControls
 o movieStop
 public void movieStop()
Stop movie thread

 o movieStart
 public void movieStart()
Start movie thread

 o handleEvent
 public boolean handleEvent(Event evt)
Event handler: Stops iteration on minimising and handles close window event
(May fail under Windows95)

Overrides:
handleEvent in class Component
 o disableAll
 public void disableAll()
Disables text input and choice contorls

 o enableAll
 public void enableAll()
Enables text input and choice contorls

 o seta
 public void seta(double ain,
                  int n)
Resets the parameter a and function number. Stores atext for later comparison (because string truncates accuracy of double)

 o function
 public double function(int n)
Returns map function of class variable x

Parameters:
n - number of iterations
 o updateParameters
 public void updateParameters()
Updates parameters from the text controls

 o restart
 public void restart()
Resets plot by deleting all curves and restarting

 o iterate
 public boolean iterate()
Iterates class variables via map functions x->f f->f(x)

Overrides:
iterate in class dynamicGraph
 o stop
 public void stop()
Stop thread

 o respondToMouse
 public void respondToMouse(double xcoord,
                            boolean xcoordValid,
                            double ycoord,
                            boolean ycoordValid)
Restarts iteration on mouse click

Parameters:
xcoord - x-coordinate of event
xcoordValid - true if event within x-range set by axes
ycoord - y-coordinate of event
ycoordValid - true if event within y-range set by axes
Overrides:
respondToMouse in class dynamicGraph