ohymosj
クラス PowerLawKinematicWave

java.lang.Object
  拡張ohymosj.OhObject
      拡張ohymosj.OhElement
          拡張ohymosj.PowerLawKinematicWave

public class PowerLawKinematicWave
extends OhElement

PowerLawKinematicWave; Power Law Kinematic Wave model for Stream Flow. 河道区間の流れを指数法則 kinematic wave 法で追跡するためのクラスです。

河道区間の流れを指数法則 kinematic wave 法で追跡します。 ここで、河道区間とはその内部に合流点を持たない1本の河道区間のことをいいます。 流量 Q は、通水断面積 A の指数関数 a*A^m で表現できるものとします。

バージョン:
$Revision: 1.38 $ $Date: 2004/02/10 20:08:11 $
作成者:
satoh

フィールドの概要
protected  double _a
          Parameter: kinematic constant a [m/sec] in Q = a*A^m
protected  double[] _cLateralIn
          Parameter: _cLateralIn[i] is a multiplication factor [-] to the i-th lateral inflow port _rpLateralIn[i].
protected  double[] _cUpIn
          Parameter: _cUpIn[i] is a multiplication factor [-] to the i-th inflow port from upstream end, _rpUpIn[i].
protected  int _dt
          Parameter: time step [sec] for finite difference calculation.
protected  double _dx
          Working variable: length of the division.
protected  double _epsilon
          Parameter: tolerance level of diffrence of two consecutive caluculated discharges to stop the iteration.
protected  InitialStateDataType _isdt
           初期時刻での流量の分布をどのように与えるかを指定する変数。
protected  double _lengthOfStream
          Parameter: length of the stream segment.
protected  double _m
          Parameter: kinematic constant m [-] in Q = a*A^m
protected  int _numOfLateralIn
          Structural variable: number of lateral inflows.
protected  int _numOfSepStream
          Parameter: number of divisions of the stream. [-] 河道区間を等分した数。
protected  int _numOfUpIn
          Structural variable: number of inflows from the upstream ends.
protected  double[] _qCrnt
          State variable: discharge Q [m^3/sec] ( = q * w) at current time.
protected  double _qLevel
          Parameter: tolerance level of diffrence of two consecutive caluculated discharges to stop the iteration.
protected  double[] _qNext
          Working variable: discharge Q [m^3/sec] at next time.
protected  OhReceiveDouble[] _rpLateralIn
          lateral inflow ports.
protected  OhReceiveDouble[] _rpUpIn
          inflow ports from the upstream end.
protected  OhSendDouble _sp
          Send port.
protected  double _theta
          Parameter: time weighting parameter [-].
 
クラス ohymosj.OhElement から継承したフィールド
_calReqP, _currentTime, _dataString, _fixedTime, _initialWorkDoneP, _numberOfObjects, _numberOfReceivePorts, _numberOfSendPorts, _objectArray, _objectList, _receivePortArray, _sendPortArray, _shareInfoDoneP, _targetTime, _timeStep
 
クラス ohymosj.OhObject から継承したフィールド
_className, _objectName, _objectNumber, _owner, NEWLINE
 
コンストラクタの概要
PowerLawKinematicWave()
          Creates a new default PowerLawKinematicWave instance.
PowerLawKinematicWave(java.lang.String aObjName, int aObjNum, java.lang.String aDataStr, int aNumOfUpIn, int aNumOfLateralIn)
          Creates a new SimpleDam instance.
 
