Skip to content

Model Calibration Best Practices ​

Overview ​

Model calibration is the process of adjusting model parameters to match observed facility performance. A well-calibrated model provides reliable predictions for design, optimization, and operational decision-making. This guide provides a comprehensive, step-by-step workflow for calibrating wastewater treatment plant models in ErgoPlanner.

What You'll Learn:

  • Systematic calibration methodology
  • Parameter selection and prioritization
  • Calibration metrics and acceptance criteria
  • Troubleshooting calibration issues
  • Validation and verification procedures
  • Documentation and quality assurance

Prerequisites:

  • Understanding of activated sludge processes
  • Familiarity with ASM model structure
  • Basic statistics knowledge
  • ErgoPlanner basic operation

Time Required: Calibration typically takes 1-3 weeks depending on data availability and model complexity.


Part 1: Calibration Fundamentals ​

1.1 Why Calibrate? ​

Uncalibrated Model Issues:

  • Predictions may deviate significantly from reality
  • Default parameters represent "typical" conditions, not your facility
  • Site-specific factors (influent characteristics, local climate, operational practices) not captured
  • Uncertainty too high for reliable design decisions

Benefits of Calibration:

  • ✓ Accurate prediction of effluent quality
  • ✓ Reliable capacity analysis
  • ✓ Confident optimization studies
  • ✓ Defensible regulatory compliance demonstrations
  • ✓ Reduced design safety factors
  • ✓ Better understanding of facility performance

1.2 Calibration vs. Validation ​

Calibration:

  • Adjusting parameters to match observed data
  • Uses "training" dataset
  • Iterative parameter adjustment
  • Goal: Minimize error between model and measurements

Validation:

  • Testing calibrated model on independent data
  • Uses separate "testing" dataset
  • No further parameter adjustment
  • Goal: Demonstrate model predictive capability

Best Practice:

Data Splitting:
- Calibration dataset: 60-70% of data
- Validation dataset: 30-40% of data
- Ensure validation data covers different conditions than calibration

Example (1 year of data):
- Calibration: Jan-Aug (8 months)
- Validation: Sep-Dec (4 months)

Or by condition:
- Calibration: Average flow, moderate temperature
- Validation: Peak flow, extreme temperatures

1.3 Calibration Philosophy ​

Principle 1: Parsimony (Simplicity)

  • Adjust as few parameters as possible
  • Prefer well-known, measurable parameters
  • Avoid over-parameterization

Principle 2: Physical Basis

  • Parameter values should be physically realistic
  • Stay within literature ranges
  • Justify deviations from typical values

Principle 3: Identifiability

  • Only adjust parameters that affect modeled outputs
  • Avoid adjusting highly correlated parameters
  • Recognize parameter interactions

Principle 4: Transparency

  • Document all changes
  • Justify parameter selections
  • Report uncertainty

Part 2: Data Collection and Preparation ​

2.1 Required Data ​

Minimum Data Requirements:

Influent Data (daily or more frequent):
☑ Flow rate (MGD or m³/day)
☑ Temperature (°C)
☑ BOD or COD (mg/L)
☑ Total Suspended Solids (TSS, mg/L)
☑ Total Kjeldahl Nitrogen (TKN, mg/L)
☑ NH4-N (mg/L)
☑ Total Phosphorus (TP, mg/L)
☑ Alkalinity (mg/L as CaCO3)

Process Data (daily):
☑ Aeration basin MLSS (mg/L)
☑ Return Activated Sludge (RAS) flow rate
☑ Waste Activated Sludge (WAS) flow rate
☑ Dissolved Oxygen (DO) in aerobic zones (mg/L)
☑ Secondary clarifier underflow TSS (if available)

Effluent Data (daily or more frequent):
☑ Flow rate
☑ BOD or COD (mg/L)
☑ TSS (mg/L)
☑ NH4-N (mg/L)
☑ NO3-N (mg/L)
☑ Total Nitrogen (TN, mg/L)
☑ Total Phosphorus (TP, mg/L)

Operational Data:
☑ Blower operation (hours, airflow)
☑ Pump operation schedules
☑ Chemical addition rates (if applicable)
☑ Process control setpoints

Recommended Additional Data:

Influent:
- Soluble COD (sCOD)
- Volatile Fatty Acids (VFA)
- Total Organic Carbon (TOC)
- Nitrate-N (NO3-N)
- Ortho-phosphate (PO4-P)

Process:
- Specific Oxygen Uptake Rate (SOUR)
- Nitrification rate
- Denitrification rate
- Sludge settling characteristics (SVI, SSVI)
- Mixed liquor volatile suspended solids (MLVSS)

Effluent:
- Soluble BOD/COD
- Ortho-phosphate

Data Duration:

Minimum: 3 months of continuous data
Recommended: 12 months (captures seasonal variation)
Ideal: 24 months (two complete annual cycles)

Data Frequency:
- Influent/effluent quality: Daily minimum, hourly ideal
- Flow: Continuous (15-min intervals) or daily average
- Process parameters: Daily minimum
- Online sensors: Continuous (5-15 min intervals)

2.2 Data Quality Assurance ​

Step 1: Data Screening

Check for obvious errors:

