Title: | Hydrologic Modelling System for R Users |
---|---|
Description: | Hydrologic modelling system is an object oriented tool for simulation and analysis of hydrologic events. The package proposes functions and methods for construction, simulation, visualization, and calibration of a hydrologic model. |
Authors: | Rezgar Arabzadeh; Shahab Araghinejad |
Maintainer: | Rezgar Arabzadeh <[email protected]> |
License: | GPL-2 |
Version: | 1.7 |
Built: | 2025-02-14 02:40:23 UTC |
Source: | https://github.com/cran/RHMS |
The RHMS package provides tools to R users for simulation of hydrologic events. The packages includes functions and methods for building, simulation, visualization, and calibration of a hydrologic model.
Package: | RHMS |
Type: | Package |
Version: | 1.7 |
Date: | 2021-09-27 |
License: | GPL-3 |
the package include three major types of functions as follows:
1- functions for construction and manipulatation of hydrologic features.
createBasin
. constructor for basin
createJunction
. constructor for junction
createReach
. constructor for reach, rivers, and channels
createReservoir
. constructor for reservoirs
createSubbasin
. constructor for sub-bains
createDiversion
. constructor for diversions
set.as
. objects connector
addObjectToBasin
. adds objects form above constructors to a basin inherited from class of createBasin
2- functions for analysis and simulation of hydrologic events.
reachRouting
. routes a flood in a channel or river
reservoirRouting
. routes a flood in a reservoir
transform
. trnasforms a rainfall event to runoff
loss
. computes excess rainfall and loss depths
baseFlowSeparation
. separates baseflow from a given discharge series
abstraction
. computes simple surface and canopy methods
sim
. simulates an objects inherited from class of createBasin
3- functions for tunning, summerizing, and visualization.
plot.createBasin
. plots the objects inherited from class of createBasin
summary.sim
. summerzies the simulation results in the tabular form for every objects existing in the basin
tune
. calibrates an objects inherited from class of createBasin
Rezgar Arabzadeh ; Shahab Araghinejad
Maintainer: Rezgar Arabzadeh <[email protected]>
Chow, V. T., Maidment, D. R., & Mays, L. W. (1988). Applied hydrology.
computes surface and canopy abstractions for a given rainfall event.
abstraction(rainfall,abstractionParams)
abstraction(rainfall,abstractionParams)
rainfall |
a vector : a time series of precipitation hyetograph (mm) |
abstractionParams |
a list: including parameters of simple surface and simple canopy methods.
|
a list: an object from class of abstraction
Rezgar Arabzadeh
rainfall<-5*exp(((seq(2.5,7.5,length.out=36))-5)^2/-0.8) abstractionParams<-list(canopyAbstraction=2,surfaceAbstraction=3.5) abstraction(rainfall,abstractionParams)
rainfall<-5*exp(((seq(2.5,7.5,length.out=36))-5)^2/-0.8) abstractionParams<-list(canopyAbstraction=2,surfaceAbstraction=3.5) abstraction(rainfall,abstractionParams)
abstraction
instantiates an object from class of abstraction
## S3 method for class 'base' abstraction(rainfall,abstractionParams)
## S3 method for class 'base' abstraction(rainfall,abstractionParams)
rainfall |
a vector : a time series of precipitation hyetograph (mm) |
abstractionParams |
a list: including parameters of simple surface and simple canopy methods.
|
a list: an object from class of abstraction
Rezgar Arabzadeh
abstraction
instantiates an object from class of abstraction
## Default S3 method: abstraction(rainfall, abstractionParams=list(canopyAbstraction=NULL, surfaceAbstraction=NULL))
## Default S3 method: abstraction(rainfall, abstractionParams=list(canopyAbstraction=NULL, surfaceAbstraction=NULL))
rainfall |
a vector : a time series of precipitation hyetograph (mm) |
abstractionParams |
a list: including parameters of simple surface and simple canopy methods.
|
a list: an object from class of abstraction
Rezgar Arabzadeh
adds an object inherited from either of RHMS
package constructors to an object instantiated by class of createBasin
.
addObjectToBasin(object, basin)
addObjectToBasin(object, basin)
object |
an object inherited from one of the following classes: |
basin |
an object inherited from class of |
an object from class of createBasin
Rezgar Arabzadeh
storageElevationCurve<-data.frame(s=0:100*10,h=100:200) dischargeElevationCurve<-data.frame(q=seq(0,5000,length.out=10), h=seq(180,200,length.out=10)) geometry<-list(storageElevationCurve=storageElevationCurve, dischargeElevationCurve=dischargeElevationCurve, capacity=800) Res1<-createReservoir(name = "Reservoir1", geometry=geometry,initialStorage=550) R1<-createReach(name="Reach1",routingParams=list(k=5,x=0.3)) R2<-createReach(name="Reach2",routingParams=list(k=5,x=0.3)) R3<-createReach(name="Reach3",routingParams=list(k=5,x=0.3)) R4<-createReach(name="Reach4",routingMethod="muskingumcunge", routingParams=list(bedWith=100, sideSlope=2, channelSlope=0.01, manningRoughness=0.05, riverLength=120)) D1<-createDiversion(name="Diversion1",capacity=80) Junc1<-createJunction(name = "Junc1") S1<-createSubbasin(name="Sub1",Area=500, precipitation=round(sin(seq(0,pi,length.out=24))*20), transformMethod="SCS",lossMethod="SCS",BFSMethod='recession', transformParams=list(Tlag=4),lossParams=list(CN=70),BFSParams=list(k=1.1)) S2<-createSubbasin(name="Sub2",Area=500, precipitation=round(sin(seq(0,pi,length.out=24))*20), transformMethod="SCS",lossMethod="SCS",BFSMethod='recession', transformParams=list(Tlag=4),lossParams=list(CN=70),BFSParams=list(k=1.1)) S3<-createSubbasin(name="Sub3",Area=650, precipitation=round(sin(seq(0,pi,length.out=24))*20), transformMethod="snyder",lossMethod="horton", transformParams=list(Cp=0.17,Ct=1.5,L=140,Lc=30), lossParams=list(f0=5,f1=1,k=1)) S1<-set.as(R2,S1,'downstream') R2<-set.as(Junc1,R2,'downstream') Junc1<-set.as(R1,Junc1,'downstream') R1<-set.as(Res1,R1,'downstream') S3<-set.as(R3,S3,'downstream') R3<-set.as(Junc1,R3,'downstream') S2<-set.as(R4,S2,'downstream') R4<-set.as(D1,R4,'downstream') D1<-set.as(Junc1,D1,'downstream') D1<-set.as(S1,D1,'divertTo') basin1<-createBasin(name = "Unknown", simulation=list(start='2000-01-01',end='2000-01-10',by=7200)) basin1<-addObjectToBasin(Junc1, basin1) basin1<-addObjectToBasin(R1, basin1) basin1<-addObjectToBasin(R2, basin1) basin1<-addObjectToBasin(R3, basin1) basin1<-addObjectToBasin(R4, basin1) basin1<-addObjectToBasin(S1, basin1) basin1<-addObjectToBasin(S2, basin1) basin1<-addObjectToBasin(S3, basin1) basin1<-addObjectToBasin(Res1, basin1) basin1<-addObjectToBasin(D1, basin1) ## Not run: plot(basin1) object<-sim(basin1) plot(object) summary(object)
storageElevationCurve<-data.frame(s=0:100*10,h=100:200) dischargeElevationCurve<-data.frame(q=seq(0,5000,length.out=10), h=seq(180,200,length.out=10)) geometry<-list(storageElevationCurve=storageElevationCurve, dischargeElevationCurve=dischargeElevationCurve, capacity=800) Res1<-createReservoir(name = "Reservoir1", geometry=geometry,initialStorage=550) R1<-createReach(name="Reach1",routingParams=list(k=5,x=0.3)) R2<-createReach(name="Reach2",routingParams=list(k=5,x=0.3)) R3<-createReach(name="Reach3",routingParams=list(k=5,x=0.3)) R4<-createReach(name="Reach4",routingMethod="muskingumcunge", routingParams=list(bedWith=100, sideSlope=2, channelSlope=0.01, manningRoughness=0.05, riverLength=120)) D1<-createDiversion(name="Diversion1",capacity=80) Junc1<-createJunction(name = "Junc1") S1<-createSubbasin(name="Sub1",Area=500, precipitation=round(sin(seq(0,pi,length.out=24))*20), transformMethod="SCS",lossMethod="SCS",BFSMethod='recession', transformParams=list(Tlag=4),lossParams=list(CN=70),BFSParams=list(k=1.1)) S2<-createSubbasin(name="Sub2",Area=500, precipitation=round(sin(seq(0,pi,length.out=24))*20), transformMethod="SCS",lossMethod="SCS",BFSMethod='recession', transformParams=list(Tlag=4),lossParams=list(CN=70),BFSParams=list(k=1.1)) S3<-createSubbasin(name="Sub3",Area=650, precipitation=round(sin(seq(0,pi,length.out=24))*20), transformMethod="snyder",lossMethod="horton", transformParams=list(Cp=0.17,Ct=1.5,L=140,Lc=30), lossParams=list(f0=5,f1=1,k=1)) S1<-set.as(R2,S1,'downstream') R2<-set.as(Junc1,R2,'downstream') Junc1<-set.as(R1,Junc1,'downstream') R1<-set.as(Res1,R1,'downstream') S3<-set.as(R3,S3,'downstream') R3<-set.as(Junc1,R3,'downstream') S2<-set.as(R4,S2,'downstream') R4<-set.as(D1,R4,'downstream') D1<-set.as(Junc1,D1,'downstream') D1<-set.as(S1,D1,'divertTo') basin1<-createBasin(name = "Unknown", simulation=list(start='2000-01-01',end='2000-01-10',by=7200)) basin1<-addObjectToBasin(Junc1, basin1) basin1<-addObjectToBasin(R1, basin1) basin1<-addObjectToBasin(R2, basin1) basin1<-addObjectToBasin(R3, basin1) basin1<-addObjectToBasin(R4, basin1) basin1<-addObjectToBasin(S1, basin1) basin1<-addObjectToBasin(S2, basin1) basin1<-addObjectToBasin(S3, basin1) basin1<-addObjectToBasin(Res1, basin1) basin1<-addObjectToBasin(D1, basin1) ## Not run: plot(basin1) object<-sim(basin1) plot(object) summary(object)
This function calculates baseflow for a given time series, discharge
, using a number of method stated in BFSMethod
.
baseFlowSeparation(discharge,BFSMethod,BFSParams,plot)
baseFlowSeparation(discharge,BFSMethod,BFSParams,plot)
discharge |
a vector of flow time series (cms) or an object inherited from class of |
BFSMethod |
a string: The method of base flow separation. Available methods: |
BFSParams |
a list including parameters associated with the method coerced in
|
plot |
(optional) logical statement to plot the result or not. default to |
a list: an object
from class of baseFlowSeparation
consisting matrix of results available at object$operation.
Rezgar Arabzadeh
Chapman, Tom. "A comparison of algorithms for stream flow recession and baseflow separation." Hydrological Processes 13.5 (1999): 701-714.
discharge<-(dnorm(seq(-3,4,length.out=200),-.3,1)+dnorm(seq(-1,7,length.out=200),4.5,1)*2)*1200 BFSMethod<-c('nathan','chapman','eckhardt','recession') BFSParams<-list(alpha=0.6,BFI=0.3,k=1.1,timeInterval=15*60) simulation<-list(start='2000-01-01',end='2000-01-02',by=400) baseFlowSeparation(discharge,BFSMethod[1],BFSParams,plot=TRUE) baseFlowSeparation(discharge,BFSMethod[2],BFSParams,plot=TRUE) baseFlowSeparation(discharge,BFSMethod[3],BFSParams,plot=TRUE) baseFlowSeparation(discharge,BFSMethod[4],BFSParams,plot=TRUE)
discharge<-(dnorm(seq(-3,4,length.out=200),-.3,1)+dnorm(seq(-1,7,length.out=200),4.5,1)*2)*1200 BFSMethod<-c('nathan','chapman','eckhardt','recession') BFSParams<-list(alpha=0.6,BFI=0.3,k=1.1,timeInterval=15*60) simulation<-list(start='2000-01-01',end='2000-01-02',by=400) baseFlowSeparation(discharge,BFSMethod[1],BFSParams,plot=TRUE) baseFlowSeparation(discharge,BFSMethod[2],BFSParams,plot=TRUE) baseFlowSeparation(discharge,BFSMethod[3],BFSParams,plot=TRUE) baseFlowSeparation(discharge,BFSMethod[4],BFSParams,plot=TRUE)
baseFlowSeparation
Methods of separating baseflow for a given flow discharge.
## S3 method for class 'base' baseFlowSeparation(discharge,BFSMethod,BFSParams,plot)
## S3 method for class 'base' baseFlowSeparation(discharge,BFSMethod,BFSParams,plot)
discharge |
a vector of flow time series (cms) or an object inherited from class of |
BFSMethod |
a string: The method of base flow separation. Available methods: |
BFSParams |
a list including parameters associated with the method coerced in
|
plot |
(optional) logical statement to plot the result or not. default to |
a matrix: A matrix of results including computed separated flow for Q
series
Rezgar Arabzadeh
baseFlowSeparation
Methods for separating baseflow for a given flow discharge
## Default S3 method: baseFlowSeparation(discharge,BFSMethod='none' , BFSParams=list(alpha=NULL , BFI=NULL , k=NULL , timeInterval=NULL), plot=FALSE)
## Default S3 method: baseFlowSeparation(discharge,BFSMethod='none' , BFSParams=list(alpha=NULL , BFI=NULL , k=NULL , timeInterval=NULL), plot=FALSE)
discharge |
a vector of flow time series (cms) or an object inherited from class of |
BFSMethod |
a string: The method of base flow separation. Available methods: |
BFSParams |
a list including parameters associated with the method coerced in
|
plot |
(optional) logical statement to plot the result or not. default to |
a list: an object
from class of baseFlowSeparation
consisting matrix of results available at object$operation.
Rezgar Arabzadeh
instantiates an object from class of createBasin
createBasin(name, simulation)
createBasin(name, simulation)
name |
a string: a name for the basin |
simulation |
a list of simulation time and dates as below:
|
a list: an object from class of creatBasin
Rezgar Arabzadeh
createBasin
instantiates an object from class of createBasin
## S3 method for class 'base' createBasin(name, simulation)
## S3 method for class 'base' createBasin(name, simulation)
name |
a string: a name for the basin |
simulation |
a list of simulation time and dates as below:
|
a list: an object from class of creatBasin
Rezgar Arabzadeh
createBasin
instantiates an object from class of createBasin
## Default S3 method: createBasin(name = "Untittled", simulation=list(start=NULL,end=NULL,by=NULL))
## Default S3 method: createBasin(name = "Untittled", simulation=list(start=NULL,end=NULL,by=NULL))
name |
a string: a name for the basin |
simulation |
a list of simulation time and dates as below:
|
a list: an object from class of creatBasin
Rezgar Arabzadeh
instantiates an object from class of createDiversion
createDiversion(name,downstream,divertTo,capacity)
createDiversion(name,downstream,divertTo,capacity)
name |
(optional) a string: the name of diversion to be instantiated |
downstream |
(optional) an object from either of classes: |
divertTo |
an object from either of classes: |
capacity |
diversion capacity (cms) |
a list: an object from class of createDiversion
Rezgar Arabzadeh
createDiversion
instantiates an object from class of createDiversion
## S3 method for class 'base' createDiversion(name,downstream,divertTo,capacity)
## S3 method for class 'base' createDiversion(name,downstream,divertTo,capacity)
name |
(optional) a string: the name of diversion to be instantiated |
downstream |
(optional) an object from either of classes: |
divertTo |
an object from either of classes: |
capacity |
diversion capacity (cms) |
a list: an object from class of createDiversion
Rezgar Arabzadeh
createDiversion
instantiates an object from class of createDiversion
## Default S3 method: createDiversion(name="Unttitled",downstream=NA,divertTo,capacity)
## Default S3 method: createDiversion(name="Unttitled",downstream=NA,divertTo,capacity)
name |
(optional) a string: the name of diversion to be instantiated |
downstream |
(optional) an object from either of classes: |
divertTo |
an object from either of classes: |
capacity |
diversion capacity (cms) |
a list: an object from class of createDiversion
Rezgar Arabzadeh
instantiates an object from class of createJunction
createJunction(name, downstream, inflow, delayInflow)
createJunction(name, downstream, inflow, delayInflow)
name |
(optional) a string: the name of junction to be instantiated |
downstream |
(optional) an object from either of classes: |
inflow |
(optional): a vector of direct inflow/lateral flow (cms) |
delayInflow |
(optional): an integer presenting the time steps to delay direct/lateral inflow time series |
a list: an object from class createJunction
Rezgar Arabzadeh
createJunction
instantiates an object from class of createJunction
## S3 method for class 'base' createJunction(name , downstream, inflow , delayInflow )
## S3 method for class 'base' createJunction(name , downstream, inflow , delayInflow )
name |
(optional) a string: the name of junction to be instantiated |
downstream |
(optional) an object from either of classes: |
inflow |
(optional): a vector of direct/lateral (cms) |
delayInflow |
(optional): an integer presenting the time steps to delay direct/lateral inflow time series |
a list: an object from class of createJunction
Rezgar Arabzadeh
createJunction
instantiates an object from class of createJunction
## Default S3 method: createJunction(name = "Unttitled", downstream=NA, inflow = NA, delayInflow = 1)
## Default S3 method: createJunction(name = "Unttitled", downstream=NA, inflow = NA, delayInflow = 1)
name |
(optional) a string: the name of junction to be instantiated |
downstream |
(optional) an object from either of classes: |
inflow |
(optional): a vector of direct/lateral inflow (cms) |
delayInflow |
(optional): an integer presenting the time steps to delay direct/lateral inflow time series |
a list: an object from class of createJunction
Rezgar Arabzadeh
instantiates an object from class of createReach
createReach(name,routingMethod,inflow, routingParams,delayInflow,downstream)
createReach(name,routingMethod,inflow, routingParams,delayInflow,downstream)
name |
(optional) a string: the name of reach to be instantiated |
routingMethod |
a string: the method of channel routing. available types: |
inflow |
(optional): a vector of direct/lateral inflow (cms) |
routingParams |
a list : parameters associated to the
|
delayInflow |
(optional): an integer presenting the time steps to delay direct/lateral inflow time series |
downstream |
(optional) an object from either of classes: |
a list: an object from class of createReach
Rezgar Arabzadeh
createReach
instantiates an object from class of createReach
## S3 method for class 'base' createReach(name,routingMethod,inflow, routingParams, delayInflow,downstream)
## S3 method for class 'base' createReach(name,routingMethod,inflow, routingParams, delayInflow,downstream)
name |
(optional) a string: the name of reach to be instantiated |
routingMethod |
a string: the method of channel routing. available types: |
inflow |
(optional): a vector of lateral inflow (cms) |
routingParams |
a list : parameters associated to the
|
delayInflow |
(optional): an integer presenting the time steps to delay direct/lateral inflow |
downstream |
(optional) an object from either of classes: |
a list: an object from class of createReach
Rezgar Arabzadeh
createReach
instantiates an object from class of createReach
## Default S3 method: createReach(name="Unttitled",routingMethod="muskingum",inflow=NA, routingParams=list(k=3,x=0.2,bedWith=NULL, sideSlope=2,channelSlope=NULL, manningRoughness=0.025,riverLength=NULL), delayInflow=1,downstream=NA)
## Default S3 method: createReach(name="Unttitled",routingMethod="muskingum",inflow=NA, routingParams=list(k=3,x=0.2,bedWith=NULL, sideSlope=2,channelSlope=NULL, manningRoughness=0.025,riverLength=NULL), delayInflow=1,downstream=NA)
name |
(optional) a string: the name of reach to be instantiated |
routingMethod |
a string: the method of channel routing. available types: |
inflow |
(optional): a vector of direct/lateral (cms) |
routingParams |
a list : parameters associated to the
|
delayInflow |
(optional): an integer presenting the time steps to delay direct/lateral inflow time series |
downstream |
(optional) an object from either of classes: |
a list: an object from class of createReach
Rezgar Arabzadeh
instantiates an object from class of createReservoir
createReservoir(name , inflow , geometry, initialStorage, delayInflow , downstream )
createReservoir(name , inflow , geometry, initialStorage, delayInflow , downstream )
name |
(optional): a string: the name of reservoir to be instantiated |
inflow |
(optional) : a vector of direct/lateral inflow (cms) |
geometry |
a list of geometric specifications of the reservoir:
|
initialStorage |
(optional) the initial storage of reservoir at the first time step of simulation (MCM) |
delayInflow |
(optional): an integer presenting the time steps to delay direct/lateral inflow time series |
downstream |
(optional): an object from either of classes: |
a list: an object from class of createReservoir
Rezgar Arabzadeh
createReservoir
instantiates an object from class of createReservoir
## S3 method for class 'base' createReservoir(name , inflow , geometry, initialStorage, delayInflow , downstream )
## S3 method for class 'base' createReservoir(name , inflow , geometry, initialStorage, delayInflow , downstream )
name |
(optional): a string: the name of reservoir to be instantiated |
inflow |
(optional) : a vector of direct/lateral inflow (cms) |
geometry |
a list of geometric specifications of the reservoir:
|
initialStorage |
(optional): the initial storage of reservoir at the first time step of simulation (MCM) |
delayInflow |
(optional): an integer presenting the time steps to delay direct/lateral inflow time series |
downstream |
(optional): an object from either of classes: |
a list: an object from class of createReservoir
Rezgar Arabzadeh
createReservoir
instantiates an object from class of createReservoir
## Default S3 method: createReservoir(name = "Unttitled", inflow = NA, geometry=list(storageElevationCurve=NULL, dischargeElevationCurve=NULL, capacity=NULL), initialStorage = NA, delayInflow = 1, downstream = NA)
## Default S3 method: createReservoir(name = "Unttitled", inflow = NA, geometry=list(storageElevationCurve=NULL, dischargeElevationCurve=NULL, capacity=NULL), initialStorage = NA, delayInflow = 1, downstream = NA)
name |
(optional): a string: the name of reservoir to be instantiated |
inflow |
(optional): a vector of direct/lateral inflow (cms) |
geometry |
a list of geometric specifications of the reservoir:
|
initialStorage |
(optional): the initial storage of reservoir at the first time step of simulation (MCM) |
delayInflow |
(optional): an integer presenting the time steps to delay direct/lateral inflow time series |
downstream |
(optional): an object from either of classes: |
a list: an object from class of createReservoir
Rezgar Arabzadeh
instantiates an object from class of createSubbasin
createSubbasin(name,precipitation, inflow,Area,delayInflow,downstream, transformMethod,lossMethod,BFSMethod,UH, abstractionParams,transformParams,lossParams,BFSParams)
createSubbasin(name,precipitation, inflow,Area,delayInflow,downstream, transformMethod,lossMethod,BFSMethod,UH, abstractionParams,transformParams,lossParams,BFSParams)
name |
(optional): a string: the name of sub-basin to be instantiated |
precipitation |
a vector : a time series of precipitation hytograph (mm) |
inflow |
(optional): a vector of direct inflow rather than flows comming from upstream (cms) |
Area |
the area of basin (Km^2) |
delayInflow |
(optional): an integer presenting the time steps to delay direct/lateral inflow time series |
downstream |
(optional): an object from either of classes: |
transformMethod |
a string: the type of transformation method. Available types: |
lossMethod |
a string: the type of loss method. Available types: |
BFSMethod |
a string: The method of base flow separation. Available methods: |
UH |
a data.frame: including the ordinates of user UH. the HU first collumn indicates time (Hr) and second collumn include flow rates (cms) |
abstractionParams |
a list: including parameters of simple surface and simple canopy methods.
|
BFSParams |
a list including parameters associated with the method coerced in
|
transformParams |
a list of parameters associated to the selcted type of
|
lossParams |
a list of parameters associated to the selcted type of
|
a list: an object from class of createSubbasin
Rezgar Arabzadeh
createSubbasin
instantiates an object from class of createSubbasin
## S3 method for class 'base' createSubbasin(name,precipitation, inflow,Area,delayInflow,downstream, transformMethod,lossMethod,BFSMethod,UH, abstractionParams,transformParams,lossParams,BFSParams)
## S3 method for class 'base' createSubbasin(name,precipitation, inflow,Area,delayInflow,downstream, transformMethod,lossMethod,BFSMethod,UH, abstractionParams,transformParams,lossParams,BFSParams)
name |
(optional): a string: the name of sub-basin to be instantiated |
precipitation |
a vector : a time series of precipitation hytograph (mm) |
inflow |
(optional): a vector of direct inflow/lateral (cms) |
Area |
the area of basin (Km^2) |
delayInflow |
(optional): an integer presenting the time steps to delay direct/lateral inflow time series |
downstream |
(optional): an object from either of classes: |
transformMethod |
a string: the type of transformation method. Available types: |
lossMethod |
a string: the type of loss method. Available types: |
BFSMethod |
a string: The method of base flow separation. Available methods: |
UH |
a data.frame: including the ordinates of user UH. the HU first collumn indicates time (Hr) and second collumn include flow rates (cms) |
abstractionParams |
a list: including parameters of simple surface and simple canopy methods.
|
BFSParams |
a list including parameters associated with the method coerced in
|
transformParams |
a list of parameters associated to the selcted type of
|
lossParams |
a list of parameters associated to the selcted type of
|
a list: a list features for the constructed sub-basin
Rezgar Arabzadeh
createSubbasin
instantiates an object from class of createSubbasin
## Default S3 method: createSubbasin(name="Unttitled", precipitation,inflow=NA,Area,delayInflow=1, downstream=NA, transformMethod="SCS", lossMethod="none", BFSMethod='none', UH=NA, abstractionParams=list(canopyAbstraction=NULL,surfaceAbstraction=NULL), transformParams=list(Tlag=NULL,Cp=NULL,Ct=NULL,L=NULL,Lc=NULL), lossParams=list(CN=NULL,f0=NULL,f1=NULL,k=NULL), BFSParams=list(alpha=NULL,BFI=NULL,k=NULL))
## Default S3 method: createSubbasin(name="Unttitled", precipitation,inflow=NA,Area,delayInflow=1, downstream=NA, transformMethod="SCS", lossMethod="none", BFSMethod='none', UH=NA, abstractionParams=list(canopyAbstraction=NULL,surfaceAbstraction=NULL), transformParams=list(Tlag=NULL,Cp=NULL,Ct=NULL,L=NULL,Lc=NULL), lossParams=list(CN=NULL,f0=NULL,f1=NULL,k=NULL), BFSParams=list(alpha=NULL,BFI=NULL,k=NULL))
name |
(optional): a string: the name of sub-basin to be instantiated |
precipitation |
a vector : a time series of precipitation hytograph (mm) |
inflow |
(optional): a vector of direct/lateral inflow (cms) |
Area |
the area of basin (Km^2) |
delayInflow |
(optional): an integer presenting the time steps to delay direct/lateral inflow time series |
downstream |
(optional): an object from either of classes: |
transformMethod |
a string: the type of transformation method. Available types: |
lossMethod |
a string: the type of loss method. Available types: |
BFSMethod |
a string: The method of base flow separation. Available methods: |
UH |
a data.frame: including the ordinates of user UH. the HU first collumn indicates time (Hr) and second collumn include flow rates (cms) |
abstractionParams |
a list: including parameters of simple surface and simple canopy methods.
|
BFSParams |
a list including parameters associated with the method coerced in
|
transformParams |
a list of parameters associated to the selcted type of
|
lossParams |
a list of parameters associated to the selcted type of
|
a list: an object from class of createSubbasin
Rezgar Arabzadeh
this function provides methods (e.g. "horton"
and "SCS"
) to compute loss and direct runoff depths
loss(precipitation,lossMethod,lossParams)
loss(precipitation,lossMethod,lossParams)
precipitation |
a vector of precipitation time series(mm) |
lossMethod |
a string including the type of lossMethod: |
lossParams |
a list of parameters associated to the selcted type of
|
a dataframe: including precipitation, loss, and exess rainfall depth
Rezgar Arabzadeh
precipitation<-sin(seq(0.1,pi-0.1,length.out=20))*30 lossParams<-list(f0=20,f1=5,k=2,timeInterval=3600,CN=65) lossMethod<-c("horton","SCS") (Horton_loss<-loss(precipitation,lossMethod[1],lossParams)) (SCS_loss<-loss(precipitation,lossMethod[2],lossParams))
precipitation<-sin(seq(0.1,pi-0.1,length.out=20))*30 lossParams<-list(f0=20,f1=5,k=2,timeInterval=3600,CN=65) lossMethod<-c("horton","SCS") (Horton_loss<-loss(precipitation,lossMethod[1],lossParams)) (SCS_loss<-loss(precipitation,lossMethod[2],lossParams))
reachRouting
this function provides methods (e.g. "horton"
and "SCS"
) to compute loss and direct runoff depths
## S3 method for class 'base' loss(precipitation,lossMethod,lossParams)
## S3 method for class 'base' loss(precipitation,lossMethod,lossParams)
precipitation |
a vector of precipitation time series(mm) |
lossMethod |
a string including the type of lossMethod: |
lossParams |
a list of parameters associated to the selcted type of
|
a dataframe: including precipitation, loss, and exess rainfall depth
Rezgar Arabzadeh
loss
this function provides methods (e.g. "horton"
and "SCS"
) to compute loss and direct runoff depths
## Default S3 method: loss(precipitation,lossMethod, lossParams=list(f0=NULL, f1=NULL, k=NULL, timeInterval=NULL, CN=NULL, imperviousness=NULL))
## Default S3 method: loss(precipitation,lossMethod, lossParams=list(f0=NULL, f1=NULL, k=NULL, timeInterval=NULL, CN=NULL, imperviousness=NULL))
precipitation |
a vector of precipitation time series(mm) |
lossMethod |
a string including the type of lossMethod: |
lossParams |
a list of parameters associated to the selcted type of
|
a dataframe: including precipitation, loss, and exess rainfall depth
Rezgar Arabzadeh
plot method for objects inherited from class of createBasin
## S3 method for class 'createBasin' plot(x,...)
## S3 method for class 'createBasin' plot(x,...)
x |
an object from class of |
... |
other objects that can be passed to |
Rezgar Arabzadeh
plot method for objects inherited from class of sim
## S3 method for class 'sim' plot(x,...)
## S3 method for class 'sim' plot(x,...)
x |
an object from class of |
... |
other objects that can be passed to |
Rezgar Arabzadeh
function for flood routing using parameteric Muskingum and muskingum-cunge techniques.
reachRouting(inflow,routingMethod, routingParams,simulation)
reachRouting(inflow,routingMethod, routingParams,simulation)
inflow |
a vector of runoff (cms) presenting a runoff event generated by excess rainfall computed by |
routingMethod |
a string: the type of channel routing method: |
routingParams |
a list : parameters associated to the
|
simulation |
a list of simulation time and dates as below:
|
a data.frame: including inflow time series routing resaults and simulation details
Rezgar Arabzadeh
Chow, V. T., Maidment, D. R., & Mays, L. W. (1988). Applied hydrology.
inflow<-c(100,500,1500,2500,5000,11000,22000,28000,28500,26000, 22000,17500,14000,10000,7000,4500,2500,1500,1000,500,100) routingMethod<-c("muskingum","muskingumcunge") routingParams<-list(k=3,x=0.2,bedWith=50,sideSlope=2,channelSlope=0.0001, manningRoughness=0.01,riverLength=100) simulation<-list(start='2000-01-01',end='2000-01-04',by=3600) reachRouting(inflow,routingMethod[1],routingParams,simulation) reachRouting(inflow,routingMethod[2],routingParams,simulation)
inflow<-c(100,500,1500,2500,5000,11000,22000,28000,28500,26000, 22000,17500,14000,10000,7000,4500,2500,1500,1000,500,100) routingMethod<-c("muskingum","muskingumcunge") routingParams<-list(k=3,x=0.2,bedWith=50,sideSlope=2,channelSlope=0.0001, manningRoughness=0.01,riverLength=100) simulation<-list(start='2000-01-01',end='2000-01-04',by=3600) reachRouting(inflow,routingMethod[1],routingParams,simulation) reachRouting(inflow,routingMethod[2],routingParams,simulation)
reachRouting
function for flood routing using Muskingum and muskingum-cunge techniques.
## S3 method for class 'base' reachRouting(inflow,routingMethod, routingParams,simulation)
## S3 method for class 'base' reachRouting(inflow,routingMethod, routingParams,simulation)
inflow |
a vector of runoff (cms) or an object inherited from any of the following classes : |
routingMethod |
a string: the type of channel routing method: |
routingParams |
a list : parameters associated to the
|
simulation |
a list of simulation time and dates as below:
|
a data.frame: including inflow time series routing resaults and simulation details
Rezgar Arabzadeh
Chow, V. T., Maidment, D. R., & Mays, L. W. (1988). Applied hydrology.
reachRouting
function for flood routing in channels using Muskingum and muskingum-cunge techniques.
## Default S3 method: reachRouting(inflow,routingMethod="muskingum", routingParams=list(k=3, x=0.2, bedWith=NULL, sideSlope=2, channelSlope=NULL, manningRoughness=0.025, riverLength=NULL), simulation=list(start=NULL,end=NULL,by=NULL))
## Default S3 method: reachRouting(inflow,routingMethod="muskingum", routingParams=list(k=3, x=0.2, bedWith=NULL, sideSlope=2, channelSlope=NULL, manningRoughness=0.025, riverLength=NULL), simulation=list(start=NULL,end=NULL,by=NULL))
inflow |
a vector of runoff (cms) or an object inherited from any of the following classes : |
routingMethod |
a string: the type of channel routing method: |
routingParams |
a list : parameters associated to the
|
simulation |
a list of simulation time and dates as below:
|
a list: including inflow time series routing resaults and simulation details
Rezgar Arabzadeh
Chow, V. T., Maidment, D. R., & Mays, L. W. (1988). Applied hydrology.
function for routing flood through a reservoir using classical Muskingum technique
reservoirRouting(inflow,geometry,initialStorage,simulation)
reservoirRouting(inflow,geometry,initialStorage,simulation)
inflow |
a vector of in (cms) presenting a runoff event generated by excess rainfall computed by |
geometry |
a list of geometric specifications of the reservoir:
|
initialStorage |
(optional) the initial storage of reservoir at the first time step of simulation (MCM). default to the capacity. |
simulation |
a list of simulation time and dates as below:
|
a data.frame: including inflow time series and routing resaults
Rezgar Arabzadeh
Chow, V. T., Maidment, D. R., & Mays, L. W. (1988). Applied hydrology.
inflow<-sin(seq(0,pi,length.out=50))*1000 storageElevationCurve<-data.frame(s=0:49*2,h=100:149) dischargeElevationCurve<-data.frame(q=0:9*250,h=140:149) geometry<-list(storageElevationCurve=storageElevationCurve, dischargeElevationCurve=dischargeElevationCurve, capacity=80) simulation<-list(start='2000-01-01',end='2000-01-05',by=1800) reservoir_sim<-reservoirRouting(inflow=inflow, geometry=geometry, simulation=simulation) plot(reservoir_sim$operation[,1],typ="o", ylab="Discharge rate (cms)", xlab="Time step") lines(reservoir_sim$operation[,3],col=2)
inflow<-sin(seq(0,pi,length.out=50))*1000 storageElevationCurve<-data.frame(s=0:49*2,h=100:149) dischargeElevationCurve<-data.frame(q=0:9*250,h=140:149) geometry<-list(storageElevationCurve=storageElevationCurve, dischargeElevationCurve=dischargeElevationCurve, capacity=80) simulation<-list(start='2000-01-01',end='2000-01-05',by=1800) reservoir_sim<-reservoirRouting(inflow=inflow, geometry=geometry, simulation=simulation) plot(reservoir_sim$operation[,1],typ="o", ylab="Discharge rate (cms)", xlab="Time step") lines(reservoir_sim$operation[,3],col=2)
reservoirRouting
function for routing flood through a reservoir using classical Muskingum technique
## S3 method for class 'base' reservoirRouting(inflow, geometry,initialStorage,simulation)
## S3 method for class 'base' reservoirRouting(inflow, geometry,initialStorage,simulation)
inflow |
a vector of in (cms) presenting a runoff event generated by excess rainfall computed by |
geometry |
a list of geometric specifications of the reservoir:
|
initialStorage |
(optional) the initial storage of reservoir at the first time step of simulation (MCM). default to the capacity. |
simulation |
a list of simulation time and dates as below:
|
a data.frame: including inflow time series and routing resaults
Rezgar Arabzadeh
Chow, V. T., Maidment, D. R., & Mays, L. W. (1988). Applied hydrology.
reservoirRouting
function for routing flood through a reservoir using classical Muskingum technique
## Default S3 method: reservoirRouting(inflow, geometry=list(storageElevationCurve=NULL, dischargeElevationCurve=NULL, capacity=NULL), initialStorage=NA, simulation=list(start=NULL,end=NULL,by=NULL))
## Default S3 method: reservoirRouting(inflow, geometry=list(storageElevationCurve=NULL, dischargeElevationCurve=NULL, capacity=NULL), initialStorage=NA, simulation=list(start=NULL,end=NULL,by=NULL))
inflow |
a vector of in (cms) presenting a runoff event generated by excess rainfall computed by |
geometry |
a list of geometric specifications of the reservoir:
|
initialStorage |
(optional) the initial storage of reservoir at the first time step of simulation (MCM). default to the capacity. |
simulation |
a list of simulation time and dates as below:
|
a data.frame: including inflow time series and routing resaults
Rezgar Arabzadeh
Chow, V. T., Maidment, D. R., & Mays, L. W. (1988). Applied hydrology.
this function connects a base
object as a either of: 'downstream'
or 'divertTo'
to a target
object, which are both instantiated by RHMS constructors.
set.as(base,target,type='downstream')
set.as(base,target,type='downstream')
base |
An object; from either of classes of |
target |
An object; from either of classes of |
type |
the type of |
an object from class of target
object.
Rezgar Arabzadeh
simulates an object inherited form class of createBasin
sim(object)
sim(object)
object |
an object from class of |
a list: the same as objects inherited from class of createBasin
Rezgar Arabzadeh
NRCS, U. (1986). Urban hydrology for small watersheds-Technical Release 55 (TR55). Water Resources Learning Center. Washington DC.
Chow, V. T., Maidment, D. R., & Mays, L. W. (1988). Applied hydrology.
data(Zaab) geometry<-list(storageElevationCurve=Zaab[[1]]$Kanisib$storageElevationCurve, dischargeElevationCurve=Zaab[[1]]$Kanisib$dischargeElevationCurve, capacity=Zaab[[1]]$Kanisib$capacity) KanisibDam<-createReservoir(name="Kanisib", geometry=geometry, initialStorage=geometry$capacity) R1<-createReach(name="Reach 1",downstream=KanisibDam) J1<-createJunction(name="Junction 1",downstream=R1) R2<-createReach(name="Reach 2",downstream=J1) R3<-createReach(name="Reach 3",downstream=J1) J2<-createJunction(name="Junction 1",downstream=R2) R4<-createReach(name="Reach 4",downstream=J2) R5<-createReach(name="Reach 5",downstream=J2) geometry<-list(storageElevationCurve=Zaab[[1]]$Gordebin$storageElevationCurve, dischargeElevationCurve=Zaab[[1]]$Gordebin$dischargeElevationCurve, capacity=Zaab[[1]]$Gordebin$capacity) GordebinDam<-createReservoir(name="Gordebin", geometry=geometry, initialStorage=geometry$capacity,downstream=R4) R6<-createReach(name="Reach 6",downstream=GordebinDam) Zangabad<-createSubbasin(name="Zangabad", precipitation=Zaab[[2]]$zangabad, Area=338.2, downstream=R6, lossMethod="SCS", transformParams=list(Tlag=4), lossParams=list(CN=70)) geometry<-list(storageElevationCurve=Zaab[[1]]$Silveh$storageElevationCurve, dischargeElevationCurve=Zaab[[1]]$Silveh$dischargeElevationCurve, capacity=Zaab[[1]]$Silveh$capacity) SilvehDam<-createReservoir(name="Silveh", geometry=geometry, initialStorage=geometry$capacity,downstream=R5) R7<-createReach(name="Reach 7",downstream=SilvehDam) Darbekaykhaneh<-createSubbasin(name="Darbekaykhaneh", precipitation=Zaab[[2]]$darbekaykhaneh, Area=338.8, downstream=R7, lossMethod="SCS", transformParams=list(Tlag=3), lossParams=list(CN=65)) D1<-createDiversion(name="Diversion 1",downstream=R3, divertTo=SilvehDam,capacity=100) R8<-createReach(name="Reach 8",downstream=D1) Pardanan<-createSubbasin(name="Pardanan", precipitation=Zaab[[2]]$pardanan, Area=200.1, downstream=R8, lossMethod="SCS", transformParams=list(Tlag=2), lossParams=list(CN=75)) ZaabRB<-createBasin(name="Zaab", simulation=list(start='2000-01-01', end ='2000-01-15', by =3600)) ZaabRB<-addObjectToBasin(R1,ZaabRB) ZaabRB<-addObjectToBasin(R2,ZaabRB) ZaabRB<-addObjectToBasin(R3,ZaabRB) ZaabRB<-addObjectToBasin(R4,ZaabRB) ZaabRB<-addObjectToBasin(R5,ZaabRB) ZaabRB<-addObjectToBasin(R6,ZaabRB) ZaabRB<-addObjectToBasin(R7,ZaabRB) ZaabRB<-addObjectToBasin(R8,ZaabRB) ZaabRB<-addObjectToBasin(J1,ZaabRB) ZaabRB<-addObjectToBasin(J2,ZaabRB) ZaabRB<-addObjectToBasin(D1,ZaabRB) ZaabRB<-addObjectToBasin(SilvehDam,ZaabRB) ZaabRB<-addObjectToBasin(GordebinDam,ZaabRB) ZaabRB<-addObjectToBasin(KanisibDam,ZaabRB) ZaabRB<-addObjectToBasin(Pardanan,ZaabRB) ZaabRB<-addObjectToBasin(Zangabad,ZaabRB) ZaabRB<-addObjectToBasin(Darbekaykhaneh,ZaabRB) ## Not run: plot(ZaabRB) plot(sim(ZaabRB)) ## End(Not run)
data(Zaab) geometry<-list(storageElevationCurve=Zaab[[1]]$Kanisib$storageElevationCurve, dischargeElevationCurve=Zaab[[1]]$Kanisib$dischargeElevationCurve, capacity=Zaab[[1]]$Kanisib$capacity) KanisibDam<-createReservoir(name="Kanisib", geometry=geometry, initialStorage=geometry$capacity) R1<-createReach(name="Reach 1",downstream=KanisibDam) J1<-createJunction(name="Junction 1",downstream=R1) R2<-createReach(name="Reach 2",downstream=J1) R3<-createReach(name="Reach 3",downstream=J1) J2<-createJunction(name="Junction 1",downstream=R2) R4<-createReach(name="Reach 4",downstream=J2) R5<-createReach(name="Reach 5",downstream=J2) geometry<-list(storageElevationCurve=Zaab[[1]]$Gordebin$storageElevationCurve, dischargeElevationCurve=Zaab[[1]]$Gordebin$dischargeElevationCurve, capacity=Zaab[[1]]$Gordebin$capacity) GordebinDam<-createReservoir(name="Gordebin", geometry=geometry, initialStorage=geometry$capacity,downstream=R4) R6<-createReach(name="Reach 6",downstream=GordebinDam) Zangabad<-createSubbasin(name="Zangabad", precipitation=Zaab[[2]]$zangabad, Area=338.2, downstream=R6, lossMethod="SCS", transformParams=list(Tlag=4), lossParams=list(CN=70)) geometry<-list(storageElevationCurve=Zaab[[1]]$Silveh$storageElevationCurve, dischargeElevationCurve=Zaab[[1]]$Silveh$dischargeElevationCurve, capacity=Zaab[[1]]$Silveh$capacity) SilvehDam<-createReservoir(name="Silveh", geometry=geometry, initialStorage=geometry$capacity,downstream=R5) R7<-createReach(name="Reach 7",downstream=SilvehDam) Darbekaykhaneh<-createSubbasin(name="Darbekaykhaneh", precipitation=Zaab[[2]]$darbekaykhaneh, Area=338.8, downstream=R7, lossMethod="SCS", transformParams=list(Tlag=3), lossParams=list(CN=65)) D1<-createDiversion(name="Diversion 1",downstream=R3, divertTo=SilvehDam,capacity=100) R8<-createReach(name="Reach 8",downstream=D1) Pardanan<-createSubbasin(name="Pardanan", precipitation=Zaab[[2]]$pardanan, Area=200.1, downstream=R8, lossMethod="SCS", transformParams=list(Tlag=2), lossParams=list(CN=75)) ZaabRB<-createBasin(name="Zaab", simulation=list(start='2000-01-01', end ='2000-01-15', by =3600)) ZaabRB<-addObjectToBasin(R1,ZaabRB) ZaabRB<-addObjectToBasin(R2,ZaabRB) ZaabRB<-addObjectToBasin(R3,ZaabRB) ZaabRB<-addObjectToBasin(R4,ZaabRB) ZaabRB<-addObjectToBasin(R5,ZaabRB) ZaabRB<-addObjectToBasin(R6,ZaabRB) ZaabRB<-addObjectToBasin(R7,ZaabRB) ZaabRB<-addObjectToBasin(R8,ZaabRB) ZaabRB<-addObjectToBasin(J1,ZaabRB) ZaabRB<-addObjectToBasin(J2,ZaabRB) ZaabRB<-addObjectToBasin(D1,ZaabRB) ZaabRB<-addObjectToBasin(SilvehDam,ZaabRB) ZaabRB<-addObjectToBasin(GordebinDam,ZaabRB) ZaabRB<-addObjectToBasin(KanisibDam,ZaabRB) ZaabRB<-addObjectToBasin(Pardanan,ZaabRB) ZaabRB<-addObjectToBasin(Zangabad,ZaabRB) ZaabRB<-addObjectToBasin(Darbekaykhaneh,ZaabRB) ## Not run: plot(ZaabRB) plot(sim(ZaabRB)) ## End(Not run)
sim
simulates an object inherited form class of createBasin
## S3 method for class 'base' sim(object)
## S3 method for class 'base' sim(object)
object |
an object from class of |
Rezgar Arabzadeh
sim
simulates an object inherited form class of createBasin
## Default S3 method: sim(object)
## Default S3 method: sim(object)
object |
an object from class of |
Rezgar Arabzadeh
summary method for objects inherited from class of sim
## S3 method for class 'sim' summary(object,...)
## S3 method for class 'sim' summary(object,...)
object |
an object from class of |
... |
other objects that can be passed to summary function |
a matrix: including inflow and outflow volumes and peaks rates respectively
Rezgar Arabzadeh
This function transforms an excess rainfall event to a direct runoff hydorgraph.
transform(rainfall,transformMethod,transformParams,Area,UH,simulation)
transform(rainfall,transformMethod,transformParams,Area,UH,simulation)
rainfall |
an object inherited from |
transformMethod |
a string: the type of transformation method. available types: |
transformParams |
a list of parameters associated to the selcted type of
|
Area |
the area of drainage basin (Km^2) |
UH |
a data.frame: must be provided when |
simulation |
a list of simulation time and dates as below:
|
Hydrogaph of direct runoff
Rezgar Arabzadeh
Area=200 lossMethod<-"SCS" lossParams<-list(CN=65) transformMethod<-c("snyder","SCS","user") simulation<-list(start='2000-01-01',end='2000-01-7',by=7200) precipitation<-sin(seq(0.1,pi-0.1,length.out=10))*20 transformParams=list(Tlag=4,Cp=0.15,Ct=2,L=100,Lc=15) UH<-data.frame(t=1:20,q=sin(seq(0,pi,length.out=20))*1) SCS_loss<-loss(precipitation,lossMethod,lossParams) snyder_transformation<-transform(rainfall=SCS_loss, transformMethod=transformMethod[1], transformParams,Area,UH=NA,simulation) SCS_transformation <-transform(rainfall=SCS_loss, transformMethod=transformMethod[2], transformParams,Area,UH=NA,simulation) user_transformation <-transform(rainfall=SCS_loss, transformMethod=transformMethod[3], transformParams,Area,UH,simulation)
Area=200 lossMethod<-"SCS" lossParams<-list(CN=65) transformMethod<-c("snyder","SCS","user") simulation<-list(start='2000-01-01',end='2000-01-7',by=7200) precipitation<-sin(seq(0.1,pi-0.1,length.out=10))*20 transformParams=list(Tlag=4,Cp=0.15,Ct=2,L=100,Lc=15) UH<-data.frame(t=1:20,q=sin(seq(0,pi,length.out=20))*1) SCS_loss<-loss(precipitation,lossMethod,lossParams) snyder_transformation<-transform(rainfall=SCS_loss, transformMethod=transformMethod[1], transformParams,Area,UH=NA,simulation) SCS_transformation <-transform(rainfall=SCS_loss, transformMethod=transformMethod[2], transformParams,Area,UH=NA,simulation) user_transformation <-transform(rainfall=SCS_loss, transformMethod=transformMethod[3], transformParams,Area,UH,simulation)
transform
This function transforms an excess rainfall event to a direct runoff hydorgraph.
## S3 method for class 'base' transform(rainfall,transformMethod,transformParams,Area,UH,simulation)
## S3 method for class 'base' transform(rainfall,transformMethod,transformParams,Area,UH,simulation)
rainfall |
an object inherited from |
transformMethod |
a string: the type of transformation method. available types: |
transformParams |
a list of parameters associated to the selcted type of
|
Area |
the area of drainage basin (Km^2) |
UH |
a data.frame: must be provided when |
simulation |
a list of simulation time and dates as below:
|
Hydrogaph of direct runoff
Rezgar Arabzadeh
transform
This function transforms an excess rainfall event to a direct runoff hydorgraph.
## Default S3 method: transform(rainfall,transformMethod='SCS', transformParams=list(Tlag=NULL, Cp =NULL, Ct =NULL, L =NULL, Lc =NULL), Area,UH=NA, simulation=list(start=NULL,end=NULL,by=NULL))
## Default S3 method: transform(rainfall,transformMethod='SCS', transformParams=list(Tlag=NULL, Cp =NULL, Ct =NULL, L =NULL, Lc =NULL), Area,UH=NA, simulation=list(start=NULL,end=NULL,by=NULL))
rainfall |
an object inherited from |
transformMethod |
a string: the type of transformation method. available types: |
transformParams |
a list of parameters associated to the selcted type of
|
Area |
the area of drainage basin (Km^2) |
UH |
a data.frame: must be provided when |
simulation |
a list of simulation time and dates as below:
|
Hydrogaph of direct runoff
Rezgar Arabzadeh
a function for tunning an RHMS model based on a set of observed time series, using particle swarm optimization
tune(object,targetObject,decisionObjects, observationTS,delay=0, transformBandWith=list(ct=c(1 , 2.5), cp=c(0.1, 0.3), cn=c(25 , 85 ), k =c(0.1, 2 )), routingBandWith=list(manning = c(0.0001, 0.1), x = c(0.2 , 0.6), k = c(1 , 5 )), maxiter=NA,update=FALSE,plot=FALSE)
tune(object,targetObject,decisionObjects, observationTS,delay=0, transformBandWith=list(ct=c(1 , 2.5), cp=c(0.1, 0.3), cn=c(25 , 85 ), k =c(0.1, 2 )), routingBandWith=list(manning = c(0.0001, 0.1), x = c(0.2 , 0.6), k = c(1 , 5 )), maxiter=NA,update=FALSE,plot=FALSE)
object |
an object from class of |
targetObject |
an object from either of classes: |
decisionObjects |
A list of objects, also, already existing in the |
observationTS |
a vector: an observed flow time series (cms) |
delay |
(optional) an integer presenting the number of time steps to delay |
transformBandWith |
an list: a list of vector(s), including upper and lower limit of parameters of tansformation methods. Each parameter search domain is set as a two-value vector, whose first element indicates lower limit and second elemnt is upper limit.
|
routingBandWith |
an list: a list of vector(s), including upper and lower limit of parameters of routing methods. Each parameter search domain is set as a two-value vector, whose first element indicates lower limit and second elemnt is upper limit.
|
maxiter |
(optional) an integer: maximum number of iterations. default to the square of dimension of decision variables |
plot |
(optional) logical: plots the optimization results |
update |
(optional) logical: If FALSE, the optimized parameter(s) are returned,If TRUE, the calibrated object from class of |
a vector of tunned parameters or an object from class of createBasin
Rezgar Arabzadeh
Kennedy, J. (1997). "The particle swarm: social adaptation of knowledge". Proceedings of IEEE International Conference on Evolutionary Computation. pp. 303-308
J1<-createJunction (name="J1") R1<-createReach(name="R1",routingMethod="muskingum", routingParams=list(k=3,x=0.2), downstream=J1) R2<-createReach(name="R2",routingMethod="muskingumcunge", routingParams=list(bedWith=50, sideSlope=2, channelSlope=0.0005, manningRoughness=0.025, riverLength=100), downstream=J1) S1<-createSubbasin(name = "S1", precipitation=sin(seq(0,pi,length.out=20))*40, Area=100,downstream=R1, transformMethod="SCS",lossMethod="SCS", transformParams=list(Tlag=4),lossParams=list(CN=60)) S2<-createSubbasin(name = "S2", precipitation=sin(seq(0,pi,length.out=20))*30, Area=300,downstream=R2, transformMethod="snyder",lossMethod="horton", transformParams=list(Cp=0.17,Ct=2,L=30,Lc=15), lossParams=list(f0=10,f1=4,k=1)) basin1<-createBasin(name = "Ghezil_Ozan", simulation=list(start='2000-01-01', end ='2000-01-05', by =3600)) basin1<-addObjectToBasin(S1, basin1) basin1<-addObjectToBasin(S2, basin1) basin1<-addObjectToBasin(R1, basin1) basin1<-addObjectToBasin(R2, basin1) basin1<-addObjectToBasin(J1, basin1) ## Not run: plot(basin1) simulated<-sim(basin1) plot(simulated) observationTS1<-simulated$operation$junctions[[1]]$outflo[,1] set.seed(1) observationTS1<-observationTS1+rnorm(length(observationTS1),0,25) y<-observationTS1; x<-1:length(observationTS1) observationTS1<-predict(loess(y~x),x) observationTS1[which(observationTS1<0)]<-0 observationTS<-observationTS1 plot(simulated$operation$junctions[[1]]$outflow[,1],typ='o',ylab='flow rate (cms)',xlab='time step') lines(observationTS,col=2) transformBandWith=list(ct=c(1 ,2.5), cp=c(0.1,0.3), cn=c(25 ,85) , k =c(0.1,2)) routingBandWith=list(maning = c(0.0001,0.1), x = c(0.2 ,0.6), k = c(1 ,5)) targetObject<-J1 decisionObjects<-list(R1,R2,S1,S2) ## Not run: tune(object=basin1, targetObject=targetObject, decisionObjects=decisionObjects, observationTS=observationTS, routingBandWith=routingBandWith, transformBandWith=transformBandWith, plot=TRUE) ## End(Not run)
J1<-createJunction (name="J1") R1<-createReach(name="R1",routingMethod="muskingum", routingParams=list(k=3,x=0.2), downstream=J1) R2<-createReach(name="R2",routingMethod="muskingumcunge", routingParams=list(bedWith=50, sideSlope=2, channelSlope=0.0005, manningRoughness=0.025, riverLength=100), downstream=J1) S1<-createSubbasin(name = "S1", precipitation=sin(seq(0,pi,length.out=20))*40, Area=100,downstream=R1, transformMethod="SCS",lossMethod="SCS", transformParams=list(Tlag=4),lossParams=list(CN=60)) S2<-createSubbasin(name = "S2", precipitation=sin(seq(0,pi,length.out=20))*30, Area=300,downstream=R2, transformMethod="snyder",lossMethod="horton", transformParams=list(Cp=0.17,Ct=2,L=30,Lc=15), lossParams=list(f0=10,f1=4,k=1)) basin1<-createBasin(name = "Ghezil_Ozan", simulation=list(start='2000-01-01', end ='2000-01-05', by =3600)) basin1<-addObjectToBasin(S1, basin1) basin1<-addObjectToBasin(S2, basin1) basin1<-addObjectToBasin(R1, basin1) basin1<-addObjectToBasin(R2, basin1) basin1<-addObjectToBasin(J1, basin1) ## Not run: plot(basin1) simulated<-sim(basin1) plot(simulated) observationTS1<-simulated$operation$junctions[[1]]$outflo[,1] set.seed(1) observationTS1<-observationTS1+rnorm(length(observationTS1),0,25) y<-observationTS1; x<-1:length(observationTS1) observationTS1<-predict(loess(y~x),x) observationTS1[which(observationTS1<0)]<-0 observationTS<-observationTS1 plot(simulated$operation$junctions[[1]]$outflow[,1],typ='o',ylab='flow rate (cms)',xlab='time step') lines(observationTS,col=2) transformBandWith=list(ct=c(1 ,2.5), cp=c(0.1,0.3), cn=c(25 ,85) , k =c(0.1,2)) routingBandWith=list(maning = c(0.0001,0.1), x = c(0.2 ,0.6), k = c(1 ,5)) targetObject<-J1 decisionObjects<-list(R1,R2,S1,S2) ## Not run: tune(object=basin1, targetObject=targetObject, decisionObjects=decisionObjects, observationTS=observationTS, routingBandWith=routingBandWith, transformBandWith=transformBandWith, plot=TRUE) ## End(Not run)
an object inherited from class of createBasin
. including features, of a sub-basin in Kurditan known as Zaab, such as: reservoirs, reachs, subbasins, and junctions.
data(Zaab)
data(Zaab)
Iran Water Resources Management Company (2015)
data(Zaab)
data(Zaab)