メソッドの概要
 boolean calculate()
          The solution of power law kimematic wave model by Keith Beven's method.
 long calculateTimeStep()
           計算時間間隔は固定した値とします。
 boolean canYouCalculate()
           計算可能性の判断 OhElement クラスの メソッド OhElement.getNecessaryTimeFrom(), OhElement.getNecessaryTimeTo() で 定義される時間の間のデータが取得できれば計算可能と判断します。
 boolean init(java.lang.String aObjName, int aObjNum, OhBufferedReader aBr)
          Initialization.
 boolean init(java.lang.String aObjName, int aObjNum, java.lang.String aDataStr, int aNumOfUpIn, int aNumOfLateralIn)
          Initialization.
 boolean initialOutput()
           初期の出力を行ないます。
 void registerReceivePorts()
           全受信端子の登録 このメソッドは、この要素モデルが持つすべての受信端子を OhElement.register(Object) OhElement.register(Object, int) により登録します。
 void registerSendPorts()
           派生クラスの全送信端子の登録 このメソッドは、この要素モデルが持つすべての送信端子を OhElement.register(Object) OhElement.register(Object, int) により登録します。
 void saveTerminalState(java.io.PrintWriter aPw)
           最終状態を保存するメソッド
 void setInitialState(OhBufferedReader aBr)
           初期状態量の設定 入力ストリーム aBr で指定されるファイルからデータを読みとって初期状態量を設定します。
 void setParameter(OhBufferedReader aBr)
           パラメタの設定 入力ストリーム aBr で指定されるファイルからデータを読みとってパラメタを設定します。
 boolean work()
           _timeStep を得てから calculate() を実行する work0() を採用します。
 
クラス ohymosj.OhElement から継承したメソッド
areYouReady, calculateIterationStep, calReq, canYouCalculate0, canYouCalculate1, canYouGetDataString, canYouRenewCurrentTime, canYouSetObjectArray, canYouShareInfo, canYouSwitch, clearDataString, construct, create, doInitialWork, doShareInfo, doYouConverge, doYouReachTargetTime, flushData, getComponent, getComponent, getComponent, getComponent, getCurrentTime, getFixedTime, getFromArray, getFromArray, getFromList, getFromList, getInitialState, getMediumTermTargetTime, getNecessaryTimeFrom, getNecessaryTimeTo, getNextTime, getObject, getObject, getParameter, getReceivePort, getReceivePort, getReceivePort, getReceivePort, getSendPort, getSendPort, getSendPort, getSendPort, getTargetTime, getTerminalTime, getTimeStep, init, init, init, init, initializeTargetTime, initialWork, isInitialTime, makeObjectArray, printConnection, printConnection, printConnection, printConnection, printObjects, printReceivePorts, printReceivePorts, printReceivePorts, printReceivePorts, printSendPorts, printSendPorts, printSendPorts, printSendPorts, printStatus, recordStatus, reduceDataPackStock, register, register, renewFixedTime, renewTargetTime, restoreSendPortStock, rewindCurrentTime, saveSendPortStock, sendStockedData, setCur2Fix2Tar, setDataPackArray, terminalState, work0, work1, work2
 
クラス ohymosj.OhObject から継承したメソッド
cPrint, getAbsName, getClassName, getObjectName, getObjectNumber, getOwner, getTopOwner, objCompare, objCompare, objCompare, oPrint, setOwner
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

_numOfUpIn

protected int _numOfUpIn
Structural variable: number of inflows from the upstream ends. _numOfUpIn >= 0.


_numOfLateralIn

protected int _numOfLateralIn
Structural variable: number of lateral inflows. _numOfLateralIn >= 0.


_rpUpIn

protected OhReceiveDouble[] _rpUpIn
inflow ports from the upstream end.


_rpLateralIn

protected OhReceiveDouble[] _rpLateralIn
lateral inflow ports. Lateral inflow rate per unit length of stream will be calculated by multiplying constant _cLateralIn[i] with the value obtained from _rpLateralIn[i]


_sp

protected OhSendDouble _sp
Send port. Runoff discharge (m^3/sec) at the slopeend or the stream end.

送信端子は1個です。 得られるデータは OhDataPackDouble 型です。 データ補間型は DataConnectionType.BROKENLINE です。

河道下流端からの流出量が得られます。 計算された流出量の次元は [m^3/sec] です。


_a

protected double _a
Parameter: kinematic constant a [m/sec] in
   Q = a*A^m
 


_m

protected double _m
Parameter: kinematic constant m [-] in
   Q = a*A^m
 


_lengthOfStream

