HydPy 6.2.dev1__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hydpy/__init__.py +275 -0
- hydpy/aliases.py +2554 -0
- hydpy/auxs/__init__.py +0 -0
- hydpy/auxs/anntools.py +1305 -0
- hydpy/auxs/armatools.py +883 -0
- hydpy/auxs/calibtools.py +3337 -0
- hydpy/auxs/interptools.py +1094 -0
- hydpy/auxs/iuhtools.py +543 -0
- hydpy/auxs/networktools.py +597 -0
- hydpy/auxs/ppolytools.py +809 -0
- hydpy/auxs/quadtools.py +61 -0
- hydpy/auxs/roottools.py +228 -0
- hydpy/auxs/smoothtools.py +273 -0
- hydpy/auxs/statstools.py +2125 -0
- hydpy/auxs/validtools.py +81 -0
- hydpy/conf/HydPyConfigBase.xsd +68637 -0
- hydpy/conf/HydPyConfigBase.xsdt +358 -0
- hydpy/conf/HydPyConfigMultipleRuns.xsd +25 -0
- hydpy/conf/HydPyConfigSingleRun.xsd +24 -0
- hydpy/conf/__init__.py +0 -0
- hydpy/conf/a_coefficients_explicit_lobatto_sequence.npy +0 -0
- hydpy/conf/support_points_for_smoothpar_logistic2.npy +0 -0
- hydpy/config.py +42 -0
- hydpy/core/__init__.py +0 -0
- hydpy/core/aliastools.py +214 -0
- hydpy/core/autodoctools.py +1947 -0
- hydpy/core/auxfiletools.py +1169 -0
- hydpy/core/devicetools.py +3810 -0
- hydpy/core/exceptiontools.py +269 -0
- hydpy/core/filetools.py +1985 -0
- hydpy/core/hydpytools.py +3089 -0
- hydpy/core/importtools.py +1398 -0
- hydpy/core/indextools.py +345 -0
- hydpy/core/itemtools.py +1849 -0
- hydpy/core/masktools.py +460 -0
- hydpy/core/modeltools.py +4868 -0
- hydpy/core/netcdftools.py +2683 -0
- hydpy/core/objecttools.py +2023 -0
- hydpy/core/optiontools.py +1045 -0
- hydpy/core/parametertools.py +4674 -0
- hydpy/core/printtools.py +222 -0
- hydpy/core/propertytools.py +643 -0
- hydpy/core/pubtools.py +254 -0
- hydpy/core/selectiontools.py +1571 -0
- hydpy/core/sequencetools.py +4476 -0
- hydpy/core/seriestools.py +339 -0
- hydpy/core/testtools.py +2483 -0
- hydpy/core/timetools.py +3567 -0
- hydpy/core/typingtools.py +333 -0
- hydpy/core/variabletools.py +2615 -0
- hydpy/cythons/__init__.py +24 -0
- hydpy/cythons/annutils.pxd +33 -0
- hydpy/cythons/annutils.pyi +25 -0
- hydpy/cythons/annutils.pyx +120 -0
- hydpy/cythons/autogen/__init__.py +0 -0
- hydpy/cythons/autogen/annutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/annutils.pxd +42 -0
- hydpy/cythons/autogen/annutils.pyx +129 -0
- hydpy/cythons/autogen/c_arma.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_arma.pxd +179 -0
- hydpy/cythons/autogen/c_arma.pyx +356 -0
- hydpy/cythons/autogen/c_arma_rimorido.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_arma_rimorido.pxd +179 -0
- hydpy/cythons/autogen/c_arma_rimorido.pyx +356 -0
- hydpy/cythons/autogen/c_conv.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_conv.pxd +198 -0
- hydpy/cythons/autogen/c_conv.pyx +491 -0
- hydpy/cythons/autogen/c_conv_idw.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_conv_idw.pxd +124 -0
- hydpy/cythons/autogen/c_conv_idw.pyx +264 -0
- hydpy/cythons/autogen/c_conv_idw_ed.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_conv_idw_ed.pxd +197 -0
- hydpy/cythons/autogen/c_conv_idw_ed.pyx +481 -0
- hydpy/cythons/autogen/c_conv_nn.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_conv_nn.pxd +120 -0
- hydpy/cythons/autogen/c_conv_nn.pyx +224 -0
- hydpy/cythons/autogen/c_dam.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam.pxd +805 -0
- hydpy/cythons/autogen/c_dam.pyx +1477 -0
- hydpy/cythons/autogen/c_dam_llake.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_llake.pxd +364 -0
- hydpy/cythons/autogen/c_dam_llake.pyx +705 -0
- hydpy/cythons/autogen/c_dam_lreservoir.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_lreservoir.pxd +365 -0
- hydpy/cythons/autogen/c_dam_lreservoir.pyx +708 -0
- hydpy/cythons/autogen/c_dam_lretention.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_lretention.pxd +340 -0
- hydpy/cythons/autogen/c_dam_lretention.pyx +625 -0
- hydpy/cythons/autogen/c_dam_pump.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_pump.pxd +402 -0
- hydpy/cythons/autogen/c_dam_pump.pyx +724 -0
- hydpy/cythons/autogen/c_dam_pump_sluice.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_pump_sluice.pxd +452 -0
- hydpy/cythons/autogen/c_dam_pump_sluice.pyx +829 -0
- hydpy/cythons/autogen/c_dam_sluice.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_sluice.pxd +404 -0
- hydpy/cythons/autogen/c_dam_sluice.pyx +726 -0
- hydpy/cythons/autogen/c_dam_v001.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_v001.pxd +452 -0
- hydpy/cythons/autogen/c_dam_v001.pyx +816 -0
- hydpy/cythons/autogen/c_dam_v002.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_v002.pxd +394 -0
- hydpy/cythons/autogen/c_dam_v002.pyx +703 -0
- hydpy/cythons/autogen/c_dam_v003.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_v003.pxd +417 -0
- hydpy/cythons/autogen/c_dam_v003.pyx +744 -0
- hydpy/cythons/autogen/c_dam_v004.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_v004.pxd +486 -0
- hydpy/cythons/autogen/c_dam_v004.pyx +891 -0
- hydpy/cythons/autogen/c_dam_v005.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_v005.pxd +524 -0
- hydpy/cythons/autogen/c_dam_v005.pyx +928 -0
- hydpy/cythons/autogen/c_dummy.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy.pxd +151 -0
- hydpy/cythons/autogen/c_dummy.pyx +263 -0
- hydpy/cythons/autogen/c_dummy_interceptedwater.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy_interceptedwater.pxd +69 -0
- hydpy/cythons/autogen/c_dummy_interceptedwater.pyx +104 -0
- hydpy/cythons/autogen/c_dummy_node2node.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy_node2node.pxd +89 -0
- hydpy/cythons/autogen/c_dummy_node2node.pyx +148 -0
- hydpy/cythons/autogen/c_dummy_snowalbedo.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy_snowalbedo.pxd +69 -0
- hydpy/cythons/autogen/c_dummy_snowalbedo.pyx +104 -0
- hydpy/cythons/autogen/c_dummy_snowcover.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy_snowcover.pxd +69 -0
- hydpy/cythons/autogen/c_dummy_snowcover.pyx +104 -0
- hydpy/cythons/autogen/c_dummy_snowycanopy.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy_snowycanopy.pxd +69 -0
- hydpy/cythons/autogen/c_dummy_snowycanopy.pyx +104 -0
- hydpy/cythons/autogen/c_dummy_soilwater.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy_soilwater.pxd +69 -0
- hydpy/cythons/autogen/c_dummy_soilwater.pyx +104 -0
- hydpy/cythons/autogen/c_evap.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap.pxd +1029 -0
- hydpy/cythons/autogen/c_evap.pyx +2601 -0
- hydpy/cythons/autogen/c_evap_aet_hbv96.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_aet_hbv96.pxd +227 -0
- hydpy/cythons/autogen/c_evap_aet_hbv96.pyx +584 -0
- hydpy/cythons/autogen/c_evap_aet_minhas.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_aet_minhas.pxd +193 -0
- hydpy/cythons/autogen/c_evap_aet_minhas.pyx +478 -0
- hydpy/cythons/autogen/c_evap_aet_morsim.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_aet_morsim.pxd +681 -0
- hydpy/cythons/autogen/c_evap_aet_morsim.pyx +1642 -0
- hydpy/cythons/autogen/c_evap_pet_ambav1.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_pet_ambav1.pxd +532 -0
- hydpy/cythons/autogen/c_evap_pet_ambav1.pyx +1296 -0
- hydpy/cythons/autogen/c_evap_pet_hbv96.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_pet_hbv96.pxd +179 -0
- hydpy/cythons/autogen/c_evap_pet_hbv96.pyx +328 -0
- hydpy/cythons/autogen/c_evap_pet_m.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_pet_m.pxd +124 -0
- hydpy/cythons/autogen/c_evap_pet_m.pyx +214 -0
- hydpy/cythons/autogen/c_evap_pet_mlc.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_pet_mlc.pxd +126 -0
- hydpy/cythons/autogen/c_evap_pet_mlc.pyx +214 -0
- hydpy/cythons/autogen/c_evap_ret_fao56.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_ret_fao56.pxd +305 -0
- hydpy/cythons/autogen/c_evap_ret_fao56.pyx +624 -0
- hydpy/cythons/autogen/c_evap_ret_io.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_ret_io.pxd +112 -0
- hydpy/cythons/autogen/c_evap_ret_io.pyx +176 -0
- hydpy/cythons/autogen/c_evap_ret_tw2002.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_ret_tw2002.pxd +139 -0
- hydpy/cythons/autogen/c_evap_ret_tw2002.pyx +273 -0
- hydpy/cythons/autogen/c_exch.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_exch.pxd +230 -0
- hydpy/cythons/autogen/c_exch.pyx +462 -0
- hydpy/cythons/autogen/c_exch_branch_hbv96.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_exch_branch_hbv96.pxd +134 -0
- hydpy/cythons/autogen/c_exch_branch_hbv96.pyx +255 -0
- hydpy/cythons/autogen/c_exch_waterlevel.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_exch_waterlevel.pxd +54 -0
- hydpy/cythons/autogen/c_exch_waterlevel.pyx +78 -0
- hydpy/cythons/autogen/c_exch_weir_hbv96.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_exch_weir_hbv96.pxd +156 -0
- hydpy/cythons/autogen/c_exch_weir_hbv96.pyx +282 -0
- hydpy/cythons/autogen/c_ga.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_ga.pxd +353 -0
- hydpy/cythons/autogen/c_ga.pyx +1204 -0
- hydpy/cythons/autogen/c_ga_garto.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_ga_garto.pxd +330 -0
- hydpy/cythons/autogen/c_ga_garto.pyx +1105 -0
- hydpy/cythons/autogen/c_ga_garto_submodel1.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_ga_garto_submodel1.pxd +236 -0
- hydpy/cythons/autogen/c_ga_garto_submodel1.pyx +944 -0
- hydpy/cythons/autogen/c_gland.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_gland.pxd +437 -0
- hydpy/cythons/autogen/c_gland.pyx +726 -0
- hydpy/cythons/autogen/c_gland_gr4.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_gland_gr4.pxd +382 -0
- hydpy/cythons/autogen/c_gland_gr4.pyx +605 -0
- hydpy/cythons/autogen/c_gland_gr5.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_gland_gr5.pxd +368 -0
- hydpy/cythons/autogen/c_gland_gr5.pyx +568 -0
- hydpy/cythons/autogen/c_gland_gr6.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_gland_gr6.pxd +420 -0
- hydpy/cythons/autogen/c_gland_gr6.pyx +673 -0
- hydpy/cythons/autogen/c_hland.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_hland.pxd +855 -0
- hydpy/cythons/autogen/c_hland.pyx +2486 -0
- hydpy/cythons/autogen/c_hland_96.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_hland_96.pxd +631 -0
- hydpy/cythons/autogen/c_hland_96.pyx +1724 -0
- hydpy/cythons/autogen/c_hland_96c.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_hland_96c.pxd +621 -0
- hydpy/cythons/autogen/c_hland_96c.pyx +1822 -0
- hydpy/cythons/autogen/c_hland_96p.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_hland_96p.pxd +683 -0
- hydpy/cythons/autogen/c_hland_96p.pyx +1911 -0
- hydpy/cythons/autogen/c_kinw.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_kinw.pxd +509 -0
- hydpy/cythons/autogen/c_kinw.pyx +965 -0
- hydpy/cythons/autogen/c_kinw_williams.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_kinw_williams.pxd +409 -0
- hydpy/cythons/autogen/c_kinw_williams.pyx +763 -0
- hydpy/cythons/autogen/c_kinw_williams_ext.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_kinw_williams_ext.pxd +220 -0
- hydpy/cythons/autogen/c_kinw_williams_ext.pyx +440 -0
- hydpy/cythons/autogen/c_lland.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_lland.pxd +1386 -0
- hydpy/cythons/autogen/c_lland.pyx +3679 -0
- hydpy/cythons/autogen/c_lland_dd.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_lland_dd.pxd +679 -0
- hydpy/cythons/autogen/c_lland_dd.pyx +1719 -0
- hydpy/cythons/autogen/c_lland_knauf.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_lland_knauf.pxd +1096 -0
- hydpy/cythons/autogen/c_lland_knauf.pyx +2784 -0
- hydpy/cythons/autogen/c_lland_knauf_ic.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_lland_knauf_ic.pxd +1369 -0
- hydpy/cythons/autogen/c_lland_knauf_ic.pyx +3625 -0
- hydpy/cythons/autogen/c_meteo.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo.pxd +469 -0
- hydpy/cythons/autogen/c_meteo.pyx +879 -0
- hydpy/cythons/autogen/c_meteo_clear_glob_io.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_clear_glob_io.pxd +75 -0
- hydpy/cythons/autogen/c_meteo_clear_glob_io.pyx +107 -0
- hydpy/cythons/autogen/c_meteo_glob_fao56.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_glob_fao56.pxd +209 -0
- hydpy/cythons/autogen/c_meteo_glob_fao56.pyx +339 -0
- hydpy/cythons/autogen/c_meteo_glob_io.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_glob_io.pxd +63 -0
- hydpy/cythons/autogen/c_meteo_glob_io.pyx +91 -0
- hydpy/cythons/autogen/c_meteo_glob_morsim.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_glob_morsim.pxd +289 -0
- hydpy/cythons/autogen/c_meteo_glob_morsim.pyx +527 -0
- hydpy/cythons/autogen/c_meteo_precip_io.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_precip_io.pxd +112 -0
- hydpy/cythons/autogen/c_meteo_precip_io.pyx +176 -0
- hydpy/cythons/autogen/c_meteo_psun_sun_glob_io.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_psun_sun_glob_io.pxd +87 -0
- hydpy/cythons/autogen/c_meteo_psun_sun_glob_io.pyx +123 -0
- hydpy/cythons/autogen/c_meteo_sun_fao56.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_sun_fao56.pxd +209 -0
- hydpy/cythons/autogen/c_meteo_sun_fao56.pyx +343 -0
- hydpy/cythons/autogen/c_meteo_sun_morsim.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_sun_morsim.pxd +286 -0
- hydpy/cythons/autogen/c_meteo_sun_morsim.pyx +519 -0
- hydpy/cythons/autogen/c_meteo_temp_io.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_temp_io.pxd +112 -0
- hydpy/cythons/autogen/c_meteo_temp_io.pyx +176 -0
- hydpy/cythons/autogen/c_musk.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_musk.pxd +282 -0
- hydpy/cythons/autogen/c_musk.pyx +605 -0
- hydpy/cythons/autogen/c_musk_classic.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_musk_classic.pxd +138 -0
- hydpy/cythons/autogen/c_musk_classic.pyx +226 -0
- hydpy/cythons/autogen/c_musk_mct.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_musk_mct.pxd +282 -0
- hydpy/cythons/autogen/c_musk_mct.pyx +609 -0
- hydpy/cythons/autogen/c_rconc.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_rconc.pxd +119 -0
- hydpy/cythons/autogen/c_rconc.pyx +174 -0
- hydpy/cythons/autogen/c_rconc_nash.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_rconc_nash.pxd +111 -0
- hydpy/cythons/autogen/c_rconc_nash.pyx +185 -0
- hydpy/cythons/autogen/c_rconc_uh.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_rconc_uh.pxd +92 -0
- hydpy/cythons/autogen/c_rconc_uh.pyx +125 -0
- hydpy/cythons/autogen/c_sw1d.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d.pxd +511 -0
- hydpy/cythons/autogen/c_sw1d.pyx +1263 -0
- hydpy/cythons/autogen/c_sw1d_channel.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_channel.pxd +119 -0
- hydpy/cythons/autogen/c_sw1d_channel.pyx +300 -0
- hydpy/cythons/autogen/c_sw1d_gate_out.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_gate_out.pxd +240 -0
- hydpy/cythons/autogen/c_sw1d_gate_out.pyx +476 -0
- hydpy/cythons/autogen/c_sw1d_lias.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_lias.pxd +320 -0
- hydpy/cythons/autogen/c_sw1d_lias.pyx +619 -0
- hydpy/cythons/autogen/c_sw1d_lias_sluice.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_lias_sluice.pxd +325 -0
- hydpy/cythons/autogen/c_sw1d_lias_sluice.pyx +644 -0
- hydpy/cythons/autogen/c_sw1d_network.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_network.pxd +90 -0
- hydpy/cythons/autogen/c_sw1d_network.pyx +246 -0
- hydpy/cythons/autogen/c_sw1d_pump.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_pump.pxd +256 -0
- hydpy/cythons/autogen/c_sw1d_pump.pyx +502 -0
- hydpy/cythons/autogen/c_sw1d_q_in.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_q_in.pxd +224 -0
- hydpy/cythons/autogen/c_sw1d_q_in.pyx +383 -0
- hydpy/cythons/autogen/c_sw1d_q_out.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_q_out.pxd +224 -0
- hydpy/cythons/autogen/c_sw1d_q_out.pyx +383 -0
- hydpy/cythons/autogen/c_sw1d_storage.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_storage.pxd +193 -0
- hydpy/cythons/autogen/c_sw1d_storage.pyx +349 -0
- hydpy/cythons/autogen/c_sw1d_weir_out.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_weir_out.pxd +212 -0
- hydpy/cythons/autogen/c_sw1d_weir_out.pyx +404 -0
- hydpy/cythons/autogen/c_test.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_test.pxd +175 -0
- hydpy/cythons/autogen/c_test.pyx +348 -0
- hydpy/cythons/autogen/c_test_discontinous.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_test_discontinous.pxd +146 -0
- hydpy/cythons/autogen/c_test_discontinous.pyx +256 -0
- hydpy/cythons/autogen/c_test_stiff0d.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_test_stiff0d.pxd +146 -0
- hydpy/cythons/autogen/c_test_stiff0d.pyx +250 -0
- hydpy/cythons/autogen/c_test_stiff1d.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_test_stiff1d.pxd +145 -0
- hydpy/cythons/autogen/c_test_stiff1d.pyx +294 -0
- hydpy/cythons/autogen/c_whmod.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_whmod.pxd +482 -0
- hydpy/cythons/autogen/c_whmod.pyx +1156 -0
- hydpy/cythons/autogen/c_whmod_rural.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_whmod_rural.pxd +411 -0
- hydpy/cythons/autogen/c_whmod_rural.pyx +982 -0
- hydpy/cythons/autogen/c_whmod_urban.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_whmod_urban.pxd +482 -0
- hydpy/cythons/autogen/c_whmod_urban.pyx +1155 -0
- hydpy/cythons/autogen/c_wland.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wland.pxd +842 -0
- hydpy/cythons/autogen/c_wland.pyx +1890 -0
- hydpy/cythons/autogen/c_wland_gd.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wland_gd.pxd +829 -0
- hydpy/cythons/autogen/c_wland_gd.pyx +1847 -0
- hydpy/cythons/autogen/c_wland_wag.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wland_wag.pxd +810 -0
- hydpy/cythons/autogen/c_wland_wag.pyx +1780 -0
- hydpy/cythons/autogen/c_wq.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wq.pxd +275 -0
- hydpy/cythons/autogen/c_wq.pyx +652 -0
- hydpy/cythons/autogen/c_wq_trapeze.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wq_trapeze.pxd +170 -0
- hydpy/cythons/autogen/c_wq_trapeze.pyx +400 -0
- hydpy/cythons/autogen/c_wq_trapeze_strickler.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wq_trapeze_strickler.pxd +243 -0
- hydpy/cythons/autogen/c_wq_trapeze_strickler.pyx +578 -0
- hydpy/cythons/autogen/c_wq_walrus.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wq_walrus.pxd +61 -0
- hydpy/cythons/autogen/c_wq_walrus.pyx +82 -0
- hydpy/cythons/autogen/configutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/configutils.pxd +17 -0
- hydpy/cythons/autogen/configutils.pyx +119 -0
- hydpy/cythons/autogen/interfaceutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/interfaceutils.pxd +31 -0
- hydpy/cythons/autogen/interfaceutils.pyx +82 -0
- hydpy/cythons/autogen/interputils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/interputils.pxd +42 -0
- hydpy/cythons/autogen/interputils.pyx +118 -0
- hydpy/cythons/autogen/masterinterface.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/masterinterface.pxd +153 -0
- hydpy/cythons/autogen/masterinterface.pyx +222 -0
- hydpy/cythons/autogen/pointerutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/pointerutils.pxd +31 -0
- hydpy/cythons/autogen/pointerutils.pyx +650 -0
- hydpy/cythons/autogen/ppolyutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/ppolyutils.pxd +35 -0
- hydpy/cythons/autogen/ppolyutils.pyx +59 -0
- hydpy/cythons/autogen/quadutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/quadutils.pxd +26 -0
- hydpy/cythons/autogen/quadutils.pyx +973 -0
- hydpy/cythons/autogen/rootutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/rootutils.pxd +28 -0
- hydpy/cythons/autogen/rootutils.pyx +109 -0
- hydpy/cythons/autogen/sequenceutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/sequenceutils.pxd +45 -0
- hydpy/cythons/autogen/sequenceutils.pyx +101 -0
- hydpy/cythons/autogen/smoothutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/smoothutils.pxd +29 -0
- hydpy/cythons/autogen/smoothutils.pyx +833 -0
- hydpy/cythons/configutils.pxd +8 -0
- hydpy/cythons/configutils.pyi +5 -0
- hydpy/cythons/configutils.pyx +110 -0
- hydpy/cythons/interfaceutils.pxd +22 -0
- hydpy/cythons/interfaceutils.pyi +15 -0
- hydpy/cythons/interfaceutils.pyx +73 -0
- hydpy/cythons/interputils.pxd +33 -0
- hydpy/cythons/interputils.pyi +32 -0
- hydpy/cythons/interputils.pyx +109 -0
- hydpy/cythons/modelutils.py +2990 -0
- hydpy/cythons/pointerutils.pxd +22 -0
- hydpy/cythons/pointerutils.pyi +89 -0
- hydpy/cythons/pointerutils.pyx +641 -0
- hydpy/cythons/ppolyutils.pxd +26 -0
- hydpy/cythons/ppolyutils.pyi +21 -0
- hydpy/cythons/ppolyutils.pyx +50 -0
- hydpy/cythons/quadutils.pxd +17 -0
- hydpy/cythons/quadutils.pyi +13 -0
- hydpy/cythons/quadutils.pyx +964 -0
- hydpy/cythons/rootutils.pxd +19 -0
- hydpy/cythons/rootutils.pyi +21 -0
- hydpy/cythons/rootutils.pyx +100 -0
- hydpy/cythons/sequenceutils.pxd +36 -0
- hydpy/cythons/sequenceutils.pyi +7 -0
- hydpy/cythons/sequenceutils.pyx +92 -0
- hydpy/cythons/smoothutils.pxd +20 -0
- hydpy/cythons/smoothutils.pyi +15 -0
- hydpy/cythons/smoothutils.pyx +824 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/land_dill_assl.py +13 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/land_lahn_kalk.py +13 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/land_lahn_leun.py +14 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/land_lahn_marb.py +13 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/stream_dill_assl_lahn_leun.py +5 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/stream_lahn_leun_lahn_kalk.py +5 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/stream_lahn_marb_lahn_leun.py +5 -0
- hydpy/data/HydPy-H-Lahn/control/default/land.py +9 -0
- hydpy/data/HydPy-H-Lahn/control/default/land_dill_assl.py +57 -0
- hydpy/data/HydPy-H-Lahn/control/default/land_lahn_kalk.py +57 -0
- hydpy/data/HydPy-H-Lahn/control/default/land_lahn_leun.py +56 -0
- hydpy/data/HydPy-H-Lahn/control/default/land_lahn_marb.py +57 -0
- hydpy/data/HydPy-H-Lahn/control/default/stream_dill_assl_lahn_leun.py +7 -0
- hydpy/data/HydPy-H-Lahn/control/default/stream_lahn_leun_lahn_kalk.py +7 -0
- hydpy/data/HydPy-H-Lahn/control/default/stream_lahn_marb_lahn_leun.py +7 -0
- hydpy/data/HydPy-H-Lahn/multiple_runs.xml +309 -0
- hydpy/data/HydPy-H-Lahn/multiple_runs_alpha.xml +71 -0
- hydpy/data/HydPy-H-Lahn/network/default/headwaters.py +11 -0
- hydpy/data/HydPy-H-Lahn/network/default/nonheadwaters.py +11 -0
- hydpy/data/HydPy-H-Lahn/network/default/streams.py +8 -0
- hydpy/data/HydPy-H-Lahn/series/default/dill_assl_obs_q.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/evap_pet_hbv96_input_normalairtemperature.nc +0 -0
- hydpy/data/HydPy-H-Lahn/series/default/evap_pet_hbv96_input_normalevapotranspiration.nc +0 -0
- hydpy/data/HydPy-H-Lahn/series/default/hland_96_input_p.nc +0 -0
- hydpy/data/HydPy-H-Lahn/series/default/hland_96_input_t.nc +0 -0
- hydpy/data/HydPy-H-Lahn/series/default/lahn_kalk_obs_q.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/lahn_leun_obs_q.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/lahn_marb_obs_q.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_dill_assl_evap_pet_hbv96_input_normalairtemperature.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_dill_assl_evap_pet_hbv96_input_normalevapotranspiration.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_dill_assl_hland_96_input_p.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_dill_assl_hland_96_input_t.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_kalk_evap_pet_hbv96_input_normalairtemperature.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_kalk_evap_pet_hbv96_input_normalevapotranspiration.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_kalk_hland_96_input_p.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_kalk_hland_96_input_t.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_leun_evap_pet_hbv96_input_normalairtemperature.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_leun_evap_pet_hbv96_input_normalevapotranspiration.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_leun_hland_96_input_p.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_leun_hland_96_input_t.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_marb_evap_pet_hbv96_input_normalairtemperature.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_marb_evap_pet_hbv96_input_normalevapotranspiration.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_marb_hland_96_input_p.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_marb_hland_96_input_t.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/obs_q.nc +0 -0
- hydpy/data/HydPy-H-Lahn/single_run.xml +152 -0
- hydpy/data/HydPy-H-Lahn/single_run.xmlt +143 -0
- hydpy/data/__init__.py +17 -0
- hydpy/docs/__init__.py +0 -0
- hydpy/docs/autofigs/__init__.py +0 -0
- hydpy/docs/bib/__init__.py +0 -0
- hydpy/docs/bib/refs.bib +566 -0
- hydpy/docs/combine_docversions.py +133 -0
- hydpy/docs/draw_model_sketches.py +1301 -0
- hydpy/docs/enable_autodoc.py +7 -0
- hydpy/docs/figs/HydPy-G-GR4.png +0 -0
- hydpy/docs/figs/HydPy-G-GR5.png +0 -0
- hydpy/docs/figs/HydPy-G-GR6.png +0 -0
- hydpy/docs/figs/HydPy-H-HBV96-COSERO.png +0 -0
- hydpy/docs/figs/HydPy-H-HBV96-PREVAH.png +0 -0
- hydpy/docs/figs/HydPy-H-HBV96.png +0 -0
- hydpy/docs/figs/HydPy-H-Lahn.png +0 -0
- hydpy/docs/figs/HydPy-KinW-Williams.png +0 -0
- hydpy/docs/figs/HydPy-L-DD.png +0 -0
- hydpy/docs/figs/HydPy-W-Wag.png +0 -0
- hydpy/docs/figs/HydPy_Logo.png +0 -0
- hydpy/docs/figs/HydPy_Logo_Text.png +0 -0
- hydpy/docs/figs/IDLE-editor.png +0 -0
- hydpy/docs/figs/IDLE-shell.png +0 -0
- hydpy/docs/figs/LAWA_river-basin-bumbers.png +0 -0
- hydpy/docs/figs/__init__.py +0 -0
- hydpy/docs/html_/__init__.py +0 -0
- hydpy/docs/polish_html.py +57 -0
- hydpy/docs/prepare.py +224 -0
- hydpy/docs/publish_docs.py +53 -0
- hydpy/docs/rst/HydPy-ARMA.rst +27 -0
- hydpy/docs/rst/HydPy-Conv.rst +22 -0
- hydpy/docs/rst/HydPy-Dam.rst +79 -0
- hydpy/docs/rst/HydPy-Dummy.rst +21 -0
- hydpy/docs/rst/HydPy-Evap.rst +26 -0
- hydpy/docs/rst/HydPy-Exch.rst +36 -0
- hydpy/docs/rst/HydPy-G.rst +40 -0
- hydpy/docs/rst/HydPy-GA.rst +34 -0
- hydpy/docs/rst/HydPy-H.rst +24 -0
- hydpy/docs/rst/HydPy-KinW.rst +32 -0
- hydpy/docs/rst/HydPy-L.rst +42 -0
- hydpy/docs/rst/HydPy-Meteo.rst +28 -0
- hydpy/docs/rst/HydPy-Musk.rst +21 -0
- hydpy/docs/rst/HydPy-Rconc.rst +17 -0
- hydpy/docs/rst/HydPy-SW1D.rst +49 -0
- hydpy/docs/rst/HydPy-Test.rst +19 -0
- hydpy/docs/rst/HydPy-W.rst +20 -0
- hydpy/docs/rst/HydPy-WHMod.rst +19 -0
- hydpy/docs/rst/HydPy-WQ.rst +20 -0
- hydpy/docs/rst/__init__.py +0 -0
- hydpy/docs/rst/additional_repositories.rst +40 -0
- hydpy/docs/rst/auxiliaries.rst +31 -0
- hydpy/docs/rst/continuous_integration.rst +75 -0
- hydpy/docs/rst/core.rst +75 -0
- hydpy/docs/rst/cythons.rst +47 -0
- hydpy/docs/rst/definitions.rst +506 -0
- hydpy/docs/rst/developer_guide.rst +54 -0
- hydpy/docs/rst/example_projects.rst +40 -0
- hydpy/docs/rst/execution.rst +22 -0
- hydpy/docs/rst/framework_tools.rst +56 -0
- hydpy/docs/rst/how_to_read_the_reference_manual.rst +156 -0
- hydpy/docs/rst/hydpydependencies.rst +55 -0
- hydpy/docs/rst/index.rst +125 -0
- hydpy/docs/rst/installation.rst +155 -0
- hydpy/docs/rst/model_families.rst +79 -0
- hydpy/docs/rst/model_overview.rst +291 -0
- hydpy/docs/rst/modelimports.rst +10 -0
- hydpy/docs/rst/options.rst +119 -0
- hydpy/docs/rst/programming_style.rst +572 -0
- hydpy/docs/rst/project_structure.rst +520 -0
- hydpy/docs/rst/quickstart.rst +304 -0
- hydpy/docs/rst/reference_manual.rst +29 -0
- hydpy/docs/rst/required_tools.rst +50 -0
- hydpy/docs/rst/simulation.rst +514 -0
- hydpy/docs/rst/submodel_interfaces.rst +32 -0
- hydpy/docs/rst/tests_and_documentation.rst +85 -0
- hydpy/docs/rst/user_guide.rst +38 -0
- hydpy/docs/rst/version_control.rst +116 -0
- hydpy/docs/rst/zbibliography.rst +8 -0
- hydpy/docs/sphinx/__init__.py +0 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/changes/frameset.html +11 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/changes/rstsource.html +15 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/changes/versionchanges.html +33 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/defindex.html +35 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/domainindex.html +56 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/genindex-single.html +63 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/genindex-split.html +41 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/genindex.html +76 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/globaltoc.html +11 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/layout.html +221 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/localtoc.html +15 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/opensearch.xml +13 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/page.html +13 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/relations.html +23 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/search.html +65 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/searchbox.html +21 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/searchfield.html +23 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/sourcelink.html +18 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/basic.css_t +925 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/doctools.js +156 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/documentation_options.js_t +13 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/file.png +0 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/language_data.js_t +26 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/minus.png +0 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/plus.png +0 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/searchtools.js +574 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/sphinx_highlight.js +154 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/theme.conf +16 -0
- hydpy/docs/sphinx/_themes/classic_hydpy/layout.html +23 -0
- hydpy/docs/sphinx/_themes/classic_hydpy/static/classic.css_t +358 -0
- hydpy/docs/sphinx/_themes/classic_hydpy/static/sidebar.js_t +72 -0
- hydpy/docs/sphinx/_themes/classic_hydpy/theme.conf +32 -0
- hydpy/docs/sphinx/conf.py +398 -0
- hydpy/docs/sphinx/defaultlinks_extension.py +36 -0
- hydpy/docs/sphinx/integrationtest_extension.py +104 -0
- hydpy/docs/sphinx/projectstructure_extension.py +58 -0
- hydpy/docs/sphinx/submodelgraph_extension.py +53 -0
- hydpy/exe/__init__.py +0 -0
- hydpy/exe/commandtools.py +651 -0
- hydpy/exe/hyd.py +277 -0
- hydpy/exe/modelimports.py +41 -0
- hydpy/exe/replacetools.py +216 -0
- hydpy/exe/servertools.py +2348 -0
- hydpy/exe/xmltools.py +3280 -0
- hydpy/interfaces/__init__.py +0 -0
- hydpy/interfaces/aetinterfaces.py +94 -0
- hydpy/interfaces/dischargeinterfaces.py +45 -0
- hydpy/interfaces/petinterfaces.py +117 -0
- hydpy/interfaces/precipinterfaces.py +42 -0
- hydpy/interfaces/radiationinterfaces.py +79 -0
- hydpy/interfaces/rconcinterfaces.py +30 -0
- hydpy/interfaces/routinginterfaces.py +324 -0
- hydpy/interfaces/soilinterfaces.py +96 -0
- hydpy/interfaces/stateinterfaces.py +98 -0
- hydpy/interfaces/tempinterfaces.py +46 -0
- hydpy/models/__init__.py +0 -0
- hydpy/models/arma/__init__.py +14 -0
- hydpy/models/arma/arma_control.py +383 -0
- hydpy/models/arma/arma_derived.py +204 -0
- hydpy/models/arma/arma_fluxes.py +41 -0
- hydpy/models/arma/arma_inlets.py +11 -0
- hydpy/models/arma/arma_logs.py +19 -0
- hydpy/models/arma/arma_model.py +461 -0
- hydpy/models/arma/arma_outlets.py +11 -0
- hydpy/models/arma_rimorido.py +381 -0
- hydpy/models/conv/__init__.py +12 -0
- hydpy/models/conv/conv_control.py +303 -0
- hydpy/models/conv/conv_derived.py +271 -0
- hydpy/models/conv/conv_fluxes.py +54 -0
- hydpy/models/conv/conv_inlets.py +11 -0
- hydpy/models/conv/conv_model.py +687 -0
- hydpy/models/conv/conv_outlets.py +11 -0
- hydpy/models/conv_idw.py +120 -0
- hydpy/models/conv_idw_ed.py +184 -0
- hydpy/models/conv_nn.py +112 -0
- hydpy/models/dam/__init__.py +16 -0
- hydpy/models/dam/dam_aides.py +17 -0
- hydpy/models/dam/dam_control.py +346 -0
- hydpy/models/dam/dam_derived.py +559 -0
- hydpy/models/dam/dam_factors.py +46 -0
- hydpy/models/dam/dam_fluxes.py +179 -0
- hydpy/models/dam/dam_inlets.py +29 -0
- hydpy/models/dam/dam_logs.py +52 -0
- hydpy/models/dam/dam_model.py +5011 -0
- hydpy/models/dam/dam_outlets.py +23 -0
- hydpy/models/dam/dam_receivers.py +41 -0
- hydpy/models/dam/dam_senders.py +23 -0
- hydpy/models/dam/dam_solver.py +75 -0
- hydpy/models/dam/dam_states.py +11 -0
- hydpy/models/dam_llake.py +499 -0
- hydpy/models/dam_lreservoir.py +548 -0
- hydpy/models/dam_lretention.py +343 -0
- hydpy/models/dam_pump.py +278 -0
- hydpy/models/dam_pump_sluice.py +339 -0
- hydpy/models/dam_sluice.py +319 -0
- hydpy/models/dam_v001.py +1127 -0
- hydpy/models/dam_v002.py +381 -0
- hydpy/models/dam_v003.py +422 -0
- hydpy/models/dam_v004.py +665 -0
- hydpy/models/dam_v005.py +479 -0
- hydpy/models/dummy/__init__.py +15 -0
- hydpy/models/dummy/dummy_control.py +22 -0
- hydpy/models/dummy/dummy_fluxes.py +11 -0
- hydpy/models/dummy/dummy_inlets.py +11 -0
- hydpy/models/dummy/dummy_inputs.py +41 -0
- hydpy/models/dummy/dummy_model.py +196 -0
- hydpy/models/dummy/dummy_outlets.py +11 -0
- hydpy/models/dummy_interceptedwater.py +85 -0
- hydpy/models/dummy_node2node.py +83 -0
- hydpy/models/dummy_snowalbedo.py +84 -0
- hydpy/models/dummy_snowcover.py +84 -0
- hydpy/models/dummy_snowycanopy.py +86 -0
- hydpy/models/dummy_soilwater.py +85 -0
- hydpy/models/evap/__init__.py +13 -0
- hydpy/models/evap/evap_control.py +354 -0
- hydpy/models/evap/evap_derived.py +236 -0
- hydpy/models/evap/evap_factors.py +188 -0
- hydpy/models/evap/evap_fixed.py +68 -0
- hydpy/models/evap/evap_fluxes.py +150 -0
- hydpy/models/evap/evap_inputs.py +54 -0
- hydpy/models/evap/evap_logs.py +91 -0
- hydpy/models/evap/evap_masks.py +48 -0
- hydpy/models/evap/evap_model.py +9170 -0
- hydpy/models/evap/evap_parameters.py +149 -0
- hydpy/models/evap/evap_sequences.py +32 -0
- hydpy/models/evap/evap_states.py +18 -0
- hydpy/models/evap_aet_hbv96.py +372 -0
- hydpy/models/evap_aet_minhas.py +331 -0
- hydpy/models/evap_aet_morsim.py +627 -0
- hydpy/models/evap_pet_ambav1.py +483 -0
- hydpy/models/evap_pet_hbv96.py +147 -0
- hydpy/models/evap_pet_m.py +94 -0
- hydpy/models/evap_pet_mlc.py +107 -0
- hydpy/models/evap_ret_fao56.py +265 -0
- hydpy/models/evap_ret_io.py +74 -0
- hydpy/models/evap_ret_tw2002.py +165 -0
- hydpy/models/exch/__init__.py +14 -0
- hydpy/models/exch/exch_control.py +262 -0
- hydpy/models/exch/exch_derived.py +36 -0
- hydpy/models/exch/exch_factors.py +26 -0
- hydpy/models/exch/exch_fluxes.py +48 -0
- hydpy/models/exch/exch_inlets.py +11 -0
- hydpy/models/exch/exch_logs.py +12 -0
- hydpy/models/exch/exch_model.py +451 -0
- hydpy/models/exch/exch_outlets.py +17 -0
- hydpy/models/exch/exch_receivers.py +17 -0
- hydpy/models/exch_branch_hbv96.py +186 -0
- hydpy/models/exch_waterlevel.py +73 -0
- hydpy/models/exch_weir_hbv96.py +609 -0
- hydpy/models/ga/__init__.py +14 -0
- hydpy/models/ga/ga_aides.py +17 -0
- hydpy/models/ga/ga_control.py +208 -0
- hydpy/models/ga/ga_derived.py +77 -0
- hydpy/models/ga/ga_fluxes.py +83 -0
- hydpy/models/ga/ga_inputs.py +26 -0
- hydpy/models/ga/ga_logs.py +17 -0
- hydpy/models/ga/ga_model.py +2952 -0
- hydpy/models/ga/ga_states.py +87 -0
- hydpy/models/ga_garto.py +1001 -0
- hydpy/models/ga_garto_submodel1.py +79 -0
- hydpy/models/gland/__init__.py +14 -0
- hydpy/models/gland/gland_control.py +90 -0
- hydpy/models/gland/gland_derived.py +113 -0
- hydpy/models/gland/gland_fluxes.py +137 -0
- hydpy/models/gland/gland_inputs.py +12 -0
- hydpy/models/gland/gland_model.py +1439 -0
- hydpy/models/gland/gland_outlets.py +11 -0
- hydpy/models/gland/gland_states.py +90 -0
- hydpy/models/gland_gr4.py +501 -0
- hydpy/models/gland_gr5.py +463 -0
- hydpy/models/gland_gr6.py +487 -0
- hydpy/models/hland/__init__.py +20 -0
- hydpy/models/hland/hland_aides.py +19 -0
- hydpy/models/hland/hland_constants.py +37 -0
- hydpy/models/hland/hland_control.py +1530 -0
- hydpy/models/hland/hland_derived.py +683 -0
- hydpy/models/hland/hland_factors.py +57 -0
- hydpy/models/hland/hland_fixed.py +42 -0
- hydpy/models/hland/hland_fluxes.py +279 -0
- hydpy/models/hland/hland_inputs.py +19 -0
- hydpy/models/hland/hland_masks.py +107 -0
- hydpy/models/hland/hland_model.py +4664 -0
- hydpy/models/hland/hland_outlets.py +11 -0
- hydpy/models/hland/hland_parameters.py +227 -0
- hydpy/models/hland/hland_sequences.py +382 -0
- hydpy/models/hland/hland_states.py +236 -0
- hydpy/models/hland_96.py +1812 -0
- hydpy/models/hland_96c.py +1196 -0
- hydpy/models/hland_96p.py +1204 -0
- hydpy/models/kinw/__init__.py +18 -0
- hydpy/models/kinw/kinw_aides.py +306 -0
- hydpy/models/kinw/kinw_control.py +270 -0
- hydpy/models/kinw/kinw_derived.py +197 -0
- hydpy/models/kinw/kinw_fixed.py +33 -0
- hydpy/models/kinw/kinw_fluxes.py +37 -0
- hydpy/models/kinw/kinw_inlets.py +11 -0
- hydpy/models/kinw/kinw_model.py +3026 -0
- hydpy/models/kinw/kinw_outlets.py +11 -0
- hydpy/models/kinw/kinw_solver.py +45 -0
- hydpy/models/kinw/kinw_states.py +17 -0
- hydpy/models/kinw_williams.py +1299 -0
- hydpy/models/kinw_williams_ext.py +768 -0
- hydpy/models/lland/__init__.py +42 -0
- hydpy/models/lland/lland_aides.py +38 -0
- hydpy/models/lland/lland_constants.py +88 -0
- hydpy/models/lland/lland_control.py +1329 -0
- hydpy/models/lland/lland_derived.py +380 -0
- hydpy/models/lland/lland_factors.py +18 -0
- hydpy/models/lland/lland_fixed.py +128 -0
- hydpy/models/lland/lland_fluxes.py +626 -0
- hydpy/models/lland/lland_inlets.py +12 -0
- hydpy/models/lland/lland_inputs.py +33 -0
- hydpy/models/lland/lland_logs.py +17 -0
- hydpy/models/lland/lland_masks.py +212 -0
- hydpy/models/lland/lland_model.py +7690 -0
- hydpy/models/lland/lland_outlets.py +12 -0
- hydpy/models/lland/lland_parameters.py +195 -0
- hydpy/models/lland/lland_sequences.py +67 -0
- hydpy/models/lland/lland_states.py +280 -0
- hydpy/models/lland_dd.py +2270 -0
- hydpy/models/lland_knauf.py +2156 -0
- hydpy/models/lland_knauf_ic.py +1920 -0
- hydpy/models/meteo/__init__.py +12 -0
- hydpy/models/meteo/meteo_control.py +154 -0
- hydpy/models/meteo/meteo_derived.py +159 -0
- hydpy/models/meteo/meteo_factors.py +88 -0
- hydpy/models/meteo/meteo_fixed.py +19 -0
- hydpy/models/meteo/meteo_fluxes.py +46 -0
- hydpy/models/meteo/meteo_inputs.py +47 -0
- hydpy/models/meteo/meteo_logs.py +30 -0
- hydpy/models/meteo/meteo_model.py +2904 -0
- hydpy/models/meteo/meteo_parameters.py +14 -0
- hydpy/models/meteo/meteo_sequences.py +22 -0
- hydpy/models/meteo_clear_glob_io.py +77 -0
- hydpy/models/meteo_glob_fao56.py +217 -0
- hydpy/models/meteo_glob_io.py +68 -0
- hydpy/models/meteo_glob_morsim.py +444 -0
- hydpy/models/meteo_precip_io.py +76 -0
- hydpy/models/meteo_psun_sun_glob_io.py +83 -0
- hydpy/models/meteo_sun_fao56.py +188 -0
- hydpy/models/meteo_sun_morsim.py +466 -0
- hydpy/models/meteo_temp_io.py +76 -0
- hydpy/models/musk/__init__.py +15 -0
- hydpy/models/musk/musk_control.py +328 -0
- hydpy/models/musk/musk_derived.py +32 -0
- hydpy/models/musk/musk_factors.py +53 -0
- hydpy/models/musk/musk_fluxes.py +24 -0
- hydpy/models/musk/musk_inlets.py +11 -0
- hydpy/models/musk/musk_masks.py +15 -0
- hydpy/models/musk/musk_model.py +838 -0
- hydpy/models/musk/musk_outlets.py +11 -0
- hydpy/models/musk/musk_sequences.py +88 -0
- hydpy/models/musk/musk_solver.py +68 -0
- hydpy/models/musk/musk_states.py +64 -0
- hydpy/models/musk_classic.py +228 -0
- hydpy/models/musk_mct.py +1247 -0
- hydpy/models/rconc/__init__.py +12 -0
- hydpy/models/rconc/rconc_control.py +473 -0
- hydpy/models/rconc/rconc_derived.py +76 -0
- hydpy/models/rconc/rconc_fluxes.py +19 -0
- hydpy/models/rconc/rconc_logs.py +74 -0
- hydpy/models/rconc/rconc_model.py +260 -0
- hydpy/models/rconc/rconc_states.py +11 -0
- hydpy/models/rconc_nash.py +48 -0
- hydpy/models/rconc_uh.py +53 -0
- hydpy/models/sw1d/__init__.py +17 -0
- hydpy/models/sw1d/sw1d_control.py +356 -0
- hydpy/models/sw1d/sw1d_derived.py +85 -0
- hydpy/models/sw1d/sw1d_factors.py +78 -0
- hydpy/models/sw1d/sw1d_fixed.py +12 -0
- hydpy/models/sw1d/sw1d_fluxes.py +55 -0
- hydpy/models/sw1d/sw1d_inlets.py +17 -0
- hydpy/models/sw1d/sw1d_model.py +3385 -0
- hydpy/models/sw1d/sw1d_outlets.py +11 -0
- hydpy/models/sw1d/sw1d_receivers.py +11 -0
- hydpy/models/sw1d/sw1d_senders.py +11 -0
- hydpy/models/sw1d/sw1d_states.py +23 -0
- hydpy/models/sw1d_channel.py +2051 -0
- hydpy/models/sw1d_gate_out.py +599 -0
- hydpy/models/sw1d_lias.py +105 -0
- hydpy/models/sw1d_lias_sluice.py +531 -0
- hydpy/models/sw1d_network.py +1219 -0
- hydpy/models/sw1d_pump.py +448 -0
- hydpy/models/sw1d_q_in.py +79 -0
- hydpy/models/sw1d_q_out.py +81 -0
- hydpy/models/sw1d_storage.py +78 -0
- hydpy/models/sw1d_weir_out.py +75 -0
- hydpy/models/test/__init__.py +14 -0
- hydpy/models/test/test_control.py +28 -0
- hydpy/models/test/test_fluxes.py +17 -0
- hydpy/models/test/test_model.py +201 -0
- hydpy/models/test/test_solver.py +48 -0
- hydpy/models/test/test_states.py +17 -0
- hydpy/models/test_discontinous.py +46 -0
- hydpy/models/test_stiff0d.py +47 -0
- hydpy/models/test_stiff1d.py +42 -0
- hydpy/models/whmod/__init__.py +21 -0
- hydpy/models/whmod/whmod_constants.py +77 -0
- hydpy/models/whmod/whmod_control.py +333 -0
- hydpy/models/whmod/whmod_derived.py +210 -0
- hydpy/models/whmod/whmod_factors.py +9 -0
- hydpy/models/whmod/whmod_fluxes.py +105 -0
- hydpy/models/whmod/whmod_inputs.py +15 -0
- hydpy/models/whmod/whmod_masks.py +178 -0
- hydpy/models/whmod/whmod_model.py +2091 -0
- hydpy/models/whmod/whmod_parameters.py +155 -0
- hydpy/models/whmod/whmod_sequences.py +193 -0
- hydpy/models/whmod/whmod_states.py +73 -0
- hydpy/models/whmod_rural.py +794 -0
- hydpy/models/whmod_urban.py +1011 -0
- hydpy/models/wland/__init__.py +43 -0
- hydpy/models/wland/wland_aides.py +55 -0
- hydpy/models/wland/wland_constants.py +103 -0
- hydpy/models/wland/wland_control.py +508 -0
- hydpy/models/wland/wland_derived.py +330 -0
- hydpy/models/wland/wland_factors.py +11 -0
- hydpy/models/wland/wland_fixed.py +12 -0
- hydpy/models/wland/wland_fluxes.py +166 -0
- hydpy/models/wland/wland_inputs.py +33 -0
- hydpy/models/wland/wland_masks.py +54 -0
- hydpy/models/wland/wland_model.py +3755 -0
- hydpy/models/wland/wland_outlets.py +11 -0
- hydpy/models/wland/wland_parameters.py +214 -0
- hydpy/models/wland/wland_sequences.py +108 -0
- hydpy/models/wland/wland_solver.py +45 -0
- hydpy/models/wland/wland_states.py +56 -0
- hydpy/models/wland_gd.py +888 -0
- hydpy/models/wland_wag.py +1244 -0
- hydpy/models/wq/__init__.py +14 -0
- hydpy/models/wq/wq_control.py +117 -0
- hydpy/models/wq/wq_derived.py +182 -0
- hydpy/models/wq/wq_factors.py +79 -0
- hydpy/models/wq/wq_fluxes.py +17 -0
- hydpy/models/wq/wq_model.py +1889 -0
- hydpy/models/wq_trapeze.py +168 -0
- hydpy/models/wq_trapeze_strickler.py +101 -0
- hydpy/models/wq_walrus.py +57 -0
- hydpy/py.typed +0 -0
- hydpy/tests/.coveragerc +22 -0
- hydpy/tests/__init__.py +0 -0
- hydpy/tests/check_consistency.py +32 -0
- hydpy/tests/hydpydoctestcustomize.pth +1 -0
- hydpy/tests/hydpydoctestcustomize.py +15 -0
- hydpy/tests/iotesting/__init__.py +0 -0
- hydpy/tests/run_doctests.py +233 -0
- hydpy-6.2.dev1.data/scripts/hyd.py +277 -0
- hydpy-6.2.dev1.dist-info/LICENSE +165 -0
- hydpy-6.2.dev1.dist-info/METADATA +163 -0
- hydpy-6.2.dev1.dist-info/RECORD +890 -0
- hydpy-6.2.dev1.dist-info/WHEEL +5 -0
- hydpy-6.2.dev1.dist-info/licenses_hydpy_installer.txt +42 -0
- hydpy-6.2.dev1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,3026 @@
|
|
|
1
|
+
# pylint: disable=missing-module-docstring
|
|
2
|
+
|
|
3
|
+
# import...
|
|
4
|
+
# ...from site-packages
|
|
5
|
+
import numpy
|
|
6
|
+
|
|
7
|
+
# ...from HydPy
|
|
8
|
+
from hydpy.auxs import roottools
|
|
9
|
+
from hydpy.core import exceptiontools
|
|
10
|
+
from hydpy.core import modeltools
|
|
11
|
+
from hydpy.core import objecttools
|
|
12
|
+
from hydpy.core.typingtools import *
|
|
13
|
+
from hydpy.cythons import smoothutils
|
|
14
|
+
from hydpy.models.kinw import kinw_control
|
|
15
|
+
from hydpy.models.kinw import kinw_derived
|
|
16
|
+
from hydpy.models.kinw import kinw_fixed
|
|
17
|
+
from hydpy.models.kinw import kinw_solver
|
|
18
|
+
from hydpy.models.kinw import kinw_fluxes
|
|
19
|
+
from hydpy.models.kinw import kinw_states
|
|
20
|
+
from hydpy.models.kinw import kinw_aides
|
|
21
|
+
from hydpy.models.kinw import kinw_inlets
|
|
22
|
+
from hydpy.models.kinw import kinw_outlets
|
|
23
|
+
|
|
24
|
+
if TYPE_CHECKING:
|
|
25
|
+
from matplotlib import pyplot
|
|
26
|
+
else:
|
|
27
|
+
pyplot = exceptiontools.OptionalImport("pyplot", ["matplotlib.pyplot"], locals())
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class Pick_Q_V1(modeltools.Method):
|
|
31
|
+
"""Query the current inflow from all inlet nodes.
|
|
32
|
+
|
|
33
|
+
Basic equation:
|
|
34
|
+
:math:`QZ = \\sum Q`
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
REQUIREDSEQUENCES = (kinw_inlets.Q,)
|
|
38
|
+
RESULTSEQUENCES = (kinw_fluxes.QZ,)
|
|
39
|
+
|
|
40
|
+
@staticmethod
|
|
41
|
+
def __call__(model: modeltools.Model) -> None:
|
|
42
|
+
flu = model.sequences.fluxes.fastaccess
|
|
43
|
+
inl = model.sequences.inlets.fastaccess
|
|
44
|
+
flu.qz = 0.0
|
|
45
|
+
for idx in range(inl.len_q):
|
|
46
|
+
flu.qz += inl.q[idx][0]
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class Calc_QZA_V1(modeltools.Method):
|
|
50
|
+
"""Calculate the current inflow into the channel.
|
|
51
|
+
|
|
52
|
+
Basic equation:
|
|
53
|
+
:math:`QZA = QZ`
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
REQUIREDSEQUENCES = (kinw_fluxes.QZ,)
|
|
57
|
+
RESULTSEQUENCES = (kinw_fluxes.QZA,)
|
|
58
|
+
|
|
59
|
+
@staticmethod
|
|
60
|
+
def __call__(model: modeltools.Model) -> None:
|
|
61
|
+
flu = model.sequences.fluxes.fastaccess
|
|
62
|
+
flu.qza = flu.qz
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class Calc_RHM_V1(modeltools.Method):
|
|
66
|
+
"""Regularise the stage with respect to the channel bottom.
|
|
67
|
+
|
|
68
|
+
Used auxiliary method:
|
|
69
|
+
|smooth_logistic2|
|
|
70
|
+
|
|
71
|
+
Basic equation:
|
|
72
|
+
:math:`RHM = smooth_{logistic2}(H, HRP)`
|
|
73
|
+
|
|
74
|
+
Examples:
|
|
75
|
+
|
|
76
|
+
>>> from hydpy.models.kinw import *
|
|
77
|
+
>>> parameterstep()
|
|
78
|
+
>>> gts(5)
|
|
79
|
+
>>> states.h = -1.0, -0.1, 0.0, 0.1, 1.0
|
|
80
|
+
|
|
81
|
+
>>> hr(0.0)
|
|
82
|
+
>>> derived.hrp.update()
|
|
83
|
+
>>> model.calc_rhm_v1()
|
|
84
|
+
>>> aides.rhm
|
|
85
|
+
rhm(0.0, 0.0, 0.0, 0.1, 1.0)
|
|
86
|
+
|
|
87
|
+
>>> hr(0.1)
|
|
88
|
+
>>> derived.hrp.update()
|
|
89
|
+
>>> model.calc_rhm_v1()
|
|
90
|
+
>>> aides.rhm
|
|
91
|
+
rhm(0.0, 0.01, 0.040983, 0.11, 1.0)
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
95
|
+
DERIVEDPARAMETERS = (kinw_derived.HRP,)
|
|
96
|
+
REQUIREDSEQUENCES = (kinw_states.H,)
|
|
97
|
+
RESULTSEQUENCES = (kinw_aides.RHM,)
|
|
98
|
+
|
|
99
|
+
@staticmethod
|
|
100
|
+
def __call__(model: modeltools.Model) -> None:
|
|
101
|
+
con = model.parameters.control.fastaccess
|
|
102
|
+
der = model.parameters.derived.fastaccess
|
|
103
|
+
sta = model.sequences.states.fastaccess
|
|
104
|
+
aid = model.sequences.aides.fastaccess
|
|
105
|
+
for i in range(con.gts):
|
|
106
|
+
aid.rhm[i] = smoothutils.smooth_logistic2(sta.h[i], der.hrp)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class Calc_RHMDH_V1(modeltools.Method):
|
|
110
|
+
"""Calculate the derivative of the stage regularised with respect
|
|
111
|
+
to the channel bottom.
|
|
112
|
+
|
|
113
|
+
Used auxiliary method:
|
|
114
|
+
|smooth_logistic2_derivative2|
|
|
115
|
+
|
|
116
|
+
Basic equation:
|
|
117
|
+
:math:`RHMDH = smooth_{logistic2'}(H, HRP)`
|
|
118
|
+
|
|
119
|
+
Examples:
|
|
120
|
+
|
|
121
|
+
We apply the class |NumericalDifferentiator| to validate the
|
|
122
|
+
calculated derivatives:
|
|
123
|
+
|
|
124
|
+
>>> from hydpy.models.kinw import *
|
|
125
|
+
>>> parameterstep()
|
|
126
|
+
>>> gts(5)
|
|
127
|
+
>>> states.h = -1.0, -0.1, 0.0, 0.1, 1.0
|
|
128
|
+
|
|
129
|
+
>>> hr(0.0)
|
|
130
|
+
>>> derived.hrp.update()
|
|
131
|
+
>>> model.calc_rhmdh_v1()
|
|
132
|
+
>>> aides.rhmdh
|
|
133
|
+
rhmdh(0.0, 0.0, 1.0, 1.0, 1.0)
|
|
134
|
+
|
|
135
|
+
>>> from hydpy import NumericalDifferentiator
|
|
136
|
+
>>> numdiff = NumericalDifferentiator(
|
|
137
|
+
... xsequence=states.h,
|
|
138
|
+
... ysequences=[aides.rhm],
|
|
139
|
+
... methods=[model.calc_rhm_v1])
|
|
140
|
+
>>> numdiff()
|
|
141
|
+
d_rhm/d_h: 0.0, 0.0, 1.0, 1.0, 1.0
|
|
142
|
+
|
|
143
|
+
>>> hr(0.1)
|
|
144
|
+
>>> derived.hrp.update()
|
|
145
|
+
>>> model.calc_rhmdh_v1()
|
|
146
|
+
>>> aides.rhmdh
|
|
147
|
+
rhmdh(0.0, 0.155602, 0.5, 0.844398, 1.0)
|
|
148
|
+
|
|
149
|
+
>>> numdiff()
|
|
150
|
+
d_rhm/d_h: 0.0, 0.155602, 0.5, 0.844398, 1.0
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
154
|
+
DERIVEDPARAMETERS = (kinw_derived.HRP,)
|
|
155
|
+
REQUIREDSEQUENCES = (kinw_states.H,)
|
|
156
|
+
RESULTSEQUENCES = (kinw_aides.RHMDH,)
|
|
157
|
+
|
|
158
|
+
@staticmethod
|
|
159
|
+
def __call__(model: modeltools.Model) -> None:
|
|
160
|
+
con = model.parameters.control.fastaccess
|
|
161
|
+
der = model.parameters.derived.fastaccess
|
|
162
|
+
sta = model.sequences.states.fastaccess
|
|
163
|
+
aid = model.sequences.aides.fastaccess
|
|
164
|
+
for i in range(con.gts):
|
|
165
|
+
aid.rhmdh[i] = smoothutils.smooth_logistic2_derivative2(sta.h[i], der.hrp)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class Calc_RHV_V1(modeltools.Method):
|
|
169
|
+
"""Regularise the stage with respect to the transition from the
|
|
170
|
+
main channel to both forelands.
|
|
171
|
+
|
|
172
|
+
Used auxiliary method:
|
|
173
|
+
|smooth_logistic2|
|
|
174
|
+
|
|
175
|
+
Basic equation:
|
|
176
|
+
:math:`RHV = smooth_{logistic2}(H-HM, HRP)`
|
|
177
|
+
|
|
178
|
+
Examples:
|
|
179
|
+
|
|
180
|
+
>>> from hydpy.models.kinw import *
|
|
181
|
+
>>> parameterstep()
|
|
182
|
+
>>> gts(5)
|
|
183
|
+
>>> hm(1.0)
|
|
184
|
+
>>> hr(0.1)
|
|
185
|
+
>>> derived.hrp.update()
|
|
186
|
+
>>> states.h = 0.0, 0.9, 1.0, 1.1, 2.0
|
|
187
|
+
>>> model.calc_rhv_v1()
|
|
188
|
+
>>> aides.rhv
|
|
189
|
+
rhv(0.0, 0.01, 0.040983, 0.11, 1.0)
|
|
190
|
+
"""
|
|
191
|
+
|
|
192
|
+
CONTROLPARAMETERS = (kinw_control.GTS, kinw_control.HM)
|
|
193
|
+
DERIVEDPARAMETERS = (kinw_derived.HRP,)
|
|
194
|
+
REQUIREDSEQUENCES = (kinw_states.H,)
|
|
195
|
+
RESULTSEQUENCES = (kinw_aides.RHV,)
|
|
196
|
+
|
|
197
|
+
@staticmethod
|
|
198
|
+
def __call__(model: modeltools.Model) -> None:
|
|
199
|
+
con = model.parameters.control.fastaccess
|
|
200
|
+
der = model.parameters.derived.fastaccess
|
|
201
|
+
sta = model.sequences.states.fastaccess
|
|
202
|
+
aid = model.sequences.aides.fastaccess
|
|
203
|
+
for i in range(con.gts):
|
|
204
|
+
aid.rhv[i] = smoothutils.smooth_logistic2(sta.h[i] - con.hm, der.hrp)
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
class Calc_RHVDH_V1(modeltools.Method):
|
|
208
|
+
"""Calculate the derivative of the stage regularised with respect
|
|
209
|
+
to the transition from the main channel to both forelands.
|
|
210
|
+
|
|
211
|
+
Used auxiliary method:
|
|
212
|
+
|smooth_logistic2_derivative2|
|
|
213
|
+
|
|
214
|
+
Basic equation:
|
|
215
|
+
:math:`RHVDH = smooth_{logistic2'}(H-HM, HRP)`
|
|
216
|
+
|
|
217
|
+
Examples:
|
|
218
|
+
|
|
219
|
+
We apply the class |NumericalDifferentiator| to validate the
|
|
220
|
+
calculated derivatives:
|
|
221
|
+
|
|
222
|
+
>>> from hydpy.models.kinw import *
|
|
223
|
+
>>> parameterstep()
|
|
224
|
+
>>> gts(5)
|
|
225
|
+
>>> hm(1.0)
|
|
226
|
+
>>> states.h = 0.0, 0.9, 1.0, 1.1, 2.0
|
|
227
|
+
|
|
228
|
+
>>> hr(0.0)
|
|
229
|
+
>>> derived.hrp.update()
|
|
230
|
+
>>> model.calc_rhvdh_v1()
|
|
231
|
+
>>> aides.rhvdh
|
|
232
|
+
rhvdh(0.0, 0.0, 1.0, 1.0, 1.0)
|
|
233
|
+
|
|
234
|
+
>>> from hydpy import NumericalDifferentiator
|
|
235
|
+
>>> numdiff = NumericalDifferentiator(
|
|
236
|
+
... xsequence=states.h,
|
|
237
|
+
... ysequences=[aides.rhv],
|
|
238
|
+
... methods=[model.calc_rhv_v1])
|
|
239
|
+
>>> numdiff()
|
|
240
|
+
d_rhv/d_h: 0.0, 0.0, 1.0, 1.0, 1.0
|
|
241
|
+
|
|
242
|
+
>>> hr(0.1)
|
|
243
|
+
>>> derived.hrp.update()
|
|
244
|
+
>>> model.calc_rhvdh_v1()
|
|
245
|
+
>>> aides.rhvdh
|
|
246
|
+
rhvdh(0.0, 0.155602, 0.5, 0.844398, 1.0)
|
|
247
|
+
|
|
248
|
+
>>> numdiff()
|
|
249
|
+
d_rhv/d_h: 0.0, 0.155602, 0.5, 0.844398, 1.0
|
|
250
|
+
"""
|
|
251
|
+
|
|
252
|
+
CONTROLPARAMETERS = (kinw_control.GTS, kinw_control.HM)
|
|
253
|
+
DERIVEDPARAMETERS = (kinw_derived.HRP,)
|
|
254
|
+
REQUIREDSEQUENCES = (kinw_states.H,)
|
|
255
|
+
RESULTSEQUENCES = (kinw_aides.RHVDH,)
|
|
256
|
+
|
|
257
|
+
@staticmethod
|
|
258
|
+
def __call__(model: modeltools.Model) -> None:
|
|
259
|
+
con = model.parameters.control.fastaccess
|
|
260
|
+
der = model.parameters.derived.fastaccess
|
|
261
|
+
sta = model.sequences.states.fastaccess
|
|
262
|
+
aid = model.sequences.aides.fastaccess
|
|
263
|
+
for i in range(con.gts):
|
|
264
|
+
aid.rhvdh[i] = smoothutils.smooth_logistic2_derivative2(
|
|
265
|
+
sta.h[i] - con.hm, der.hrp
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
class Calc_RHLVR_RHRVR_V1(modeltools.Method):
|
|
270
|
+
"""Regularise the stage with respect to the transitions from the
|
|
271
|
+
forelands to the outer embankments.
|
|
272
|
+
|
|
273
|
+
Used auxiliary method:
|
|
274
|
+
|smooth_logistic2|
|
|
275
|
+
|
|
276
|
+
Basic equation:
|
|
277
|
+
:math:`RHVR = smooth_{logistic2}(H-HM-HV, HRP)`
|
|
278
|
+
|
|
279
|
+
Examples:
|
|
280
|
+
|
|
281
|
+
>>> from hydpy.models.kinw import *
|
|
282
|
+
>>> parameterstep()
|
|
283
|
+
>>> gts(6)
|
|
284
|
+
>>> hm(1.0)
|
|
285
|
+
>>> hr(0.1)
|
|
286
|
+
>>> derived.hv(left=1.0, right=1.1)
|
|
287
|
+
>>> derived.hrp.update()
|
|
288
|
+
>>> states.h = 1.0, 1.9, 2.0, 2.1, 2.2, 3.0
|
|
289
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
290
|
+
>>> aides.rhlvr
|
|
291
|
+
rhlvr(0.0, 0.01, 0.040983, 0.11, 0.201974, 1.0)
|
|
292
|
+
>>> aides.rhrvr
|
|
293
|
+
rhrvr(0.0, 0.001974, 0.01, 0.040983, 0.11, 0.9)
|
|
294
|
+
"""
|
|
295
|
+
|
|
296
|
+
CONTROLPARAMETERS = (kinw_control.GTS, kinw_control.HM)
|
|
297
|
+
DERIVEDPARAMETERS = (kinw_derived.HV, kinw_derived.HRP)
|
|
298
|
+
REQUIREDSEQUENCES = (kinw_states.H,)
|
|
299
|
+
RESULTSEQUENCES = (kinw_aides.RHLVR, kinw_aides.RHRVR)
|
|
300
|
+
|
|
301
|
+
@staticmethod
|
|
302
|
+
def __call__(model: modeltools.Model) -> None:
|
|
303
|
+
con = model.parameters.control.fastaccess
|
|
304
|
+
der = model.parameters.derived.fastaccess
|
|
305
|
+
sta = model.sequences.states.fastaccess
|
|
306
|
+
aid = model.sequences.aides.fastaccess
|
|
307
|
+
for i in range(con.gts):
|
|
308
|
+
aid.rhlvr[i] = smoothutils.smooth_logistic2(
|
|
309
|
+
sta.h[i] - con.hm - der.hv[0], der.hrp
|
|
310
|
+
)
|
|
311
|
+
aid.rhrvr[i] = smoothutils.smooth_logistic2(
|
|
312
|
+
sta.h[i] - con.hm - der.hv[1], der.hrp
|
|
313
|
+
)
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
class Calc_RHLVRDH_RHRVRDH_V1(modeltools.Method):
|
|
317
|
+
"""Calculate the derivative of the stage regularised with respect
|
|
318
|
+
to the transition from the forelands to the outer embankments.
|
|
319
|
+
|
|
320
|
+
Used auxiliary method:
|
|
321
|
+
|smooth_logistic2_derivative2|
|
|
322
|
+
|
|
323
|
+
Basic equation:
|
|
324
|
+
:math:`RHVDH = smooth_{logistic2'}(H-HM-HV, HRP)`
|
|
325
|
+
|
|
326
|
+
Examples:
|
|
327
|
+
|
|
328
|
+
We apply the class |NumericalDifferentiator| to validate the
|
|
329
|
+
calculated derivatives:
|
|
330
|
+
|
|
331
|
+
>>> from hydpy.models.kinw import *
|
|
332
|
+
>>> parameterstep()
|
|
333
|
+
>>> gts(8)
|
|
334
|
+
>>> hm(1.0)
|
|
335
|
+
>>> derived.hv(left=1.0, right=2.0)
|
|
336
|
+
>>> states.h = 1.0, 1.9, 2.0, 2.1, 2.9, 3.0, 3.1, 4.0
|
|
337
|
+
|
|
338
|
+
>>> hr(0.0)
|
|
339
|
+
>>> derived.hrp.update()
|
|
340
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
341
|
+
>>> aides.rhlvrdh
|
|
342
|
+
rhlvrdh(0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
|
|
343
|
+
>>> aides.rhrvrdh
|
|
344
|
+
rhrvrdh(0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0)
|
|
345
|
+
|
|
346
|
+
>>> from hydpy import NumericalDifferentiator
|
|
347
|
+
>>> numdiff = NumericalDifferentiator(
|
|
348
|
+
... xsequence=states.h,
|
|
349
|
+
... ysequences=[aides.rhlvr, aides.rhrvr],
|
|
350
|
+
... methods=[model.calc_rhlvr_rhrvr_v1])
|
|
351
|
+
>>> numdiff()
|
|
352
|
+
d_rhlvr/d_h: 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0
|
|
353
|
+
d_rhrvr/d_h: 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0
|
|
354
|
+
|
|
355
|
+
>>> hr(0.1)
|
|
356
|
+
>>> derived.hrp.update()
|
|
357
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
358
|
+
>>> aides.rhlvrdh
|
|
359
|
+
rhlvrdh(0.0, 0.155602, 0.5, 0.844398, 1.0, 1.0, 1.0, 1.0)
|
|
360
|
+
>>> aides.rhrvrdh
|
|
361
|
+
rhrvrdh(0.0, 0.0, 0.0, 0.0, 0.155602, 0.5, 0.844398, 1.0)
|
|
362
|
+
|
|
363
|
+
>>> numdiff()
|
|
364
|
+
d_rhlvr/d_h: 0.0, 0.155602, 0.5, 0.844398, 1.0, 1.0, 1.0, 1.0
|
|
365
|
+
d_rhrvr/d_h: 0.0, 0.0, 0.0, 0.0, 0.155602, 0.5, 0.844398, 1.0
|
|
366
|
+
"""
|
|
367
|
+
|
|
368
|
+
CONTROLPARAMETERS = (kinw_control.GTS, kinw_control.HM)
|
|
369
|
+
DERIVEDPARAMETERS = (kinw_derived.HRP, kinw_derived.HV)
|
|
370
|
+
REQUIREDSEQUENCES = (kinw_states.H,)
|
|
371
|
+
RESULTSEQUENCES = (kinw_aides.RHLVRDH, kinw_aides.RHRVRDH)
|
|
372
|
+
|
|
373
|
+
@staticmethod
|
|
374
|
+
def __call__(model: modeltools.Model) -> None:
|
|
375
|
+
con = model.parameters.control.fastaccess
|
|
376
|
+
der = model.parameters.derived.fastaccess
|
|
377
|
+
sta = model.sequences.states.fastaccess
|
|
378
|
+
aid = model.sequences.aides.fastaccess
|
|
379
|
+
for i in range(con.gts):
|
|
380
|
+
aid.rhlvrdh[i] = smoothutils.smooth_logistic2_derivative2(
|
|
381
|
+
sta.h[i] - con.hm - der.hv[0], der.hrp
|
|
382
|
+
)
|
|
383
|
+
aid.rhrvrdh[i] = smoothutils.smooth_logistic2_derivative2(
|
|
384
|
+
sta.h[i] - con.hm - der.hv[1], der.hrp
|
|
385
|
+
)
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
class Calc_AM_UM_V1(modeltools.Method):
|
|
389
|
+
"""Calculate the wetted area and the wetted perimeter of the main channel.
|
|
390
|
+
|
|
391
|
+
The main channel is assumed to have identical slopes on both sides. Water flowing
|
|
392
|
+
exactly above the main channel contributes to |AM|. Both theoretical surfaces
|
|
393
|
+
separating the water above the main channel from the water above the forelands
|
|
394
|
+
contribute to |UM|.
|
|
395
|
+
|
|
396
|
+
Examples:
|
|
397
|
+
|
|
398
|
+
Generally, a trapezoid with reflection symmetry is assumed. Here, we set its
|
|
399
|
+
smaller base (bottom) to a length of 2 meters, its legs to an inclination of
|
|
400
|
+
1 meter per 4 meters, and its height (depths) to 1 meter:
|
|
401
|
+
|
|
402
|
+
>>> from hydpy.models.kinw import *
|
|
403
|
+
>>> parameterstep()
|
|
404
|
+
>>> gts(8)
|
|
405
|
+
>>> bm(2.0)
|
|
406
|
+
>>> bnm(4.0)
|
|
407
|
+
>>> derived.bnmf.update()
|
|
408
|
+
|
|
409
|
+
First, we show that all calculations agree with the unmodified triple trapezoid
|
|
410
|
+
profile results when setting the smoothing parameter |HRP| to zero:
|
|
411
|
+
|
|
412
|
+
>>> derived.hrp(0)
|
|
413
|
+
|
|
414
|
+
This example deals with normal flow conditions, where water flows within the
|
|
415
|
+
main channel completely (|H| < |HM|, the first five channel sections), and
|
|
416
|
+
with high flow conditions, where water flows over the foreland also
|
|
417
|
+
(|H| > |HM|, the three last channel sections):
|
|
418
|
+
|
|
419
|
+
>>> hm(1.0)
|
|
420
|
+
>>> states.h = 0.0, 0.1, 0.5, 0.9, 1.0, 1.1, 1.5, 2.0
|
|
421
|
+
>>> model.calc_rhm_v1()
|
|
422
|
+
>>> model.calc_rhv_v1()
|
|
423
|
+
>>> model.calc_am_um_v1()
|
|
424
|
+
>>> aides.am
|
|
425
|
+
am(0.0, 0.24, 2.0, 5.04, 6.0, 7.0, 11.0, 16.0)
|
|
426
|
+
>>> aides.um
|
|
427
|
+
um(2.0, 2.824621, 6.123106, 9.42159, 10.246211, 10.446211, 11.246211,
|
|
428
|
+
12.246211)
|
|
429
|
+
|
|
430
|
+
The next example checks the special case of a channel with zero height:
|
|
431
|
+
|
|
432
|
+
>>> hm(0.0)
|
|
433
|
+
>>> model.calc_rhm_v1()
|
|
434
|
+
>>> model.calc_rhv_v1()
|
|
435
|
+
>>> model.calc_am_um_v1()
|
|
436
|
+
>>> aides.am
|
|
437
|
+
am(0.0, 0.2, 1.0, 1.8, 2.0, 2.2, 3.0, 4.0)
|
|
438
|
+
>>> aides.um
|
|
439
|
+
um(2.0, 2.2, 3.0, 3.8, 4.0, 4.2, 5.0, 6.0)
|
|
440
|
+
|
|
441
|
+
Second, we repeat both examples with a reasonable smoothing parameterisation.
|
|
442
|
+
The primary deviations occur around the original discontinuities related to
|
|
443
|
+
the channel bottom and the main channel's transition to both forelands:
|
|
444
|
+
|
|
445
|
+
>>> hr(0.1)
|
|
446
|
+
>>> derived.hrp.update()
|
|
447
|
+
|
|
448
|
+
>>> hm(1.0)
|
|
449
|
+
>>> states.h = 0.0, 0.1, 0.5, 0.9, 1.0, 1.1, 1.5, 2.0
|
|
450
|
+
>>> model.calc_rhm_v1()
|
|
451
|
+
>>> model.calc_rhv_v1()
|
|
452
|
+
>>> model.calc_am_um_v1()
|
|
453
|
+
>>> aides.am
|
|
454
|
+
am(0.088684, 0.2684, 2.000075, 5.0396, 5.993282, 6.9916, 10.99995, 16.0)
|
|
455
|
+
>>> aides.um
|
|
456
|
+
um(2.337952, 2.907083, 6.123131, 9.359128, 9.990225, 10.383749,
|
|
457
|
+
11.246133, 12.246211)
|
|
458
|
+
|
|
459
|
+
>>> hm(0.0)
|
|
460
|
+
>>> model.calc_rhm_v1()
|
|
461
|
+
>>> model.calc_rhv_v1()
|
|
462
|
+
>>> model.calc_am_um_v1()
|
|
463
|
+
>>> aides.am
|
|
464
|
+
am(0.081965, 0.22, 1.000025, 1.8, 2.0, 2.2, 3.0, 4.0)
|
|
465
|
+
>>> aides.um
|
|
466
|
+
um(2.081965, 2.22, 3.000025, 3.8, 4.0, 4.2, 5.0, 6.0)
|
|
467
|
+
"""
|
|
468
|
+
|
|
469
|
+
CONTROLPARAMETERS = (kinw_control.GTS, kinw_control.BM, kinw_control.BNM)
|
|
470
|
+
DERIVEDPARAMETERS = (kinw_derived.BNMF,)
|
|
471
|
+
REQUIREDSEQUENCES = (kinw_aides.RHM, kinw_aides.RHV)
|
|
472
|
+
RESULTSEQUENCES = (kinw_aides.AM, kinw_aides.UM)
|
|
473
|
+
|
|
474
|
+
@staticmethod
|
|
475
|
+
def __call__(model: modeltools.Model) -> None:
|
|
476
|
+
con = model.parameters.control.fastaccess
|
|
477
|
+
der = model.parameters.derived.fastaccess
|
|
478
|
+
aid = model.sequences.aides.fastaccess
|
|
479
|
+
for i in range(con.gts):
|
|
480
|
+
d_temp = aid.rhm[i] - aid.rhv[i]
|
|
481
|
+
aid.am[i] = d_temp * (con.bm + d_temp * con.bnm) + aid.rhv[i] * (
|
|
482
|
+
con.bm + 2.0 * d_temp * con.bnm
|
|
483
|
+
)
|
|
484
|
+
aid.um[i] = con.bm + 2.0 * d_temp * der.bnmf + 2.0 * aid.rhv[i]
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
class Calc_AMDH_UMDH_V1(modeltools.Method):
|
|
488
|
+
"""Calculate the derivatives of the wetted area and perimeter of
|
|
489
|
+
the main channel.
|
|
490
|
+
|
|
491
|
+
Examples:
|
|
492
|
+
|
|
493
|
+
In the following, we repeat the examples of the documentation on method
|
|
494
|
+
|Calc_AM_UM_V1| and check the derivatives' correctness by comparing the
|
|
495
|
+
results of class |NumericalDifferentiator|:
|
|
496
|
+
|
|
497
|
+
>>> from hydpy.models.kinw import *
|
|
498
|
+
>>> parameterstep()
|
|
499
|
+
>>> gts(8)
|
|
500
|
+
>>> bm(2.0)
|
|
501
|
+
>>> bnm(4.0)
|
|
502
|
+
|
|
503
|
+
>>> derived.bnmf.update()
|
|
504
|
+
>>> derived.hrp(0)
|
|
505
|
+
|
|
506
|
+
>>> hm(1.0)
|
|
507
|
+
>>> states.h = 0.0, 0.1, 0.5, 0.9, 1.0, 1.1, 1.5, 2.0
|
|
508
|
+
>>> model.calc_rhm_v1()
|
|
509
|
+
>>> model.calc_rhmdh_v1()
|
|
510
|
+
>>> model.calc_rhv_v1()
|
|
511
|
+
>>> model.calc_rhvdh_v1()
|
|
512
|
+
>>> model.calc_amdh_umdh_v1()
|
|
513
|
+
>>> aides.amdh
|
|
514
|
+
amdh(2.0, 2.8, 6.0, 9.2, 10.0, 10.0, 10.0, 10.0)
|
|
515
|
+
>>> aides.umdh
|
|
516
|
+
umdh(8.246211, 8.246211, 8.246211, 8.246211, 2.0, 2.0, 2.0, 2.0)
|
|
517
|
+
|
|
518
|
+
>>> from hydpy import NumericalDifferentiator
|
|
519
|
+
>>> numdiff = NumericalDifferentiator(
|
|
520
|
+
... xsequence=states.h,
|
|
521
|
+
... ysequences=[aides.am, aides.um],
|
|
522
|
+
... methods=[model.calc_rhm_v1,
|
|
523
|
+
... model.calc_rhv_v1,
|
|
524
|
+
... model.calc_am_um_v1])
|
|
525
|
+
>>> numdiff()
|
|
526
|
+
d_am/d_h: 2.0, 2.8, 6.0, 9.2, 10.0, 10.0, 10.0, 10.0
|
|
527
|
+
d_um/d_h: 8.246211, 8.246211, 8.246211, 8.246211, 2.0, 2.0, 2.0, 2.0
|
|
528
|
+
|
|
529
|
+
>>> hm(0.0)
|
|
530
|
+
>>> model.calc_rhm_v1()
|
|
531
|
+
>>> model.calc_rhmdh_v1()
|
|
532
|
+
>>> model.calc_rhv_v1()
|
|
533
|
+
>>> model.calc_rhvdh_v1()
|
|
534
|
+
>>> model.calc_amdh_umdh_v1()
|
|
535
|
+
>>> aides.amdh
|
|
536
|
+
amdh(2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0)
|
|
537
|
+
>>> aides.umdh
|
|
538
|
+
umdh(2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0)
|
|
539
|
+
>>> numdiff()
|
|
540
|
+
d_am/d_h: 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0
|
|
541
|
+
d_um/d_h: 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0
|
|
542
|
+
|
|
543
|
+
>>> hr(0.1)
|
|
544
|
+
>>> derived.hrp.update()
|
|
545
|
+
|
|
546
|
+
>>> hm(1.0)
|
|
547
|
+
>>> model.calc_rhm_v1()
|
|
548
|
+
>>> model.calc_rhmdh_v1()
|
|
549
|
+
>>> model.calc_rhv_v1()
|
|
550
|
+
>>> model.calc_rhvdh_v1()
|
|
551
|
+
>>> model.calc_amdh_umdh_v1()
|
|
552
|
+
>>> aides.amdh
|
|
553
|
+
amdh(1.163931, 2.431865, 5.998826, 9.18755, 9.836069, 10.05693,
|
|
554
|
+
10.000749, 10.0)
|
|
555
|
+
>>> aides.umdh
|
|
556
|
+
umdh(4.123105, 6.963079, 8.243132, 7.274283, 5.123105, 2.971926,
|
|
557
|
+
2.001327, 2.0)
|
|
558
|
+
|
|
559
|
+
>>> numdiff()
|
|
560
|
+
d_am/d_h: 1.163931, 2.431865, 5.998826, 9.18755, 9.836069, 10.05693, \
|
|
561
|
+
10.000749, 10.0
|
|
562
|
+
d_um/d_h: 4.123105, 6.963079, 8.243132, 7.274283, 5.123105, 2.971926, \
|
|
563
|
+
2.001327, 2.0
|
|
564
|
+
"""
|
|
565
|
+
|
|
566
|
+
CONTROLPARAMETERS = (kinw_control.GTS, kinw_control.BM, kinw_control.BNM)
|
|
567
|
+
DERIVEDPARAMETERS = (kinw_derived.BNMF,)
|
|
568
|
+
REQUIREDSEQUENCES = (
|
|
569
|
+
kinw_aides.RHM,
|
|
570
|
+
kinw_aides.RHMDH,
|
|
571
|
+
kinw_aides.RHV,
|
|
572
|
+
kinw_aides.RHVDH,
|
|
573
|
+
)
|
|
574
|
+
RESULTSEQUENCES = (kinw_aides.AMDH, kinw_aides.UMDH)
|
|
575
|
+
|
|
576
|
+
@staticmethod
|
|
577
|
+
def __call__(model: modeltools.Model) -> None:
|
|
578
|
+
con = model.parameters.control.fastaccess
|
|
579
|
+
der = model.parameters.derived.fastaccess
|
|
580
|
+
aid = model.sequences.aides.fastaccess
|
|
581
|
+
for i in range(con.gts):
|
|
582
|
+
d_temp1 = aid.rhm[i] - aid.rhv[i]
|
|
583
|
+
d_temp2 = aid.rhmdh[i] - aid.rhvdh[i]
|
|
584
|
+
aid.amdh[i] = (
|
|
585
|
+
con.bnm * d_temp1 * d_temp2
|
|
586
|
+
+ 2.0 * con.bnm * d_temp2 * aid.rhv[i]
|
|
587
|
+
+ (con.bm + con.bnm * d_temp1) * d_temp2
|
|
588
|
+
+ (con.bm + 2.0 * con.bnm * d_temp1) * aid.rhvdh[i]
|
|
589
|
+
)
|
|
590
|
+
aid.umdh[i] = 2.0 * d_temp2 * der.bnmf + 2.0 * aid.rhvdh[i]
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
class Calc_ALV_ARV_ULV_URV_V1(modeltools.Method):
|
|
594
|
+
"""Calculate the wetted area and wetted perimeter of both forelands.
|
|
595
|
+
|
|
596
|
+
Each foreland lies between the main channel and one outer embankment. The water
|
|
597
|
+
flowing exactly above a foreland is contributing to |ALV| or |ARV|. The
|
|
598
|
+
theoretical surface separating the water above the main channel from the water
|
|
599
|
+
above the foreland is not contributing to |ULV| or |URV|. On the other hand, the
|
|
600
|
+
surface separating the water above the foreland from the water above its outer
|
|
601
|
+
embankment is contributing to |ULV| and |URV|.
|
|
602
|
+
|
|
603
|
+
Examples:
|
|
604
|
+
|
|
605
|
+
>>> from hydpy.models.kinw import *
|
|
606
|
+
>>> parameterstep()
|
|
607
|
+
>>> gts(14)
|
|
608
|
+
>>> hm(1.0)
|
|
609
|
+
|
|
610
|
+
First, we show that all calculations agree with the unmodified triple trapezoid
|
|
611
|
+
profile results when setting the smoothing parameter |HRP| to zero:
|
|
612
|
+
|
|
613
|
+
>>> derived.hrp(0)
|
|
614
|
+
|
|
615
|
+
This example deals with normal flow conditions, where water flows within the
|
|
616
|
+
main channel completely (|H| < |HM|, the first four channel sections); with
|
|
617
|
+
moderate high flow conditions, where water flows over both forelands, but not
|
|
618
|
+
over their embankments (|HM| < |H| < (|HM| + |HV|), channel sections six to
|
|
619
|
+
eight or twelve for the left and the right foreland, respectively), and with
|
|
620
|
+
extreme high flow conditions, where water flows over both forelands and their
|
|
621
|
+
outer embankments ((|HM| + |HV|) < |H|, the last six or two channel sections
|
|
622
|
+
for the left and the right foreland, respectively):
|
|
623
|
+
|
|
624
|
+
>>> bv(left=2.0, right=3.0)
|
|
625
|
+
>>> bnv(left=4.0, right=5.0)
|
|
626
|
+
>>> derived.bnvf.update()
|
|
627
|
+
>>> derived.hv(left=1.0, right=2.0)
|
|
628
|
+
|
|
629
|
+
>>> states.h = (0.0, 0.5, 0.9, 1.0, 1.1, 1.5, 1.9,
|
|
630
|
+
... 2.0, 2.1, 2.5, 2.9, 3.0, 3.1, 4.0)
|
|
631
|
+
>>> model.calc_rhm_v1()
|
|
632
|
+
>>> model.calc_rhv_v1()
|
|
633
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
634
|
+
>>> model.calc_alv_arv_ulv_urv_v1()
|
|
635
|
+
>>> aides.alv
|
|
636
|
+
alv(0.0, 0.0, 0.0, 0.0, 0.22, 1.5, 3.42, 4.0, 4.6, 7.0, 9.4, 10.0, 10.6,
|
|
637
|
+
16.0)
|
|
638
|
+
>>> aides.arv
|
|
639
|
+
arv(0.0, 0.0, 0.0, 0.0, 0.325, 2.125, 4.725, 5.5, 6.325, 10.125, 14.725,
|
|
640
|
+
16.0, 17.3, 29.0)
|
|
641
|
+
>>> aides.ulv
|
|
642
|
+
ulv(2.0, 2.0, 2.0, 2.0, 2.412311, 4.061553, 5.710795, 6.123106,
|
|
643
|
+
6.223106, 6.623106, 7.023106, 7.123106, 7.223106, 8.123106)
|
|
644
|
+
>>> aides.urv
|
|
645
|
+
urv(3.0, 3.0, 3.0, 3.0, 3.509902, 5.54951, 7.589118, 8.09902, 8.608921,
|
|
646
|
+
10.648529, 12.688137, 13.198039, 13.298039, 14.198039)
|
|
647
|
+
|
|
648
|
+
The next example proves the correct handling of forelands with zero
|
|
649
|
+
widths and heights:
|
|
650
|
+
|
|
651
|
+
>>> bv(left=0.0, right=2.0)
|
|
652
|
+
>>> bnv(4.0)
|
|
653
|
+
>>> derived.hv(left=1.0, right=0.0)
|
|
654
|
+
>>> model.calc_rhv_v1()
|
|
655
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
656
|
+
>>> model.calc_alv_arv_ulv_urv_v1()
|
|
657
|
+
>>> aides.alv
|
|
658
|
+
alv(0.0, 0.0, 0.0, 0.0, 0.02, 0.5, 1.62, 2.0, 2.4, 4.0, 5.6, 6.0, 6.4,
|
|
659
|
+
10.0)
|
|
660
|
+
>>> aides.arv
|
|
661
|
+
arv(0.0, 0.0, 0.0, 0.0, 0.2, 1.0, 1.8, 2.0, 2.2, 3.0, 3.8, 4.0, 4.2, 6.0)
|
|
662
|
+
>>> aides.ulv
|
|
663
|
+
ulv(0.0, 0.0, 0.0, 0.0, 0.412311, 2.061553, 3.710795, 4.123106,
|
|
664
|
+
4.223106, 4.623106, 5.023106, 5.123106, 5.223106, 6.123106)
|
|
665
|
+
>>> aides.urv
|
|
666
|
+
urv(2.0, 2.0, 2.0, 2.0, 2.1, 2.5, 2.9, 3.0, 3.1, 3.5, 3.9, 4.0, 4.1, 5.0)
|
|
667
|
+
|
|
668
|
+
Second, we repeat both examples with a reasonable smoothing parameterisation.
|
|
669
|
+
The primary deviations occur around the original discontinuities related to
|
|
670
|
+
the channel bottom and the main channel's transition to both forelands:
|
|
671
|
+
|
|
672
|
+
>>> hr(0.1)
|
|
673
|
+
>>> derived.hrp.update()
|
|
674
|
+
|
|
675
|
+
>>> bv(left=2.0, right=3.0)
|
|
676
|
+
>>> bnv(left=4.0, right=5.0)
|
|
677
|
+
>>> derived.hv(left=1.0, right=2.0)
|
|
678
|
+
>>> model.calc_rhv_v1()
|
|
679
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
680
|
+
>>> model.calc_alv_arv_ulv_urv_v1()
|
|
681
|
+
>>> aides.alv
|
|
682
|
+
alv(0.0, 0.000025, 0.0202, 0.085324, 0.2442, 1.50005, 3.4198, 3.996641,
|
|
683
|
+
4.5958, 6.999975, 9.4, 10.0, 10.6, 16.0)
|
|
684
|
+
>>> aides.arv
|
|
685
|
+
arv(0.0, 0.000038, 0.03025, 0.127147, 0.36025, 2.125069, 4.725, 5.5,
|
|
686
|
+
6.325, 10.125, 14.72475, 15.995801, 17.29475, 29.0)
|
|
687
|
+
>>> aides.ulv
|
|
688
|
+
ulv(2.0, 2.000052, 2.041231, 2.168976, 2.453542, 4.061565, 5.679564,
|
|
689
|
+
5.995113, 6.191875, 6.623066, 7.023106, 7.123106, 7.223106, 8.123106)
|
|
690
|
+
>>> aides.urv
|
|
691
|
+
urv(3.0, 3.000064, 3.05099, 3.208971, 3.560892, 5.549574, 7.589118,
|
|
692
|
+
8.09902, 8.608921, 10.648478, 12.647147, 13.03005, 13.257049,
|
|
693
|
+
14.198039)
|
|
694
|
+
|
|
695
|
+
>>> bv(left=0.0, right=2.0)
|
|
696
|
+
>>> bnv(4.0)
|
|
697
|
+
>>> derived.hv(left=1.0, right=0.0)
|
|
698
|
+
>>> model.calc_rhm_v1()
|
|
699
|
+
>>> model.calc_rhv_v1()
|
|
700
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
701
|
+
>>> model.calc_alv_arv_ulv_urv_v1()
|
|
702
|
+
>>> aides.alv
|
|
703
|
+
alv(0.0, 0.0, 0.0002, 0.003359, 0.0242, 0.500025, 1.6198, 1.996641,
|
|
704
|
+
2.3958, 3.999975, 5.6, 6.0, 6.4, 10.0)
|
|
705
|
+
>>> aides.arv
|
|
706
|
+
arv(0.0, 0.000025, 0.02, 0.081965, 0.22, 1.000025, 1.8, 2.0, 2.2, 3.0,
|
|
707
|
+
3.8, 4.0, 4.2, 6.0)
|
|
708
|
+
>>> aides.ulv
|
|
709
|
+
ulv(0.0, 0.000052, 0.041231, 0.168976, 0.453542, 2.061565, 3.679564,
|
|
710
|
+
3.995113, 4.191875, 4.623066, 5.023106, 5.123106, 5.223106, \
|
|
711
|
+
6.123106)
|
|
712
|
+
>>> aides.urv
|
|
713
|
+
urv(2.0, 2.000013, 2.01, 2.040983, 2.11, 2.500013, 2.9, 3.0, 3.1, 3.5,
|
|
714
|
+
3.9, 4.0, 4.1, 5.0)
|
|
715
|
+
"""
|
|
716
|
+
|
|
717
|
+
CONTROLPARAMETERS = (kinw_control.GTS, kinw_control.BV, kinw_control.BNV)
|
|
718
|
+
DERIVEDPARAMETERS = (kinw_derived.BNVF,)
|
|
719
|
+
REQUIREDSEQUENCES = (kinw_aides.RHV, kinw_aides.RHLVR, kinw_aides.RHRVR)
|
|
720
|
+
RESULTSEQUENCES = (kinw_aides.ALV, kinw_aides.ARV, kinw_aides.ULV, kinw_aides.URV)
|
|
721
|
+
|
|
722
|
+
@staticmethod
|
|
723
|
+
def __call__(model: modeltools.Model) -> None:
|
|
724
|
+
con = model.parameters.control.fastaccess
|
|
725
|
+
der = model.parameters.derived.fastaccess
|
|
726
|
+
aid = model.sequences.aides.fastaccess
|
|
727
|
+
for i in range(con.gts):
|
|
728
|
+
d_temp = aid.rhv[i] - aid.rhlvr[i]
|
|
729
|
+
aid.alv[i] = d_temp * (con.bv[0] + (d_temp * con.bnv[0] / 2.0)) + aid.rhlvr[
|
|
730
|
+
i
|
|
731
|
+
] * (con.bv[0] + d_temp * con.bnv[0])
|
|
732
|
+
aid.ulv[i] = con.bv[0] + d_temp * der.bnvf[0] + aid.rhlvr[i]
|
|
733
|
+
d_temp = aid.rhv[i] - aid.rhrvr[i]
|
|
734
|
+
aid.arv[i] = d_temp * (con.bv[1] + (d_temp * con.bnv[1] / 2.0)) + aid.rhrvr[
|
|
735
|
+
i
|
|
736
|
+
] * (con.bv[1] + d_temp * con.bnv[1])
|
|
737
|
+
aid.urv[i] = con.bv[1] + d_temp * der.bnvf[1] + aid.rhrvr[i]
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
class Calc_ALVDH_ARVDH_ULVDH_URVDH_V1(modeltools.Method):
|
|
741
|
+
"""Calculate the derivatives of the wetted area and perimeter of
|
|
742
|
+
both forelands.
|
|
743
|
+
|
|
744
|
+
Examples:
|
|
745
|
+
|
|
746
|
+
In the following, we repeat the examples of the documentation on method
|
|
747
|
+
|Calc_ALV_ARV_ULV_URV_V1| and check the derivatives' correctness by comparing
|
|
748
|
+
the results of class |NumericalDifferentiator|:
|
|
749
|
+
|
|
750
|
+
>>> from hydpy.models.kinw import *
|
|
751
|
+
>>> parameterstep()
|
|
752
|
+
>>> gts(13)
|
|
753
|
+
>>> hm(1.0)
|
|
754
|
+
>>> bv(left=2.0, right=3.0)
|
|
755
|
+
>>> bnv(left=4.0, right=5.0)
|
|
756
|
+
>>> derived.bnvf.update()
|
|
757
|
+
>>> derived.hv(left=1.0, right=2.0)
|
|
758
|
+
|
|
759
|
+
>>> derived.hrp(0)
|
|
760
|
+
|
|
761
|
+
>>> states.h = (1.0, 1.5, 1.9, 2.0, 2.1, 2.5, 3.0,
|
|
762
|
+
... 3.5, 3.9, 4.0, 4.1, 4.5, 5.0)
|
|
763
|
+
>>> model.calc_rhv_v1()
|
|
764
|
+
>>> model.calc_rhvdh_v1()
|
|
765
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
766
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
767
|
+
>>> model.calc_alvdh_arvdh_ulvdh_urvdh_v1()
|
|
768
|
+
>>> aides.alvdh
|
|
769
|
+
alvdh(2.0, 4.0, 5.6, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0)
|
|
770
|
+
>>> aides.arvdh
|
|
771
|
+
arvdh(3.0, 5.5, 7.5, 8.0, 8.5, 10.5, 13.0, 13.0, 13.0, 13.0, 13.0, 13.0,
|
|
772
|
+
13.0)
|
|
773
|
+
>>> aides.ulvdh
|
|
774
|
+
ulvdh(4.123106, 4.123106, 4.123106, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
|
|
775
|
+
1.0, 1.0, 1.0)
|
|
776
|
+
>>> aides.urvdh
|
|
777
|
+
urvdh(5.09902, 5.09902, 5.09902, 5.09902, 5.09902, 5.09902, 1.0, 1.0,
|
|
778
|
+
1.0, 1.0, 1.0, 1.0, 1.0)
|
|
779
|
+
|
|
780
|
+
>>> from hydpy import NumericalDifferentiator
|
|
781
|
+
>>> numdiff = NumericalDifferentiator(
|
|
782
|
+
... xsequence=states.h,
|
|
783
|
+
... ysequences=[aides.alv, aides.arv, aides.ulv, aides.urv],
|
|
784
|
+
... methods=[model.calc_rhv_v1,
|
|
785
|
+
... model.calc_rhlvr_rhrvr_v1,
|
|
786
|
+
... model.calc_alv_arv_ulv_urv_v1])
|
|
787
|
+
>>> numdiff()
|
|
788
|
+
d_alv/d_h: 2.0, 4.0, 5.6, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, \
|
|
789
|
+
6.0
|
|
790
|
+
d_arv/d_h: 3.0, 5.5, 7.5, 8.0, 8.5, 10.5, 13.0, 13.0, 13.0, 13.0, \
|
|
791
|
+
13.0, 13.0, 13.0
|
|
792
|
+
d_ulv/d_h: 4.123106, 4.123106, 4.123106, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, \
|
|
793
|
+
1.0, 1.0, 1.0, 1.0
|
|
794
|
+
d_urv/d_h: 5.09902, 5.09902, 5.09902, 5.09902, 5.09902, 5.09902, 1.0, \
|
|
795
|
+
1.0, 1.0, 1.0, 1.0, 1.0, 1.0
|
|
796
|
+
|
|
797
|
+
>>> bv(left=0.0, right=2.0)
|
|
798
|
+
>>> bnv(4.0)
|
|
799
|
+
>>> derived.bnvf.update()
|
|
800
|
+
>>> derived.hv(left=1.0, right=0.0)
|
|
801
|
+
>>> model.calc_rhv_v1()
|
|
802
|
+
>>> model.calc_rhvdh_v1()
|
|
803
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
804
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
805
|
+
>>> model.calc_alvdh_arvdh_ulvdh_urvdh_v1()
|
|
806
|
+
>>> aides.alvdh
|
|
807
|
+
alvdh(0.0, 2.0, 3.6, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0)
|
|
808
|
+
>>> aides.arvdh
|
|
809
|
+
arvdh(2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0)
|
|
810
|
+
>>> aides.ulvdh
|
|
811
|
+
ulvdh(4.123106, 4.123106, 4.123106, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
|
|
812
|
+
1.0, 1.0, 1.0)
|
|
813
|
+
>>> aides.urvdh
|
|
814
|
+
urvdh(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
|
|
815
|
+
>>> numdiff()
|
|
816
|
+
d_alv/d_h: 0.0, 2.0, 3.6, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, \
|
|
817
|
+
4.0
|
|
818
|
+
d_arv/d_h: 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, \
|
|
819
|
+
2.0
|
|
820
|
+
d_ulv/d_h: 4.123106, 4.123106, 4.123106, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, \
|
|
821
|
+
1.0, 1.0, 1.0, 1.0
|
|
822
|
+
d_urv/d_h: 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, \
|
|
823
|
+
1.0
|
|
824
|
+
|
|
825
|
+
>>> hr(0.1)
|
|
826
|
+
>>> derived.hrp.update()
|
|
827
|
+
|
|
828
|
+
>>> bv(left=2.0, right=3.0)
|
|
829
|
+
>>> bnv(left=4.0, right=5.0)
|
|
830
|
+
>>> derived.bnvf.update()
|
|
831
|
+
>>> derived.hv(left=1.0, right=2.0)
|
|
832
|
+
|
|
833
|
+
>>> model.calc_rhv_v1()
|
|
834
|
+
>>> model.calc_rhvdh_v1()
|
|
835
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
836
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
837
|
+
>>> model.calc_alvdh_arvdh_ulvdh_urvdh_v1()
|
|
838
|
+
>>> aides.alvdh
|
|
839
|
+
alvdh(1.081965, 3.9992, 5.593775, 5.918034, 6.028465, 6.000375, 6.0,
|
|
840
|
+
6.0, 6.0, 6.0, 6.0, 6.0, 6.0)
|
|
841
|
+
>>> aides.arvdh
|
|
842
|
+
arvdh(1.602457, 5.498894, 7.499998, 8.0, 8.5, 10.5, 12.897543,
|
|
843
|
+
13.000468, 13.000001, 13.0, 13.0, 13.0, 13.0)
|
|
844
|
+
>>> aides.ulvdh
|
|
845
|
+
ulvdh(2.061553, 4.121566, 3.637142, 2.561553, 1.485963, 1.000664, 1.0,
|
|
846
|
+
1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
|
|
847
|
+
>>> aides.urvdh
|
|
848
|
+
urvdh(2.54951, 5.097936, 5.099018, 5.099019, 5.099018, 5.098149,
|
|
849
|
+
3.04951, 1.000871, 1.000001, 1.0, 1.0, 1.0, 1.0)
|
|
850
|
+
|
|
851
|
+
>>> numdiff()
|
|
852
|
+
d_alv/d_h: 1.081965, 3.9992, 5.593775, 5.918034, 6.028465, 6.000375, \
|
|
853
|
+
6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0
|
|
854
|
+
d_arv/d_h: 1.602457, 5.498894, 7.499998, 8.0, 8.5, 10.5, 12.897543, \
|
|
855
|
+
13.000468, 13.000001, 13.0, 13.0, 13.0, 13.0
|
|
856
|
+
d_ulv/d_h: 2.061553, 4.121566, 3.637142, 2.561553, 1.485963, 1.000664, \
|
|
857
|
+
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0
|
|
858
|
+
d_urv/d_h: 2.54951, 5.097936, 5.099018, 5.099019, 5.099018, 5.098149, \
|
|
859
|
+
3.04951, 1.000871, 1.000001, 1.0, 1.0, 1.0, 1.0
|
|
860
|
+
"""
|
|
861
|
+
|
|
862
|
+
CONTROLPARAMETERS = (kinw_control.GTS, kinw_control.BV, kinw_control.BNV)
|
|
863
|
+
DERIVEDPARAMETERS = (kinw_derived.BNVF,)
|
|
864
|
+
REQUIREDSEQUENCES = (
|
|
865
|
+
kinw_aides.RHV,
|
|
866
|
+
kinw_aides.RHVDH,
|
|
867
|
+
kinw_aides.RHLVR,
|
|
868
|
+
kinw_aides.RHLVRDH,
|
|
869
|
+
kinw_aides.RHRVR,
|
|
870
|
+
kinw_aides.RHRVRDH,
|
|
871
|
+
)
|
|
872
|
+
RESULTSEQUENCES = (
|
|
873
|
+
kinw_aides.ALVDH,
|
|
874
|
+
kinw_aides.ARVDH,
|
|
875
|
+
kinw_aides.ULVDH,
|
|
876
|
+
kinw_aides.URVDH,
|
|
877
|
+
)
|
|
878
|
+
|
|
879
|
+
@staticmethod
|
|
880
|
+
def __call__(model: modeltools.Model) -> None:
|
|
881
|
+
con = model.parameters.control.fastaccess
|
|
882
|
+
der = model.parameters.derived.fastaccess
|
|
883
|
+
aid = model.sequences.aides.fastaccess
|
|
884
|
+
for i in range(con.gts):
|
|
885
|
+
d_temp1 = aid.rhv[i] - aid.rhlvr[i]
|
|
886
|
+
d_temp2 = aid.rhvdh[i] - aid.rhlvrdh[i]
|
|
887
|
+
aid.alvdh[i] = (
|
|
888
|
+
con.bnv[0] * d_temp1 * d_temp2 / 2.0
|
|
889
|
+
+ con.bnv[0] * d_temp2 * aid.rhlvr[i]
|
|
890
|
+
+ (con.bnv[0] * d_temp1 / 2 + con.bv[0]) * d_temp2
|
|
891
|
+
+ (con.bnv[0] * d_temp1 + con.bv[0]) * aid.rhlvrdh[i]
|
|
892
|
+
)
|
|
893
|
+
aid.ulvdh[i] = d_temp2 * der.bnvf[0] + aid.rhlvrdh[i]
|
|
894
|
+
d_temp1 = aid.rhv[i] - aid.rhrvr[i]
|
|
895
|
+
d_temp2 = aid.rhvdh[i] - aid.rhrvrdh[i]
|
|
896
|
+
aid.arvdh[i] = (
|
|
897
|
+
con.bnv[1] * d_temp1 * d_temp2 / 2.0
|
|
898
|
+
+ con.bnv[1] * d_temp2 * aid.rhrvr[i]
|
|
899
|
+
+ (con.bnv[1] * d_temp1 / 2 + con.bv[1]) * d_temp2
|
|
900
|
+
+ (con.bnv[1] * d_temp1 + con.bv[1]) * aid.rhrvrdh[i]
|
|
901
|
+
)
|
|
902
|
+
aid.urvdh[i] = d_temp2 * der.bnvf[1] + aid.rhrvrdh[i]
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
class Calc_ALVR_ARVR_ULVR_URVR_V1(modeltools.Method):
|
|
906
|
+
"""Calculate the wetted area and perimeter of both outer embankments.
|
|
907
|
+
|
|
908
|
+
Each outer embankment lies beyond its foreland. The water flowing exactly above
|
|
909
|
+
an embankment adds to |ALVR| and |ARVR|. The theoretical surface separating water
|
|
910
|
+
above the foreland from the water above its embankment is not contributing to
|
|
911
|
+
|ULVR| and |URVR|.
|
|
912
|
+
|
|
913
|
+
Examples:
|
|
914
|
+
|
|
915
|
+
>>> from hydpy.models.kinw import *
|
|
916
|
+
>>> parameterstep()
|
|
917
|
+
>>> gts(11)
|
|
918
|
+
>>> hm(1.0)
|
|
919
|
+
|
|
920
|
+
First, we show that all calculations agree with the unmodified triple trapezoid
|
|
921
|
+
profile results when the setting the smoothing parameter |HRP| to zero:
|
|
922
|
+
|
|
923
|
+
>>> derived.hrp(0)
|
|
924
|
+
|
|
925
|
+
This example deals with moderate high flow conditions, where
|
|
926
|
+
water flows over the forelands, but not over their outer embankments
|
|
927
|
+
(|HM| < |H| < (|HM| + |HV|), the first four or eight channel sections
|
|
928
|
+
for the left and the right outer embankment, respectively); the second
|
|
929
|
+
example deals with extreme high flow conditions, where water flows
|
|
930
|
+
both over the foreland and their outer embankments ((|HM| + |HV|) < |H|,
|
|
931
|
+
the last seven or three channel sections for the left and the right
|
|
932
|
+
outer embankment, respectively):
|
|
933
|
+
|
|
934
|
+
>>> states.h = 1.0, 1.5, 1.9, 2.0, 2.1, 2.5, 2.9, 3.0, 3.1, 3.5, 4.0
|
|
935
|
+
>>> bnvr(left=4.0, right=5.0)
|
|
936
|
+
>>> derived.bnvrf.update()
|
|
937
|
+
>>> derived.hv(left=1.0, right=2.0)
|
|
938
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
939
|
+
>>> model.calc_alvr_arvr_ulvr_urvr_v1()
|
|
940
|
+
>>> aides.alvr
|
|
941
|
+
alvr(0.0, 0.0, 0.0, 0.0, 0.02, 0.5, 1.62, 2.0, 2.42, 4.5, 8.0)
|
|
942
|
+
>>> aides.arvr
|
|
943
|
+
arvr(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.025, 0.625, 2.5)
|
|
944
|
+
>>> aides.ulvr
|
|
945
|
+
ulvr(0.0, 0.0, 0.0, 0.0, 0.412311, 2.061553, 3.710795, 4.123106,
|
|
946
|
+
4.535416, 6.184658, 8.246211)
|
|
947
|
+
>>> aides.urvr
|
|
948
|
+
urvr(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.509902, 2.54951, 5.09902)
|
|
949
|
+
|
|
950
|
+
The next example checks the special cases of a vertical outer embankment
|
|
951
|
+
(left side) and zero-height foreland (right side):
|
|
952
|
+
|
|
953
|
+
>>> bnvr(left=0.0, right=5.0)
|
|
954
|
+
>>> derived.bnvrf.update()
|
|
955
|
+
>>> derived.hv(left=1.0, right=0.0)
|
|
956
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
957
|
+
>>> model.calc_alvr_arvr_ulvr_urvr_v1()
|
|
958
|
+
>>> aides.alvr
|
|
959
|
+
alvr(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
|
|
960
|
+
>>> aides.arvr
|
|
961
|
+
arvr(0.0, 0.625, 2.025, 2.5, 3.025, 5.625, 9.025, 10.0, 11.025, 15.625,
|
|
962
|
+
22.5)
|
|
963
|
+
>>> aides.ulvr
|
|
964
|
+
ulvr(0.0, 0.0, 0.0, 0.0, 0.1, 0.5, 0.9, 1.0, 1.1, 1.5, 2.0)
|
|
965
|
+
>>> aides.urvr
|
|
966
|
+
urvr(0.0, 2.54951, 4.589118, 5.09902, 5.608921, 7.648529, 9.688137,
|
|
967
|
+
10.198039, 10.707941, 12.747549, 15.297059)
|
|
968
|
+
|
|
969
|
+
Second, we repeat both examples with a reasonable smoothing parameterisation.
|
|
970
|
+
The primary deviations occur around the original discontinuities related to
|
|
971
|
+
the channel bottom and the main channel's transition to both forelands:
|
|
972
|
+
|
|
973
|
+
>>> hr(0.1)
|
|
974
|
+
>>> derived.hrp.update()
|
|
975
|
+
>>> bnvr(left=4.0, right=5.0)
|
|
976
|
+
>>> derived.bnvrf.update()
|
|
977
|
+
>>> derived.hv(left=1.0, right=2.0)
|
|
978
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
979
|
+
>>> model.calc_alvr_arvr_ulvr_urvr_v1()
|
|
980
|
+
>>> aides.alvr
|
|
981
|
+
alvr(0.0, 0.0, 0.0002, 0.003359, 0.0242, 0.500025, 1.62, 2.0, 2.42, 4.5,
|
|
982
|
+
8.0)
|
|
983
|
+
>>> aides.arvr
|
|
984
|
+
arvr(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00025, 0.004199, 0.03025, 0.625031,
|
|
985
|
+
2.5)
|
|
986
|
+
>>> aides.ulvr
|
|
987
|
+
ulvr(0.0, 0.000052, 0.041231, 0.168976, 0.453542, 2.061605, 3.710795,
|
|
988
|
+
4.123106, 4.535416, 6.184658, 8.246211)
|
|
989
|
+
>>> aides.urvr
|
|
990
|
+
urvr(0.0, 0.0, 0.0, 0.0, 0.0, 0.000064, 0.05099, 0.208971, 0.560892,
|
|
991
|
+
2.549574, 5.09902)
|
|
992
|
+
|
|
993
|
+
>>> bnvr(left=0.0, right=5.0)
|
|
994
|
+
>>> derived.bnvrf.update()
|
|
995
|
+
>>> derived.hv(left=1.0, right=0.0)
|
|
996
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
997
|
+
>>> model.calc_alvr_arvr_ulvr_urvr_v1()
|
|
998
|
+
>>> aides.alvr
|
|
999
|
+
alvr(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
|
|
1000
|
+
>>> aides.arvr
|
|
1001
|
+
arvr(0.004199, 0.625031, 2.025, 2.5, 3.025, 5.625, 9.025, 10.0, 11.025,
|
|
1002
|
+
15.625, 22.5)
|
|
1003
|
+
>>> aides.ulvr
|
|
1004
|
+
ulvr(0.0, 0.000013, 0.01, 0.040983, 0.11, 0.500013, 0.9, 1.0, 1.1, 1.5,
|
|
1005
|
+
2.0)
|
|
1006
|
+
>>> aides.urvr
|
|
1007
|
+
urvr(0.208971, 2.549574, 4.589118, 5.09902, 5.608921, 7.648529,
|
|
1008
|
+
9.688137, 10.198039, 10.707941, 12.747549, 15.297059)
|
|
1009
|
+
"""
|
|
1010
|
+
|
|
1011
|
+
CONTROLPARAMETERS = (kinw_control.GTS, kinw_control.BNVR)
|
|
1012
|
+
DERIVEDPARAMETERS = (kinw_derived.BNVRF,)
|
|
1013
|
+
REQUIREDSEQUENCES = (kinw_aides.RHLVR, kinw_aides.RHRVR)
|
|
1014
|
+
RESULTSEQUENCES = (
|
|
1015
|
+
kinw_aides.ALVR,
|
|
1016
|
+
kinw_aides.ARVR,
|
|
1017
|
+
kinw_aides.ULVR,
|
|
1018
|
+
kinw_aides.URVR,
|
|
1019
|
+
)
|
|
1020
|
+
|
|
1021
|
+
@staticmethod
|
|
1022
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1023
|
+
con = model.parameters.control.fastaccess
|
|
1024
|
+
der = model.parameters.derived.fastaccess
|
|
1025
|
+
aid = model.sequences.aides.fastaccess
|
|
1026
|
+
for i in range(con.gts):
|
|
1027
|
+
aid.alvr[i] = aid.rhlvr[i] ** 2 * con.bnvr[0] / 2.0
|
|
1028
|
+
aid.ulvr[i] = aid.rhlvr[i] * der.bnvrf[0]
|
|
1029
|
+
aid.arvr[i] = aid.rhrvr[i] ** 2 * con.bnvr[1] / 2.0
|
|
1030
|
+
aid.urvr[i] = aid.rhrvr[i] * der.bnvrf[1]
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
class Calc_ALVRDH_ARVRDH_ULVRDH_URVRDH_V1(modeltools.Method):
|
|
1034
|
+
"""Calculate the derivatives of the wetted area and perimeter of
|
|
1035
|
+
both outer embankments.
|
|
1036
|
+
|
|
1037
|
+
Examples:
|
|
1038
|
+
|
|
1039
|
+
In the following, we repeat the examples of the documentation on method
|
|
1040
|
+
|Calc_ALVR_ARVR_ULVR_URVR_V1| and check the derivatives' correctness by
|
|
1041
|
+
comparing the results of class |NumericalDifferentiator|:
|
|
1042
|
+
|
|
1043
|
+
>>> from hydpy.models.kinw import *
|
|
1044
|
+
>>> parameterstep()
|
|
1045
|
+
>>> gts(11)
|
|
1046
|
+
>>> hm(1.0)
|
|
1047
|
+
|
|
1048
|
+
>>> derived.hrp(0)
|
|
1049
|
+
|
|
1050
|
+
>>> states.h = 1.0, 1.5, 1.9, 2.0, 2.1, 2.5, 2.9, 3.0, 3.1, 3.5, 4.0
|
|
1051
|
+
>>> bnvr(left=4.0, right=5.0)
|
|
1052
|
+
>>> derived.bnvrf.update()
|
|
1053
|
+
>>> derived.hv(left=1.0, right=2.0)
|
|
1054
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
1055
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
1056
|
+
>>> model.calc_alvrdh_arvrdh_ulvrdh_urvrdh_v1()
|
|
1057
|
+
>>> aides.alvrdh
|
|
1058
|
+
alvrdh(0.0, 0.0, 0.0, 0.0, 0.4, 2.0, 3.6, 4.0, 4.4, 6.0, 8.0)
|
|
1059
|
+
>>> aides.arvrdh
|
|
1060
|
+
arvrdh(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 2.5, 5.0)
|
|
1061
|
+
>>> aides.ulvrdh
|
|
1062
|
+
ulvrdh(0.0, 0.0, 0.0, 4.123106, 4.123106, 4.123106, 4.123106, 4.123106,
|
|
1063
|
+
4.123106, 4.123106, 4.123106)
|
|
1064
|
+
>>> aides.urvrdh
|
|
1065
|
+
urvrdh(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5.09902, 5.09902, 5.09902,
|
|
1066
|
+
5.09902)
|
|
1067
|
+
|
|
1068
|
+
>>> from hydpy import NumericalDifferentiator
|
|
1069
|
+
>>> numdiff = NumericalDifferentiator(
|
|
1070
|
+
... xsequence=states.h,
|
|
1071
|
+
... ysequences=[aides.alvr, aides.arvr, aides.ulvr, aides.urvr],
|
|
1072
|
+
... methods=[model.calc_rhlvr_rhrvr_v1,
|
|
1073
|
+
... model.calc_alvr_arvr_ulvr_urvr_v1])
|
|
1074
|
+
>>> numdiff()
|
|
1075
|
+
d_alvr/d_h: 0.0, 0.0, 0.0, 0.0, 0.4, 2.0, 3.6, 4.0, 4.4, 6.0, 8.0
|
|
1076
|
+
d_arvr/d_h: 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 2.5, 5.0
|
|
1077
|
+
d_ulvr/d_h: 0.0, 0.0, 0.0, 4.123106, 4.123106, 4.123106, 4.123106, \
|
|
1078
|
+
4.123106, 4.123106, 4.123106, 4.123106
|
|
1079
|
+
d_urvr/d_h: 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5.09902, 5.09902, \
|
|
1080
|
+
5.09902, 5.09902
|
|
1081
|
+
|
|
1082
|
+
>>> bnvr(left=0.0, right=5.0)
|
|
1083
|
+
>>> derived.bnvrf.update()
|
|
1084
|
+
>>> derived.hv(left=1.0, right=0.0)
|
|
1085
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
1086
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
1087
|
+
>>> model.calc_alvrdh_arvrdh_ulvrdh_urvrdh_v1()
|
|
1088
|
+
>>> aides.alvrdh
|
|
1089
|
+
alvrdh(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
|
|
1090
|
+
>>> aides.arvrdh
|
|
1091
|
+
arvrdh(0.0, 2.5, 4.5, 5.0, 5.5, 7.5, 9.5, 10.0, 10.5, 12.5, 15.0)
|
|
1092
|
+
>>> aides.ulvrdh
|
|
1093
|
+
ulvrdh(0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
|
|
1094
|
+
>>> aides.urvrdh
|
|
1095
|
+
urvrdh(5.09902, 5.09902, 5.09902, 5.09902, 5.09902, 5.09902, 5.09902,
|
|
1096
|
+
5.09902, 5.09902, 5.09902, 5.09902)
|
|
1097
|
+
|
|
1098
|
+
>>> numdiff()
|
|
1099
|
+
d_alvr/d_h: 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
|
|
1100
|
+
d_arvr/d_h: 0.0, 2.5, 4.5, 5.0, 5.5, 7.5, 9.5, 10.0, 10.5, 12.5, 15.0
|
|
1101
|
+
d_ulvr/d_h: 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0
|
|
1102
|
+
d_urvr/d_h: 5.09902, 5.09902, 5.09902, 5.09902, 5.09902, 5.09902, \
|
|
1103
|
+
5.09902, 5.09902, 5.09902, 5.09902, 5.09902
|
|
1104
|
+
|
|
1105
|
+
>>> hr(0.1)
|
|
1106
|
+
>>> derived.hrp.update()
|
|
1107
|
+
>>> bnvr(left=4.0, right=5.0)
|
|
1108
|
+
>>> derived.bnvrf.update()
|
|
1109
|
+
>>> derived.hv(left=1.0, right=2.0)
|
|
1110
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
1111
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
1112
|
+
>>> model.calc_alvrdh_arvrdh_ulvrdh_urvrdh_v1()
|
|
1113
|
+
>>> aides.alvrdh
|
|
1114
|
+
alvrdh(0.0, 0.0, 0.006224, 0.081965, 0.371535, 1.999625, 3.599999, 4.0,
|
|
1115
|
+
4.4, 6.0, 8.0)
|
|
1116
|
+
>>> aides.arvrdh
|
|
1117
|
+
arvrdh(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00778, 0.102457, 0.464419,
|
|
1118
|
+
2.499532, 5.0)
|
|
1119
|
+
>>> aides.ulvrdh
|
|
1120
|
+
ulvrdh(0.0, 0.000876, 0.641565, 2.061553, 3.48154, 4.12223, 4.123105,
|
|
1121
|
+
4.123105, 4.123106, 4.123106, 4.123106)
|
|
1122
|
+
>>> aides.urvrdh
|
|
1123
|
+
urvrdh(0.0, 0.0, 0.0, 0.0, 0.000001, 0.001083, 0.79342, 2.54951,
|
|
1124
|
+
4.305599, 5.097936, 5.099019)
|
|
1125
|
+
|
|
1126
|
+
>>> numdiff()
|
|
1127
|
+
d_alvr/d_h: 0.0, 0.0, 0.006224, 0.081965, 0.371535, 1.999625, \
|
|
1128
|
+
3.599999, 4.0, 4.4, 6.0, 8.0
|
|
1129
|
+
d_arvr/d_h: 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00778, 0.102457, \
|
|
1130
|
+
0.464419, 2.499532, 5.0
|
|
1131
|
+
d_ulvr/d_h: 0.0, 0.000876, 0.641565, 2.061553, 3.48154, 4.12223, \
|
|
1132
|
+
4.123105, 4.123105, 4.123106, 4.123106, 4.123106
|
|
1133
|
+
d_urvr/d_h: 0.0, 0.0, 0.0, 0.0, 0.000001, 0.001083, 0.79342, \
|
|
1134
|
+
2.54951, 4.305599, 5.097936, 5.099019
|
|
1135
|
+
"""
|
|
1136
|
+
|
|
1137
|
+
CONTROLPARAMETERS = (kinw_control.GTS, kinw_control.BNVR)
|
|
1138
|
+
DERIVEDPARAMETERS = (kinw_derived.BNVRF,)
|
|
1139
|
+
REQUIREDSEQUENCES = (
|
|
1140
|
+
kinw_aides.RHLVR,
|
|
1141
|
+
kinw_aides.RHLVRDH,
|
|
1142
|
+
kinw_aides.RHRVR,
|
|
1143
|
+
kinw_aides.RHRVRDH,
|
|
1144
|
+
)
|
|
1145
|
+
RESULTSEQUENCES = (
|
|
1146
|
+
kinw_aides.ALVRDH,
|
|
1147
|
+
kinw_aides.ARVRDH,
|
|
1148
|
+
kinw_aides.ULVRDH,
|
|
1149
|
+
kinw_aides.URVRDH,
|
|
1150
|
+
)
|
|
1151
|
+
|
|
1152
|
+
@staticmethod
|
|
1153
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1154
|
+
con = model.parameters.control.fastaccess
|
|
1155
|
+
der = model.parameters.derived.fastaccess
|
|
1156
|
+
aid = model.sequences.aides.fastaccess
|
|
1157
|
+
for i in range(con.gts):
|
|
1158
|
+
aid.alvrdh[i] = con.bnvr[0] * aid.rhlvr[i] * aid.rhlvrdh[i]
|
|
1159
|
+
aid.ulvrdh[i] = aid.rhlvrdh[i] * der.bnvrf[0]
|
|
1160
|
+
aid.arvrdh[i] = con.bnvr[1] * aid.rhrvr[i] * aid.rhrvrdh[i]
|
|
1161
|
+
aid.urvrdh[i] = aid.rhrvrdh[i] * der.bnvrf[1]
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
class Calc_QM_V1(modeltools.Method):
|
|
1165
|
+
"""Calculate the discharge of the main channel after Manning-Strickler.
|
|
1166
|
+
|
|
1167
|
+
Basic equation:
|
|
1168
|
+
:math:`QM = MFM \\cdot \\frac{AM^{5/3}}{UM^{2/3}}`
|
|
1169
|
+
|
|
1170
|
+
Examples:
|
|
1171
|
+
|
|
1172
|
+
Note the handling of zero values for |UM| (in the third subsection):
|
|
1173
|
+
|
|
1174
|
+
>>> from hydpy.models.kinw import *
|
|
1175
|
+
>>> parameterstep()
|
|
1176
|
+
>>> gts(3)
|
|
1177
|
+
>>> derived.mfm(10.0)
|
|
1178
|
+
>>> aides.am = 3.0, 0.0, 3.0
|
|
1179
|
+
>>> aides.um = 7.0, 7.0, 0.0
|
|
1180
|
+
>>> model.calc_qm_v1()
|
|
1181
|
+
>>> aides.qm
|
|
1182
|
+
qm(17.053102, 0.0, 0.0)
|
|
1183
|
+
"""
|
|
1184
|
+
|
|
1185
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
1186
|
+
DERIVEDPARAMETERS = (kinw_derived.MFM,)
|
|
1187
|
+
REQUIREDSEQUENCES = (kinw_aides.AM, kinw_aides.UM)
|
|
1188
|
+
RESULTSEQUENCES = (kinw_aides.QM,)
|
|
1189
|
+
|
|
1190
|
+
@staticmethod
|
|
1191
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1192
|
+
con = model.parameters.control.fastaccess
|
|
1193
|
+
der = model.parameters.derived.fastaccess
|
|
1194
|
+
aid = model.sequences.aides.fastaccess
|
|
1195
|
+
for i in range(con.gts):
|
|
1196
|
+
if aid.um[i] > 0.0:
|
|
1197
|
+
aid.qm[i] = (
|
|
1198
|
+
der.mfm * aid.am[i] ** (5.0 / 3.0) / aid.um[i] ** (2.0 / 3.0)
|
|
1199
|
+
)
|
|
1200
|
+
else:
|
|
1201
|
+
aid.qm[i] = 0.0
|
|
1202
|
+
|
|
1203
|
+
|
|
1204
|
+
class Calc_QM_V2(modeltools.Method):
|
|
1205
|
+
"""Calculate the discharge of the main channel following the kinematic
|
|
1206
|
+
wave approach.
|
|
1207
|
+
|
|
1208
|
+
Basic equation:
|
|
1209
|
+
:math:`QM = \\frac{QMDH}{AMDH} \\cdot AM`
|
|
1210
|
+
|
|
1211
|
+
Examples:
|
|
1212
|
+
|
|
1213
|
+
Note the handling of zero values for |AMDH| (in the second subsection):
|
|
1214
|
+
|
|
1215
|
+
>>> from hydpy.models.kinw import *
|
|
1216
|
+
>>> parameterstep()
|
|
1217
|
+
>>> gts(2)
|
|
1218
|
+
>>> aides.am = 4.0, 4.0
|
|
1219
|
+
>>> aides.qmdh = 3.0, 3.0
|
|
1220
|
+
>>> aides.amdh = 2.0, 0.0
|
|
1221
|
+
>>> model.calc_qm_v2()
|
|
1222
|
+
>>> aides.qm
|
|
1223
|
+
qm(6.0, 0.0)
|
|
1224
|
+
"""
|
|
1225
|
+
|
|
1226
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
1227
|
+
REQUIREDSEQUENCES = (kinw_aides.AM, kinw_aides.QMDH, kinw_aides.AMDH)
|
|
1228
|
+
RESULTSEQUENCES = (kinw_aides.QM,)
|
|
1229
|
+
|
|
1230
|
+
@staticmethod
|
|
1231
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1232
|
+
con = model.parameters.control.fastaccess
|
|
1233
|
+
aid = model.sequences.aides.fastaccess
|
|
1234
|
+
for i in range(con.gts):
|
|
1235
|
+
if aid.amdh[i] > 0.0:
|
|
1236
|
+
aid.qm[i] = aid.qmdh[i] / aid.amdh[i] * aid.am[i]
|
|
1237
|
+
else:
|
|
1238
|
+
aid.qm[i] = 0.0
|
|
1239
|
+
|
|
1240
|
+
|
|
1241
|
+
class Calc_QMDH_V1(modeltools.Method):
|
|
1242
|
+
"""Calculate the derivative of the discharge of the main channel
|
|
1243
|
+
following method |Calc_QM_V1|.
|
|
1244
|
+
|
|
1245
|
+
Basic equation:
|
|
1246
|
+
:math:`QMDH = MFM \\cdot
|
|
1247
|
+
\\frac{5 \\cdot AM^{2/3} \\cdot AMDH}{3 \\cdot UM^{2/3}} -
|
|
1248
|
+
\\frac{2 \\cdot AM^{5/3} \\cdot UMDH}{3 \\cdot UM^{5/3}}`
|
|
1249
|
+
|
|
1250
|
+
Examples:
|
|
1251
|
+
|
|
1252
|
+
First, we apply the class |NumericalDifferentiator| to validate the
|
|
1253
|
+
calculated derivatives:
|
|
1254
|
+
|
|
1255
|
+
>>> from hydpy.models.kinw import *
|
|
1256
|
+
>>> parameterstep()
|
|
1257
|
+
>>> gts(2)
|
|
1258
|
+
>>> bm(2.0)
|
|
1259
|
+
>>> bnm(4.0)
|
|
1260
|
+
>>> hm(2.0)
|
|
1261
|
+
>>> derived.mfm(10.0)
|
|
1262
|
+
>>> derived.hrp(0.0)
|
|
1263
|
+
>>> derived.bnmf.update()
|
|
1264
|
+
>>> states.h = 0.0, 1.0
|
|
1265
|
+
>>> model.calc_rhm_v1()
|
|
1266
|
+
>>> model.calc_rhmdh_v1()
|
|
1267
|
+
>>> model.calc_rhv_v1()
|
|
1268
|
+
>>> model.calc_rhvdh_v1()
|
|
1269
|
+
>>> model.calc_am_um_v1()
|
|
1270
|
+
>>> model.calc_amdh_umdh_v1()
|
|
1271
|
+
>>> model.calc_qmdh_v1()
|
|
1272
|
+
>>> aides.qmdh
|
|
1273
|
+
qmdh(0.0, 94.12356)
|
|
1274
|
+
|
|
1275
|
+
>>> from hydpy import NumericalDifferentiator,pub
|
|
1276
|
+
>>> numdiff = NumericalDifferentiator(
|
|
1277
|
+
... xsequence=states.h,
|
|
1278
|
+
... ysequences=[aides.qm],
|
|
1279
|
+
... methods=[model.calc_rhm_v1,
|
|
1280
|
+
... model.calc_rhv_v1,
|
|
1281
|
+
... model.calc_am_um_v1,
|
|
1282
|
+
... model.calc_qm_v1],
|
|
1283
|
+
... dx=1e-8)
|
|
1284
|
+
>>> with pub.options.reprdigits(5):
|
|
1285
|
+
... numdiff()
|
|
1286
|
+
d_qm/d_h: 0.00002, 94.12356
|
|
1287
|
+
|
|
1288
|
+
Second, we show that zero values for |AM| or |UM| result in zero
|
|
1289
|
+
values for |QMDH|:
|
|
1290
|
+
|
|
1291
|
+
>>> aides.am = 1.0, 0.0
|
|
1292
|
+
>>> aides.um = 0.0, 1.0
|
|
1293
|
+
>>> model.calc_qmdh_v1()
|
|
1294
|
+
>>> aides.qmdh
|
|
1295
|
+
qmdh(0.0, 0.0)
|
|
1296
|
+
"""
|
|
1297
|
+
|
|
1298
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
1299
|
+
DERIVEDPARAMETERS = (kinw_derived.MFM,)
|
|
1300
|
+
REQUIREDSEQUENCES = (kinw_aides.AM, kinw_aides.AMDH, kinw_aides.UM, kinw_aides.UMDH)
|
|
1301
|
+
RESULTSEQUENCES = (kinw_aides.QMDH,)
|
|
1302
|
+
|
|
1303
|
+
@staticmethod
|
|
1304
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1305
|
+
con = model.parameters.control.fastaccess
|
|
1306
|
+
der = model.parameters.derived.fastaccess
|
|
1307
|
+
aid = model.sequences.aides.fastaccess
|
|
1308
|
+
for i in range(con.gts):
|
|
1309
|
+
if (aid.am[i] > 0.0) and (aid.um[i] > 0.0):
|
|
1310
|
+
aid.qmdh[i] = der.mfm * (
|
|
1311
|
+
5.0
|
|
1312
|
+
* aid.am[i] ** (2.0 / 3.0)
|
|
1313
|
+
* aid.amdh[i]
|
|
1314
|
+
/ (3.0 * aid.um[i] ** (2.0 / 3.0))
|
|
1315
|
+
- 2.0
|
|
1316
|
+
* aid.am[i] ** (5.0 / 3.0)
|
|
1317
|
+
* aid.umdh[i]
|
|
1318
|
+
/ (3.0 * aid.um[i] ** (5.0 / 3.0))
|
|
1319
|
+
)
|
|
1320
|
+
else:
|
|
1321
|
+
aid.qmdh[i] = 0.0
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
class Calc_QLV_QRV_V1(modeltools.Method):
|
|
1325
|
+
"""Calculate the discharge of both forelands after Manning-Strickler.
|
|
1326
|
+
|
|
1327
|
+
Basic equation:
|
|
1328
|
+
:math:`QV = MFV \\cdot \\frac{AV^{5/3}}{UV^{2/3}}`
|
|
1329
|
+
|
|
1330
|
+
Examples:
|
|
1331
|
+
|
|
1332
|
+
Note the handling of zero values for |ULV| and |URV| (in the second
|
|
1333
|
+
subsection):
|
|
1334
|
+
|
|
1335
|
+
>>> from hydpy.models.kinw import *
|
|
1336
|
+
>>> parameterstep()
|
|
1337
|
+
>>> gts(2)
|
|
1338
|
+
>>> derived.mfv(left=10.0, right=18.0)
|
|
1339
|
+
>>> aides.alv = 3.0, 3.0
|
|
1340
|
+
>>> aides.arv = 4.0, 4.0
|
|
1341
|
+
>>> aides.ulv = 7.0, 0.0
|
|
1342
|
+
>>> aides.urv = 8.0, 0.0
|
|
1343
|
+
>>> model.calc_qlv_qrv_v1()
|
|
1344
|
+
>>> aides.qlv
|
|
1345
|
+
qlv(17.053102, 0.0)
|
|
1346
|
+
>>> aides.qrv
|
|
1347
|
+
qrv(45.357158, 0.0)
|
|
1348
|
+
"""
|
|
1349
|
+
|
|
1350
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
1351
|
+
DERIVEDPARAMETERS = (kinw_derived.MFV,)
|
|
1352
|
+
REQUIREDSEQUENCES = (kinw_aides.ALV, kinw_aides.ARV, kinw_aides.ULV, kinw_aides.URV)
|
|
1353
|
+
RESULTSEQUENCES = (kinw_aides.QLV, kinw_aides.QRV)
|
|
1354
|
+
|
|
1355
|
+
@staticmethod
|
|
1356
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1357
|
+
con = model.parameters.control.fastaccess
|
|
1358
|
+
der = model.parameters.derived.fastaccess
|
|
1359
|
+
aid = model.sequences.aides.fastaccess
|
|
1360
|
+
for i in range(con.gts):
|
|
1361
|
+
if aid.ulv[i] > 0.0:
|
|
1362
|
+
aid.qlv[i] = (
|
|
1363
|
+
der.mfv[0] * aid.alv[i] ** (5.0 / 3.0) / aid.ulv[i] ** (2.0 / 3.0)
|
|
1364
|
+
)
|
|
1365
|
+
else:
|
|
1366
|
+
aid.qlv[i] = 0.0
|
|
1367
|
+
if aid.urv[i] > 0:
|
|
1368
|
+
aid.qrv[i] = (
|
|
1369
|
+
der.mfv[1] * aid.arv[i] ** (5.0 / 3.0) / aid.urv[i] ** (2.0 / 3.0)
|
|
1370
|
+
)
|
|
1371
|
+
else:
|
|
1372
|
+
aid.qrv[i] = 0.0
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
class Calc_QLV_QRV_V2(modeltools.Method):
|
|
1376
|
+
"""Calculate the discharge of both forelands following the kinematic
|
|
1377
|
+
wave approach.
|
|
1378
|
+
|
|
1379
|
+
Basic equation:
|
|
1380
|
+
:math:`QV = \\frac{QVDH}{AVDH} \\cdot AV`
|
|
1381
|
+
|
|
1382
|
+
Examples:
|
|
1383
|
+
|
|
1384
|
+
Note the handling of zero values for |ALVDH| and |ARVDH| (in the
|
|
1385
|
+
second subsection):
|
|
1386
|
+
|
|
1387
|
+
>>> from hydpy.models.kinw import *
|
|
1388
|
+
>>> parameterstep()
|
|
1389
|
+
>>> gts(2)
|
|
1390
|
+
>>> aides.alv = 3.0, 3.0
|
|
1391
|
+
>>> aides.arv = 5.0, 5.0
|
|
1392
|
+
>>> aides.qlvdh = 4.0, 4.0
|
|
1393
|
+
>>> aides.qrvdh = 6.0, 6.0
|
|
1394
|
+
>>> aides.alvdh = 2.0, 0.0
|
|
1395
|
+
>>> aides.arvdh = 4.0, 0.0
|
|
1396
|
+
>>> model.calc_qlv_qrv_v2()
|
|
1397
|
+
>>> aides.qlv
|
|
1398
|
+
qlv(6.0, 0.0)
|
|
1399
|
+
>>> aides.qrv
|
|
1400
|
+
qrv(7.5, 0.0)
|
|
1401
|
+
"""
|
|
1402
|
+
|
|
1403
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
1404
|
+
REQUIREDSEQUENCES = (
|
|
1405
|
+
kinw_aides.ALV,
|
|
1406
|
+
kinw_aides.ARV,
|
|
1407
|
+
kinw_aides.ALVDH,
|
|
1408
|
+
kinw_aides.ARVDH,
|
|
1409
|
+
kinw_aides.QLVDH,
|
|
1410
|
+
kinw_aides.QRVDH,
|
|
1411
|
+
)
|
|
1412
|
+
RESULTSEQUENCES = (kinw_aides.QLV, kinw_aides.QRV)
|
|
1413
|
+
|
|
1414
|
+
@staticmethod
|
|
1415
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1416
|
+
con = model.parameters.control.fastaccess
|
|
1417
|
+
aid = model.sequences.aides.fastaccess
|
|
1418
|
+
for i in range(con.gts):
|
|
1419
|
+
if aid.alvdh[i] > 0.0:
|
|
1420
|
+
aid.qlv[i] = aid.qlvdh[i] / aid.alvdh[i] * aid.alv[i]
|
|
1421
|
+
else:
|
|
1422
|
+
aid.qlv[i] = 0.0
|
|
1423
|
+
if aid.arvdh[i] > 0.0:
|
|
1424
|
+
aid.qrv[i] = aid.qrvdh[i] / aid.arvdh[i] * aid.arv[i]
|
|
1425
|
+
else:
|
|
1426
|
+
aid.qrv[i] = 0.0
|
|
1427
|
+
|
|
1428
|
+
|
|
1429
|
+
class Calc_QLVDH_QRVDH_V1(modeltools.Method):
|
|
1430
|
+
"""Calculate the derivative of both forelands' discharge with respect to the stage
|
|
1431
|
+
following method |Calc_QLV_QRV_V1|.
|
|
1432
|
+
|
|
1433
|
+
Basic equation:
|
|
1434
|
+
:math:`QVDH = MFV \\cdot
|
|
1435
|
+
\\frac{5 \\cdot AV^{2/3} \\cdot AVDH}{3 \\cdot UV^{2/3}} -
|
|
1436
|
+
\\frac{2 \\cdot AV^{5/3} \\cdot UVDH}{3 \\cdot UV^{5/3}}`
|
|
1437
|
+
|
|
1438
|
+
Examples:
|
|
1439
|
+
|
|
1440
|
+
First, we apply the class |NumericalDifferentiator| to validate the
|
|
1441
|
+
calculated derivatives:
|
|
1442
|
+
|
|
1443
|
+
>>> from hydpy.models.kinw import *
|
|
1444
|
+
>>> parameterstep()
|
|
1445
|
+
>>> gts(2)
|
|
1446
|
+
>>> hm(1.0)
|
|
1447
|
+
>>> bv(left=2.0, right=3.0)
|
|
1448
|
+
>>> bnv(left=4.0, right=5.0)
|
|
1449
|
+
>>> derived.bnvf.update()
|
|
1450
|
+
>>> derived.hv(left=1.0, right=2.0)
|
|
1451
|
+
>>> derived.mfv(left=10.0, right=18.0)
|
|
1452
|
+
>>> derived.hrp(0.0)
|
|
1453
|
+
>>> states.h = 0.5, 1.5
|
|
1454
|
+
>>> model.calc_rhv_v1()
|
|
1455
|
+
>>> model.calc_rhvdh_v1()
|
|
1456
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
1457
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
1458
|
+
>>> model.calc_alv_arv_ulv_urv_v1()
|
|
1459
|
+
>>> model.calc_alvdh_arvdh_ulvdh_urvdh_v1()
|
|
1460
|
+
>>> model.calc_qlvdh_qrvdh_v1()
|
|
1461
|
+
>>> aides.qlvdh
|
|
1462
|
+
qlvdh(0.0, 29.091363)
|
|
1463
|
+
>>> aides.qrvdh
|
|
1464
|
+
qrvdh(0.0, 74.651886)
|
|
1465
|
+
|
|
1466
|
+
>>> from hydpy import NumericalDifferentiator
|
|
1467
|
+
>>> numdiff = NumericalDifferentiator(
|
|
1468
|
+
... xsequence=states.h,
|
|
1469
|
+
... ysequences=[aides.qlv, aides.qrv],
|
|
1470
|
+
... methods=[model.calc_rhv_v1,
|
|
1471
|
+
... model.calc_rhlvr_rhrvr_v1,
|
|
1472
|
+
... model.calc_alv_arv_ulv_urv_v1,
|
|
1473
|
+
... model.calc_qlv_qrv_v1])()
|
|
1474
|
+
d_qlv/d_h: 0.0, 29.091363
|
|
1475
|
+
d_qrv/d_h: 0.0, 74.651886
|
|
1476
|
+
|
|
1477
|
+
Second, we show that zero values for |ALV| or |ULV| as well as for
|
|
1478
|
+
|ARV| or |URV| result in zero values for |QLVDH| or |QRVDH|,
|
|
1479
|
+
respectively:
|
|
1480
|
+
|
|
1481
|
+
>>> aides.alv = 1.0, 0.0
|
|
1482
|
+
>>> aides.ulv = 0.0, 1.0
|
|
1483
|
+
>>> aides.arv = 1.0, 0.0
|
|
1484
|
+
>>> aides.urv = 0.0, 1.0
|
|
1485
|
+
>>> model.calc_qlvdh_qrvdh_v1()
|
|
1486
|
+
>>> aides.qlvdh
|
|
1487
|
+
qlvdh(0.0, 0.0)
|
|
1488
|
+
>>> aides.qrvdh
|
|
1489
|
+
qrvdh(0.0, 0.0)
|
|
1490
|
+
"""
|
|
1491
|
+
|
|
1492
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
1493
|
+
DERIVEDPARAMETERS = (kinw_derived.MFV,)
|
|
1494
|
+
REQUIREDSEQUENCES = (
|
|
1495
|
+
kinw_aides.ALV,
|
|
1496
|
+
kinw_aides.ALVDH,
|
|
1497
|
+
kinw_aides.ARV,
|
|
1498
|
+
kinw_aides.ARVDH,
|
|
1499
|
+
kinw_aides.ULV,
|
|
1500
|
+
kinw_aides.ULVDH,
|
|
1501
|
+
kinw_aides.URV,
|
|
1502
|
+
kinw_aides.URVDH,
|
|
1503
|
+
)
|
|
1504
|
+
RESULTSEQUENCES = (kinw_aides.QLVDH, kinw_aides.QRVDH)
|
|
1505
|
+
|
|
1506
|
+
@staticmethod
|
|
1507
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1508
|
+
con = model.parameters.control.fastaccess
|
|
1509
|
+
der = model.parameters.derived.fastaccess
|
|
1510
|
+
aid = model.sequences.aides.fastaccess
|
|
1511
|
+
for i in range(con.gts):
|
|
1512
|
+
if (aid.alv[i] > 0.0) and (aid.ulv[i] > 0.0):
|
|
1513
|
+
aid.qlvdh[i] = der.mfv[0] * (
|
|
1514
|
+
5.0
|
|
1515
|
+
* aid.alv[i] ** (2.0 / 3.0)
|
|
1516
|
+
* aid.alvdh[i]
|
|
1517
|
+
/ (3.0 * aid.ulv[i] ** (2.0 / 3.0))
|
|
1518
|
+
- 2.0
|
|
1519
|
+
* aid.alv[i] ** (5.0 / 3.0)
|
|
1520
|
+
* aid.ulvdh[i]
|
|
1521
|
+
/ (3.0 * aid.ulv[i] ** (5.0 / 3.0))
|
|
1522
|
+
)
|
|
1523
|
+
else:
|
|
1524
|
+
aid.qlvdh[i] = 0.0
|
|
1525
|
+
if (aid.arv[i] > 0.0) and (aid.urv[i] > 0.0):
|
|
1526
|
+
aid.qrvdh[i] = der.mfv[1] * (
|
|
1527
|
+
5.0
|
|
1528
|
+
* aid.arv[i] ** (2.0 / 3.0)
|
|
1529
|
+
* aid.arvdh[i]
|
|
1530
|
+
/ (3.0 * aid.urv[i] ** (2.0 / 3.0))
|
|
1531
|
+
- 2.0
|
|
1532
|
+
* aid.arv[i] ** (5.0 / 3.0)
|
|
1533
|
+
* aid.urvdh[i]
|
|
1534
|
+
/ (3.0 * aid.urv[i] ** (5.0 / 3.0))
|
|
1535
|
+
)
|
|
1536
|
+
else:
|
|
1537
|
+
aid.qrvdh[i] = 0.0
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
class Calc_QLVR_QRVR_V1(modeltools.Method):
|
|
1541
|
+
"""Calculate the discharge of both outer embankments after
|
|
1542
|
+
Manning-Strickler.
|
|
1543
|
+
|
|
1544
|
+
Basic equation:
|
|
1545
|
+
:math:`QVR = MFV \\cdot \\frac{AVR^{5/3}}{UVR^{2/3}}`
|
|
1546
|
+
|
|
1547
|
+
Examples:
|
|
1548
|
+
|
|
1549
|
+
Note the handling of zero values for |ULVR| and |URVR| (in the second
|
|
1550
|
+
subsection):
|
|
1551
|
+
|
|
1552
|
+
>>> from hydpy.models.kinw import *
|
|
1553
|
+
>>> parameterstep()
|
|
1554
|
+
>>> gts(2)
|
|
1555
|
+
>>> derived.mfv(left=10.0, right=1.2)
|
|
1556
|
+
>>> aides.alvr = 3.0, 3.0
|
|
1557
|
+
>>> aides.arvr = 4.0, 4.0
|
|
1558
|
+
>>> aides.ulvr = 7.0, 0.0
|
|
1559
|
+
>>> aides.urvr = 8.0, 0.0
|
|
1560
|
+
>>> model.calc_qlvr_qrvr_v1()
|
|
1561
|
+
>>> aides.qlvr
|
|
1562
|
+
qlvr(17.053102, 0.0)
|
|
1563
|
+
>>> aides.qrvr
|
|
1564
|
+
qrvr(3.023811, 0.0)
|
|
1565
|
+
"""
|
|
1566
|
+
|
|
1567
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
1568
|
+
DERIVEDPARAMETERS = (kinw_derived.MFV,)
|
|
1569
|
+
REQUIREDSEQUENCES = (
|
|
1570
|
+
kinw_aides.ALVR,
|
|
1571
|
+
kinw_aides.ARVR,
|
|
1572
|
+
kinw_aides.ULVR,
|
|
1573
|
+
kinw_aides.URVR,
|
|
1574
|
+
)
|
|
1575
|
+
RESULTSEQUENCES = (kinw_aides.QLVR, kinw_aides.QRVR)
|
|
1576
|
+
|
|
1577
|
+
@staticmethod
|
|
1578
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1579
|
+
con = model.parameters.control.fastaccess
|
|
1580
|
+
der = model.parameters.derived.fastaccess
|
|
1581
|
+
aid = model.sequences.aides.fastaccess
|
|
1582
|
+
for i in range(con.gts):
|
|
1583
|
+
if aid.ulvr[i] > 0.0:
|
|
1584
|
+
aid.qlvr[i] = (
|
|
1585
|
+
der.mfv[0] * aid.alvr[i] ** (5.0 / 3.0) / aid.ulvr[i] ** (2.0 / 3.0)
|
|
1586
|
+
)
|
|
1587
|
+
else:
|
|
1588
|
+
aid.qlvr[i] = 0.0
|
|
1589
|
+
if aid.urvr[i] > 0.0:
|
|
1590
|
+
aid.qrvr[i] = (
|
|
1591
|
+
der.mfv[1] * aid.arvr[i] ** (5.0 / 3.0) / aid.urvr[i] ** (2.0 / 3.0)
|
|
1592
|
+
)
|
|
1593
|
+
else:
|
|
1594
|
+
aid.qrvr[i] = 0.0
|
|
1595
|
+
|
|
1596
|
+
|
|
1597
|
+
class Calc_QLVR_QRVR_V2(modeltools.Method):
|
|
1598
|
+
"""Calculate the discharge of both outer embankments following the
|
|
1599
|
+
kinematic wave approach.
|
|
1600
|
+
|
|
1601
|
+
Basic equation:
|
|
1602
|
+
:math:`QVR = \\frac{QVRDH}{AVRDH} \\cdot AVR`
|
|
1603
|
+
|
|
1604
|
+
Examples:
|
|
1605
|
+
|
|
1606
|
+
Note the handling of zero values for |ALVRDH| and |ARVRDH| (in the
|
|
1607
|
+
second subsection):
|
|
1608
|
+
|
|
1609
|
+
>>> from hydpy.models.kinw import *
|
|
1610
|
+
>>> parameterstep()
|
|
1611
|
+
>>> gts(2)
|
|
1612
|
+
>>> aides.alvr = 3.0, 3.0
|
|
1613
|
+
>>> aides.arvr = 5.0, 5.0
|
|
1614
|
+
>>> aides.qlvrdh = 4.0, 4.0
|
|
1615
|
+
>>> aides.qrvrdh = 6.0, 6.0
|
|
1616
|
+
>>> aides.alvrdh = 2.0, 0.0
|
|
1617
|
+
>>> aides.arvrdh = 4.0, 0.0
|
|
1618
|
+
>>> model.calc_qlvr_qrvr_v2()
|
|
1619
|
+
>>> aides.qlvr
|
|
1620
|
+
qlvr(6.0, 0.0)
|
|
1621
|
+
>>> aides.qrvr
|
|
1622
|
+
qrvr(7.5, 0.0)
|
|
1623
|
+
"""
|
|
1624
|
+
|
|
1625
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
1626
|
+
REQUIREDSEQUENCES = (
|
|
1627
|
+
kinw_aides.ALVR,
|
|
1628
|
+
kinw_aides.ARVR,
|
|
1629
|
+
kinw_aides.QLVRDH,
|
|
1630
|
+
kinw_aides.QRVRDH,
|
|
1631
|
+
kinw_aides.ALVRDH,
|
|
1632
|
+
kinw_aides.ARVRDH,
|
|
1633
|
+
)
|
|
1634
|
+
RESULTSEQUENCES = (kinw_aides.QLVR, kinw_aides.QRVR)
|
|
1635
|
+
|
|
1636
|
+
@staticmethod
|
|
1637
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1638
|
+
con = model.parameters.control.fastaccess
|
|
1639
|
+
aid = model.sequences.aides.fastaccess
|
|
1640
|
+
for i in range(con.gts):
|
|
1641
|
+
if aid.alvrdh[i] > 0.0:
|
|
1642
|
+
aid.qlvr[i] = aid.qlvrdh[i] / aid.alvrdh[i] * aid.alvr[i]
|
|
1643
|
+
else:
|
|
1644
|
+
aid.qlvr[i] = 0.0
|
|
1645
|
+
if aid.arvrdh[i] > 0.0:
|
|
1646
|
+
aid.qrvr[i] = aid.qrvrdh[i] / aid.arvrdh[i] * aid.arvr[i]
|
|
1647
|
+
else:
|
|
1648
|
+
aid.qrvr[i] = 0.0
|
|
1649
|
+
|
|
1650
|
+
|
|
1651
|
+
class Calc_QLVRDH_QRVRDH_V1(modeltools.Method):
|
|
1652
|
+
"""Calculate the derivative of the discharge over the outer embankments
|
|
1653
|
+
with respect to the stage following method |Calc_QLVR_QRVR_V1|.
|
|
1654
|
+
|
|
1655
|
+
Basic equation:
|
|
1656
|
+
:math:`QVRDH = MFVR \\cdot
|
|
1657
|
+
\\frac{5 \\cdot AVR^{2/3} \\cdot AVRDH}{3 \\cdot UVR^{2/3}} -
|
|
1658
|
+
\\frac{2 \\cdot AVR{5/3} \\cdot UVRDH}{3 \\cdot UVR^{5/3}}`
|
|
1659
|
+
|
|
1660
|
+
Examples:
|
|
1661
|
+
|
|
1662
|
+
First, we apply the class |NumericalDifferentiator| to validate the
|
|
1663
|
+
calculated derivatives:
|
|
1664
|
+
|
|
1665
|
+
>>> from hydpy.models.kinw import *
|
|
1666
|
+
>>> parameterstep()
|
|
1667
|
+
>>> gts(2)
|
|
1668
|
+
>>> hm(1.0)
|
|
1669
|
+
>>> bnvr(left=4.0, right=5.0)
|
|
1670
|
+
>>> derived.bnvrf.update()
|
|
1671
|
+
>>> derived.hv(left=1.0, right=2.0)
|
|
1672
|
+
>>> derived.mfv(left=10.0, right=18.0)
|
|
1673
|
+
>>> derived.hrp(0.0)
|
|
1674
|
+
>>> states.h = 1.5, 3.5
|
|
1675
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
1676
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
1677
|
+
>>> model.calc_alvr_arvr_ulvr_urvr_v1()
|
|
1678
|
+
>>> model.calc_alvrdh_arvrdh_ulvrdh_urvrdh_v1()
|
|
1679
|
+
>>> model.calc_qlvrdh_qrvrdh_v1()
|
|
1680
|
+
>>> aides.qlvrdh
|
|
1681
|
+
qlvrdh(0.0, 64.717418)
|
|
1682
|
+
>>> aides.qrvrdh
|
|
1683
|
+
qrvrdh(0.0, 23.501747)
|
|
1684
|
+
|
|
1685
|
+
>>> from hydpy import NumericalDifferentiator
|
|
1686
|
+
>>> NumericalDifferentiator(
|
|
1687
|
+
... xsequence=states.h,
|
|
1688
|
+
... ysequences=[aides.qlvr, aides.qrvr],
|
|
1689
|
+
... methods=[model.calc_rhlvr_rhrvr_v1,
|
|
1690
|
+
... model.calc_alvr_arvr_ulvr_urvr_v1,
|
|
1691
|
+
... model.calc_qlvr_qrvr_v1])()
|
|
1692
|
+
d_qlvr/d_h: 0.0, 64.717418
|
|
1693
|
+
d_qrvr/d_h: 0.0, 23.501747
|
|
1694
|
+
|
|
1695
|
+
Second, we show that zero values for |ALVR| or |ULVR| as well as for
|
|
1696
|
+
|ARVR| or |URVR| result in zero values for |QLVRDH| or |QRVRDH|,
|
|
1697
|
+
respectively:
|
|
1698
|
+
|
|
1699
|
+
>>> aides.alvr = 1.0, 0.0
|
|
1700
|
+
>>> aides.ulvr = 0.0, 1.0
|
|
1701
|
+
>>> aides.arvr = 1.0, 0.0
|
|
1702
|
+
>>> aides.urvr = 0.0, 1.0
|
|
1703
|
+
>>> model.calc_qlvrdh_qrvrdh_v1()
|
|
1704
|
+
>>> aides.qlvrdh
|
|
1705
|
+
qlvrdh(0.0, 0.0)
|
|
1706
|
+
>>> aides.qrvrdh
|
|
1707
|
+
qrvrdh(0.0, 0.0)
|
|
1708
|
+
"""
|
|
1709
|
+
|
|
1710
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
1711
|
+
DERIVEDPARAMETERS = (kinw_derived.MFV,)
|
|
1712
|
+
REQUIREDSEQUENCES = (
|
|
1713
|
+
kinw_aides.ALVR,
|
|
1714
|
+
kinw_aides.ALVRDH,
|
|
1715
|
+
kinw_aides.ARVR,
|
|
1716
|
+
kinw_aides.ARVRDH,
|
|
1717
|
+
kinw_aides.ULVR,
|
|
1718
|
+
kinw_aides.ULVRDH,
|
|
1719
|
+
kinw_aides.URVR,
|
|
1720
|
+
kinw_aides.URVRDH,
|
|
1721
|
+
)
|
|
1722
|
+
RESULTSEQUENCES = (kinw_aides.QLVRDH, kinw_aides.QRVRDH)
|
|
1723
|
+
|
|
1724
|
+
@staticmethod
|
|
1725
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1726
|
+
con = model.parameters.control.fastaccess
|
|
1727
|
+
der = model.parameters.derived.fastaccess
|
|
1728
|
+
aid = model.sequences.aides.fastaccess
|
|
1729
|
+
for i in range(con.gts):
|
|
1730
|
+
if (aid.alvr[i] > 0.0) and (aid.ulvr[i] > 0.0):
|
|
1731
|
+
aid.qlvrdh[i] = der.mfv[0] * (
|
|
1732
|
+
5.0
|
|
1733
|
+
* aid.alvr[i] ** (2.0 / 3.0)
|
|
1734
|
+
* aid.alvrdh[i]
|
|
1735
|
+
/ (3.0 * aid.ulvr[i] ** (2.0 / 3.0))
|
|
1736
|
+
- 2.0
|
|
1737
|
+
* aid.alvr[i] ** (5.0 / 3.0)
|
|
1738
|
+
* aid.ulvrdh[i]
|
|
1739
|
+
/ (3.0 * aid.ulvr[i] ** (5.0 / 3.0))
|
|
1740
|
+
)
|
|
1741
|
+
else:
|
|
1742
|
+
aid.qlvrdh[i] = 0.0
|
|
1743
|
+
if (aid.arvr[i] > 0.0) and (aid.urvr[i] > 0.0):
|
|
1744
|
+
aid.qrvrdh[i] = der.mfv[1] * (
|
|
1745
|
+
5.0
|
|
1746
|
+
* aid.arvr[i] ** (2.0 / 3.0)
|
|
1747
|
+
* aid.arvrdh[i]
|
|
1748
|
+
/ (3.0 * aid.urvr[i] ** (2.0 / 3.0))
|
|
1749
|
+
- 2.0
|
|
1750
|
+
* aid.arvr[i] ** (5.0 / 3.0)
|
|
1751
|
+
* aid.urvrdh[i]
|
|
1752
|
+
/ (3.0 * aid.urvr[i] ** (5.0 / 3.0))
|
|
1753
|
+
)
|
|
1754
|
+
else:
|
|
1755
|
+
aid.qrvrdh[i] = 0.0
|
|
1756
|
+
|
|
1757
|
+
|
|
1758
|
+
class Calc_AG_V1(modeltools.Method):
|
|
1759
|
+
"""Calculate the through wetted of the total cross-sections.
|
|
1760
|
+
|
|
1761
|
+
Basic equation:
|
|
1762
|
+
:math:`AG = AM+ALV+ARV+ALVR+ARVR`
|
|
1763
|
+
|
|
1764
|
+
Example:
|
|
1765
|
+
|
|
1766
|
+
>>> from hydpy.models.kinw import *
|
|
1767
|
+
>>> parameterstep()
|
|
1768
|
+
>>> gts(2)
|
|
1769
|
+
>>> aides.am = 0.0, 1.0
|
|
1770
|
+
>>> aides.alv = 2.0, 4.0
|
|
1771
|
+
>>> aides.arv = 3.0, 5.0
|
|
1772
|
+
>>> aides.alvr = 6.0, 8.0
|
|
1773
|
+
>>> aides.arvr = 7.0, 9.0
|
|
1774
|
+
>>> model.calc_ag_v1()
|
|
1775
|
+
>>> aides.ag
|
|
1776
|
+
ag(18.0, 27.0)
|
|
1777
|
+
"""
|
|
1778
|
+
|
|
1779
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
1780
|
+
REQUIREDSEQUENCES = (
|
|
1781
|
+
kinw_aides.AM,
|
|
1782
|
+
kinw_aides.ALV,
|
|
1783
|
+
kinw_aides.ARV,
|
|
1784
|
+
kinw_aides.ALVR,
|
|
1785
|
+
kinw_aides.ARVR,
|
|
1786
|
+
)
|
|
1787
|
+
RESULTSEQUENCES = (kinw_aides.AG,)
|
|
1788
|
+
|
|
1789
|
+
@staticmethod
|
|
1790
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1791
|
+
con = model.parameters.control.fastaccess
|
|
1792
|
+
aid = model.sequences.aides.fastaccess
|
|
1793
|
+
for i in range(con.gts):
|
|
1794
|
+
aid.ag[i] = aid.am[i] + aid.alv[i] + aid.arv[i] + aid.alvr[i] + aid.arvr[i]
|
|
1795
|
+
|
|
1796
|
+
|
|
1797
|
+
class Calc_QG_V1(modeltools.Method):
|
|
1798
|
+
"""Calculate the discharge of the total cross-section.
|
|
1799
|
+
|
|
1800
|
+
Basic equation:
|
|
1801
|
+
:math:`QG = QM + QLV + QRV + QLVR + QRVR`
|
|
1802
|
+
|
|
1803
|
+
Example:
|
|
1804
|
+
|
|
1805
|
+
>>> from hydpy.models.kinw import *
|
|
1806
|
+
>>> parameterstep()
|
|
1807
|
+
>>> gts(2)
|
|
1808
|
+
>>> aides.qm = 0.0, 1.0
|
|
1809
|
+
>>> aides.qlv = 2.0, 4.0
|
|
1810
|
+
>>> aides.qrv = 3.0, 5.0
|
|
1811
|
+
>>> aides.qlvr = 6.0, 8.0
|
|
1812
|
+
>>> aides.qrvr = 7.0, 9.0
|
|
1813
|
+
>>> model.calc_qg_v1()
|
|
1814
|
+
>>> fluxes.qg
|
|
1815
|
+
qg(18.0, 27.0)
|
|
1816
|
+
"""
|
|
1817
|
+
|
|
1818
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
1819
|
+
REQUIREDSEQUENCES = (
|
|
1820
|
+
kinw_aides.QM,
|
|
1821
|
+
kinw_aides.QLV,
|
|
1822
|
+
kinw_aides.QRV,
|
|
1823
|
+
kinw_aides.QLVR,
|
|
1824
|
+
kinw_aides.QRVR,
|
|
1825
|
+
)
|
|
1826
|
+
RESULTSEQUENCES = (kinw_fluxes.QG,)
|
|
1827
|
+
|
|
1828
|
+
@staticmethod
|
|
1829
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1830
|
+
con = model.parameters.control.fastaccess
|
|
1831
|
+
flu = model.sequences.fluxes.fastaccess
|
|
1832
|
+
aid = model.sequences.aides.fastaccess
|
|
1833
|
+
for i in range(con.gts):
|
|
1834
|
+
flu.qg[i] = aid.qm[i] + aid.qlv[i] + aid.qrv[i] + aid.qlvr[i] + aid.qrvr[i]
|
|
1835
|
+
|
|
1836
|
+
|
|
1837
|
+
class Calc_QG_V2(modeltools.Method):
|
|
1838
|
+
r"""Calculate the discharge of the total cross-section based on an interpolated
|
|
1839
|
+
flow velocity.
|
|
1840
|
+
|
|
1841
|
+
Basic equation:
|
|
1842
|
+
:math:`QG = EK \cdot \frac{1000 \cdot V_{interpolated} \cdot VG \cdot GTS}{Laen}`
|
|
1843
|
+
|
|
1844
|
+
Example:
|
|
1845
|
+
|
|
1846
|
+
For simplicity, we define a linear between flow velocity and water storage:
|
|
1847
|
+
|
|
1848
|
+
>>> from hydpy.models.kinw import *
|
|
1849
|
+
>>> parameterstep()
|
|
1850
|
+
>>> gts(2)
|
|
1851
|
+
>>> laen(10.0)
|
|
1852
|
+
>>> ek(0.5)
|
|
1853
|
+
>>> vg2fg(PPoly.from_data(xs=[0.0, 1.0], ys=[0.0, 1.0]))
|
|
1854
|
+
>>> from hydpy import UnitTest
|
|
1855
|
+
>>> test = UnitTest(model,
|
|
1856
|
+
... model.calc_qg_v2,
|
|
1857
|
+
... last_example=3,
|
|
1858
|
+
... parseqs=(states.vg,
|
|
1859
|
+
... fluxes.qg))
|
|
1860
|
+
>>> test.nexts.vg = numpy.empty((4, 2))
|
|
1861
|
+
>>> test.nexts.vg[:, 0] = numpy.arange(-1.0, 3.0)
|
|
1862
|
+
>>> test.nexts.vg[:, 1] = numpy.arange(3.0, 7.0)
|
|
1863
|
+
>>> test()
|
|
1864
|
+
| ex. | vg | qg |
|
|
1865
|
+
-----------------------------------
|
|
1866
|
+
| 1 | -1.0 3.0 | 0.0 900.0 |
|
|
1867
|
+
| 2 | 0.0 4.0 | 0.0 1600.0 |
|
|
1868
|
+
| 3 | 1.0 5.0 | 100.0 2500.0 |
|
|
1869
|
+
|
|
1870
|
+
Our example shows that a linear velocity-volume relationship results in a
|
|
1871
|
+
quadratic discharge-volume relationship. Note also that we generally set the
|
|
1872
|
+
discharge to zero for negative volumes.
|
|
1873
|
+
|
|
1874
|
+
For more realistic approximations of measured relationships between
|
|
1875
|
+
storage and discharge, we require larger neural networks.
|
|
1876
|
+
"""
|
|
1877
|
+
|
|
1878
|
+
CONTROLPARAMETERS = (
|
|
1879
|
+
kinw_control.GTS,
|
|
1880
|
+
kinw_control.Laen,
|
|
1881
|
+
kinw_control.VG2FG,
|
|
1882
|
+
kinw_control.EK,
|
|
1883
|
+
)
|
|
1884
|
+
REQUIREDSEQUENCES = (kinw_states.VG,)
|
|
1885
|
+
RESULTSEQUENCES = (kinw_fluxes.QG,)
|
|
1886
|
+
|
|
1887
|
+
@staticmethod
|
|
1888
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1889
|
+
con = model.parameters.control.fastaccess
|
|
1890
|
+
sta = model.sequences.states.fastaccess
|
|
1891
|
+
flu = model.sequences.fluxes.fastaccess
|
|
1892
|
+
for i in range(con.gts):
|
|
1893
|
+
con.vg2fg.inputs[0] = sta.vg[i]
|
|
1894
|
+
con.vg2fg.calculate_values()
|
|
1895
|
+
d_v = max(con.ek * con.vg2fg.outputs[0], 0.0)
|
|
1896
|
+
flu.qg[i] = 1000.0 * d_v * sta.vg[i] * con.gts / con.laen
|
|
1897
|
+
|
|
1898
|
+
|
|
1899
|
+
class Calc_WBM_V1(modeltools.Method):
|
|
1900
|
+
"""Calculate the water table width above the main channel.
|
|
1901
|
+
|
|
1902
|
+
Examples:
|
|
1903
|
+
|
|
1904
|
+
Due to :math:`WBM = \\frac{dAM}{dh}`, we can apply the class
|
|
1905
|
+
|NumericalDifferentiator| to validate the calculated water
|
|
1906
|
+
table widths:
|
|
1907
|
+
|
|
1908
|
+
>>> from hydpy.models.kinw import *
|
|
1909
|
+
>>> parameterstep()
|
|
1910
|
+
>>> gts(5)
|
|
1911
|
+
>>> bm(4.0)
|
|
1912
|
+
>>> bnm(2.0)
|
|
1913
|
+
>>> hm(1.0)
|
|
1914
|
+
>>> hr(0.0)
|
|
1915
|
+
>>> derived.hrp.update()
|
|
1916
|
+
>>> states.h = 0.0, 0.9, 1.0, 1.1, 2.0
|
|
1917
|
+
>>> model.calc_rhm_v1()
|
|
1918
|
+
>>> model.calc_rhmdh_v1()
|
|
1919
|
+
>>> model.calc_rhv_v1()
|
|
1920
|
+
>>> model.calc_rhvdh_v1()
|
|
1921
|
+
>>> model.calc_wbm_v1()
|
|
1922
|
+
>>> aides.wbm
|
|
1923
|
+
wbm(4.0, 7.6, 8.0, 8.0, 8.0)
|
|
1924
|
+
|
|
1925
|
+
>>> from hydpy import NumericalDifferentiator
|
|
1926
|
+
>>> numdiff = NumericalDifferentiator(
|
|
1927
|
+
... xsequence=states.h,
|
|
1928
|
+
... ysequences=[aides.am],
|
|
1929
|
+
... methods=[model.calc_rhm_v1,
|
|
1930
|
+
... model.calc_rhv_v1,
|
|
1931
|
+
... model.calc_am_um_v1])
|
|
1932
|
+
>>> numdiff()
|
|
1933
|
+
d_am/d_h: 4.0, 7.6, 8.0, 8.0, 8.0
|
|
1934
|
+
|
|
1935
|
+
>>> hr(0.1)
|
|
1936
|
+
>>> derived.hrp.update()
|
|
1937
|
+
>>> model.calc_rhm_v1()
|
|
1938
|
+
>>> model.calc_rhmdh_v1()
|
|
1939
|
+
>>> model.calc_rhv_v1()
|
|
1940
|
+
>>> model.calc_rhvdh_v1()
|
|
1941
|
+
>>> model.calc_wbm_v1()
|
|
1942
|
+
>>> aides.wbm
|
|
1943
|
+
wbm(2.081965, 7.593774, 7.918034, 8.028465, 8.0)
|
|
1944
|
+
|
|
1945
|
+
>>> numdiff()
|
|
1946
|
+
d_am/d_h: 2.081965, 7.593774, 7.918034, 8.028465, 8.0
|
|
1947
|
+
"""
|
|
1948
|
+
|
|
1949
|
+
CONTROLPARAMETERS = (kinw_control.GTS, kinw_control.BM, kinw_control.BNM)
|
|
1950
|
+
FIXEDPARAMETERS = (kinw_fixed.WBMin, kinw_fixed.WBReg)
|
|
1951
|
+
REQUIREDSEQUENCES = (
|
|
1952
|
+
kinw_aides.RHM,
|
|
1953
|
+
kinw_aides.RHMDH,
|
|
1954
|
+
kinw_aides.RHV,
|
|
1955
|
+
kinw_aides.RHVDH,
|
|
1956
|
+
)
|
|
1957
|
+
RESULTSEQUENCES = (kinw_aides.WBM,)
|
|
1958
|
+
|
|
1959
|
+
@staticmethod
|
|
1960
|
+
def __call__(model: modeltools.Model) -> None:
|
|
1961
|
+
con = model.parameters.control.fastaccess
|
|
1962
|
+
fix = model.parameters.fixed.fastaccess
|
|
1963
|
+
aid = model.sequences.aides.fastaccess
|
|
1964
|
+
for i in range(con.gts):
|
|
1965
|
+
d_temp1 = aid.rhm[i] - aid.rhv[i]
|
|
1966
|
+
d_temp2 = aid.rhmdh[i] - aid.rhvdh[i]
|
|
1967
|
+
aid.wbm[i] = (
|
|
1968
|
+
con.bnm * d_temp1 * d_temp2
|
|
1969
|
+
+ con.bnm * 2.0 * d_temp2 * aid.rhv[i]
|
|
1970
|
+
+ (con.bm + con.bnm * d_temp1) * d_temp2
|
|
1971
|
+
+ (con.bm + con.bnm * 2.0 * d_temp1) * aid.rhvdh[i]
|
|
1972
|
+
)
|
|
1973
|
+
aid.wbm[i] = smoothutils.smooth_max1(fix.wbmin, aid.wbm[i], fix.wbreg)
|
|
1974
|
+
|
|
1975
|
+
|
|
1976
|
+
class Calc_WBLV_WBRV_V1(modeltools.Method):
|
|
1977
|
+
"""Calculate the water table width above both forelands.
|
|
1978
|
+
|
|
1979
|
+
Examples:
|
|
1980
|
+
|
|
1981
|
+
Due to :math:`WBV = \\frac{dAV}{dh}`, we can apply the class
|
|
1982
|
+
|NumericalDifferentiator| to validate the calculated water
|
|
1983
|
+
table widths:
|
|
1984
|
+
|
|
1985
|
+
>>> from hydpy.models.kinw import *
|
|
1986
|
+
>>> parameterstep()
|
|
1987
|
+
>>> gts(11)
|
|
1988
|
+
>>> bm(4.0)
|
|
1989
|
+
>>> bnm(2.0)
|
|
1990
|
+
>>> derived.bnvf.update()
|
|
1991
|
+
>>> hm(1.0)
|
|
1992
|
+
>>> bv(left=2.0, right=3.0)
|
|
1993
|
+
>>> bbv(left=10., right=40.)
|
|
1994
|
+
>>> bnv(left=10., right=20.)
|
|
1995
|
+
>>> derived.hv.update()
|
|
1996
|
+
>>> derived.hv
|
|
1997
|
+
hv(left=1.0, right=2.0)
|
|
1998
|
+
>>> hr(0.0)
|
|
1999
|
+
>>> derived.hrp.update()
|
|
2000
|
+
>>> states.h = 1.0, 1.5, 1.9, 2.0, 2.1, 2.5, 2.9, 3.0, 3.1, 3.5, 4.0
|
|
2001
|
+
>>> model.calc_rhv_v1()
|
|
2002
|
+
>>> model.calc_rhvdh_v1()
|
|
2003
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
2004
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
2005
|
+
>>> model.calc_wblv_wbrv_v1()
|
|
2006
|
+
>>> aides.wblv
|
|
2007
|
+
wblv(2.0, 7.0, 11.0, 12.0, 12.0, 12.0, 12.0, 12.0, 12.0, 12.0, 12.0)
|
|
2008
|
+
>>> aides.wbrv
|
|
2009
|
+
wbrv(3.0, 13.0, 21.0, 23.0, 25.0, 33.0, 41.0, 43.0, 43.0, 43.0, 43.0)
|
|
2010
|
+
|
|
2011
|
+
>>> from hydpy import NumericalDifferentiator
|
|
2012
|
+
>>> numdiff = NumericalDifferentiator(
|
|
2013
|
+
... xsequence=states.h,
|
|
2014
|
+
... ysequences=[aides.alv, aides.arv],
|
|
2015
|
+
... methods=[model.calc_rhv_v1,
|
|
2016
|
+
... model.calc_rhlvr_rhrvr_v1,
|
|
2017
|
+
... model.calc_alv_arv_ulv_urv_v1])
|
|
2018
|
+
>>> numdiff()
|
|
2019
|
+
d_alv/d_h: 2.0, 7.0, 11.0, 12.0, 12.0, 12.0, 12.0, 12.0, 12.0, \
|
|
2020
|
+
12.0, 12.0
|
|
2021
|
+
d_arv/d_h: 3.0, 13.0, 21.0, 23.0, 25.0, 33.0, 41.0, 43.0, 43.0, \
|
|
2022
|
+
43.0, 43.0
|
|
2023
|
+
|
|
2024
|
+
>>> hr(0.1)
|
|
2025
|
+
>>> derived.hrp.update()
|
|
2026
|
+
>>> model.calc_rhv_v1()
|
|
2027
|
+
>>> model.calc_rhvdh_v1()
|
|
2028
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
2029
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
2030
|
+
>>> model.calc_wblv_wbrv_v1()
|
|
2031
|
+
>>> aides.wblv
|
|
2032
|
+
wblv(1.204913, 6.998638, 10.984437, 11.795086, 12.071163, 12.000937,
|
|
2033
|
+
12.000002, 12.0, 12.0, 12.0, 12.0)
|
|
2034
|
+
>>> aides.wbrv
|
|
2035
|
+
wbrv(1.909826, 12.997489, 20.999995, 22.999999, 25.0, 33.0, 40.96888,
|
|
2036
|
+
42.590174, 43.142325, 43.001873, 43.000001)
|
|
2037
|
+
|
|
2038
|
+
>>> numdiff()
|
|
2039
|
+
d_alv/d_h: 1.204913, 6.998638, 10.984437, 11.795086, 12.071163, \
|
|
2040
|
+
12.000937, 12.000002, 12.0, 12.0, 12.0, 12.0
|
|
2041
|
+
d_arv/d_h: 1.909826, 12.997489, 20.999995, 22.999999, 25.0, 33.0, \
|
|
2042
|
+
40.96888, 42.590174, 43.142325, 43.001873, 43.000001
|
|
2043
|
+
"""
|
|
2044
|
+
|
|
2045
|
+
CONTROLPARAMETERS = (kinw_control.GTS, kinw_control.BV, kinw_control.BNV)
|
|
2046
|
+
REQUIREDSEQUENCES = (
|
|
2047
|
+
kinw_aides.RHV,
|
|
2048
|
+
kinw_aides.RHVDH,
|
|
2049
|
+
kinw_aides.RHLVR,
|
|
2050
|
+
kinw_aides.RHLVRDH,
|
|
2051
|
+
kinw_aides.RHRVR,
|
|
2052
|
+
kinw_aides.RHRVRDH,
|
|
2053
|
+
)
|
|
2054
|
+
RESULTSEQUENCES = (kinw_aides.WBLV, kinw_aides.WBRV)
|
|
2055
|
+
|
|
2056
|
+
@staticmethod
|
|
2057
|
+
def __call__(model: modeltools.Model) -> None:
|
|
2058
|
+
con = model.parameters.control.fastaccess
|
|
2059
|
+
aid = model.sequences.aides.fastaccess
|
|
2060
|
+
for i in range(con.gts):
|
|
2061
|
+
d_temp1 = aid.rhv[i] - aid.rhlvr[i]
|
|
2062
|
+
d_temp2 = aid.rhvdh[i] - aid.rhlvrdh[i]
|
|
2063
|
+
aid.wblv[i] = (
|
|
2064
|
+
con.bnv[0] * d_temp1 * d_temp2 / 2.0
|
|
2065
|
+
+ con.bnv[0] * d_temp2 * aid.rhlvr[i]
|
|
2066
|
+
+ (con.bnv[0] * d_temp1 / 2.0 + con.bv[0]) * d_temp2
|
|
2067
|
+
+ (con.bnv[0] * d_temp1 + con.bv[0]) * aid.rhlvrdh[i]
|
|
2068
|
+
)
|
|
2069
|
+
d_temp1 = aid.rhv[i] - aid.rhrvr[i]
|
|
2070
|
+
d_temp2 = aid.rhvdh[i] - aid.rhrvrdh[i]
|
|
2071
|
+
aid.wbrv[i] = (
|
|
2072
|
+
con.bnv[1] * d_temp1 * d_temp2 / 2.0
|
|
2073
|
+
+ con.bnv[1] * d_temp2 * aid.rhrvr[i]
|
|
2074
|
+
+ (con.bnv[1] * d_temp1 / 2.0 + con.bv[1]) * d_temp2
|
|
2075
|
+
+ (con.bnv[1] * d_temp1 + con.bv[1]) * aid.rhrvrdh[i]
|
|
2076
|
+
)
|
|
2077
|
+
|
|
2078
|
+
|
|
2079
|
+
class Calc_WBLVR_WBRVR_V1(modeltools.Method):
|
|
2080
|
+
"""Calculate the water table width above both outer embankments.
|
|
2081
|
+
|
|
2082
|
+
Examples:
|
|
2083
|
+
|
|
2084
|
+
Due to :math:`WBVR = \\frac{dAVR}{dh}`, we can apply the class
|
|
2085
|
+
|NumericalDifferentiator| to validate the calculated water
|
|
2086
|
+
table widths:
|
|
2087
|
+
|
|
2088
|
+
>>> from hydpy.models.kinw import *
|
|
2089
|
+
>>> parameterstep()
|
|
2090
|
+
>>> gts(11)
|
|
2091
|
+
>>> hm(1.0)
|
|
2092
|
+
>>> bnvr(left=4.0, right=5.0)
|
|
2093
|
+
>>> derived.bnvrf.update()
|
|
2094
|
+
>>> derived.hv(left=1.0, right=2.0)
|
|
2095
|
+
>>> hr(0.0)
|
|
2096
|
+
>>> derived.hrp.update()
|
|
2097
|
+
>>> states.h = 1.0, 1.5, 1.9, 2.0, 2.1, 2.5, 2.9, 3.0, 3.1, 3.5, 4.0
|
|
2098
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
2099
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
2100
|
+
>>> model.calc_wblvr_wbrvr_v1()
|
|
2101
|
+
>>> aides.wblvr
|
|
2102
|
+
wblvr(0.0, 0.0, 0.0, 0.0, 0.4, 2.0, 3.6, 4.0, 4.4, 6.0, 8.0)
|
|
2103
|
+
>>> aides.wbrvr
|
|
2104
|
+
wbrvr(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 2.5, 5.0)
|
|
2105
|
+
|
|
2106
|
+
>>> from hydpy import NumericalDifferentiator
|
|
2107
|
+
>>> numdiff = NumericalDifferentiator(
|
|
2108
|
+
... xsequence=states.h,
|
|
2109
|
+
... ysequences=[aides.alvr, aides.arvr],
|
|
2110
|
+
... methods=[model.calc_rhlvr_rhrvr_v1,
|
|
2111
|
+
... model.calc_alvr_arvr_ulvr_urvr_v1])
|
|
2112
|
+
>>> numdiff()
|
|
2113
|
+
d_alvr/d_h: 0.0, 0.0, 0.0, 0.0, 0.4, 2.0, 3.6, 4.0, 4.4, 6.0, 8.0
|
|
2114
|
+
d_arvr/d_h: 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 2.5, 5.0
|
|
2115
|
+
|
|
2116
|
+
>>> hr(0.1)
|
|
2117
|
+
>>> derived.hrp.update()
|
|
2118
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
2119
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
2120
|
+
>>> model.calc_wblvr_wbrvr_v1()
|
|
2121
|
+
>>> aides.wblvr
|
|
2122
|
+
wblvr(0.0, 0.0, 0.006224, 0.081965, 0.371535, 1.999625, 3.599999, 4.0,
|
|
2123
|
+
4.4, 6.0, 8.0)
|
|
2124
|
+
>>> aides.wbrvr
|
|
2125
|
+
wbrvr(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00778, 0.102457, 0.464419,
|
|
2126
|
+
2.499532, 5.0)
|
|
2127
|
+
|
|
2128
|
+
>>> numdiff()
|
|
2129
|
+
d_alvr/d_h: 0.0, 0.0, 0.006224, 0.081965, 0.371535, 1.999625, \
|
|
2130
|
+
3.599999, 4.0, 4.4, 6.0, 8.0
|
|
2131
|
+
d_arvr/d_h: 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00778, 0.102457, \
|
|
2132
|
+
0.464419, 2.499532, 5.0
|
|
2133
|
+
"""
|
|
2134
|
+
|
|
2135
|
+
CONTROLPARAMETERS = (kinw_control.GTS, kinw_control.BNVR)
|
|
2136
|
+
REQUIREDSEQUENCES = (
|
|
2137
|
+
kinw_aides.RHLVR,
|
|
2138
|
+
kinw_aides.RHLVRDH,
|
|
2139
|
+
kinw_aides.RHRVR,
|
|
2140
|
+
kinw_aides.RHRVRDH,
|
|
2141
|
+
)
|
|
2142
|
+
RESULTSEQUENCES = (kinw_aides.WBLVR, kinw_aides.WBRVR)
|
|
2143
|
+
|
|
2144
|
+
@staticmethod
|
|
2145
|
+
def __call__(model: modeltools.Model) -> None:
|
|
2146
|
+
con = model.parameters.control.fastaccess
|
|
2147
|
+
aid = model.sequences.aides.fastaccess
|
|
2148
|
+
for i in range(con.gts):
|
|
2149
|
+
aid.wblvr[i] = con.bnvr[0] * aid.rhlvr[i] * aid.rhlvrdh[i]
|
|
2150
|
+
aid.wbrvr[i] = con.bnvr[1] * aid.rhrvr[i] * aid.rhrvrdh[i]
|
|
2151
|
+
|
|
2152
|
+
|
|
2153
|
+
class Calc_WBG_V1(modeltools.Method):
|
|
2154
|
+
"""Calculate the water level width of the total cross-section.
|
|
2155
|
+
|
|
2156
|
+
Basic equation:
|
|
2157
|
+
:math:`WBG = WBM+WLV+WRV+WLVR+WRVR`
|
|
2158
|
+
|
|
2159
|
+
Example:
|
|
2160
|
+
|
|
2161
|
+
>>> from hydpy.models.kinw import *
|
|
2162
|
+
>>> parameterstep()
|
|
2163
|
+
>>> gts(2)
|
|
2164
|
+
>>> aides.wbm = 0.0, 1.0
|
|
2165
|
+
>>> aides.wblv = 2.0, 4.0
|
|
2166
|
+
>>> aides.wbrv = 3.0, 5.0
|
|
2167
|
+
>>> aides.wblvr = 6.0, 8.0
|
|
2168
|
+
>>> aides.wbrvr = 7.0, 9.0
|
|
2169
|
+
>>> model.calc_wbg_v1()
|
|
2170
|
+
>>> aides.wbg
|
|
2171
|
+
wbg(18.0, 27.0)
|
|
2172
|
+
"""
|
|
2173
|
+
|
|
2174
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
2175
|
+
REQUIREDSEQUENCES = (
|
|
2176
|
+
kinw_aides.WBM,
|
|
2177
|
+
kinw_aides.WBLV,
|
|
2178
|
+
kinw_aides.WBRV,
|
|
2179
|
+
kinw_aides.WBLVR,
|
|
2180
|
+
kinw_aides.WBRVR,
|
|
2181
|
+
)
|
|
2182
|
+
RESULTSEQUENCES = (kinw_aides.WBG,)
|
|
2183
|
+
|
|
2184
|
+
@staticmethod
|
|
2185
|
+
def __call__(model: modeltools.Model) -> None:
|
|
2186
|
+
con = model.parameters.control.fastaccess
|
|
2187
|
+
aid = model.sequences.aides.fastaccess
|
|
2188
|
+
for i in range(con.gts):
|
|
2189
|
+
aid.wbg[i] = (
|
|
2190
|
+
aid.wbm[i] + aid.wblv[i] + aid.wbrv[i] + aid.wblvr[i] + aid.wbrvr[i]
|
|
2191
|
+
)
|
|
2192
|
+
|
|
2193
|
+
|
|
2194
|
+
class Calc_DH_V1(modeltools.Method):
|
|
2195
|
+
"""Determine the change in the stage.
|
|
2196
|
+
|
|
2197
|
+
Basic equation:
|
|
2198
|
+
:math:`DH = \\frac{QG_{i-1}-QG_i}{WBG \\cdot 1000 \\cdot Laen / GTS}`
|
|
2199
|
+
|
|
2200
|
+
Example:
|
|
2201
|
+
|
|
2202
|
+
>>> from hydpy.models.kinw import *
|
|
2203
|
+
>>> parameterstep()
|
|
2204
|
+
>>> laen(10.0)
|
|
2205
|
+
>>> gts(5)
|
|
2206
|
+
>>> aides.wbg(3.0, 3.5, 4.0, 3.5, 3.0)
|
|
2207
|
+
>>> fluxes.qz = 1.0
|
|
2208
|
+
>>> fluxes.qg = 2.0, 3.0, 4.0, 3.0, 2.0
|
|
2209
|
+
>>> model.calc_dh_v1()
|
|
2210
|
+
>>> fluxes.dh
|
|
2211
|
+
dh(-0.000167, -0.000143, -0.000125, 0.000143, 0.000167)
|
|
2212
|
+
"""
|
|
2213
|
+
|
|
2214
|
+
CONTROLPARAMETERS = (kinw_control.Laen, kinw_control.GTS)
|
|
2215
|
+
REQUIREDSEQUENCES = (kinw_fluxes.QZ, kinw_fluxes.QG, kinw_aides.WBG)
|
|
2216
|
+
RESULTSEQUENCES = (kinw_fluxes.DH,)
|
|
2217
|
+
|
|
2218
|
+
@staticmethod
|
|
2219
|
+
def __call__(model: modeltools.Model) -> None:
|
|
2220
|
+
con = model.parameters.control.fastaccess
|
|
2221
|
+
flu = model.sequences.fluxes.fastaccess
|
|
2222
|
+
aid = model.sequences.aides.fastaccess
|
|
2223
|
+
for i in range(con.gts):
|
|
2224
|
+
if i:
|
|
2225
|
+
d_qz = flu.qg[i - 1]
|
|
2226
|
+
else:
|
|
2227
|
+
d_qz = flu.qz
|
|
2228
|
+
flu.dh[i] = (d_qz - flu.qg[i]) / (1000.0 * con.laen / con.gts * aid.wbg[i])
|
|
2229
|
+
|
|
2230
|
+
|
|
2231
|
+
class Update_H_V1(modeltools.Method):
|
|
2232
|
+
"""Update the stage.
|
|
2233
|
+
|
|
2234
|
+
Basic equation:
|
|
2235
|
+
:math:`\\frac{dH}{dt} = DH`
|
|
2236
|
+
|
|
2237
|
+
Example:
|
|
2238
|
+
|
|
2239
|
+
>>> from hydpy.models.kinw import *
|
|
2240
|
+
>>> parameterstep()
|
|
2241
|
+
>>> gts(5)
|
|
2242
|
+
>>> derived.sek(60*60)
|
|
2243
|
+
>>> fluxes.dh = -0.12, -0.1, -0.09, 0.1, 0.12
|
|
2244
|
+
>>> fluxes.dh /= 60*60
|
|
2245
|
+
>>> states.h(1.0, 1.2, 1.3, 1.2, 1.0)
|
|
2246
|
+
>>> model.update_h_v1()
|
|
2247
|
+
>>> states.h
|
|
2248
|
+
h(0.88, 1.1, 1.21, 1.3, 1.12)
|
|
2249
|
+
"""
|
|
2250
|
+
|
|
2251
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
2252
|
+
DERIVEDPARAMETERS = (kinw_derived.Sek,)
|
|
2253
|
+
REQUIREDSEQUENCES = (kinw_fluxes.DH,)
|
|
2254
|
+
UPDATEDSEQUENCES = (kinw_states.H,)
|
|
2255
|
+
|
|
2256
|
+
@staticmethod
|
|
2257
|
+
def __call__(model: modeltools.Model) -> None:
|
|
2258
|
+
con = model.parameters.control.fastaccess
|
|
2259
|
+
der = model.parameters.derived.fastaccess
|
|
2260
|
+
flu = model.sequences.fluxes.fastaccess
|
|
2261
|
+
old = model.sequences.states.fastaccess_old
|
|
2262
|
+
new = model.sequences.states.fastaccess_new
|
|
2263
|
+
for i in range(con.gts):
|
|
2264
|
+
new.h[i] = old.h[i] + der.sek * flu.dh[i]
|
|
2265
|
+
|
|
2266
|
+
|
|
2267
|
+
class Update_VG_V1(modeltools.Method):
|
|
2268
|
+
"""Update the water volume.
|
|
2269
|
+
|
|
2270
|
+
Basic equation:
|
|
2271
|
+
:math:`\\frac{dV}{dt} = QG_{i-1}-QG_i`
|
|
2272
|
+
|
|
2273
|
+
Example:
|
|
2274
|
+
|
|
2275
|
+
>>> from hydpy.models.kinw import *
|
|
2276
|
+
>>> parameterstep()
|
|
2277
|
+
>>> gts(5)
|
|
2278
|
+
>>> derived.sek(60*60)
|
|
2279
|
+
>>> states.vg(1.0, 1.2, 1.3, 1.2, 1.0)
|
|
2280
|
+
>>> fluxes.qza = 1.0
|
|
2281
|
+
>>> fluxes.qg = 3.0, 2.0, 4.0, 3.0, 5.0
|
|
2282
|
+
>>> model.update_vg_v1()
|
|
2283
|
+
>>> states.vg
|
|
2284
|
+
vg(0.9928, 1.2036, 1.2928, 1.2036, 0.9928)
|
|
2285
|
+
"""
|
|
2286
|
+
|
|
2287
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
2288
|
+
DERIVEDPARAMETERS = (kinw_derived.Sek,)
|
|
2289
|
+
REQUIREDSEQUENCES = (kinw_fluxes.QZA, kinw_fluxes.QG)
|
|
2290
|
+
UPDATEDSEQUENCES = (kinw_states.VG,)
|
|
2291
|
+
|
|
2292
|
+
@staticmethod
|
|
2293
|
+
def __call__(model: modeltools.Model) -> None:
|
|
2294
|
+
con = model.parameters.control.fastaccess
|
|
2295
|
+
der = model.parameters.derived.fastaccess
|
|
2296
|
+
flu = model.sequences.fluxes.fastaccess
|
|
2297
|
+
old = model.sequences.states.fastaccess_old
|
|
2298
|
+
new = model.sequences.states.fastaccess_new
|
|
2299
|
+
for i in range(con.gts):
|
|
2300
|
+
if i:
|
|
2301
|
+
new.vg[i] = old.vg[i] + der.sek * (flu.qg[i - 1] - flu.qg[i]) / 1e6
|
|
2302
|
+
else:
|
|
2303
|
+
new.vg[i] = old.vg[i] + der.sek * (flu.qza - flu.qg[i]) / 1e6
|
|
2304
|
+
|
|
2305
|
+
|
|
2306
|
+
class Calc_QA_V1(modeltools.Method):
|
|
2307
|
+
"""Query the actual outflow.
|
|
2308
|
+
|
|
2309
|
+
Examples:
|
|
2310
|
+
|
|
2311
|
+
>>> from hydpy.models.kinw import *
|
|
2312
|
+
>>> parameterstep()
|
|
2313
|
+
>>> gts(3)
|
|
2314
|
+
>>> fluxes.qz = 1.0
|
|
2315
|
+
>>> fluxes.qg = 2.0, 3.0, 4.0
|
|
2316
|
+
>>> model.calc_qa_v1()
|
|
2317
|
+
>>> fluxes.qa
|
|
2318
|
+
qa(4.0)
|
|
2319
|
+
>>> gts(0)
|
|
2320
|
+
>>> model.calc_qa_v1()
|
|
2321
|
+
>>> fluxes.qa
|
|
2322
|
+
qa(1.0)
|
|
2323
|
+
"""
|
|
2324
|
+
|
|
2325
|
+
CONTROLPARAMETERS = (kinw_control.GTS,)
|
|
2326
|
+
REQUIREDSEQUENCES = (kinw_fluxes.QZ, kinw_fluxes.QG)
|
|
2327
|
+
RESULTSEQUENCES = (kinw_fluxes.QA,)
|
|
2328
|
+
|
|
2329
|
+
@staticmethod
|
|
2330
|
+
def __call__(model: modeltools.Model) -> None:
|
|
2331
|
+
con = model.parameters.control.fastaccess
|
|
2332
|
+
flu = model.sequences.fluxes.fastaccess
|
|
2333
|
+
if con.gts > 0:
|
|
2334
|
+
flu.qa = flu.qg[con.gts - 1]
|
|
2335
|
+
else:
|
|
2336
|
+
flu.qa = flu.qz
|
|
2337
|
+
|
|
2338
|
+
|
|
2339
|
+
class Pass_Q_V1(modeltools.Method):
|
|
2340
|
+
"""Pass the outflow to the outlet node."""
|
|
2341
|
+
|
|
2342
|
+
REQUIREDSEQUENCES = (kinw_fluxes.QA,)
|
|
2343
|
+
RESULTSEQUENCES = (kinw_outlets.Q,)
|
|
2344
|
+
|
|
2345
|
+
@staticmethod
|
|
2346
|
+
def __call__(model: modeltools.Model) -> None:
|
|
2347
|
+
flu = model.sequences.fluxes.fastaccess
|
|
2348
|
+
out = model.sequences.outlets.fastaccess
|
|
2349
|
+
out.q[0] += flu.qa
|
|
2350
|
+
|
|
2351
|
+
|
|
2352
|
+
class Return_QF_V1(modeltools.Method):
|
|
2353
|
+
"""Calculate and return the "error" between the actual discharge and the
|
|
2354
|
+
discharge corresponding to the given water stage.
|
|
2355
|
+
|
|
2356
|
+
Basic equation:
|
|
2357
|
+
:math:`Q(H) - QG_0`
|
|
2358
|
+
|
|
2359
|
+
Method |Return_QF_V1| is a helper function not intended for performing
|
|
2360
|
+
simulation runs but for easing the implementation of method
|
|
2361
|
+
|kinw_williams.Model.calculate_characteristiclength| of application model
|
|
2362
|
+
|kinw_williams| (and similar functionalities). More specifically, it
|
|
2363
|
+
defines the target function for the iterative root search triggered by
|
|
2364
|
+
method |Return_H_V1|.
|
|
2365
|
+
|
|
2366
|
+
While method |Return_QF_V1| performs discharge calculations for all
|
|
2367
|
+
stream subsections, it evaluates only those of the first subsection.
|
|
2368
|
+
Accordingly, to avoid wasting computation time, one should not initialise
|
|
2369
|
+
more than one subsection before calling method |Return_QF_V1| (or methods
|
|
2370
|
+
|Return_H_V1| or |kinw_williams.Model.calculate_characteristiclength|).
|
|
2371
|
+
|
|
2372
|
+
Example:
|
|
2373
|
+
|
|
2374
|
+
We reuse the example given in the main documentation on module |kinw_williams|:
|
|
2375
|
+
|
|
2376
|
+
>>> from hydpy.models.kinw import *
|
|
2377
|
+
>>> parameterstep("1d")
|
|
2378
|
+
>>> simulationstep("30m")
|
|
2379
|
+
|
|
2380
|
+
>>> gts(1)
|
|
2381
|
+
>>> laen(100.0)
|
|
2382
|
+
>>> gef(0.00025)
|
|
2383
|
+
>>> bm(15.0)
|
|
2384
|
+
>>> bnm(5.0)
|
|
2385
|
+
>>> skm(1.0/0.035)
|
|
2386
|
+
>>> hm(6.0)
|
|
2387
|
+
>>> bv(100.0)
|
|
2388
|
+
>>> bbv(20.0)
|
|
2389
|
+
>>> bnv(10.0)
|
|
2390
|
+
>>> bnvr(100.0)
|
|
2391
|
+
>>> skv(10.0)
|
|
2392
|
+
>>> ekm(1.0)
|
|
2393
|
+
>>> ekv(1.0)
|
|
2394
|
+
>>> hr(0.1)
|
|
2395
|
+
>>> parameters.update()
|
|
2396
|
+
|
|
2397
|
+
A water stage of 1 m results in a discharge of 7.7 m³/s:
|
|
2398
|
+
|
|
2399
|
+
>>> states.h = 1.0
|
|
2400
|
+
>>> model.calc_rhm_v1()
|
|
2401
|
+
>>> model.calc_rhmdh_v1()
|
|
2402
|
+
>>> model.calc_rhv_v1()
|
|
2403
|
+
>>> model.calc_rhvdh_v1()
|
|
2404
|
+
>>> model.calc_rhlvr_rhrvr_v1()
|
|
2405
|
+
>>> model.calc_rhlvrdh_rhrvrdh_v1()
|
|
2406
|
+
>>> model.calc_am_um_v1()
|
|
2407
|
+
>>> model.calc_alv_arv_ulv_urv_v1()
|
|
2408
|
+
>>> model.calc_alvr_arvr_ulvr_urvr_v1()
|
|
2409
|
+
>>> model.calc_qm_v1()
|
|
2410
|
+
>>> model.calc_qlv_qrv_v1()
|
|
2411
|
+
>>> model.calc_qlvr_qrvr_v1()
|
|
2412
|
+
>>> model.calc_ag_v1()
|
|
2413
|
+
>>> model.calc_qg_v1()
|
|
2414
|
+
>>> fluxes.qg
|
|
2415
|
+
qg(7.745345)
|
|
2416
|
+
|
|
2417
|
+
The calculated |QG| value serves as the "true" value. Now, when
|
|
2418
|
+
passing stage values of 0.5 and 1.0 m, method |Return_QF_V1|
|
|
2419
|
+
calculates the corresponding discharge values and returns the
|
|
2420
|
+
"errors" -5.5 m³/s (a stage of 0.5 m results in a too-small discharge
|
|
2421
|
+
value) and 0.0 m³/s (1.0 m is the "true" stage), respectively:
|
|
2422
|
+
|
|
2423
|
+
>>> from hydpy import round_
|
|
2424
|
+
>>> round_(model.return_qf_v1(0.5))
|
|
2425
|
+
-5.474691
|
|
2426
|
+
>>> round_(model.return_qf_v1(1.0))
|
|
2427
|
+
0.0
|
|
2428
|
+
|
|
2429
|
+
Note that method |Return_QF_V1| does not overwrite the first
|
|
2430
|
+
entry of |QG|, which would complicate its application within
|
|
2431
|
+
an iterative approach.
|
|
2432
|
+
|
|
2433
|
+
Technical checks:
|
|
2434
|
+
|
|
2435
|
+
Note that method |Return_QF_V1| calculates the value of sequence |QG|
|
|
2436
|
+
temporarily and resets it afterwards, and calculates all other values of the
|
|
2437
|
+
mentioned sequences without resetting:
|
|
2438
|
+
|
|
2439
|
+
>>> from hydpy.core.testtools import check_selectedvariables
|
|
2440
|
+
>>> from hydpy.models.kinw.kinw_model import Return_QF_V1
|
|
2441
|
+
>>> print(check_selectedvariables(Return_QF_V1))
|
|
2442
|
+
Definitely missing: qg
|
|
2443
|
+
Possibly missing (REQUIREDSEQUENCES):
|
|
2444
|
+
Calc_RHM_V1: H
|
|
2445
|
+
Calc_RHMDH_V1: H
|
|
2446
|
+
Calc_RHV_V1: H
|
|
2447
|
+
Calc_RHVDH_V1: H
|
|
2448
|
+
Calc_RHLVR_RHRVR_V1: H
|
|
2449
|
+
Calc_RHLVRDH_RHRVRDH_V1: H
|
|
2450
|
+
Calc_AM_UM_V1: RHM and RHV
|
|
2451
|
+
Calc_ALV_ARV_ULV_URV_V1: RHV, RHLVR, and RHRVR
|
|
2452
|
+
Calc_ALVR_ARVR_ULVR_URVR_V1: RHLVR and RHRVR
|
|
2453
|
+
Calc_QM_V1: AM and UM
|
|
2454
|
+
Calc_QLV_QRV_V1: ALV, ARV, ULV, and URV
|
|
2455
|
+
Calc_QLVR_QRVR_V1: ALVR, ARVR, ULVR, and URVR
|
|
2456
|
+
Calc_AG_V1: AM, ALV, ARV, ALVR, and ARVR
|
|
2457
|
+
Calc_QG_V1: QM, QLV, QRV, QLVR, and QRVR
|
|
2458
|
+
Possibly missing (RESULTSEQUENCES):
|
|
2459
|
+
Calc_QG_V1: QG
|
|
2460
|
+
"""
|
|
2461
|
+
|
|
2462
|
+
SUBMETHODS = (
|
|
2463
|
+
Calc_RHM_V1,
|
|
2464
|
+
Calc_RHMDH_V1,
|
|
2465
|
+
Calc_RHV_V1,
|
|
2466
|
+
Calc_RHVDH_V1,
|
|
2467
|
+
Calc_RHLVR_RHRVR_V1,
|
|
2468
|
+
Calc_RHLVRDH_RHRVRDH_V1,
|
|
2469
|
+
Calc_AM_UM_V1,
|
|
2470
|
+
Calc_ALV_ARV_ULV_URV_V1,
|
|
2471
|
+
Calc_ALVR_ARVR_ULVR_URVR_V1,
|
|
2472
|
+
Calc_QM_V1,
|
|
2473
|
+
Calc_QLV_QRV_V1,
|
|
2474
|
+
Calc_QLVR_QRVR_V1,
|
|
2475
|
+
Calc_AG_V1,
|
|
2476
|
+
Calc_QG_V1,
|
|
2477
|
+
)
|
|
2478
|
+
CONTROLPARAMETERS = (
|
|
2479
|
+
kinw_control.GTS,
|
|
2480
|
+
kinw_control.HM,
|
|
2481
|
+
kinw_control.BM,
|
|
2482
|
+
kinw_control.BNM,
|
|
2483
|
+
kinw_control.BV,
|
|
2484
|
+
kinw_control.BNV,
|
|
2485
|
+
kinw_control.BNVR,
|
|
2486
|
+
)
|
|
2487
|
+
DERIVEDPARAMETERS = (
|
|
2488
|
+
kinw_derived.HV,
|
|
2489
|
+
kinw_derived.HRP,
|
|
2490
|
+
kinw_derived.BNMF,
|
|
2491
|
+
kinw_derived.BNVF,
|
|
2492
|
+
kinw_derived.BNVRF,
|
|
2493
|
+
kinw_derived.MFM,
|
|
2494
|
+
kinw_derived.MFV,
|
|
2495
|
+
)
|
|
2496
|
+
RESULTSEQUENCES = (
|
|
2497
|
+
kinw_states.H,
|
|
2498
|
+
kinw_aides.RHM,
|
|
2499
|
+
kinw_aides.RHMDH,
|
|
2500
|
+
kinw_aides.RHV,
|
|
2501
|
+
kinw_aides.RHVDH,
|
|
2502
|
+
kinw_aides.RHLVR,
|
|
2503
|
+
kinw_aides.RHRVR,
|
|
2504
|
+
kinw_aides.RHLVRDH,
|
|
2505
|
+
kinw_aides.RHRVRDH,
|
|
2506
|
+
kinw_aides.AM,
|
|
2507
|
+
kinw_aides.UM,
|
|
2508
|
+
kinw_aides.ALV,
|
|
2509
|
+
kinw_aides.ARV,
|
|
2510
|
+
kinw_aides.ULV,
|
|
2511
|
+
kinw_aides.URV,
|
|
2512
|
+
kinw_aides.ALVR,
|
|
2513
|
+
kinw_aides.ARVR,
|
|
2514
|
+
kinw_aides.ULVR,
|
|
2515
|
+
kinw_aides.URVR,
|
|
2516
|
+
kinw_aides.QM,
|
|
2517
|
+
kinw_aides.QLV,
|
|
2518
|
+
kinw_aides.QRV,
|
|
2519
|
+
kinw_aides.QLVR,
|
|
2520
|
+
kinw_aides.QRVR,
|
|
2521
|
+
kinw_aides.AG,
|
|
2522
|
+
)
|
|
2523
|
+
|
|
2524
|
+
@staticmethod
|
|
2525
|
+
def __call__(model: modeltools.Model, h: float) -> float:
|
|
2526
|
+
flu = model.sequences.fluxes.fastaccess
|
|
2527
|
+
sta = model.sequences.states.fastaccess
|
|
2528
|
+
d_qg = flu.qg[0]
|
|
2529
|
+
sta.h[0] = h
|
|
2530
|
+
model.calc_rhm_v1()
|
|
2531
|
+
model.calc_rhmdh_v1()
|
|
2532
|
+
model.calc_rhv_v1()
|
|
2533
|
+
model.calc_rhvdh_v1()
|
|
2534
|
+
model.calc_rhlvr_rhrvr_v1()
|
|
2535
|
+
model.calc_rhlvrdh_rhrvrdh_v1()
|
|
2536
|
+
model.calc_am_um_v1()
|
|
2537
|
+
model.calc_alv_arv_ulv_urv_v1()
|
|
2538
|
+
model.calc_alvr_arvr_ulvr_urvr_v1()
|
|
2539
|
+
model.calc_qm_v1()
|
|
2540
|
+
model.calc_qlv_qrv_v1()
|
|
2541
|
+
model.calc_qlvr_qrvr_v1()
|
|
2542
|
+
model.calc_ag_v1()
|
|
2543
|
+
model.calc_qg_v1()
|
|
2544
|
+
d_error = flu.qg[0] - d_qg
|
|
2545
|
+
flu.qg[0] = d_qg
|
|
2546
|
+
return d_error
|
|
2547
|
+
|
|
2548
|
+
|
|
2549
|
+
class Return_H_V1(modeltools.Method):
|
|
2550
|
+
"""Calculate and return the water stage corresponding to the current
|
|
2551
|
+
discharge value.
|
|
2552
|
+
|
|
2553
|
+
Method |Return_H_V1| is a helper function not for performing simulation runs but
|
|
2554
|
+
for easing the implementation of method
|
|
2555
|
+
|kinw_williams.Model.calculate_characteristiclength| of application model
|
|
2556
|
+
|kinw_williams| (or similar functionalities). It performs a root search by
|
|
2557
|
+
applying the |Pegasus| method implemented in module `rootutils` on the target
|
|
2558
|
+
method |Return_QF_V1|. Hence, please see the additional application notes in the
|
|
2559
|
+
documentation on method |Return_QF_V1|.
|
|
2560
|
+
|
|
2561
|
+
Example:
|
|
2562
|
+
|
|
2563
|
+
We recreate the exact parameterisation as in the example of the
|
|
2564
|
+
documentation on method |Return_QF_V1|:
|
|
2565
|
+
|
|
2566
|
+
>>> from hydpy.models.kinw import *
|
|
2567
|
+
>>> simulationstep("30m")
|
|
2568
|
+
>>> parameterstep()
|
|
2569
|
+
|
|
2570
|
+
>>> gts(1)
|
|
2571
|
+
>>> laen(100.0)
|
|
2572
|
+
>>> gef(0.00025)
|
|
2573
|
+
>>> bm(15.0)
|
|
2574
|
+
>>> bnm(5.0)
|
|
2575
|
+
>>> skm(1.0/0.035)
|
|
2576
|
+
>>> hm(6.0)
|
|
2577
|
+
>>> bv(100.0)
|
|
2578
|
+
>>> bbv(20.0)
|
|
2579
|
+
>>> bnv(10.0)
|
|
2580
|
+
>>> bnvr(100.0)
|
|
2581
|
+
>>> skv(10.0)
|
|
2582
|
+
>>> ekm(1.0)
|
|
2583
|
+
>>> ekv(1.0)
|
|
2584
|
+
>>> hr(0.1)
|
|
2585
|
+
>>> parameters.update()
|
|
2586
|
+
|
|
2587
|
+
For a given discharge value of 7.7 m³/s (discussed in the documentation
|
|
2588
|
+
on method |Return_QF_V1|), method |Return_H_V1| correctly determines
|
|
2589
|
+
the water stage of 1 m:
|
|
2590
|
+
|
|
2591
|
+
>>> fluxes.qg = 7.745345
|
|
2592
|
+
>>> from hydpy import print_vector, round_
|
|
2593
|
+
>>> round_(model.return_h_v1())
|
|
2594
|
+
1.0
|
|
2595
|
+
|
|
2596
|
+
To evaluate our implementation's reliability, we search for water stages
|
|
2597
|
+
covering an extensive range of discharge values. The last printed column
|
|
2598
|
+
shows that method |Return_H_V1| finds the correct water stage in all cases:
|
|
2599
|
+
|
|
2600
|
+
>>> import numpy
|
|
2601
|
+
>>> for q in [0.0]+list(numpy.logspace(-6, 6, 13)):
|
|
2602
|
+
... fluxes.qg = q
|
|
2603
|
+
... h = model.return_h_v1()
|
|
2604
|
+
... states.h = h
|
|
2605
|
+
... model.calc_rhm_v1()
|
|
2606
|
+
... model.calc_rhmdh_v1()
|
|
2607
|
+
... model.calc_rhv_v1()
|
|
2608
|
+
... model.calc_rhvdh_v1()
|
|
2609
|
+
... model.calc_rhlvr_rhrvr_v1()
|
|
2610
|
+
... model.calc_rhlvrdh_rhrvrdh_v1()
|
|
2611
|
+
... model.calc_am_um_v1()
|
|
2612
|
+
... model.calc_alv_arv_ulv_urv_v1()
|
|
2613
|
+
... model.calc_alvr_arvr_ulvr_urvr_v1()
|
|
2614
|
+
... model.calc_qm_v1()
|
|
2615
|
+
... model.calc_qlv_qrv_v1()
|
|
2616
|
+
... model.calc_qlvr_qrvr_v1()
|
|
2617
|
+
... model.calc_ag_v1()
|
|
2618
|
+
... model.calc_qg_v1()
|
|
2619
|
+
... error = fluxes.qg[0]-q
|
|
2620
|
+
... print_vector([q, h, error])
|
|
2621
|
+
0.0, -10.0, 0.0
|
|
2622
|
+
0.000001, -0.390737, 0.0
|
|
2623
|
+
0.00001, -0.308934, 0.0
|
|
2624
|
+
0.0001, -0.226779, 0.0
|
|
2625
|
+
0.001, -0.143209, 0.0
|
|
2626
|
+
0.01, -0.053833, 0.0
|
|
2627
|
+
0.1, 0.061356, 0.0
|
|
2628
|
+
1.0, 0.310079, 0.0
|
|
2629
|
+
10.0, 1.150307, 0.0
|
|
2630
|
+
100.0, 3.717833, 0.0
|
|
2631
|
+
1000.0, 9.108276, 0.0
|
|
2632
|
+
10000.0, 18.246131, 0.0
|
|
2633
|
+
100000.0, 37.330632, 0.0
|
|
2634
|
+
1000000.0, 81.363979, 0.0
|
|
2635
|
+
|
|
2636
|
+
Due to smoothing the water stage with respect to the channel bottom, small
|
|
2637
|
+
discharge values result in negative water stages. The lowest allowed stage
|
|
2638
|
+
is -10 m.
|
|
2639
|
+
|
|
2640
|
+
Through setting the regularisation parameter |HR| to zero (which we do not
|
|
2641
|
+
recommend), method |Return_H_V1| should return the non-negative water stages
|
|
2642
|
+
agreeing with the original, discontinuous Manning-Strickler equation:
|
|
2643
|
+
|
|
2644
|
+
>>> hr(0.0)
|
|
2645
|
+
>>> parameters.update()
|
|
2646
|
+
>>> for q in [0.0]+list(numpy.logspace(-6, 6, 13)):
|
|
2647
|
+
... fluxes.qg = q
|
|
2648
|
+
... h = model.return_h_v1()
|
|
2649
|
+
... states.h = h
|
|
2650
|
+
... model.calc_rhm_v1()
|
|
2651
|
+
... model.calc_rhmdh_v1()
|
|
2652
|
+
... model.calc_rhv_v1()
|
|
2653
|
+
... model.calc_rhvdh_v1()
|
|
2654
|
+
... model.calc_rhlvr_rhrvr_v1()
|
|
2655
|
+
... model.calc_rhlvrdh_rhrvrdh_v1()
|
|
2656
|
+
... model.calc_am_um_v1()
|
|
2657
|
+
... model.calc_alv_arv_ulv_urv_v1()
|
|
2658
|
+
... model.calc_alvr_arvr_ulvr_urvr_v1()
|
|
2659
|
+
... model.calc_qm_v1()
|
|
2660
|
+
... model.calc_qlv_qrv_v1()
|
|
2661
|
+
... model.calc_qlvr_qrvr_v1()
|
|
2662
|
+
... model.calc_ag_v1()
|
|
2663
|
+
... model.calc_qg_v1()
|
|
2664
|
+
... error = fluxes.qg[0]-q
|
|
2665
|
+
... print_vector([q, h, error])
|
|
2666
|
+
0.0, 0.0, 0.0
|
|
2667
|
+
0.000001, 0.00008, 0.0
|
|
2668
|
+
0.00001, 0.000317, 0.0
|
|
2669
|
+
0.0001, 0.001263, 0.0
|
|
2670
|
+
0.001, 0.005027, 0.0
|
|
2671
|
+
0.01, 0.019992, 0.0
|
|
2672
|
+
0.1, 0.079286, 0.0
|
|
2673
|
+
1.0, 0.31039, 0.0
|
|
2674
|
+
10.0, 1.150307, 0.0
|
|
2675
|
+
100.0, 3.717833, 0.0
|
|
2676
|
+
1000.0, 9.108276, 0.0
|
|
2677
|
+
10000.0, 18.246131, 0.0
|
|
2678
|
+
100000.0, 37.330632, 0.0
|
|
2679
|
+
1000000.0, 81.363979, 0.0
|
|
2680
|
+
"""
|
|
2681
|
+
|
|
2682
|
+
SUBMETHODS = (Return_QF_V1,)
|
|
2683
|
+
CONTROLPARAMETERS = (
|
|
2684
|
+
kinw_control.GTS,
|
|
2685
|
+
kinw_control.HM,
|
|
2686
|
+
kinw_control.BM,
|
|
2687
|
+
kinw_control.BNM,
|
|
2688
|
+
kinw_control.BV,
|
|
2689
|
+
kinw_control.BNV,
|
|
2690
|
+
kinw_control.BNVR,
|
|
2691
|
+
)
|
|
2692
|
+
DERIVEDPARAMETERS = (
|
|
2693
|
+
kinw_derived.HV,
|
|
2694
|
+
kinw_derived.HRP,
|
|
2695
|
+
kinw_derived.BNMF,
|
|
2696
|
+
kinw_derived.BNVF,
|
|
2697
|
+
kinw_derived.BNVRF,
|
|
2698
|
+
kinw_derived.MFM,
|
|
2699
|
+
kinw_derived.MFV,
|
|
2700
|
+
)
|
|
2701
|
+
RESULTSEQUENCES = (
|
|
2702
|
+
kinw_states.H,
|
|
2703
|
+
kinw_aides.RHM,
|
|
2704
|
+
kinw_aides.RHMDH,
|
|
2705
|
+
kinw_aides.RHV,
|
|
2706
|
+
kinw_aides.RHVDH,
|
|
2707
|
+
kinw_aides.RHLVR,
|
|
2708
|
+
kinw_aides.RHRVR,
|
|
2709
|
+
kinw_aides.RHLVRDH,
|
|
2710
|
+
kinw_aides.RHRVRDH,
|
|
2711
|
+
kinw_aides.AM,
|
|
2712
|
+
kinw_aides.UM,
|
|
2713
|
+
kinw_aides.ALV,
|
|
2714
|
+
kinw_aides.ARV,
|
|
2715
|
+
kinw_aides.ULV,
|
|
2716
|
+
kinw_aides.URV,
|
|
2717
|
+
kinw_aides.ALVR,
|
|
2718
|
+
kinw_aides.ARVR,
|
|
2719
|
+
kinw_aides.ULVR,
|
|
2720
|
+
kinw_aides.URVR,
|
|
2721
|
+
kinw_aides.QM,
|
|
2722
|
+
kinw_aides.QLV,
|
|
2723
|
+
kinw_aides.QRV,
|
|
2724
|
+
kinw_aides.QLVR,
|
|
2725
|
+
kinw_aides.QRVR,
|
|
2726
|
+
kinw_aides.AG,
|
|
2727
|
+
)
|
|
2728
|
+
|
|
2729
|
+
@staticmethod
|
|
2730
|
+
def __call__(model: modeltools.Model) -> float:
|
|
2731
|
+
con = model.parameters.control.fastaccess
|
|
2732
|
+
return model.pegasush.find_x(0.0, 2.0 * con.hm, -10.0, 1000.0, 0.0, 1e-10, 1000)
|
|
2733
|
+
|
|
2734
|
+
|
|
2735
|
+
class PegasusH(roottools.Pegasus):
|
|
2736
|
+
"""Pegasus iterator for finding the correct water stage."""
|
|
2737
|
+
|
|
2738
|
+
METHODS = (Return_QF_V1,)
|
|
2739
|
+
|
|
2740
|
+
|
|
2741
|
+
class Model(modeltools.ELSModel):
|
|
2742
|
+
"""|kinw.DOCNAME.complete|."""
|
|
2743
|
+
|
|
2744
|
+
DOCNAME = modeltools.DocName(short="KinW")
|
|
2745
|
+
__HYDPY_ROOTMODEL__ = None
|
|
2746
|
+
|
|
2747
|
+
SOLVERPARAMETERS = (
|
|
2748
|
+
kinw_solver.AbsErrorMax,
|
|
2749
|
+
kinw_solver.RelErrorMax,
|
|
2750
|
+
kinw_solver.RelDTMin,
|
|
2751
|
+
kinw_solver.RelDTMax,
|
|
2752
|
+
)
|
|
2753
|
+
SOLVERSEQUENCES = ()
|
|
2754
|
+
INLET_METHODS = (Pick_Q_V1,)
|
|
2755
|
+
RECEIVER_METHODS = ()
|
|
2756
|
+
ADD_METHODS = (Return_QF_V1, Return_H_V1)
|
|
2757
|
+
PART_ODE_METHODS = (
|
|
2758
|
+
Calc_RHM_V1,
|
|
2759
|
+
Calc_RHMDH_V1,
|
|
2760
|
+
Calc_RHV_V1,
|
|
2761
|
+
Calc_RHVDH_V1,
|
|
2762
|
+
Calc_RHLVR_RHRVR_V1,
|
|
2763
|
+
Calc_RHLVRDH_RHRVRDH_V1,
|
|
2764
|
+
Calc_AM_UM_V1,
|
|
2765
|
+
Calc_AMDH_UMDH_V1,
|
|
2766
|
+
Calc_ALV_ARV_ULV_URV_V1,
|
|
2767
|
+
Calc_ALVDH_ARVDH_ULVDH_URVDH_V1,
|
|
2768
|
+
Calc_ALVR_ARVR_ULVR_URVR_V1,
|
|
2769
|
+
Calc_ALVRDH_ARVRDH_ULVRDH_URVRDH_V1,
|
|
2770
|
+
Calc_QM_V1,
|
|
2771
|
+
Calc_QMDH_V1,
|
|
2772
|
+
Calc_QM_V2,
|
|
2773
|
+
Calc_QLV_QRV_V1,
|
|
2774
|
+
Calc_QLVDH_QRVDH_V1,
|
|
2775
|
+
Calc_QLV_QRV_V2,
|
|
2776
|
+
Calc_QLVR_QRVR_V1,
|
|
2777
|
+
Calc_QLVRDH_QRVRDH_V1,
|
|
2778
|
+
Calc_QLVR_QRVR_V2,
|
|
2779
|
+
Calc_AG_V1,
|
|
2780
|
+
Calc_QG_V1,
|
|
2781
|
+
Calc_QG_V2,
|
|
2782
|
+
Calc_QA_V1,
|
|
2783
|
+
Calc_WBM_V1,
|
|
2784
|
+
Calc_WBLV_WBRV_V1,
|
|
2785
|
+
Calc_WBLVR_WBRVR_V1,
|
|
2786
|
+
Calc_WBG_V1,
|
|
2787
|
+
Calc_DH_V1,
|
|
2788
|
+
)
|
|
2789
|
+
FULL_ODE_METHODS = (Update_H_V1, Update_VG_V1)
|
|
2790
|
+
OUTLET_METHODS = (Pass_Q_V1,)
|
|
2791
|
+
SENDER_METHODS = ()
|
|
2792
|
+
SUBMODELINTERFACES = ()
|
|
2793
|
+
SUBMODELS = (PegasusH,)
|
|
2794
|
+
|
|
2795
|
+
|
|
2796
|
+
class BaseModelProfile(modeltools.ELSModel):
|
|
2797
|
+
"""Base class for |kinw.DOCNAME.long| models performing discharge calculations
|
|
2798
|
+
based on a triple trapezoid profile."""
|
|
2799
|
+
|
|
2800
|
+
def plot_profile(self, labelformat: str = "%.1f"):
|
|
2801
|
+
"""Plot the triple trapezoid profile and insert the discharge values at some
|
|
2802
|
+
distinct stages.
|
|
2803
|
+
|
|
2804
|
+
We reuse the second example given in the main documentation on module
|
|
2805
|
+
|kinw_williams|:
|
|
2806
|
+
|
|
2807
|
+
>>> from hydpy.models.kinw_williams import *
|
|
2808
|
+
>>> parameterstep("1d")
|
|
2809
|
+
>>> simulationstep("30m")
|
|
2810
|
+
>>> laen(100.0)
|
|
2811
|
+
>>> gef(0.00025)
|
|
2812
|
+
>>> bm(15.0)
|
|
2813
|
+
>>> bnm(5.0)
|
|
2814
|
+
>>> skm(1.0/0.035)
|
|
2815
|
+
>>> hm(6.0)
|
|
2816
|
+
>>> bv(100.0)
|
|
2817
|
+
>>> bbv(20.0)
|
|
2818
|
+
>>> bnv(10.0)
|
|
2819
|
+
>>> bnvr(100.0)
|
|
2820
|
+
>>> skv(10.0)
|
|
2821
|
+
>>> ekm(1.0)
|
|
2822
|
+
>>> ekv(1.0)
|
|
2823
|
+
>>> hr(0.1)
|
|
2824
|
+
>>> gts(1)
|
|
2825
|
+
>>> parameters.update()
|
|
2826
|
+
|
|
2827
|
+
Calling method |BaseModelProfile.plot_profile| prepares the profile plot and,
|
|
2828
|
+
depending on your `matplotlib` configuration, eventually prints it directly on
|
|
2829
|
+
your screen:
|
|
2830
|
+
|
|
2831
|
+
>>> model.plot_profile()
|
|
2832
|
+
>>> from hydpy.core.testtools import save_autofig
|
|
2833
|
+
>>> save_autofig("kinw_plot_profile.png")
|
|
2834
|
+
|
|
2835
|
+
.. image:: kinw_plot_profile.png
|
|
2836
|
+
"""
|
|
2837
|
+
|
|
2838
|
+
class _XYs:
|
|
2839
|
+
def __init__(self):
|
|
2840
|
+
self._xs = [0.0]
|
|
2841
|
+
self._ys = [0.0]
|
|
2842
|
+
|
|
2843
|
+
def __iadd__(self, dxdy):
|
|
2844
|
+
self._xs.append(self._xs[-1] + dxdy[0])
|
|
2845
|
+
self._ys.append(self._ys[-1] + dxdy[1])
|
|
2846
|
+
return self
|
|
2847
|
+
|
|
2848
|
+
def __isub__(self, dxdy):
|
|
2849
|
+
self._xs.insert(0, self._xs[0] - dxdy[0])
|
|
2850
|
+
self._ys.insert(0, self._ys[0] + dxdy[1])
|
|
2851
|
+
return self
|
|
2852
|
+
|
|
2853
|
+
def __call__(self) -> tuple[list[float], list[float]]:
|
|
2854
|
+
return self._xs, self._ys
|
|
2855
|
+
|
|
2856
|
+
con = self.parameters.control
|
|
2857
|
+
der = self.parameters.derived
|
|
2858
|
+
hmax = 1.3 * (con.hm + max(der.hv.value))
|
|
2859
|
+
|
|
2860
|
+
xys = _XYs()
|
|
2861
|
+
xys += con.bm / 2.0, 0.0
|
|
2862
|
+
xys -= con.bm / 2.0, 0.0
|
|
2863
|
+
xys += con.hm * con.bnm, con.hm
|
|
2864
|
+
xys -= con.hm * con.bnm, con.hm
|
|
2865
|
+
xys += con.bv[1], 0.0
|
|
2866
|
+
xys -= con.bv[0], 0.0
|
|
2867
|
+
xys += der.hv[1] * con.bnv[1], der.hv[1]
|
|
2868
|
+
xys -= der.hv[0] * con.bnv[0], der.hv[0]
|
|
2869
|
+
dh = hmax - der.hv[1] - con.hm
|
|
2870
|
+
xys += dh * con.bnvr[1], dh
|
|
2871
|
+
dh = hmax - der.hv[0] - con.hm
|
|
2872
|
+
xys -= dh * con.bnvr[0], dh
|
|
2873
|
+
xs, ys = xys()
|
|
2874
|
+
pyplot.plot(xs, ys, color="r")
|
|
2875
|
+
|
|
2876
|
+
x0, x1 = min(xs), max(xs)
|
|
2877
|
+
y0, y1 = min(ys), max(ys)
|
|
2878
|
+
dy = (y1 - y0) / 80.0
|
|
2879
|
+
hs = [
|
|
2880
|
+
0.0,
|
|
2881
|
+
con.hm / 2.0,
|
|
2882
|
+
con.hm,
|
|
2883
|
+
con.hm + der.hv[0] / 2.0,
|
|
2884
|
+
con.hm + der.hv[0],
|
|
2885
|
+
con.hm + der.hv[1] / 2.0,
|
|
2886
|
+
con.hm + der.hv[1],
|
|
2887
|
+
(con.hm + der.hv[0] + hmax) / 2.0,
|
|
2888
|
+
(con.hm + der.hv[1] + hmax) / 2.0,
|
|
2889
|
+
hmax,
|
|
2890
|
+
]
|
|
2891
|
+
temp = []
|
|
2892
|
+
for h in hs:
|
|
2893
|
+
if h not in temp:
|
|
2894
|
+
temp.append(h)
|
|
2895
|
+
hs = sorted(temp)
|
|
2896
|
+
qs = self.calculate_qgvector(hs)
|
|
2897
|
+
for idx, (h, q) in enumerate(zip(hs, qs)):
|
|
2898
|
+
pyplot.plot([x0, x1], [h, h], "b:")
|
|
2899
|
+
text = f"{labelformat % q} m³/s"
|
|
2900
|
+
if idx % 2:
|
|
2901
|
+
pyplot.text(x0, h + dy, text, horizontalalignment="left")
|
|
2902
|
+
else:
|
|
2903
|
+
pyplot.text(x1, h + dy, text, horizontalalignment="right")
|
|
2904
|
+
|
|
2905
|
+
pyplot.title(f"Profile of model {objecttools.elementphrase(self)}")
|
|
2906
|
+
pyplot.ylabel("height above the channel bottom [m]")
|
|
2907
|
+
|
|
2908
|
+
def prepare_hvector(
|
|
2909
|
+
self,
|
|
2910
|
+
nmb: int = 1000,
|
|
2911
|
+
exp: float = 2.0,
|
|
2912
|
+
hmin: float | None = None,
|
|
2913
|
+
hmax: float | None = None,
|
|
2914
|
+
) -> tuple[float, ...]:
|
|
2915
|
+
"""Prepare a vector of the stage values.
|
|
2916
|
+
|
|
2917
|
+
The argument `nmb` defines the number of stage values, `exp` defines their
|
|
2918
|
+
spacing (1.0 results in equidistant values), and `hmin` and `hmax` the lowest
|
|
2919
|
+
and highest water stage, respectively:
|
|
2920
|
+
|
|
2921
|
+
>>> from hydpy.models.kinw_williams import *
|
|
2922
|
+
>>> parameterstep()
|
|
2923
|
+
>>> from hydpy import print_vector
|
|
2924
|
+
>>> print_vector(model.prepare_hvector(
|
|
2925
|
+
... nmb=10, hmin=-1.0, hmax=8, exp=1.0))
|
|
2926
|
+
-1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0
|
|
2927
|
+
|
|
2928
|
+
When not specified by the user, method
|
|
2929
|
+
|kinw_model.BaseModelProfile.prepare_hvector| determines `hmin` and `hmax`
|
|
2930
|
+
based on the current value of |HM| (-10 % and 300 %, respectively) and takes a
|
|
2931
|
+
higher sampling rate in the lower value range (by setting `exp` to two):
|
|
2932
|
+
|
|
2933
|
+
>>> hm(6.0)
|
|
2934
|
+
>>> print_vector(model.prepare_hvector(nmb=10))
|
|
2935
|
+
-0.6, -0.37037, 0.318519, 1.466667, 3.074074, 5.140741, 7.666667,
|
|
2936
|
+
10.651852, 14.096296, 18.0
|
|
2937
|
+
"""
|
|
2938
|
+
if hmin is None:
|
|
2939
|
+
hmin = -0.1 * self.parameters.control.hm
|
|
2940
|
+
if hmax is None:
|
|
2941
|
+
hmax = 3.0 * self.parameters.control.hm
|
|
2942
|
+
hs = numpy.linspace(0.0, 1.0, nmb) ** exp
|
|
2943
|
+
hs /= hs[-1]
|
|
2944
|
+
hs *= hmax - hmin
|
|
2945
|
+
hs += hmin
|
|
2946
|
+
return tuple(hs)
|
|
2947
|
+
|
|
2948
|
+
def calculate_qgvector(self, hvector: Iterable[float]) -> tuple[float, ...]:
|
|
2949
|
+
"""Calculate the discharge values (in m³/s) corresponding to the
|
|
2950
|
+
given stage vector.
|
|
2951
|
+
|
|
2952
|
+
We reuse the second example given in the main documentation on module
|
|
2953
|
+
|kinw_williams| also show the results of the similar methods
|
|
2954
|
+
|kinw_model.BaseModelProfile.calculate_agvector| and
|
|
2955
|
+
|kinw_model.BaseModelProfile.calculate_vgvector|:
|
|
2956
|
+
|
|
2957
|
+
>>> from hydpy.models.kinw_williams import *
|
|
2958
|
+
>>> parameterstep("1d")
|
|
2959
|
+
>>> simulationstep("30m")
|
|
2960
|
+
>>> laen(100.0)
|
|
2961
|
+
>>> gef(0.00025)
|
|
2962
|
+
>>> bm(15.0)
|
|
2963
|
+
>>> bnm(5.0)
|
|
2964
|
+
>>> skm(1.0/0.035)
|
|
2965
|
+
>>> hm(6.0)
|
|
2966
|
+
>>> bv(100.0)
|
|
2967
|
+
>>> bbv(20.0)
|
|
2968
|
+
>>> bnv(10.0)
|
|
2969
|
+
>>> bnvr(100.0)
|
|
2970
|
+
>>> skv(10.0)
|
|
2971
|
+
>>> ekm(1.0)
|
|
2972
|
+
>>> ekv(1.0)
|
|
2973
|
+
>>> hr(0.1)
|
|
2974
|
+
>>> gts(2)
|
|
2975
|
+
>>> parameters.update()
|
|
2976
|
+
|
|
2977
|
+
>>> from hydpy import print_vector
|
|
2978
|
+
>>> print_vector(model.calculate_qgvector([0.0, 1.0, 2.0]))
|
|
2979
|
+
0.033153, 7.745345, 28.436875
|
|
2980
|
+
>>> print_vector(model.calculate_agvector([0.0, 1.0, 2.0]))
|
|
2981
|
+
0.623138, 20.0, 50.0
|
|
2982
|
+
>>> print_vector(model.calculate_vgvector([0.0, 1.0, 2.0]))
|
|
2983
|
+
0.031157, 1.0, 2.5
|
|
2984
|
+
"""
|
|
2985
|
+
h_ = self.sequences.states.h.values.copy()
|
|
2986
|
+
qg = []
|
|
2987
|
+
try:
|
|
2988
|
+
for h in hvector:
|
|
2989
|
+
self.sequences.states.h = h
|
|
2990
|
+
self.calculate_single_terms()
|
|
2991
|
+
qg.append(self.sequences.fluxes.qg[0])
|
|
2992
|
+
return tuple(qg)
|
|
2993
|
+
finally:
|
|
2994
|
+
self.sequences.states.h(h_)
|
|
2995
|
+
|
|
2996
|
+
def calculate_agvector(self, hvector: Iterable[float]) -> tuple[float, ...]:
|
|
2997
|
+
"""Calculate the wetted cross-section areas (in m²) corresponding to the given
|
|
2998
|
+
vector of stage values.
|
|
2999
|
+
|
|
3000
|
+
See the documentation on method
|
|
3001
|
+
|kinw_model.BaseModelProfile.calculate_qgvector| for an example.
|
|
3002
|
+
"""
|
|
3003
|
+
h_ = self.sequences.states.h.values.copy()
|
|
3004
|
+
ag = []
|
|
3005
|
+
aid = self.sequences.aides
|
|
3006
|
+
try:
|
|
3007
|
+
for h in hvector:
|
|
3008
|
+
self.sequences.states.h = h
|
|
3009
|
+
self.calculate_single_terms()
|
|
3010
|
+
ag.append(
|
|
3011
|
+
aid.am[0] + aid.alv[0] + aid.arv[0] + aid.alvr[0] + aid.arvr[0]
|
|
3012
|
+
)
|
|
3013
|
+
return tuple(ag)
|
|
3014
|
+
finally:
|
|
3015
|
+
self.sequences.states.h(h_)
|
|
3016
|
+
|
|
3017
|
+
def calculate_vgvector(self, hvector: Iterable[float]) -> tuple[float, ...]:
|
|
3018
|
+
"""Calculate the water volume stored within a channel subsection (in Mio m³)
|
|
3019
|
+
corresponding to the given vector of stage values.
|
|
3020
|
+
|
|
3021
|
+
See the documentation on method
|
|
3022
|
+
|kinw_model.BaseModelProfile.calculate_qgvector| for an example.
|
|
3023
|
+
"""
|
|
3024
|
+
con = self.parameters.control
|
|
3025
|
+
ags = numpy.array(self.calculate_agvector(hvector))
|
|
3026
|
+
return tuple(con.laen / con.gts * 1000.0 * ags / 1e6)
|