Chaotic Motion  1.0
Chen.cs
1 using UnityEngine;
2 using System.Collections;
3 
4 // eqn (28) from http://lsc.amss.ac.cn/~ljh/04LCC.pdf
5 public class Chen : ChaosEqn {
6 
7  private float a ;
8  private float b ;
9  private float c ;
10 
11  public Chen() {
12  name = "Chen";
13 
14  eqnStrings = new string[]{
15  "xdot = a(y-x)",
16  "ydot = (c-a)x - xz + cy",
17  "zdot = xy - bz"
18  };
19 
20  paramBundles = new ParamBundle[] {
21  // sigma, b, rho
22  new ParamBundle("default (scaled)", 40f, 3f, 28f,
23  new Vector3(-0.1f, 0.5f, -0.6f), new Vector3(-2.5f, -3f, -18.9f), 0.25f),
24  new ParamBundle("default", 40f, 3f, 28f,
25  new Vector3(-0.1f, 0.5f, -0.6f)),
26  };
27 
28  paramNames = new string[] { "a", "b", "c"};
29  slideShowSpeed = 0.9f;
30  }
31 
32  public override void SetParams(ParamBundle pb)
33  {
34  a = pb.eqnParam[0];
35  b = pb.eqnParam[1];
36  c = pb.eqnParam[2];
37  }
38 
39  public override void Function(ref float[] x_in, ref float[] x_out) {
40  x_out[0] = a*(x_in[1]-x_in[0]);
41  x_out[1] = (c-a)*x_in[0] - x_in[0]*x_in[2] + c*x_in[1];
42  x_out[2] = x_in[0]*x_in[1] - b * x_in[2];
43  }
44 
45 }
override void Function(ref float[] x_in, ref float[] x_out)
Evaluate the first order evolution of the attractor, given the current position.
Definition: Chen.cs:39
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: Chen.cs:32
Chaos eqn. Base class for all equations that define a 3D chaotic system.
Definition: ChaosEqn.cs:9
Definition: Chen.cs:5
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