Scripting > Math Functions


Determine if Computation Stable for Given Muskingum Routing Parameters

isMuskingumRoutingStable(integer numberSubreaches,

      floating-point muskingumK,

      floating-point muskingumX)

 

Check for possible instability for the given Muskingum Routing parameters.

Test if the input parameters satisfy the stability criteria:

 

1/(2(1-x)) <= K/deltaT <= 1/2x

 

 where deltaT = (time series time interval)/numberSubreaches

 

Parameters:

numberSubreaches – integer specifying the number of routing subreaches.

muskingumK –floating-point number specifying the Muskingum "K" parameter, in hours.

muskingumX - floating-point number specifying the Muskingum "x" parameter, between 0.0 and 0.5 (inclusive).

Example:

warning = tsDataSet.isMuskingumRoutingStable(

reachCount,

kVal,

xVal)

      if warning :

            print warning

            return

Returns: A string if the stability criteria is not met.  The string contains a warning message detailing the specific instability problem.  Otherwise returns None.

Generated Exceptions: Throws a hec.hecmath.HecMathException if the current time series is not a regular interval time series, or if values for numberSubreaches or muskingumX are invalid.