public class TFunc2ndOrderBlock extends CMLControlBlock1stOrderAdapter
Transfer Function:
y = [ k / ( 1 + a s + b s^2 ) ] u
Differential eqn
dot(x1) = | 0 1 | |x1| + | 0 | u
dot(x2) | -1/b -a/b | |x2| |k/b|
y = [ 1 0 ] |x1| = x1
|x2|
x2(0) = 0
x1(0) = k * u(0);
y(0) = k * u(0);
ICMLStaticBlock.StaticBlockTypeserialVersionUID| Constructor and Description |
|---|
TFunc2ndOrderBlock(double k,
double a,
double b)
constructor
|
TFunc2ndOrderBlock(double k,
double a,
double b,
double max,
double min)
constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
eulerStep1(double u,
double dt)
Perform Euler step-1 calculation
|
void |
eulerStep2(double u,
double dt)
Perform Euler step-2 calculation
|
java.lang.String |
getState()
get block state as a string for debug info
|
double |
getU0()
get the controller initial input u0, it should be always called after
the intiState() call.
|
double |
getY()
get the controller output
|
boolean |
initStateU0(double u0)
Initial the controller state variables
|
boolean |
initStateY0(double y0)
Initial the controller state variables
|
java.lang.String |
toString() |
getU, setDX_dtgetStateX, readData, setStateX, writeDatadebugInfo, getType, getU0, setParameter, setTypeequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetU0, setParameterpublic TFunc2ndOrderBlock(double k,
double a,
double b)
k - a - b - public TFunc2ndOrderBlock(double k,
double a,
double b,
double max,
double min)
k - a - b - max - min - public java.lang.String getState()
CMLControlBlock1stOrderAdaptergetState in class CMLControlBlock1stOrderAdapterpublic boolean initStateY0(double y0)
ICMLStaticBlockinitStateY0 in interface ICMLStaticBlockinitStateY0 in class CMLStaticBlockAdaptery0 - output initial value.public boolean initStateU0(double u0)
ICMLStaticBlockinitStateU0 in interface ICMLStaticBlockinitStateU0 in class CMLStaticBlockAdapteru0 - input initial value.public double getU0()
ICMLStaticBlockgetU0 in interface ICMLStaticBlockgetU0 in class CMLStaticBlockAdapterpublic void eulerStep1(double u,
double dt)
ICMLStaticBlockeulerStep1 in interface ICMLStaticBlockeulerStep1 in class CMLControlBlock1stOrderAdapteru - the input variabledt - the time steppublic void eulerStep2(double u,
double dt)
ICMLStaticBlockeulerStep2 in interface ICMLStaticBlockeulerStep2 in class CMLControlBlock1stOrderAdapteru - the input variabledt - the time steppublic double getY()
ICMLStaticBlockgetY in interface ICMLStaticBlockgetY in class CMLControlBlock1stOrderAdapterpublic java.lang.String toString()
toString in class java.lang.Object