ErgoPlanner QA/QC Tools:
1. Import data → Data → QA/QC → Run Checks

Automatic Checks:
☑ Missing values identified
☑ Outliers flagged (> 3σ from mean)
☑ Negative values in non-negative parameters
☑ Values exceeding physical limits
☑ Inconsistent units detected
☑ Duplicate timestamps
☑ Mass balance violations

Step 2: Mass Balance Verification

Influent vs. Effluent + Sludge Balance:

COD Balance:
COD_in = COD_eff + COD_wasted + COD_respired

Nitrogen Balance:
N_in = N_eff + N_wasted + N_denitrified

Phosphorus Balance:
P_in = P_eff + P_wasted

Acceptable Error: ±10% for preliminary check

Example Mass Balance Check:

Daily Average Data:
- Influent: 10 MGD, COD = 400 mg/L
- Effluent: 10 MGD, COD = 30 mg/L
- WAS: 0.05 MGD, TSS = 12,000 mg/L, VSS = 9,000 mg/L
- VSS destruction in aeration: 40%

COD In:
10 MGD × 400 mg/L × 8.34 = 33,360 lb COD/day

COD Out:
- Effluent: 10 × 30 × 8.34 = 2,502 lb/day
- WAS: 0.05 × 9,000 × 8.34 × 1.42 (COD/VSS) = 5,321 lb/day
- Respired: (33,360 - 2,502 - 5,321) = 25,537 lb/day

Check: 2,502 + 5,321 + 25,537 = 33,360 ✓ (balances)

Step 3: Handle Missing Data

Strategies by Data Type:

Short Gaps (< 3 days):
- Linear interpolation
- Moving average
- Seasonal pattern substitution

Long Gaps (> 3 days):
- Exclude from calibration dataset
- Use alternative indicator (BOD ↔ COD)
- Mark as validation gap

Critical Parameters (always needed):
- Flow: Never interpolate long gaps, exclude period
- Temperature: Can interpolate or use weather data
- Quality: Exclude if >20% missing in period

Step 4: Outlier Treatment

Outlier Identification:
1. Statistical: Values > 3σ from mean
2. Physical: Impossible values (negative, >saturation)
3. Expert judgment: Known upsets, sampling errors

Outlier Handling:
☐ Investigate cause (lab error, upset, sampling issue)
☐ If error: Remove or correct
☐ If real upset: Flag but keep (may exclude from calibration)
☐ Document all changes in data log

Example Outliers to Investigate:
- Influent COD > 1,000 mg/L (unless industrial discharge)
- Effluent NH4 < 0.1 mg/L (detection limit issue?)
- MLSS suddenly doubles (measurement error?)
- DO > 8 mg/L (sensor malfunction?)

2.3 Data Characterization ​

Calculate Summary Statistics:

For Each Parameter:
- Mean and median
- Standard deviation
- Minimum and maximum
- 10th, 25th, 75th, 90th percentiles
- Coefficient of variation (CV = σ/μ)

ErgoPlanner: Data → Characterization → Summary Statistics

Identify Patterns:

Temporal Patterns:
☑ Diurnal (daily) variation
☑ Day-of-week patterns
☑ Seasonal trends
☑ Long-term trends

Correlation Analysis:
☑ Flow vs. loading (dilution?)
☑ Temperature vs. performance
☑ Influent vs. effluent relationships

ErgoPlanner: Data → Analysis → Pattern Recognition

Example Data Summary:

Influent Characterization (1 year):

Parameter      Mean    Std    Min    Max    CV
────────────────────────────────────────────────
Flow (MGD)     10.2    1.8    6.5    15.8   0.18
Temp (°C)      18.5    4.2    10.2   26.8   0.23
COD (mg/L)     420     78     245    680    0.19
BOD (mg/L)     210     42     120    350    0.20
TSS (mg/L)     235     56     130    420    0.24
TKN (mg/L)     42      8      28     65     0.19
NH4-N (mg/L)   28      6      18     45     0.21
TP (mg/L)      6.2     1.4    3.8    10.5   0.23

Interpretation:
- Moderate variability (CV = 0.18-0.24)
- Typical domestic wastewater characteristics
- Some industrial contribution (higher COD:BOD)
- Seasonal temperature variation significant

Part 3: Calibration Strategy ​

3.1 Calibration Hierarchy ​

Calibrate in this order:

Level 1: Mass Flow (Fundamental)
1.1 Total flow balance
1.2 Solids balance (TSS, VSS)
1.3 Hydraulic retention time (HRT)
1.4 Solids retention time (SRT)

Level 2: Organic Removal (Easier)
2.1 Influent COD fractionation
2.2 Aerobic heterotrophic kinetics
2.3 Effluent BOD/COD

Level 3: Nitrification (Moderate)
3.1 Autotrophic kinetics
3.2 Ammonia oxidation
3.3 Effluent NH4-N

Level 4: Denitrification (Complex)
4.1 Anoxic heterotrophic kinetics
4.2 Denitrification rate
4.3 Effluent TN

Level 5: Phosphorus (Most Complex)
5.1 PAO kinetics
5.2 Bio-P release and uptake
5.3 Effluent TP

