项目描述:
- 创建动态模型练习Formulate a dynamic model with model quantities such as constants, parameters, and variables and model expressions such as intermediates and equations.
- 具体实例是一个区域的水资源利用情况In Utah, water flows into the (1) Jordanelle reservoir, to the (2) Deer Creek reservoir, to (3) Utah Lake, and finally to the (4) Great Salt Lake.
两个假定:
- (1)河道流量与水库高程的平方根成比例;Suppose that there is a spillway from each upstream body of water to the lower body of water with a flow that is proportional to the square root of the reservoir height.
- (2)下游的Great Salt Lake没有出流;There is no outflow from the Great Salt Lake except due to evaporation.
- (3)没有人为的调控及不考虑其他相关河流补给。This is a simple simulation model that assumes no active control.Utah Lake and the Great Salt Lake also have additional inlet sources such as the Payson River (Utah Lake) and the Weber River and Bear River (Great Salt Lake) that are not considered in this simulation.
建模要求:建立一个基于水量平衡方程的各高程高程变化情况,Develop a simplified dynamic model of the height change in each reservoir from water mass balances.Simulate the height of the reservoirs (in meters) over the course of a year, starting in January, with higher inlet flowrates in the spring due to melting snow. Use a mass balance to describe the change in volume and height of each body of water.
- 给定相关初始条件及数据资料。Below are constants such as area (km^2) and usage requirements (km^3/yr), inlet and outlet flow correlations (km^3/yr), evaporation correlations, and initial conditions for the volumes (km^3).123456789101112131415161718192021222324252627282930313233**Outflow River Rates (km^3/yr)//径流量**Vflow_out1 = 0.030 sqrt(h1)Vflow_out2 = 0.015 sqrt(h2)Vflow_out3 = 0.060 sqrt(h3)Vflow_out4 = 0**Evaporation Rates (km^3/yr)//蒸发量**Vevap = 0.5e-5 * Area, for salt water (Great Salt Lake)Vevap = 1e-5 * Area, for fresh water (all others)**Inflow Rates (km^3/yr)//流入量**Vflow_in1 = 0.13 (July-Mar), 0.21 (Apr-June)Vflow_in2 = Vflow_out1Vflow_in3 = Vflow_out2Vflow_in4 = Vflow_out3**Usage Requirements (km^3/yr)//使用量**Vuse1 = 0.03Vuse2 = 0.05Vuse3 = 0.02Vuse4 = 0.00**Area of Reservoir / Lake (km^2)//水库及湖泊面积**A1 = 13.4A2 = 12.0A3 = 384.5A4 = 4400**Initial Volume of Reservoir / Lake (km^3)//初始容量**V1 = 0.26V2 = 0.18V3 = 0.68V4 = 22.0
对问题数据及变量进行了提取和梳理,构造.apm文件
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 **Constants**! outflow constants(overflow river rates(km^3/yr)c[1]=0.03c[2]=c[1]/2c[3]=c[1]*2c[4]=0! usage amounts(km^3/yr)Vuse[1]=0.03Vuse[2]=0.05Vuse[2]=0.02Vuse[4]=0.00**Parameters**! evaporation constantsevap_c[1:3]=1e-5 !fresh waterevap_c[4]=0.5e-5 !salt water! surface areasA[1]=13.4 !km^2A[2]=12.0 !km^2A[3]=384.5 !km^2A[4]=4400 !km^2! snow pack run-offVin[1] !see data file**Variables**! initial volumes (km^3)V[1]=0.26V[2]=0.18V[3]=0.68V[4]=22.0! initial heights(m)h[1:4]=1000*c[1:4]/A[1:4]! outlet flow rates (km^3/yr)Vout[1:4]=c[1:4]*sqrt(h[1:4])**Intermediates**! river flow rates (km^3/yr)Vin[2:4]=Vout[1:3]! evaporation rates (km^3/yr)Vevap[1:4]=evap_c[1:4}*A[1:4]**Equations**$V[1:4]=Vin[1:4]-Vout[1:4]-Vevap[1:4]-Vuse[1:4]1000*V[1:4]=h[1:4]*A[1:4]Vout[1:4]^2=c[1:4]^2*h[1:4]matlab 代码实现
|
|
实验结果如下图所示: