Flow Regime

Functions to allow the basic StreamModel to be run across a range of flow values, and estimate frequency curves for nitrate concentrations based on the frequency curves for flow.

Function documentation

NitrateNetworkModel.FlowRegimeType
FlowRegime(
    q_gage::Vector{Float64},
    p_exceed::Vector{Float64},
    p_mass::Vector{Float64}
)

Input structure for evaluating StreamModel against multiple flow values. Single-link flow regime - values measured at gaged link.

source
NitrateNetworkModel.evaluate!Method
evaluate!(model::StreamModel, flowregime::FlowRegime)

Runs stream_model.evaluate!(model, q) for each q in flowregime.q_gage. Outlet and average concentrations are saved to a FlowRegimeSimResults struct and returned.

source
NitrateNetworkModel.FlowRegimeSimResultsType
FlowRegimeSimResults(
    n_conc_outlet::Vector{Float64},
    n_conc_avg::Vector{Float64},
    p_mass::Vector{Float64}
)

Results structure returned by evaluate_with_flow_regime. Contains outlet and average nitrate concentration values for each of the flow values in flowregime.q_gage. flowregime.p_mass is copied over for convenience.

source

Example

using NitrateNetworkModel
using Plots
using Printf

# required input files
baseparams_file = "../data/baseparams.csv"
network_file = "../data/network_table.csv"
flowfile = "../data/flow_values.csv"

# create the model structs
sm = StreamModel(baseparams_file, network_file)
fr = FlowRegime(flowfile)

# run the model
results = evaluate!(sm, fr)

# create a summary figure
plot(fr.p_exceed, results.n_conc_outlet,
    label=@sprintf "Outlet (overall: %.2f)" weighted_outlet_nconc(results))
plot!(fr.p_exceed, results.n_conc_avg,
    label=@sprintf "Average (overall: %.2f)" weighted_avg_nconc(results))
xaxis!("Probability Exceedance")
yaxis!("Nitrate Concentration")