Rationale:
- Build foundation before advanced processes
- Ensure mass balance before kinetics
- Each level depends on previous levels

3.2 Parameter Selection ​

Parameters to Calibrate:

Tier 1: Almost Always Adjust
☑ Influent COD fractionation (SI, SS, XS, XI)
☑ Maximum heterotrophic growth rate (μH)
☑ Maximum autotrophic growth rate (μA)

Tier 2: Frequently Adjust
☑ Aerobic half-saturation for heterotrophs (KS)
☑ Ammonia half-saturation for autotrophs (KNH)
☑ Anoxic reduction factor (ηg)
☑ Settling parameters (v0, rp, rh)

Tier 3: Occasionally Adjust
☑ Heterotrophic yield (YH)
☑ Autotrophic yield (YA)
☑ Decay rates (bH, bA)
☑ Hydrolysis rate (kh)

Tier 4: Rarely Adjust (Keep Default)
☐ Stoichiometric coefficients (iPBM, iNXS, etc.)
☐ Oxygen saturation
☐ Correction factors (except temperature)

Parameters to NOT Calibrate:

Fixed Parameters (Physical Constants):
✗ Oxygen saturation concentration (physical property)
✗ Molecular weights
✗ Stoichiometry of fundamental reactions
✗ Unit conversion factors

Well-Established Parameters:
✗ Temperature correction factors (θ values from literature)
✗ ASM stoichiometric coefficients (iNBM, iPBM, fP, etc.)

Reason: These are fundamental and well-known. Adjusting them
indicates problems elsewhere (data, model structure, etc.)

3.3 Calibration Targets ​

Define Acceptable Error:

Primary Targets (Must Match Closely):

Effluent Quality:
- NH4-N: ±0.5 mg/L or ±20% (whichever larger)
- NO3-N: ±1.0 mg/L or ±20%
- TN: ±1.5 mg/L or ±15%
- TP: ±0.3 mg/L or ±20%
- BOD: ±2 mg/L or ±25%
- TSS: ±3 mg/L or ±25%

Process Variables:
- MLSS: ±200 mg/L or ±10%
- RAS TSS: ±500 mg/L or ±15%

Secondary Targets (Should Match Reasonably):

Mass Flows:
- Oxygen demand: ±15%
- Sludge production: ±20%
- Nutrient removal: ±15%

Performance Metrics:
- R² > 0.80 (good), > 0.90 (excellent)
- Mean bias < ±10%

Part 4: Step-by-Step Calibration Workflow ​

4.1 Step 1: Set Up Base Model ​

Configure Plant Layout:

  1. Model → Plant Configuration → New Plant
  2. Define process units matching facility:
Example Configuration:
- Primary Clarifier: 2 tanks, 1.5 MG each
- Aeration Basin: 4 tanks, total 8.0 MG
  • Zone 1: Anaerobic, 1.0 MG
  • Zone 2: Anoxic, 1.5 MG
  • Zone 3: Aerobic, 5.5 MG
- Secondary Clarifier: 2 tanks, 2.0 MG each
- RAS pumps: Variable, 50-150% of influent flow
- WAS pumps: Variable

Set Initial Conditions:

Steady-State Initial Conditions:
- MLSS: Measured average (e.g., 3,500 mg/L)
- MLVSS/MLSS: 0.75 (typical)
- DO in aerobic zone: Setpoint (e.g., 2.0 mg/L)
- Nitrate in anoxic: 2-5 mg/L (estimated)
- RAS flow: Measured average (e.g., 75% of influent)
- WAS flow: Calculated from SRT

SRT Calculation:
SRT = (MLSS × Volume) / (WAS_TSS × WAS_flow + Eff_TSS × Eff_flow)

Example:
SRT = (3,500 mg/L × 8.0 MG) / (10,000 mg/L × 0.05 MGD + 10 mg/L × 10 MGD)
    = 28,000 / 600 = 47 days... Too high!

Check calculation. Likely WAS flow higher or calculation error.

4.2 Step 2: Characterize Influent ​

COD Fractionation:

This is critical and often the most important calibration step.

COD Components in ASM1:
- SI: Soluble inert (passes through)
- SS: Readily biodegradable substrate
- XS: Slowly biodegradable substrate
- XI: Particulate inert

Total COD = SI + SS + XS + XI

Method 1: Use Measured Data (Best)

If you have:

  • Total COD
  • Soluble COD (sCOD from filtered sample)
  • BOD5
Procedure:
1. SI = sCOD - SS
2. SS = 1.6 × BOD5_soluble (or from OUR test)
3. XI = Particulate inert (literature: 10-20% of total COD)
4. XS = Total COD - SI - SS - XI

Example:
- Total COD = 400 mg/L
- sCOD = 150 mg/L
- BOD5 = 200 mg/L
- Assume XI = 15% of total = 60 mg/L

SS = 1.6 × 200 × 0.65 (assume 65% soluble) = 208 mg/L
SI = 150 - 208 = -58... Negative! Issue detected.

Revise: SS likely lower. Try SS = 100 mg/L
SI = 150 - 100 = 50 mg/L
XS = 400 - 50 - 100 - 60 = 190 mg/L

