an application programmer’s interface (api) to · pdf fileinteractive tutorial on...

1
Water Sim 5.0 Model API Both researchers and water managers indicated that a different type of interface to model would be needed to meet their research and analysis needs. However these needs were not similar between different researchers and between different water managers. Thus it would not be possible to create a one size fits all interface for the model. For this reason, version 5.0 of the model does not include an interactive interface. To begin providing more flexibility for use of the model a C# application interface was developed that makes the model usable by anyone using a Windows .Net platform. The API provides access to read and set model parameters with, error checking of input data, routines to run the model in year increments, and routines to output model results into a database. Researches can write visual basic or C# programs to interact with the model. Source code for an application that implements a simplified visual interface to the model is provided as an example of using the What is WaterSim? WaterSim is a hierarchical supply and demand budget model that uses supply from surface and groundwater sources and demand from residential and commercial, incorporating the rules that govern reservoirs, aquifer use, and land-use change. It simulates the urban water systems for Maricopa County and supplies that come from the Colorado River Basin and the Salt Verde River basins (Figure 1). Water Sim in the Decision Theater Implemented in PowerSim High interactive framework Very successful for educating general audiences about the complex of water management and the tradeoffs required to achieve sustainability. Limitations: Access and quantitative informationWaterSim on the Web WaterSim on the Web Web interface allows anyone to interact with model Interactive tutorial on regional water resources Being used in Geography or Environmental Science classes. WaterSim for Research and Analysis PowerSim limited the complex of water systems that could be modeled. WaterSim for Research - Version 5.0 Developed in Fortran. Modeling 33 individual providers with an expanded urban demand and supply model (Figure 2). includes groundwater, surface water, wastewater, reclaimed water, banked water, and aquifer recharge. No visual Interface, Application Programming Interface API. All source code, assemblies for the interface and a DLL for the model, and documentation is provided online under an open source License. The API includes a number of features to extend the Fortran model. This includes: Database support to save and load model input parameters and to output model results. A mechanism to define feedback loops that can be used to change model parameters annually based on model output. Classes that allow creation of derived parameters from model output that can be automatically included in the database output. Visual input components for model parameters that can be used in Visual Studio The goal is for researchers to develop a wide range of interfaces that each best suit a particular need. Two interfaces are currently under development: 1) an interface that allows WaterSim to be used to study how people make decisions under uncertainty, and 2) an interface that provides a scenario generator to run hundreds of scenarios through the model and analyze the model outputs in aggregate. These two interfaces are primarily to meet researcher’s needs. Research continues to identify the type of interface that would meet the needs of water managers. Vadose Zone Power Plant Traditional WWTP Reverse Osmosis Evaporation Runoff (leaving system) Rainfall Ground Surface Land Surface Water Agricultural Irrigation Groundwater CAP Water SRP Water Surface Water Surface Water Treatment Plant Water Supply Residential Use Evaporation Regional WW Surface Discharge/ Environment Commercial/ Industrial Industrial Reuse Direct Injection Reclaimed WWTP Potable water Reclaimed Water Effluent Evaporation Evaporation Evaporation RO Reclaimed Water (Output) RO Reclaimed Water (Input) Outdoor Residential Use Indoor Residential Use Outdoor Commercial/ Industrial Indoor Commercial/ Industrial Groundwater Treatment Key Potable Water Non-potable Water Demand Variable Switch Flux DCDC Aug 5 2011 Landscape Form Information Flow Reclaimed Water (Output) Groundwater Banking Reclaimed Water (Input) Draft PCT_Reclaimed _to_RO PCT_Wastewater _Reclaimed PCT_RO_to_ Water_Supply PCT_Reclaimed_ to_Water_Supply difference difference difference PCT_Outdoor_ WaterUse PCT_Reclaimed_to _Vadose PCT_Reclaimed _to_DirectInject difference PCT_WaterSupply _to_Residential Use_WaterSupply _to_DirectInject PCT_WaterSupply _to_ComInd PCT_Wastewater_to_Effluent IR difference WWtoIndReuse PCT_SurfaceWater _to_WaterBank WBtoSW SurfaceWater _to_Vadose difference PCT_Effluent_ to_PowerPlant difference PCT_Effluent_to_ Vadose PCT_Groundwater _Treated difference vK1 vK2 1-vK8 vK8 difference PCT_Outdoor _WaterUse 1 3 4 5 6 7 8 9 10 11 12 13 16 15 14 19 20 17 18 PCT_Reclaimed_Outdoor_ Use PCT_Reclaimed_Out door_Use Problem Water is an essential resource for human settlement. Water management is a very complicated issue. Complex highly regulated systems often operated by multiple agencies over different geographies spanning hundreds of miles. collect, treat and deliver potable water collect, treat, and reuse wastewater. Complicated by the future uncertainty in the factors that affect water supply and demand. possible changes in the future growth or decline of a community behavior of residents using water, change is future of climate conditions of the community ability of government and private institutions to respond Research Understand how these uncertainties affect the complex tasks of water resources management Using WaterSim to understand the dynamic nature of managing a complex water supply and demand system for urban regions. Exploring the effectiveness of various water management policies. Exploring the uncertainty of regional growth and climate change by understanding the impact different growth and climate change scenarios may have on the region’s water system. Exploring how people make decisions for highly complex problems that are subject to high uncertainty. An Application Programmer’s Interface (API) to WaterSim: WaterSim 5.0. Sampson, D.A. ([email protected]) and R. Quay ([email protected]) WaterSim DCDC Our mission at the Decision Center for a Desert City (DCDC) is to “conduct climate, water, and decision research and to develop innovative tools to bridge the boundary between scientists and decision makers in order to put our work into the hands of those whose concern is for the sustainable future of Greater Phoenix.” The WaterSim water policy and management model represents one of the core tools created, updated, and maintained by DCDC. We use WaterSim to examine the potential impact of uncertainties in climate and policies on water supply and demand. The newest version of WaterSim, WaterSim 5.0, represents a radical departure from previous versions. Our newly released, provider-level model includes: 1) a city infrastructure model that simulates the movement of water through a standard city system including the water use chain starting from water supply and treatment to delivery to residential and commercial users and, eventually, effluent production and the possible pathways of reclaimed and recycled water; 2) a hierarchical demand-based water supply module; and 3) an open source API and associated documentation which enables others to freely use the WaterSim model for their own research, education, and outreach. This last feature, the API, a major step towards expanding the use of WaterSim. Figure 1: Geography of Watersim Figure 2 WaterSim Urban Water Supply and Demand Model