protected double _lengthOfStream
Parameter: length of the stream segment. [m]

河道区間の長さ。[m]


_numOfSepStream

protected int _numOfSepStream
Parameter: number of divisions of the stream. [-]

河道区間を等分した数。[-]


_dt

protected int _dt
Parameter: time step [sec] for finite difference calculation. Time step is fixed in this calculation model.

計算時間間隔。[sec]

このモデルでは固定値として扱います。


_theta

protected double _theta
Parameter: time weighting parameter [-]. The standard value of theta is 0.5. If theta = 0, the finite difference calculation scheme becomes an explicit one.


_epsilon

protected double _epsilon
Parameter: tolerance level of diffrence of two consecutive caluculated discharges to stop the iteration.


_qLevel

protected double _qLevel
Parameter: tolerance level of diffrence of two consecutive caluculated discharges to stop the iteration.


_cUpIn

protected double[] _cUpIn
Parameter: _cUpIn[i] is a multiplication factor [-] to the i-th inflow port from upstream end, _rpUpIn[i].


_cLateralIn

protected double[] _cLateralIn
Parameter: _cLateralIn[i] is a multiplication factor [-] to the i-th lateral inflow port _rpLateralIn[i].


_qCrnt

protected double[] _qCrnt
State variable: discharge Q [m^3/sec] ( = q * w) at current time.


_dx

protected double _dx
Working variable: length of the division. [m]
   _dx = _lengthOfStream / _numOfSepStream
 


_qNext

protected double[] _qNext
Working variable: discharge Q [m^3/sec] at next time.


_isdt

protected InitialStateDataType _isdt
初期時刻での流量の分布をどのように与えるかを指定する変数。 ONLY_DOWN_STREAM_END なら、下流端で流量を与えて、他は内挿。 EVERY_SECTION なら、x = _dx, 2*_dx, ..., _numOfSepStream * _dx の分点で流量を与える。

Supplemental variable for setting initial state.

コンストラクタの詳細

PowerLawKinematicWave

public PowerLawKinematicWave()
Creates a new default PowerLawKinematicWave instance.

例外:
OhError - if an error occurs

PowerLawKinematicWave

public PowerLawKinematicWave(java.lang.String aObjName,
                             int aObjNum,
                             java.lang.String aDataStr,
                             int aNumOfUpIn,
                             int aNumOfLateralIn)
                      throws OhError
Creates a new SimpleDam instance. Uses init(String, int, String, int, int).

パラメータ:
aObjName - a String value
aObjNum - an int value
aDataStr - a String value
aNumOfUpIn - an int value
aNumOfLateralIn - an int value
例外:
OhError - if an error occurs
メソッドの詳細

init

public boolean init(java.lang.String aObjName,
                    int aObjNum,
                    OhBufferedReader aBr)
             throws OhError
Initialization.

Uses init(String, int, String, int, int).

オーバーライド:
クラス OhElement 内の init
パラメータ:
aObjName - a String value
aObjNum - an int value
aBr - an OhBufferedReader value
戻り値:
a boolean value
例外:
OhError - if an error occurs

init

public boolean init(java.lang.String aObjName,
                    int aObjNum,
                    java.lang.String aDataStr,
                    int aNumOfUpIn,
                    int aNumOfLateralIn)
             throws OhError
Initialization.

Uses OhElement.init(String, int, int, String).

パラメータ:
aObjName - a String value
aObjNum - an int value
aDataStr - a String value
aNumOfUpIn - an int value
aNumOfLateralIn - an int value
戻り値:
a boolean value
例外:
OhError - if an error occurs

registerReceivePorts

public void registerReceivePorts()
                          throws OhError
全受信端子の登録

このメソッドは、この要素モデルが持つすべての受信端子を OhElement.register(Object) OhElement.register(Object, int) により登録します。

登録されていない端子は接続できないので送受信に利用できません。

定義:
クラス OhElement 内の registerReceivePorts
例外:
OhError - if an error occurs

registerSendPorts

public void registerSendPorts()
                       throws OhError
