Chaotic Motion  1.0
LuiChen.cs
1 using UnityEngine;
2 using System.Collections;
3 
4 // http://chaoticatmospheres.deviantart.com/art/Strange-Attractors-The-Liu-Chen-Attractor-376173482
5 public class LiuChen : ChaosEqn {
6 
7  private float alpha ;
8  private float beta ;
9  private float eta ;
10  private float delta ;
11  private float epsilon;
12  private float rho;
13  private float zeta;
14 
15  public LiuChen() {
16  name = "LiuChen";
17 
18  eqnStrings = new string[]{
19  "xdot = alpha y + beta x + eta yz",
20  "ydot = delta y - z + epsilon x z",
21  "zdot = zeta z + rho xy"
22  };
23 
24  paramBundles = new ParamBundle[] {
25 // new ParamBundle("default (scaled)", 5f, -10f, -0.38f,
26 // new Vector3(1f,1f,1f), new Vector3(-04.1f,-04.4f,-15.5f), 0.15f),
27  new ParamBundle("default", new float[] {2.4f, -3.78f, 14f, -11f, 4f, 5.58f, 1f},
28  new Vector3(0.1f, 0, 0)),
29  };
30 
31  paramNames = new string[] { "alpha", "beta", "eta", "delta", "eplsilon", "rho", "zeta"};
32  slideShowSpeed = 1f;
33  }
34 
35  public override void SetParams(ParamBundle pb)
36  {
37  alpha = pb.eqnParam[0];
38  beta = pb.eqnParam[1];
39  eta = pb.eqnParam[2];
40  delta = pb.eqnParam[3];
41  epsilon = pb.eqnParam[4];
42  rho = pb.eqnParam[5];
43  zeta = pb.eqnParam[6];
44  }
45 
46  public override void Function(ref float[] x_in, ref float[] x_out) {
47  x_out[0] = alpha*x_in[1] + beta*x_in[0] + eta*x_in[1]*x_in[2];
48  x_out[1] = delta*x_in[1] - x_in[2] + epsilon*x_in[0]*x_in[2];
49  x_out[2] = zeta*x_in[2] + rho*x_in[0]*x_in[1];
50  }
51 
52 }
float[] eqnParam
parameters used in the equation
Definition: ParamBundle.cs:19
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: LuiChen.cs:46
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
override void SetParams(ParamBundle pb)
Sets the parameter bunlde to be used by the system.
Definition: LuiChen.cs:35