Fractions:
- SI: 50/400 = 0.125 (12.5%)
- SS: 100/400 = 0.25 (25%)
- XS: 190/400 = 0.475 (47.5%)
- XI: 60/400 = 0.15 (15%)
- Total: 100% ✓

Method 2: Use ErgoPlanner Fractionation Tool

  1. Data → Influent Characterization → COD Fractionation
  2. Enter available data:
    • Total COD
    • Soluble COD (if available)
    • BOD5
    • VSS/TSS ratio
  3. Select fractionation method:
    • Default (typical wastewater)
    • Domestic (low industrial)
    • Industrial (high strength)
    • Custom
  4. Click Calculate Fractions

ErgoPlanner uses OUR/NUR test simulation or default ratios.

Method 3: Use Literature Defaults

Typical Domestic Wastewater Fractions:

Component    Fraction    Example (COD = 400 mg/L)
──────────────────────────────────────────────────────
SI           0.05-0.10   30 mg/L (7.5%)
SS           0.25-0.35   120 mg/L (30%)
XS           0.40-0.50   180 mg/L (45%)
XI           0.10-0.20   70 mg/L (17.5%)

Industrial Wastewater (higher strength):
SI           0.10-0.15
SS           0.30-0.40
XS           0.30-0.40
XI           0.15-0.25

Nitrogen Fractionation:

TKN Components:
- Soluble NH4-N
- Soluble organic N
- Particulate organic N

Typical:
- NH4-N: 60-70% of TKN
- Organic N: 30-40% of TKN
  • Soluble: 5-10% of TKN
  • Particulate: 20-30% of TKN

Example (TKN = 40 mg/L):
- NH4-N: 28 mg/L (measured)
- Organic N: 12 mg/L
  • Soluble: 3 mg/L
  • Particulate: 9 mg/L

Phosphorus Fractionation:

TP Components:
- Soluble ortho-phosphate (PO4-P)
- Particulate P (organic + poly-P)

Typical:
- PO4-P: 70-80% of TP
- Particulate P: 20-30% of TP

Example (TP = 6 mg/L):
- PO4-P: 4.5 mg/L (measured or 75%)
- Particulate P: 1.5 mg/L

4.3 Step 3: Calibrate Solids Balance ​

Verify MLSS Prediction:

Run steady-state simulation with measured inputs:

Compare Model vs. Measured:

Parameter           Measured    Model    Error    Status
─────────────────────────────────────────────────────────
MLSS (mg/L)         3,520       3,850    +9.4%    OK
RAS TSS (mg/L)      10,200      11,500   +12.7%   Marginal
Effluent TSS (mg/L) 8           12       +50%     FAIL

If MLSS too high:

  • Check SRT calculation (is WAS flow correct?)
  • Verify influent TSS and VSS data
  • Adjust decay rates (bH, bA) - higher decay = less biomass
  • Adjust yield (YH) - lower yield = less growth

If MLSS too low:

  • Opposite adjustments
  • Check for measurement bias in TSS/VSS

Settling Model Calibration:

Clarifier Parameters (Takács Model):

v0: Maximum settling velocity (m/day)
- Typical: 200-400 m/day
- Good settling sludge: 300-400
- Poor settling (bulking): 100-200

rp: Practical minimum settling velocity (m/day)
- Typical: 0.5-1.0 m/day

rh: Hindered settling parameter (L/g)
- Typical: 0.0003-0.0006
- Lower value = less hindered settling

Calibration:
1. Measure SVI (Sludge Volume Index)
2. Correlate to settling parameters
3. Adjust v0 and rh to match RAS TSS and effluent TSS

Rule of thumb:
v0 (m/day) ≈ 10,000 / SVI

Example: SVI = 80 mL/g
v0 ≈ 10,000 / 80 = 125 m/day... Poor settling!
Typical SVI for good sludge: 50-100 mL/g

4.4 Step 4: Calibrate Organic Removal ​

Target: Effluent BOD/COD

Adjust Heterotrophic Parameters:

1. μH,max (Maximum growth rate, d⁻¹)
   - Default (20°C): 6.0 d⁻¹
   - Range: 4.0-13.2 d⁻¹
   - Higher μH → faster COD removal

2. KS (Half-saturation for substrate, mg COD/L)
   - Default: 20 mg/L
   - Range: 5-50 mg/L
   - Lower KS → better removal at low COD

3. bH (Decay rate, d⁻¹)
   - Default (20°C): 0.62 d⁻¹
   - Range: 0.3-1.2 d⁻¹
   - Higher bH → more oxygen demand, less sludge

Temperature Correction:
μH(T) = μH(20°C) × θ^(T-20)
θ = 1.07 (typical)

Calibration Procedure:

Step 1: Run simulation with defaults
Step 2: Compare effluent BOD to measured

If model BOD too high (under-predicting removal):
→ Increase μH by 10-20%
→ Or decrease KS by 20-30%
→ Or adjust COD fractions (more SS, less XI)

If model BOD too low (over-predicting removal):
→ Decrease μH by 10-20%
→ Or increase KS by 20-30%
→ Or adjust COD fractions (less SS, more XI)

Step 3: Iterate until error < ±25%

Example Adjustment:
Measured effluent BOD: 5 mg/L
Model effluent BOD: 8 mg/L (too high)

Action: Increase μH from 6.0 to 6.8 d⁻¹ (+13%)
Result: Model BOD → 5.2 mg/L ✓

4.5 Step 5: Calibrate Nitrification ​

Target: Effluent NH4-N

Adjust Autotrophic Parameters:

1. μA,max (Maximum autotroph growth rate, d⁻¹)
   - Default (20°C): 0.9 d⁻¹
   - Range: 0.5-1.5 d⁻¹
   - Highly temperature-sensitive (θ ≈ 1.10-1.12)

2. KNH (Half-saturation for ammonia, mg N/L)
   - Default: 1.0 mg N/L
   - Range: 0.5-2.0 mg N/L

3. bA (Autotroph decay rate, d⁻¹)
   - Default (20°C): 0.15-0.20 d⁻¹
   - Range: 0.10-0.30 d⁻¹

Nitrification is sensitive to:

  • Temperature (strongly)
  • DO concentration
  • SRT (must be > minimum for nitrifier growth)
  • pH and alkalinity

Calibration Procedure:

Step 1: Verify DO > 1.5 mg/L in aerobic zone (required)
Step 2: Verify SRT > minimum for nitrification

Minimum SRT for nitrification:
SRT_min = 1 / (μA,max - bA)

At 20°C with defaults:
SRT_min = 1 / (0.9 - 0.17) = 1.37 days

At 12°C (winter):
μA,max(12°C) = 0.9 × 1.11^(12-20) = 0.42 d⁻¹
bA(12°C) = 0.17 × 1.04^(12-20) = 0.13 d⁻¹
SRT_min = 1 / (0.42 - 0.13) = 3.4 days

Apply safety factor (1.5-2.5×):
SRT_design > 3.4 × 2.0 = 6.8 days minimum

Step 3: Compare measured vs. modeled NH4-N

If model NH4 too high (under-predicting nitrification):
→ Increase μA by 10-20%
→ Or decrease KNH
→ Check DO > 2.0 mg/L
→ Check alkalinity sufficient

If model NH4 too low (over-predicting nitrification):
→ Decrease μA by 10-20%
→ Or increase KNH
→ Check for inhibition (toxics, low pH)

Step 4: Verify across temperature range

Example:
Measured NH4 (summer, 22°C): 0.8 mg/L
Model NH4 (summer): 2.1 mg/L (too high)

Action: Increase μA from 0.9 to 1.05 d⁻¹ (+17%)
Result: Model NH4 → 0.9 mg/L ✓

Validation:
Measured NH4 (winter, 12°C): 2.5 mg/L
Model NH4 (winter): 2.3 mg/L ✓ Good match!

4.6 Step 6: Calibrate Denitrification ​

Target: Effluent NO3-N and TN

Adjust Denitrification Parameters:

1. ηg (Anoxic growth correction factor)
   - Default: 0.8
   - Range: 0.6-0.9
   - Lower value = slower denitrification

2. Anoxic volume and mixing
   - Verify actual anoxic volume and DO < 0.5 mg/L

3. Internal recycle ratio
   - Verify measured value
   - Affects nitrate return to anoxic zone

Denitrification Rate:

Specific denitrification rate (SDNR):
SDNR = NO3_removed / (MLVSS × Volume × Time)

Typical: 0.03-0.12 kg NO3-N / kg MLVSS / day
Higher with external carbon source

Theoretical maximum (ASM1):
SDNR = (1 - YH) / (2.86 × YH) × μH × ηg × (SS / (KS + SS))

With defaults (high substrate):
SDNR ≈ 0.10-0.15 kg N / kg VSS / day

Calibration Procedure:

Step 1: Verify anoxic volume and internal recycle
Step 2: Calculate measured SDNR from data

Example:
Influent TKN: 40 mg/L, Flow: 10 MGD
N nitrified: 35 mg/L (assume 5 mg/L to effluent as NH4)
NO3 to anoxic: 35 × (1 + IR) / (1 + IR + Flow)
  With IR = 3.0: NO3 = 35 × 4.0 / 14 = 10 mg/L
Effluent NO3: 3 mg/L
N denitrified: 10 - 3 = 7 mg/L
Anoxic MLVSS: 2,800 mg/L, Volume: 1.5 MG

SDNR = (10 MGD × 7 mg/L × 3.785) / (2,800 mg/L × 1.5 MG × 3.785)
     = 265.95 / 15,877.5 = 0.017 kg N/kg VSS/day... Low!

This indicates:
- Limited carbon source in anoxic zone
- May need external carbon addition
- Or increase internal recycle

Step 3: Adjust model ηg to match observed SDNR

If model NO3 too high (under-predicting denitrification):
→ Increase ηg (toward 0.9)
→ Or increase internal recycle
→ Or verify carbon availability

If model NO3 too low (over-predicting denitrification):
→ Decrease ηg (toward 0.6)
→ Or check for oxygen intrusion in anoxic zone
→ Verify DO < 0.5 mg/L in anoxic

4.7 Step 7: Calibrate Phosphorus (if BNR) ​

