| 1 | package Model; |
|---|
| 2 | |
|---|
| 3 | import viabController.Point; |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | public class Population extends Dynamic_System { |
|---|
| 13 | |
|---|
| 14 | Population() { |
|---|
| 15 | |
|---|
| 16 | this.nbDim_ = 2; |
|---|
| 17 | this.nbDimControl_ = 1; |
|---|
| 18 | this.initSystem(); |
|---|
| 19 | |
|---|
| 20 | this.lowerBoundState_[0] = 0.2f; |
|---|
| 21 | this.upperBoundState_[0] = 3; |
|---|
| 22 | this.lowerBoundState_[1] = -2; |
|---|
| 23 | this.upperBoundState_[1] = 2; |
|---|
| 24 | this.lowerBoundControl_[0] = -0.5f; |
|---|
| 25 | this.upperBoundControl_[0] = 0.5f; |
|---|
| 26 | this.dt_ = 0.2; |
|---|
| 27 | |
|---|
| 28 | this.theoricCurves_ = true; |
|---|
| 29 | this.nbLineTheoric = 2; |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | @Override |
|---|
| 37 | public Point computePhi(Point inP, Point inU) { |
|---|
| 38 | Point res = new Point(inP.nbDim_); |
|---|
| 39 | res.vect_[ 0] = (float) (inP.vect_[ 0] * inP.vect_[1]); |
|---|
| 40 | res.vect_[ 1] = inU.vect_[ 0]; |
|---|
| 41 | return res; |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | @Override |
|---|
| 45 | public double fTheoric(double inX, int i) { |
|---|
| 46 | if (i == 1) { |
|---|
| 47 | return Math.sqrt(2 * this.upperBoundControl_[0] * Math.log(this.upperBoundState_[0] / inX)); |
|---|
| 48 | } else { |
|---|
| 49 | return -Math.sqrt(2 * this.upperBoundControl_[0] * Math.log(inX / this.lowerBoundState_[0])); |
|---|
| 50 | } |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | @Override |
|---|
| 61 | public Point derivative(Point inP, Point inU, int indice, float betaHNorme) { |
|---|
| 62 | Point res = new Point(inP.nbDim_); |
|---|
| 63 | |
|---|
| 64 | res.vect_[0] = (float) 0; |
|---|
| 65 | res.vect_[1] = (float) 1; |
|---|
| 66 | return this.norme(res); |
|---|
| 67 | } |
|---|
| 68 | } |
|---|