Chaotic Motion  1.0
Bouali2.cs
1 using UnityEngine;
2 using System.Collections;
3 
4 // see http://chaoticatmospheres.deviantart.com/art/Strange-Attractors-The-2nd-Bouali-Attractor-375986029
5 public class Bouali2 : ChaosEqn {
6 
7  private float a;
8  private float b;
9 
10  public Bouali2() {
11  name = "Bouali2";
12 
13  eqnStrings = new string[]{
14  "xdot = x(4-y)+az",
15  "ydot = -y(1-x^2)",
16  "zdot = -x(1.5 - bz) - 0.05z "
17  };
18 
19  paramBundles = new ParamBundle[] {
20  new ParamBundle("default", new float[]{0.3f, 1f},
21  new Vector3(0f, 0, 0.1f)),
22 // new ParamBundle("default", new float[]{0.3f, 1f},
23 // new Vector3(0.5f, -1f, 0.5f)),
24  };
25 
26  paramNames = new string[] { "a", "b",};
27  slideShowSpeed = 1f;
28  }
29 
30  public override void SetParams(ParamBundle pb)
31  {
32  a = pb.eqnParam[0];
33  b = pb.eqnParam[1];
34  }
35 
36 
37 
38  public override void Function(ref float[] x_in, ref float[] x_out) {
39 
40  x_out[0] = x_in[0]*(4f-x_in[1]) + a*x_in[2];
41  x_out[1] = -x_in[1]*(1f-x_in[0]*x_in[0]);
42  x_out[2] = -x_in[0]*(1.5f - b * x_in[2]) - 0.05f*x_in[2];
43  }
44 
45 }
float[] eqnParam
parameters used in the equation
Definition: ParamBundle.cs:19
override void SetParams(ParamBundle pb)
Sets the parameter bunlde to be used by the system.
Definition: Bouali2.cs:30
Chaos eqn. Base class for all equations that define a 3D chaotic system.
Definition: ChaosEqn.cs:9
override void Function(ref float[] x_in, ref float[] x_out)
Evaluate the first order evolution of the attractor, given the current position.
Definition: Bouali2.cs:38
Parameter bundle. Container class to hold the values for starting a chaotic system. Holds the parameters for the equations and the initial position and scale values.
Definition: ParamBundle.cs:13