Target: Effluent TP

Adjust PAO Parameters (ASM2d):

1. qPP (P uptake rate, d⁻¹)
   - Default: 1.5-3.0 d⁻¹
   - Higher = better P removal

2. YPO4 (Poly-P content)
   - Default: 0.4 g P/g VSS
   - Range: 0.2-0.6

3. Anaerobic volume and VFA availability
   - Critical for PAO selection
   - VFA/COD ratio important

Bio-P is complex and sensitive to:

  • Anaerobic volume (typically 10-20% of total)
  • VFA concentration in influent
  • Influent P:COD ratio
  • Presence of nitrate in anaerobic zone (defeats process)
  • Competing heterotrophs
  • Temperature
  • pH

If Bio-P difficult to calibrate: Consider chemical P removal addition to model.


Part 5: Calibration Metrics ​

5.1 Statistical Metrics ​

R² (Coefficient of Determination):

R² = 1 - (Σ(observed - predicted)²) / (Σ(observed - mean_observed)²)

Interpretation:
R² = 1.0: Perfect fit
R² > 0.90: Excellent
R² = 0.80-0.90: Good
R² = 0.60-0.80: Fair
R² < 0.60: Poor

Calculate for each key parameter (NH4, NO3, TN, TP, etc.)

RMSE (Root Mean Square Error):

RMSE = √(Σ(observed - predicted)² / n)

Units: Same as measured variable (mg/L)

Example:
Effluent NH4-N
Measured: [0.5, 0.8, 1.2, 0.6, 0.9, 1.1, 0.7] mg/L
Predicted: [0.6, 0.9, 1.0, 0.7, 0.8, 1.2, 0.8] mg/L

Differences²: [0.01, 0.01, 0.04, 0.01, 0.01, 0.01, 0.01]
RMSE = √(0.10 / 7) = 0.12 mg/L

Interpretation:
Model typically within ±0.12 mg/L of measurements

Bias (Mean Error):

Bias = Σ(predicted - observed) / n

Positive bias: Model over-predicts
Negative bias: Model under-predicts

Target: |Bias| < 10% of mean observed value

Example:
Mean observed NH4: 0.8 mg/L
Bias: +0.15 mg/L
Percent bias: +0.15 / 0.8 = +19%... Too high!
Model systematically over-predicts.

5.2 Visual Assessment ​

Time Series Plots:

Plot observed and predicted on same graph:
- X-axis: Time
- Y-axis: Parameter value
- Two lines: Observed (solid), Predicted (dashed)
- Include target/limit line if applicable

Look for:
☑ General trend match
☑ Peak values captured
☑ Timing of changes correct
☑ Steady-state values close
☐ Systematic over/under-prediction (bias)

Scatter Plots:

X-axis: Observed values
Y-axis: Predicted values
Include:
- 1:1 line (perfect fit)
- ±20% error bands
- Linear regression line
- R² value

Good calibration:
- Points cluster around 1:1 line
- No systematic deviation
- Similar scatter at low and high values

Residual Plots:

X-axis: Predicted values
Y-axis: Residuals (Predicted - Observed)
Include:
- Zero line (horizontal)

Good calibration:
- Residuals randomly distributed around zero
- No trends (cone shape, systematic deviation)
- Consistent variance across range

Part 6: Troubleshooting Common Issues ​

6.1 Convergence Problems ​

Symptom: Model fails to converge, gives error messages

Possible Causes:
1. Time step too large
   → Solution: Reduce time step (e.g., 1 hr → 15 min)

2. Initial conditions far from steady-state
   → Solution: Run long warm-up period (3-5× SRT)

3. Unrealistic parameter values
   → Solution: Check all parameters within reasonable range

4. Mass balance violations
   → Solution: Verify input data consistency

5. Numerical instability
   → Solution: Adjust solver tolerance settings

6.2 Mass Balance Errors ​

Symptom: COD/N/P not conserved

Troubleshooting:
1. Check influent fractionation (components sum to 100%)
2. Verify all recycle streams defined correctly
3. Ensure wastage streams accounted for
4. Review stoichiometric coefficients (should be defaults)
5. Check for missing unit processes
6. Verify no "loss" terms unaccounted for

ErgoPlanner: Results → Mass Balance → Check Closure
Acceptable: ±5% error

6.3 Unrealistic Results ​

Symptom: Model predicts impossible values

Examples:
- Negative concentrations
- DO > saturation
- MLSS > 20,000 mg/L
- Effluent better than influent

Troubleshooting:
1. Check input data for errors
2. Verify process configuration matches facility
3. Review parameter values (within literature range?)
4. Ensure proper unit conversions
5. Check for typos in equations (if custom model)

6.4 Can't Match All Parameters ​

Symptom: Good fit for some parameters, poor for others

Example: Good NH4 prediction, poor NO3 prediction

Possible Causes:
1. Model structure inadequate
   → Consider more complex model (ASM2d, ASM3)

2. Missing process
   → Add unit process not previously included

3. Measurement errors
   → Re-evaluate data quality for problematic parameter

4. Over-parameterization
   → Too many adjusted parameters, overfitting

5. Conflicting objectives
   → Some parameter sets inherently can't match everything
   → May need to accept compromise