Upload: doandung

Post on 05-Mar-2018

239 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: An Application Programmer’s Interface (API) to · PDF fileInteractive tutorial on regional water resources ... used in Visual Studio ... An Application Programmer’s Interface (API)

Water Sim 5.0 Model APIBoth researchers and water managers indicated that a different type of interface to model would be needed to meet their research and analysis needs. However these needs were not similar between different researchers and between different

water managers. Thus it would not be possible to create a one size fi ts all interface for the model. For this reason, version 5.0 of the model does not include an interactive interface. To begin providing more fl exibility for use of the model a C# application interface was developed that makes the model usable by anyone using a Windows .Net platform. The API provides access to

read and set model parameters with, error checking of input data, routines to run the model in year increments, and routines to output model results into a database. Researches can write visual basic or C# programs to interact with the model. Source code for an application that implements a simplifi ed visual interface to the model is provided as an example of using the

What is WaterSim?

WaterSim is a hierarchical supply and demand budget model that uses supply from surface and groundwater sources and demand from residential and commercial, incorporating the rules that govern reservoirs, aquifer use, and land-use change. It simulates the urban water systems for Maricopa County and supplies that come from the Colorado River Basin and the Salt Verde River basins (Figure 1).

● Water Sim in the Decision Theater ◦ Implemented in PowerSim ◦ High interactive framework ◦ Very successful for educating general audiences

about the complex of water management and the tradeoffs required to achieve sustainability.

◦ Limitations: Access and quantitative informationWaterSim on the Web

● WaterSim on the Web ◦ Web interface allows anyone to interact with model ◦ Interactive tutorial on regional water resources ◦ Being used in Geography or Environmental Science classes. ◦ WaterSim for Research and Analysis ◦ PowerSim limited the complex of water systems that could be

modeled. ● WaterSim for Research - Version 5.0

◦ Developed in Fortran. ◦ Modeling 33 individual providers with an expanded urban

demand and supply model (Figure 2). ◦ includes groundwater, surface water, wastewater, reclaimed

water, banked water, and aquifer recharge. ◦ No visual Interface, Application Programming Interface

API. All source code, assemblies for the interface and a DLL for the model, and documentation is provided online under an open source License.The API includes a number of features to extend the Fortran model. This includes:

● Database support to save and load model input parameters and to output model results.

● A mechanism to defi ne feedback loops that can be used to change model parameters annually based on model output.

● Classes that allow creation of derived parameters from model output that can be automatically included in the database output.

● Visual input components for model parameters that can be used in Visual Studio

The goal is for researchers to develop a wide range of interfaces that each best suit a particular need. Two interfaces are currently under development: 1) an interface that allows WaterSim to be used to study how people make decisions under uncertainty, and 2) an interface that provides a scenario generator to run hundreds of scenarios through the model and