派生クラスの全送信端子の登録

このメソッドは、この要素モデルが持つすべての送信端子を OhElement.register(Object) OhElement.register(Object, int) により登録します。

登録されていない端子は接続できないので送受信に利用できません。

定義:
クラス OhElement 内の registerSendPorts
例外:
OhError - if an error occurs

setParameter

public void setParameter(OhBufferedReader aBr)
                  throws OhError
パラメタの設定

入力ストリーム aBr で指定されるファイルからデータを読みとってパラメタを設定します。

定義:
クラス OhElement 内の setParameter
パラメータ:
aBr - an OhBufferedReader value
例外:
OhError - if an error occurs

setInitialState

public void setInitialState(OhBufferedReader aBr)
                     throws OhError
初期状態量の設定

入力ストリーム aBr で指定されるファイルからデータを読みとって初期状態量を設定します。

定義:
クラス OhElement 内の setInitialState
パラメータ:
aBr - an OhBufferedReader value
例外:
OhError - if an error occurs

initialOutput

public boolean initialOutput()
                      throws OhError
クラス OhElement の記述:
初期の出力を行ないます。

初期状態量を決めた直後に、_currentTime での出力を定義します。 送信端子に時刻と出力値を書き込みます。 _currnetTime での出力が計算できた場合は true を返します。 必要な入力データが得られていないなどして、 _currentTime の出力が計算できなかった場合は false を返します。

要素によっては、setInitialState() の中で 初期の出力をするようにした方が都合がよいかも知れません。 たとえば、初期値設定のために与えられる文字列によって、 初期の出力のやり方を変えたりする場合などです。 そうした場合は、initialOutput() は何もしないように定義して、 setInitialState() で初期の出力をするように定義しても構いません。

An initial output. In classes derived from class Element, its definition should be given.

The output in "_currentTime" is defined immediately after deciding the amount of initial states. Time and an output value are written in a sending port. "true" is returned when the output in "_currentTime" is able to be calculated. "false" is returned when the output of "_currentTime" is not able to be calculated by required input data not being obtained.

定義:
クラス OhElement 内の initialOutput
戻り値:
a boolean value
例外:
OhError - if an error occurs

saveTerminalState

public void saveTerminalState(java.io.PrintWriter aPw)
最終状態を保存するメソッド

定義:
クラス OhElement 内の saveTerminalState
パラメータ:
aPw - a PrintWriter value

calculateTimeStep

public long calculateTimeStep()
                       throws OhError
計算時間間隔は固定した値とします。

定義:
クラス OhElement 内の calculateTimeStep
戻り値:
a long value
例外:
OhError - if an error occurs

canYouCalculate

public boolean canYouCalculate()
                        throws OhCannotGetDataError,
                               OhError
計算可能性の判断

OhElement クラスの メソッド OhElement.getNecessaryTimeFrom(), OhElement.getNecessaryTimeTo() で 定義される時間の間のデータが取得できれば計算可能と判断します。 OhElement.getNecessaryTimeFrom() メソッドは _currentTime を返し、 OhElement.getNecessaryTimeTo() メソッドは _currentTime + _timeStep の値を返します。

データが取得不可能であると返事をしてきた受信端子に対して計算要求を出します。 具体的には、受信端子に calReq() メッセージを送ります。

定義:
クラス OhElement 内の canYouCalculate
戻り値:
a boolean value
例外:
OhCannotGetDataError - if an error occurs
OhError - if an error occurs

calculate

public boolean calculate()
                  throws OhError
The solution of power law kimematic wave model by Keith Beven's method.

Beven 法による指数法則 kinematic wave モデルの解法

定義:
クラス OhElement 内の calculate
戻り値:
a boolean value
例外:
OhError - if an error occurs

work

public boolean work()
             throws OhCannotGetDataError,
                    OhError

_timeStep を得てから calculate() を実行する work0() を採用します。

定義:
クラス OhElement 内の work
戻り値:
a boolean value
例外:
OhCannotGetDataError - if an error occurs
OhError - if an error occurs