Strategy:
- Prioritize most important parameters (regulatory)
- Accept less-perfect match on secondary parameters
- Document limitations

Part 7: Validation ​

7.1 Independent Dataset Validation ​

Use data NOT used for calibration:

Validation Procedure:
1. Set aside 30-40% of data for validation
2. Complete calibration on training data
3. Lock all parameters (no further adjustment!)
4. Run model on validation dataset
5. Calculate validation metrics (R², RMSE, bias)
6. Compare to calibration metrics

Acceptance Criteria:
- Validation R² within 0.10 of calibration R²
- Validation RMSE within 25% of calibration RMSE
- No significant bias shift

Example:
Parameter      Calib R²   Valid R²   Status
─────────────────────────────────────────────
Effluent NH4     0.88       0.84      ✓ OK
Effluent NO3     0.82       0.78      ✓ OK
Effluent TN      0.85       0.71      ✗ Marginal

If validation significantly worse:
→ Possible overfitting during calibration
→ Validation data covers different conditions
→ May need more representative calibration data

7.2 Cross-Validation ​

K-Fold Cross-Validation:

Method:
1. Split data into k subsets (e.g., k=5)
2. Use 4 subsets for calibration, 1 for validation
3. Repeat 5 times, each subset used for validation once
4. Average validation metrics

Advantage:
- Uses all data for both calibration and validation
- Reduces dependence on specific data split
- More robust assessment

ErgoPlanner: Calibration → Cross-Validation → Run k-Fold

7.3 Extrapolation Testing ​

Test model under conditions outside calibration range:

Test Scenarios:
1. Higher flow (1.5× max calibration flow)
2. Lower temperature (5°C below calibration min)
3. Higher loading (1.5× max calibration load)
4. Equipment failure (blower down, pump out)

Acceptance:
- Model should not crash
- Results should be physically reasonable
- Trends should be correct (even if absolute values uncertain)

If model fails extrapolation:
→ Clearly document applicability limits
→ Use with caution outside calibrated range
→ Consider safety factors in design

Part 8: Documentation ​

8.1 Calibration Report Contents ​

1. Executive Summary
   - Calibration objectives
   - Key parameters calibrated
   - Calibration quality metrics
   - Limitations and recommendations

2. Facility Description
   - Process configuration
   - Design parameters
   - Operating conditions

3. Data Description
   - Data sources and dates
   - Data quality and gaps
   - Statistical summary
   - Seasonal patterns

4. Calibration Methodology
   - Model selection (ASM1, ASM2d, etc.)
   - Parameter selection strategy
   - Calibration hierarchy
   - Acceptance criteria

5. Results
   - Parameter values (calibrated vs. default)
   - Calibration metrics (R², RMSE, bias)
   - Time series and scatter plots
   - Mass balance verification

6. Validation
   - Independent dataset results
   - Validation metrics
   - Comparison to calibration

7. Sensitivity Analysis
   - Key parameter sensitivity
   - Uncertainty quantification

8. Conclusions and Recommendations
   - Model applicability
   - Limitations
   - Recommended uses
   - Future improvements

Appendices:
A. Data tables
B. Parameter definitions
C. Model equations
D. Detailed plots

8.2 Parameter Summary Table ​

Parameter          Symbol   Default   Calibrated   Units      Justification
──────────────────────────────────────────────────────────────────────────────
Heterotrophs
 Max growth rate   μH       6.0       6.5          d⁻¹        Matched effluent BOD
 Half-sat (S)      KS       20        18           mg COD/L   "
 Yield             YH       0.67      0.67         -          Kept default
 Decay rate        bH       0.62      0.58         d⁻¹        Matched MLSS

Autotrophs
 Max growth rate   μA       0.90      1.05         d⁻¹        Matched effluent NH4
 Half-sat (NH4)    KNH      1.0       0.8          mg N/L     Improved low NH4 fit
 Yield             YA       0.24      0.24         -          Kept default
 Decay rate        bA       0.17      0.17         d⁻¹        Kept default

Influent Fractions (% of total COD)
 Sol inert         SI       10%       12%          -          From sCOD data
 Readily biod.     SS       30%       28%          -          From BOD5 correlation
 Slowly biod.      XS       45%       43%          -          Calculated
 Part inert        XI       15%       17%          -          Matched eff COD

Settling
 Max velocity      v0       250       280          m/day      Matched RAS TSS
 Hindered param    rh       0.000576  0.000520     L/g        "

All temperature correction factors (θ) kept at literature defaults.

8.3 Version Control ​

Model Version History:

Version   Date        Author   Changes
────────────────────────────────────────────────────────────────
v0.1      2024-01-10  JD       Initial model setup
v0.2      2024-01-15  JD       Added influent data (Jan-Jun)
v1.0      2024-01-22  JD       First calibration (organic removal)
v1.1      2024-01-28  JD       Calibrated nitrification
v1.2      2024-02-05  JD       Calibrated denitrification
v2.0      2024-02-12  JD       Validation complete, final calibration
v2.1      2024-02-18  AS       Peer review revisions
v2.2      2024-03-01  JD       Added winter data validation

Current Version: v2.2 (Approved for design use)

