MotorStateFeedback.java
01 /*
02  * $Id$
03  *
04  * Copyright (C) 2004 Koga Laboratory. All rights reserved.
05  *
06  */
07 package matxbook.chap21;
08 
09 import org.mklab.nfc.matrix.Matrix;
10 import org.mklab.tool.control.system.continuous.BaseContinuousDynamicSystem;
11 
12 
13 /**
14  * モーターの状態フィードバック制御システムを表すクラスです。
15  
16  @author koga
17  @version $Revision$, 2004/04/23
18  */
19 public class MotorStateFeedback extends BaseContinuousDynamicSystem {
20   /** モーター */
21   Motor motor = new Motor();
22   /** 状態フィードバック制御器 */
23   StateFeedback stateFeedback = new StateFeedback();
24 
25   /**
26    * コンストラクター
27    */
28   public MotorStateFeedback() {
29     super(112);
30     setHasDirectFeedthrough(false);
31   }
32 
33   /**
34    @see org.mklab.tool.control.system.continuous.ContinuousDynamicSystem#stateEquation(double, org.mklab.nfc.matrix.Matrix, org.mklab.nfc.matrix.Matrix)
35    */
36   public Matrix stateEquation(double t, Matrix x, Matrix u) {
37     return this.motor.stateEquation(t, x, u);
38   }
39 
40   /**
41    @see org.mklab.tool.control.system.continuous.BaseContinuousDynamicSystem#inputOutputEquation(double, org.mklab.nfc.matrix.Matrix)
42    */
43   @Override
44   public Matrix inputOutputEquation(double t, Matrix x) {
45     Matrix y = this.motor.outputEquation(t, x);
46     Matrix u = this.stateFeedback.outputEquation(t, y);
47     return u.appendDown(y);
48   }
49 
50   /**
51    @see org.mklab.tool.control.system.continuous.BaseContinuousDynamicSystem#outputEquation(double, org.mklab.nfc.matrix.Matrix)
52    */
53   @Override
54   public Matrix outputEquation(double t, Matrix x) {
55     return this.motor.outputEquation(t, x);
56   }
57 
58   /**
59    @see org.mklab.tool.control.system.DynamicSystem#setInitialState(org.mklab.nfc.matrix.Matrix)
60    */
61   @Override
62   public void setInitialState(Matrix initialState) {
63     this.motor.setInitialState(initialState);
64   }
65 
66   /**
67    @see org.mklab.tool.control.system.DynamicSystem#getInitialState()
68    */
69   @Override
70   public Matrix getInitialState() {
71     return this.motor.getInitialState();
72   }
73 
74   /**
75    @see org.mklab.tool.control.system.DynamicSystem#setState(org.mklab.nfc.matrix.Matrix)
76    */
77   @Override
78   public void setState(Matrix state) {
79     this.motor.setState(state);
80   }
81 
82   /**
83    @see org.mklab.tool.control.system.DynamicSystem#getState()
84    */
85   @Override
86   public Matrix getState() {
87     return this.motor.getState();
88   }
89 }