ContinuousObserver.java
01 /*
02  * $Id: ContinuousObserver.java,v 1.5 2008/06/26 10:10:34 koga Exp $
03  *
04  * Copyright (C) 2004 Koga Laboratory. All rights reserved.
05  *
06  */
07 package matxbook.chap21;
08 
09 import org.mklab.nfc.matrix.DoubleMatrix;
10 import org.mklab.nfc.matrix.Matrix;
11 import org.mklab.tool.control.system.continuous.BaseContinuousDynamicSystem;
12 
13 
14 /**
15  * 連続時間オブザーバーを表すクラスです。
16  
17  @author koga
18  @version $Revision: 1.5 $, 2004/04/23
19  */
20 public class ContinuousObserver extends BaseContinuousDynamicSystem {
21   /** 係数行列 */
22   Matrix Ah = new DoubleMatrix(new double[] {-3});
23   /** 係数行列 */
24   Matrix Bh = new DoubleMatrix(new double[] {-6});
25   /** 係数行列 */
26   Matrix Jh = new DoubleMatrix(new double[] {1});
27   /** 係数行列 */
28   Matrix Ch = new DoubleMatrix(new double[][] { {0}{1}});
29   /** 係数行列 */
30   Matrix Dh = new DoubleMatrix(new double[][] { {1}{2}});
31 
32   /**
33    * コンストラクター
34    */
35   public ContinuousObserver() {
36     super(221);
37   }
38 
39   /**
40    @see org.mklab.tool.control.system.continuous.ContinuousDynamicSystem#stateEquation(double, org.mklab.nfc.matrix.Matrix, org.mklab.nfc.matrix.Matrix)
41    */
42   @SuppressWarnings("unused"
43   public Matrix stateEquation(double t, Matrix z, Matrix uy) {
44     Matrix u = uy.getSubVector(11);
45     Matrix y = uy.getSubVector(22);
46     Matrix dz = this.Ah.multiply(z).add(this.Bh.multiply(y)).add(this.Jh.multiply(u));
47     return dz;
48   }
49 
50   /**
51    @see org.mklab.tool.control.system.continuous.BaseContinuousDynamicSystem#outputEquation(double, org.mklab.nfc.matrix.Matrix, org.mklab.nfc.matrix.Matrix)
52    */
53   @Override
54   @SuppressWarnings("unused"
55   public Matrix outputEquation(double t, Matrix z, Matrix y) {
56     Matrix xh = this.Ch.multiply(z).add(this.Dh.multiply(y));
57     return xh;
58   }
59 }