Nodal Demand Functions¶
These functions are used for managing nodal demands.
Function | Description |
---|---|
addDemand |
appends a new demand to a junction node demands list. |
deleteDemand |
deletes a demand from a junction node. |
getBaseDemand |
Gets the base demand for one of a node's demand categories. |
getDemandIndex |
Retrieves the index of a node's named demand category. |
getDemandModel |
Retrieves the type of demand model in use and its parameters. |
getDemandName |
Retrieves the name of a node's demand category. |
getDemandPattern |
Retrieves the index of a time pattern assigned to one of a node's demand categories. |
getNumberOfDemands |
Retrieves the number of demand categories for a junction node. |
setBaseDemand |
Sets the base demand for one of a node's demand categories. |
setDemandModel |
Sets the type of demand model to use and its parameters. |
setDemandName |
Assigns a name to a node's demand category. |
setDemandPattern |
Sets the index of a time pattern used for one of a node's demand categories. |
addDemand¶
appends a new demand to a junction node demands list.
addDemand(nodeIndex: number, baseDemand: number, demandPattern: string, demandName: string): void;
Parameters
Parameter | Type | Description |
---|---|---|
nodeIndex | number |
the index of a node (starting from 1). |
baseDemand | number |
the demand's base value. |
demandPattern | string |
the name of a time pattern used by the demand |
demandName | string |
the name of the demand's category |
A NULL or blank string can be used for demandPattern and for demandName to indicate that no time pattern or category name is associated with the demand.
deleteDemand¶
Deletes a demand from a junction node.
deleteDemand(nodeIndex: number, demandIndex: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
nodeIndex | |
the index of a node (starting from 1). |
demandIndex | |
the position of the demand in the node's demands list (starting from 1). |
getBaseDemand¶
Gets the base demand for one of a node's demand categories.
getBaseDemand(nodeIndex: number, demandIndex: number): number;
Parameters
Parameter | Type | Description |
---|---|---|
nodeIndex | number |
a node's index (starting from 1). |
demandIndex | number |
the index of a demand category for the node (starting from 1). |
Returns
Number
the category's base demand.
getDemandIndex¶
Retrieves the index of a node's named demand category.
getDemandIndex(nodeIndex: number, demandName: string): number;
Parameters
Parameter | Type | Description |
---|---|---|
nodeIndex | number |
the index of a node (starting from 1) |
demandName | string |
the name of a demand category for the node |
Returns
Number
the index of the demand being sought
getDemandModel¶
Retrieves the type of demand model in use and its parameters.
getDemandModel(): {
type: DemandModel;
pmin: number;
preq: number;
pexp: number;
};
Returns
Object
{
type: DemandModel;
pmin: number;
preq: number;
pexp: number;
}
Property | Type | Description |
---|---|---|
type | DemandModel |
Type of demand model (see DemandModel ). |
pmin | number |
Pressure below which there is no demand. |
preq | number |
Pressure required to deliver full demand. |
pexp | number |
Pressure exponent in demand function. |
Parameters pmin, preq, and pexp are only used when the demand model is DemandModel.PDA
.
getDemandName¶
Retrieves the name of a node's demand category.
getDemandName(nodeIndex: number, demandIndex: number): string;
Parameters
Parameter | Type | Description |
---|---|---|
nodeIndex | number |
a node's index (starting from 1). |
demandIndex | number |
the index of one of the node's demand categories (starting from 1). |
Returns
String
The name of the selected category.
getDemandPattern¶
Retrieves the index of a time pattern assigned to one of a node's demand categories.
getDemandPattern(nodeIndex: number, demandIndex: number): number;
Parameters
Parameter | Type | Description |
---|---|---|
nodeIndex | number |
the node's index (starting from 1). |
demandIndex | number |
the index of a demand category for the node (starting from 1). |
Returns
Number
the index of the category's time pattern.
A returned pattern index of 0 indicates that no time pattern has been assigned to the demand category.
getNumberOfDemands¶
Retrieves the number of demand categories for a junction node.
getNumberOfDemands(nodeIndex: number): number;
Parameters
Parameter | Type | Description |
---|---|---|
nodeIndex | number |
the index of a node (starting from 1). |
Returns
Number
the number of demand categories assigned to the node.
setBaseDemand¶
Sets the base demand for one of a node's demand categories.
setBaseDemand(nodeIndex: number, demandIndex: number, baseDemand: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
nodeIndex | number |
a node's index (starting from 1). |
demandIndex | number |
the index of a demand category for the node (starting from 1). |
baseDemand | number |
the new base demand for the category. |
setDemandModel¶
Sets the type of demand model to use and its parameters.
setDemandModel(type: DemandModel, pmin: number, preq: number, pexp: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
type | DemandModel |
Type of demand model (see DemandModel ). |
pmin | number |
Pressure below which there is no demand. |
preq | number |
Pressure required to deliver full demand. |
pexp | number |
Pressure exponent in demand function. |
Set type to EN_DDA for a traditional demand driven analysis (in which case the remaining three parameter values are ignored) or to EN_PDA for a pressure driven analysis. In the latter case a node's demand is computed as:
Dfull * [ (P - pmin) / (preq - pmin) ] ^ pexp
where Dfull is the full demand and P is the current pressure.
Setting preq equal to pmin will result in a solution with the smallest amount of demand reductions needed to insure that no node delivers positive demand at a pressure below pmin.
setDemandName¶
Assigns a name to a node's demand category.
setDemandName(nodeIndex: number, demandIdx: number, demandName: string): void;
Parameters
Parameter | Type | Description |
---|---|---|
nodeIndex | number |
a node's index (starting from 1). |
demandIdx | number |
the index of one of the node's demand categories (starting from 1). |
demandName | string |
the new name assigned to the category. |
setDemandPattern¶
Sets the index of a time pattern used for one of a node's demand categories.
setDemandPattern(nodeIndex: number, demandIndex: number, patIndex: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
nodeIndex | number |
a node's index (starting from 1). |
demandIndex | number |
the index of one of the node's demand categories (starting from 1). |
patIndex | number |
the index of the time pattern assigned to the category. |
Specifying a pattern index of 0 indicates that no time pattern is assigned to the demand category.