Chaotic Motion  1.0
LuChenCheng.cs
1 using UnityEngine;
2 using System.Collections;
3 
4 
5 // eqn (28) from http://lsc.amss.ac.cn/~ljh/04LCC.pdf
6 public class LuChenCheng : ChaosEqn {
7 
8  private float a ;
9  private float b ;
10 
11  public LuChenCheng() {
12  name = "LuChenCheng";
13 
14  eqnStrings = new string[]{
15  "xdot = -(ab)/(a+b)x - yz",
16  "ydot = ay + xy",
17  "zdot = bz + xy"
18  };
19 
20  paramBundles = new ParamBundle[] {
21  // sigma, b, rho
22  new ParamBundle("default (scaled)", -6f, -15f, 0f,
23  new Vector3(1f, 0f, 1f), new Vector3(-3.4f, -20.1f, -4f ), 0.12f),
24  new ParamBundle("default", -6f, -15f, 0f,
25  new Vector3(1f, 0f, 1f)),
26  };
27 
28  paramNames = new string[] { "a", "b", ChaoticSystem.NO_PARAM};
29 
30  }
31 
32  public override void SetParams(ParamBundle pb)
33  {
34  a = pb.eqnParam[0];
35  b = pb.eqnParam[1];
36  }
37 
38  public override void Function(ref float[] x_in, ref float[] x_out) {
39  x_out[0] = -(a*b)*x_in[0]/(a+b) - x_in[1]*x_in[2];
40  x_out[1] = a*x_in[1] + x_in[0]*x_in[2];
41  x_out[2] = b*x_in[2] + x_in[0]*x_in[1];
42  }
43 
44 }
Chaotic system. Base class for chaotic scripts. Holds the type of system selected, the parameter set or the custom parameters to be used.
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: LuChenCheng.cs:38
override void SetParams(ParamBundle pb)
Sets the parameter bunlde to be used by the system.
Definition: LuChenCheng.cs:32
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