Part 9: Best Practices Summary ​

9.1 Do's ​

✓ Collect sufficient data (minimum 3 months, ideally 12 months) ✓ Perform thorough QA/QC on data before calibration ✓ Start simple and add complexity only as needed ✓ Calibrate systematically (follow hierarchy: mass → organics → N → P) ✓ Adjust few parameters (parsimony principle) ✓ Stay within literature ranges for parameters ✓ Validate on independent data (always!) ✓ Document everything (assumptions, changes, justifications) ✓ Calculate multiple metrics (R², RMSE, bias, visual) ✓ Test extrapolation limits before using for design ✓ Perform sensitivity analysis to quantify uncertainty ✓ Get peer review before finalizing

9.2 Don'ts ​

❌ Don't over-parameterize (adjust only what's necessary) ❌ Don't use defaults blindly (always check against site data) ❌ Don't ignore mass balance (must close within ±5%) ❌ Don't accept poor fits without investigation ❌ Don't extrapolate far beyond calibration range without caution ❌ Don't skip validation (calibration fit ≠ predictive ability) ❌ Don't adjust stoichiometric coefficients (fundamental parameters) ❌ Don't ignore temperature effects (use proper correction factors) ❌ Don't use questionable data (outliers, lab errors, upsets) ❌ Don't forget to document (you'll forget details in 6 months!)


Part 10: Example Calibration Case Study ​

10.1 Facility Profile ​

Anytown WWTP:
- Capacity: 12 MGD design, 10 MGD average
- Treatment: 5-stage Bardenpho BNR
- Limits: BOD < 10 mg/L, NH4 < 2 mg/L, TN < 8 mg/L, TP < 1 mg/L
- Available data: 18 months (complete)

10.2 Calibration Summary ​

Dataset Split:
- Calibration: Jan 2023 - Oct 2023 (10 months)
- Validation: Nov 2023 - Jun 2024 (8 months)

Parameters Calibrated:
1. Influent COD fractionation (SI, SS, XS, XI)
2. μH: 6.0 → 6.8 d⁻¹
3. μA: 0.90 → 1.10 d⁻¹
4. KNH: 1.0 → 0.7 mg N/L
5. ηg: 0.80 → 0.75
6. v0: 250 → 320 m/day

All other parameters kept at defaults.

10.3 Calibration Results ​

Calibration Metrics:

Parameter        R²     RMSE        Bias      Status
──────────────────────────────────────────────────────
Eff BOD         0.76   1.8 mg/L    +0.2      Good
Eff TSS         0.82   2.1 mg/L    -0.3      Good
Eff NH4         0.91   0.35 mg/L   +0.05     Excellent
Eff NO3         0.84   0.8 mg/L    -0.1      Good
Eff TN          0.88   0.9 mg/L    -0.05     Excellent
Eff TP          0.79   0.22 mg/L   +0.03     Good
MLSS            0.73   220 mg/L    +85       Fair

10.4 Validation Results ​

Validation Metrics:

Parameter        R²     RMSE        Bias      Δ from Calib
────────────────────────────────────────────────────────────
Eff BOD         0.74   1.9 mg/L    +0.3      -0.02
Eff TSS         0.79   2.3 mg/L    -0.2      -0.03
Eff NH4         0.89   0.38 mg/L   +0.08     -0.02
Eff NO3         0.81   0.9 mg/L    -0.2      -0.03
Eff TN          0.86   1.0 mg/L    -0.12     -0.02
Eff TP          0.77   0.24 mg/L   +0.05     -0.02

Conclusion:
Validation results very close to calibration.
Model demonstrates good predictive ability.
Approved for design and optimization studies.

10.5 Lessons Learned ​

Challenges:
1. Initial difficulty matching MLSS
   → Resolved by correcting WAS flow measurement error
2. Poor winter nitrification fit
   → Improved by increasing μA (facility has warm influent)
3. Bio-P variability
   → Attributed to industrial discharge variations (documented)

Successes:
1. Excellent TN prediction (R² = 0.86 validation)
2. Model captures seasonal trends well
3. Good performance under peak flow conditions

Recommendations:
- Install continuous NH4 analyzer for real-time validation
- Improve influent VFA measurements for better bio-P modeling
- Conduct annual model update with new data

Conclusion ​

Effective model calibration is essential for reliable WWTP modeling. Follow this systematic approach:

  1. Collect quality data (minimum 3-12 months)
  2. Characterize inputs thoroughly (COD fractionation critical)
  3. Calibrate hierarchically (mass → organics → N → P)
  4. Adjust selectively (few parameters, within ranges)
  5. Validate rigorously (independent dataset)
  6. Document completely (assumptions, changes, limitations)

A well-calibrated model provides confidence in design decisions, optimization strategies, and regulatory compliance demonstrations. Invest the time to calibrate properly—the returns are substantial.

Next Steps:

  • Apply this workflow to your facility
  • Start with organic removal calibration
  • Progressively add complexity (N, P)
  • Maintain and update model as conditions change

Related Guides:


Questions or need help with calibration?

Contact ErgoPlanner support or consult with experienced modelers.

Last Updated: January 2025 Version: 1.0