Chaotic Motion  1.0
DequanLee.cs
1 using UnityEngine;
2 using System.Collections;
3 
4 // http://chaoticatmospheres.deviantart.com/art/Strange-Attractors-The-Dequan-Li-Attractor-376066584
5 // http://3d-meier.de/tut19/Seite9.html
6 public class DequanLee : ChaosEqn {
7 
8  private float alpha ;
9  private float beta ;
10  private float delta ;
11  private float epsilon;
12  private float rho;
13  private float zeta;
14 
15  public DequanLee() {
16  name = "DequanLee";
17 
18  eqnStrings = new string[]{
19  "xdot = alpha(y-x) - delta xz",
20  "ydot = rho x + zeta y - xz",
21  "zdot = beta z + xy - epsilon x^2"
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[] {40f,1.833f,0.16f,0.65f,55f,20f},
28  new Vector3(0.349f,0f,-0.16f)),
29  };
30 
31  paramNames = new string[] { "alpha", "beta", "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  delta = pb.eqnParam[2];
40  epsilon = pb.eqnParam[3];
41  rho = pb.eqnParam[4];
42  zeta = pb.eqnParam[5];
43  }
44 
45  public override void Function(ref float[] x_in, ref float[] x_out) {
46  x_out[0] = alpha*(x_in[1]-x_in[0]) - delta*x_in[0]*x_in[2];
47  x_out[1] = rho*x_in[0] + zeta*x_in[1] - x_in[0]*x_in[2];
48  x_out[2] = beta*x_in[2] + x_in[0]*x_in[1] - epsilon*x_in[0]*x_in[0];
49  }
50 
51 }
override void SetParams(ParamBundle pb)
Sets the parameter bunlde to be used by the system.
Definition: DequanLee.cs:35
float[] eqnParam
parameters used in the equation
Definition: ParamBundle.cs:19
override void Function(ref float[] x_in, ref float[] x_out)
Evaluate the first order evolution of the attractor, given the current position.
Definition: DequanLee.cs:45
Chaos eqn. Base class for all equations that define a 3D chaotic system.
Definition: ChaosEqn.cs:9
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