analyze the model outputs in aggregate. These two interfaces are primarily to meet researcher’s needs. Research continues to identify the type of interface that would meet the needs of water managers.

Vadose Zone

Power Plant

TraditionalWWTP

ReverseOsmosis

Evaporation

Runoff(leavingsystem)

Rainfall GroundSurface

LandSurfaceWater

AgriculturalIrrigation Groundwater

CAP Water

SRP Water

Surface Water

Surface Water Treatment Plant

Water Supply

Residential Use

Evaporation

Regional WW Surface Discharge/ Environment

Commercial/Industrial

Industrial Reuse

Direct Injection

ReclaimedWWTP

Potablewater

ReclaimedWater

Effluent

Evaporation

Evaporation

Evaporation

RO Reclaimed Water (Output)

RO Reclaimed Water (Input)

OutdoorResidential Use

IndoorResidential Use

OutdoorCommercial/

Industrial

IndoorCommercial/

Industrial

GroundwaterTreatment

Key

Potable Water

Non-potable Water Demand Variable

SwitchFlux

DCDC

Aug 5 2011

LandscapeForm

InformationFlow

ReclaimedWater (Output)

GroundwaterBanking

ReclaimedWater (Input)

Draft PCT_Reclaimed_to_RO

PCT_Wastewater_Reclaimed

PCT_RO_to_Water_Supply

PCT_Reclaimed_to_Water_Supply

difference

difference

difference

PCT_Outdoor_WaterUse

PCT_Reclaimed_to_Vadose

PCT_Reclaimed_to_DirectInject

difference

PCT_WaterSupply_to_ResidentialUse_WaterSupply

_to_DirectInject

PCT_

Wat

erSu

pply

_to_

Com

Ind

PCT_Wastewater_to_Effluent IR

diffe

renc

e

WWtoIndReuse

PCT_SurfaceWater_to_WaterBank

WBtoSW

SurfaceWater_to_Vadose

difference

PCT_Effluent_to_PowerPlant

difference

PCT_Effluent_to_Vadose

PCT_Groundwater_Treated

difference

vK1

vK2

1-vK8

vK8

difference

PCT_Outdoor_WaterUse

1

3

4

5

6

7

8

9

10

11

12

13

16

15

14

19

20

17

18

PCT_Reclaimed_Outdoor_Use

PCT_Reclaimed_Outdoor_Use

Problem ● Water is an essential resource for human settlement. ● Water management is a very complicated issue. ● Complex highly regulated systems often operated by multiple agencies over different geographies spanning hundreds of miles. ◦ collect, treat and deliver potable water ◦ collect, treat, and reuse wastewater.

● Complicated by the future uncertainty in the factors that affect water supply and demand. ◦ possible changes in the future growth or decline of a

community ◦ behavior of residents using water, ◦ change is future of climate conditions of the community ◦ ability of government and private institutions to respond

Research ● Understand how these uncertainties affect the complex tasks of water resources management

● Using WaterSim to understand the dynamic nature of managing a complex water supply and demand system for urban regions. ◦ Exploring the effectiveness of various water management

policies. ◦ Exploring the uncertainty of regional growth and climate

change by understanding the impact different growth and climate change scenarios may have on the region’s water system.

◦ Exploring how people make decisions for highly complex problems that are subject to high uncertainty.

An Application Programmer’s Interface (API) to WaterSim: WaterSim 5.0.Sampson, D.A. ([email protected]) and R. Quay ([email protected])

WaterSim DCDCOur mission at the Decision Center for a Desert City (DCDC) is to “conduct climate, water, and decision research and to develop innovative tools to bridge the boundary between scientists and decision makers in order to put our work into the hands of those whose concern is for the sustainable future of Greater Phoenix.” The WaterSim water policy and management model represents one of the core tools created, updated, and maintained by DCDC. We use WaterSim to examine the potential impact of uncertainties in climate and policies on water supply and demand. The newest version of WaterSim, WaterSim 5.0, represents a radical departure from previous versions. Our newly released, provider-level model includes: 1) a city infrastructure model that simulates the movement of water through a standard city system including the water use chain starting from water supply and treatment to delivery to residential and commercial users and, eventually, effl uent production and the possible pathways of reclaimed and recycled water; 2) a hierarchical demand-based water supply module; and 3) an open source API and associated documentation which enables others to freely use the WaterSim model for their own research, education, and outreach. This last feature, the API, a major step towards expanding the use of WaterSim.

Figure 1: Geography of Watersim

Figure 2 WaterSim Urban Water Supply and Demand Model