01: package JSci.maths.chaos;
02:
03: import JSci.maths.*;
04:
05: /**
06: * The HenonMap class provides an object that encapsulates the Henon map.
07: * x<sub>n+1</sub> = 1 - a x<sub>n</sub><sup>2</sup> + y<sub>n</sub>
08: * y<sub>n+1</sub> = b x<sub>n</sub>
09: * @version 1.0
10: * @author Mark Hale
11: */
12: public final class HenonMap extends Object implements MappingND {
13: private final double a;
14: private final double b;
15: /**
16: * Chaotic a parameter value.
17: */
18: public final static double A_CHAOS = 1.4;
19: /**
20: * Chaotic b parameter value.
21: */
22: public final static double B_CHAOS = 0.3;
23:
24: /**
25: * Constructs a Henon map.
26: * @param aval the value of the a parameter
27: * @param bval the value of the b parameter
28: */
29: public HenonMap(double aval, double bval) {
30: a = aval;
31: b = bval;
32: }
33:
34: /**
35: * Performs the mapping.
36: * @param x a 2-D double array
37: * @return a 2-D double array
38: */
39: public double[] map(double x[]) {
40: double ans[] = new double[2];
41: ans[0] = 1.0 - a * x[0] * x[0] + x[1];
42: ans[1] = b * x[0];
43: return ans;
44: }
45:
46: public double hausdorffDimension() {
47: return 1.26;
48: }
49:
50: /**
51: * Iterates the map.
52: * @param n the number of iterations
53: * @param x the initial values (2-D)
54: * @return a 2-D double array
55: */
56: public double[] iterate(int n, double x[]) {
57: double xn[] = map(x);
58: for (int i = 1; i < n; i++)
59: xn = map(xn);
60: return xn;
61: }
62: }
|