Chaotic Motion  1.0
Anishchenko_Astakhov.cs
1 using UnityEngine;
2 using System.Collections;
3 
4 // from http://chaoticatmospheres.com/mathrules-strange-attractors
5 public class Anishchenko_Astakhov : ChaosEqn {
6 
7  private float mu ;
8  private float eta ;
9 
10  public Anishchenko_Astakhov() {
11  name = "Anishchenko_Astakhov";
12 
13  eqnStrings = new string[]{
14  "xdot = mu x + y - x z",
15  "ydot = -x",
16  "zdot = -eta z + eta I(x) x^2"
17  };
18 
19  paramBundles = new ParamBundle[] {
20  new ParamBundle("default (scaled)", 1.2f, 0.5f, 0f,
21  new Vector3(0.1f, 0f, 0f), new Vector3(-00.6f,-02.3f,-01.9f), 1.54f),
22  new ParamBundle("default", 1.2f, 0.5f, 0f,
23  new Vector3(0.1f, 0f, 0f)),
24  };
25 
26  paramNames = new string[] { "mu", "eta"};
27  slideShowSpeed = 2.5f;
28  }
29 
30  public override void SetParams(ParamBundle pb)
31  {
32  mu = pb.eqnParam[0];
33  eta = pb.eqnParam[1];
34  }
35 
36  public override void Function(ref float[] x_in, ref float[] x_out) {
37  x_out[0] = mu*x_in[0] + x_in[1] - x_in[0]*x_in[2];
38  x_out[1] = -x_in[0];
39  float I = (x_in[0] > 0) ? 1f: 0f;
40  x_out[2] = -eta* x_in[2] + eta * I * x_in[0]*x_in[0];
41  }
42 
43 }
override void Function(ref float[] x_in, ref float[] x_out)
Evaluate the first order evolution of the attractor, given the current position.
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 SetParams(ParamBundle pb)
Sets the parameter bunlde to be used by the system.
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