GSESUB/GSEXX/GSEXU/GSEYX/GSEYU
モデリング入力、内部状態、および出力を定義した一般的なシステムを表すために使用します。
定義
非線形時変システムをモデル化するために使用できます。通常は、一般状態方程式を使用して、自動制御理論またはサードパーティソフトウェアパッケージを統合できます。最も一般的な実装では、GSESUBが代数方程式または微分方程式の任意のシステムを表すために使用されます。
使用
一般状態方程式のエンティティ:
<Control_StateEqn
id = "301001"
type = "USERSUB"
x_solver_array_id = "30100200"
y_solver_array_id = "30100300"
u_solver_array_id = "30100100"
ic_solver_array_id = "0"
num_state = "2"
num_output = "1"
usrsub_param_string = "USER(0,1,-10,.1,10,0,0,1)"
usrsub_dll_name = "NULL"
is_static_hold = "FALSE"
/>
フォーマット
Fortranの呼出し構文
SUBROUTINE GSESUB (ID, TIME, PAR, NPAR, DFLAG, IFLAG,NSTATE, STATES, NINPUT, INPUT, NOUTPT, STATED, OUTPUT)
SUBROUTINE GSEXU (ID, TIME, PAR, NPAR, IFLAG, NSTATE,STATES, NINPUT, INPUT, NOUTPT, PXUMAT)
SUBROUTINE GSEXX (ID, TIME, PAR, NPAR, IFLAG, NSTATE,STATES, NINPUT, INPUT, NOUTPT, PXXMAT)
SUBROUTINE GSEYU (ID, TIME, PAR, NPAR, IFLAG, NSTATE, STATES, NINPUT, INPUT, NOUTPT, PYUMAT)
SUBROUTINE GSEYX (ID, TIME, PAR, NPAR, IFLAG, NSTATE, STATES, NINPUT, INPUT, NOUTPT, PYXMAT)
Cの呼出し構文
void STDCALL GSESUB (int *id, double *time, double *par, int *npar,int *dflag, int *iflag, int
*nstate, double *states,int *ninput, double *input, int *noutpt, double *stated,double *output)
void STDCALL GSEXU (int *id, double *time, double *par, int *npar, int *iflag, int
*nstate,double *states, int *ninput, double *input, int *noutpt, double *pxumat)
void STDCALL GSEXX (int *id, double *time, double *par, int *npar, int *iflag, int
*nstate, double *states, int *ninput, double *input, int *noutpt, double *pxxmat)
void STDCALL GSEYU (int *id, double *time, double *par, int *npar, int *iflag, int
*nstate, double *states, int *ninput, double *input, int *noutpt, double *pyumat)
void STDCALL GSEYX (int *id, double *time, double *par, int *npar, int *iflag, int
*nstate, double *states, int *ninput, double *input, int *noutpt, double *pyxmat)
Pythonの呼出し構文
def GSESUB(id, time, par, npar, dflag, iflag, nstate, states, ninput,input, noutpt):
return [stated, output]
def GSEXU(id, time, par, npar, iflag, nstate, states, ninput,input, noutpt):
return pxumat
def GSEXX(id, time, par, npar, iflag, nstate, states, ninput,input, noutpt):
return pxxmat
def GSEYU(id, time, par, npar, iflag, nstate, states, ninput,input, noutpt):
return pyumat
def GSEYX(id, time, par, npar, iflag, nstate, states, ninput,input, noutpt):
return pyxmat
MATLABの呼出し構文
function [stated, output] = GSESUB(id, time, par, npar, dflag, iflag, nstate, states, ninput, input, noutpt)
function pxumat = GSEXU(id, time, par, npar, iflag, nstate, states, ninput, input, noutpt)
function pxxmat = GSEXX(id, time, par, npar, iflag, nstate, states, ninput, input, noutpt)
function pyumat = GSEYU(id, time, par, npar, iflag, nstate, states, ninput, input, noutpt)
function pyxmat = GSEYX(id, time, par, npar, iflag, nstate, states, ninput, input, noutpt)
GSESUBは、次の一般状態方程式内のf関数とg関数を評価します。
x' = f(x,u,t)
y = g(x,u,t)
ここで、xは状態のベクトル、x'は状態導関数のベクトル、uは入力、yは出力です。
属性
- ID
- [整数]
- TIME
- [倍精度]
- PAR
- [倍精度]
- NPAR
- [整数]
- DFLAG
- [論理]
- IFLAG
- [論理]
- NSTATE
- [整数]
- STATES
- [倍精度]
- NINPUT
- [整数]
- INPUT
- [倍精度]
- NOUTPT
- [整数]
出力
- STATED
- [倍精度]
- OUTPUT
- [倍精度]
例
def GSESUB(id, time, par, npar, dflag, iflag, nstate, states, ninput,input, noutpt):
stated = []
for i in xrange (nstate):
stated.append(0.0)
output = []
for i in xrange(noutpt):
output.append(0.0)
ax = int(par[1])
au = int(par[2])
A = [[0.0, 0.0], [0.0, 0.0]]
A[0][0] = -1.0e3
A[0][1] = -2.0e4
A[1][0] = 0.0
A[1][1] = -1.0e3
B = []
B.append([0.0, -1.0])
B.append([1.0,0.0])
C = []
C.append(1.0e3)
C.append(0.0)
stated[0] = A[0][0]*states[0] + A[0][1]*states[1] + B[0][0]*input[0] + B [0][1]*input[1]
stated[1] = A[1][0]*states[0] + A[1][1]*states[1] + B[1][0]*input[0] + B [1][1]*input[1]
output[0] = C[0]*states[0] + C[1]*states[1];
return [stated, output]
def GSEXX(id, time, par, npar, iflag, nstate, states, ninput,input, noutpt):
pxxmat = []
for i in xrange(nstate*nstate):
pxxmat.append(0.0)
pxxmat[0] = -1.0e3
pxxmat[1] =0.0
pxxmat[2] = -2.0e4
pxxmat[3] = -1.0e3
return pxxmat
def GSEXU(id, time, par, npar, iflag, nstate, states, ninput,input, noutpt):
pxumat = []
for i in xrange(nstate*ninput):
pxumat.append(0.0)
pxumat[0] = 0.0
pxumat[1] = 1.0
pxumat[2] = -1.0
pxumat[3] = 0.0
return pxumat