Skip to content

Dynamic Simulation ​

Learn to set up and run time-varying simulations to analyze plant performance under changing conditions such as flow variations, storm events, and process upsets.

Overview ​

Dynamic simulation models how a wastewater treatment plant responds to time-varying inputs and conditions. Unlike steady-state simulation (which assumes constant conditions), dynamic simulation tracks changes over hours, days, or weeks.

In this guide you'll learn:

  • Differences between steady-state and dynamic simulation
  • Time-step selection and integration methods
  • Configuring dynamic influent patterns
  • Importing time-series data
  • Controller integration for automated response
  • Analyzing temporal results
  • Simulating specific events (storms, upsets, startups)

Estimated Time: 45 minutes

Difficulty: Advanced

Prerequisites ​

Step 1: Dynamic vs Steady-State ​

1.1 When to Use Dynamic Simulation ​

Use steady-state simulation when:

  • Analyzing average long-term performance
  • Comparing design alternatives
  • Sizing process units
  • Checking permit compliance under typical conditions
  • Initial feasibility studies

Use dynamic simulation when:

  • Analyzing wet weather/storm events
  • Evaluating process control strategies
  • Studying startup/shutdown procedures
  • Assessing peak loading impacts
  • Optimizing equalization basin operations
  • Validating tank sizing for fluctuating loads
  • Analyzing diurnal (daily) load variations

Tip: Start with steady-state to ensure your configuration is correct, then add dynamics for detailed analysis.

1.2 Key Differences ​

AspectSteady-StateDynamic
TimeSingle point in timeTime-series over hours/days
InputsConstant valuesTime-varying profiles
OutputsSingle set of resultsTemporal profiles
ComputationAlgebraic equationsDifferential equations
Solve TimeSeconds to minutesMinutes to hours
Use CaseDesign, avg performanceOperations, control, events

1.3 Dynamic Simulation Concepts ​

State Variables: Values that change over time

  • Biomass concentrations
  • Substrate concentrations
  • Dissolved oxygen
  • Tank volumes (for variable volume tanks)

Time Integration: Methods to solve differential equations

  • Euler: Simple, fast, less accurate
  • Runge-Kutta 4: Balanced accuracy and speed (recommended)
  • Rosenbrock: Stiff systems, high accuracy

Time Step: Interval between calculations

  • Smaller steps = more accurate, slower
  • Larger steps = faster, may miss dynamics
  • Typical: 2-15 minutes for most applications

Note: ErgoPlanner uses adaptive time-stepping by default to balance accuracy and performance.

Step 2: Create Dynamic Simulation Project ​

2.1 Start from Existing Project ​

The easiest way to set up dynamic simulation:

  1. Create and configure a steady-state project first (see Creating-Projects)
  2. Run steady-state simulation successfully
  3. Use steady-state results as initial conditions for dynamic run

Why? Steady-state provides realistic initial concentrations and flows. Starting dynamic "cold" (from zero) requires long equilibration time.

2.2 Configure for Dynamic Simulation ​

  1. Open your configured project
  2. Click "Run Simulation" in the toolbar
  3. Select "Dynamic" as simulation type
  4. The interface will update to show dynamic-specific options

Screenshot placeholder: Run Simulation dialog with "Dynamic" radio button selected, showing additional time-related configuration options.

2.3 Set Simulation Duration ​

Configure the time period to simulate:

ParameterTypical ValueRangeUse Case
Duration7 days6 hours - 30 daysLength of simulation
Time Step5 minutes1-30 minutesCalculation interval
Output Interval15 minutes5-60 minutesResults saving frequency

Example Configurations:

Storm Event:

  • Duration: 24-48 hours
  • Time Step: 2-5 minutes
  • Output Interval: 10 minutes

Diurnal Cycle:

  • Duration: 7 days
  • Time Step: 5-10 minutes
  • Output Interval: 30 minutes

Plant Startup:

  • Duration: 14-30 days
  • Time Step: 15-30 minutes
  • Output Interval: 2 hours

Tip: Shorter time steps increase accuracy but also computation time. Start with default (5 min) and adjust if needed.

Screenshot placeholder: Dynamic simulation configuration panel showing Duration: 7 days, Time Step: 5 min, Output Interval: 15 min.

Step 3: Configure Dynamic Influent ​

The key to dynamic simulation is time-varying influent conditions.

3.1 Influent Pattern Types ​

ErgoPlanner supports several influent pattern types:

  1. Diurnal Pattern - Daily repeating pattern (typical day)
  2. Storm Event - Wet weather hydrograph
  3. Custom Time-Series - Import from CSV file
  4. Synthesized Pattern - Generate from parameters

3.2 Configure Diurnal Pattern ​

Most WWTPs experience daily flow and load patterns:

  1. Click on the Influent stream
  2. In properties panel, click "Dynamic Configuration"
  3. Select "Diurnal Pattern"
  4. Configure the pattern:

Typical Municipal Diurnal Pattern:

Time of DayFlow MultiplierCOD MultiplierTKN Multiplier
00:00 - 06:000.60.50.5
06:00 - 09:001.41.31.4
09:00 - 12:001.21.11.2
12:00 - 15:001.11.01.1
15:00 - 18:001.00.91.0
18:00 - 21:001.31.21.3
21:00 - 24:000.80.70.8

Base flow: 10,000 m³/day Base COD: 500 mg/L Base TKN: 40 mg/L

The multipliers are applied to base values at each time.

Tip: Peak flows typically occur during morning hours (6-9 AM) when domestic water use is highest.

Screenshot placeholder: Diurnal pattern configuration showing time-of-day table with flow and concentration multipliers. Graph preview shows flow pattern over 24 hours.

3.3 Configure Storm Event ​

For wet weather analysis:

  1. Select "Storm Event" pattern type
  2. Choose storm characteristics:
ParameterValueDescription
Storm TypeDesign StormType of event
Return Period10 yearsFrequency (2, 5, 10, 25, 50, 100 yr)
Duration6 hoursLength of storm
Peak Intensity50 mm/hrMaximum rainfall rate
PatternSCS Type IITemporal distribution
  1. Configure I&I (Inflow & Infiltration):
ParameterValueUnit
I&I Coefficient2.5-
Response Time2hours
Decay Time12hours

The resulting hydrograph shows:

  • Pre-storm base flow: 10,000 m³/day
  • Peak flow: 45,000 m³/day (4.5x base)
  • Duration of peak: ~8 hours total
  • Return to base: ~18 hours after storm start

Warning: Ensure your process units can handle peak flows. Check clarifier overflow rates and tank volumes.

Screenshot placeholder: Storm event configuration dialog with parameters above. Preview graph shows flow hydrograph with steep rise to peak and gradual recession.

3.4 Import Time-Series Data ​

For actual plant data or custom patterns:

  1. Select "Import Time-Series"
  2. Click "Choose File"
  3. Select CSV file with this format:
csv
Time,Flow_m3d,COD_mgL,BOD_mgL,TSS_mgL,TKN_mgL,NH4N_mgL,TP_mgL,Temp_C
0,8500,450,220,280,38,22,7.5,19.5
15,8800,460,225,285,39,23,7.6,19.6
30,9200,475,230,290,40,24,7.7,19.8
45,9800,490,240,300,41,25,7.8,20.0
60,10500,510,250,310,42,26,7.9,20.1
...

CSV Format Requirements:

  • First column: Time in minutes from start
  • Header row: Parameter names with units
  • Data rows: Numeric values
  1. Click "Import and Validate"
  2. Preview shows the imported data graphically
  3. Click "Apply"

Tip: You can export data from SCADA systems, lab databases, or Excel to create input files.

Screenshot placeholder: Import time-series dialog showing file upload area and preview graph of imported flow and COD data over time.

Step 4: Configure Process Units for Dynamics ​

Some process units need additional dynamic configuration.

4.1 Reactor Initial Conditions ​

Set starting concentrations for reactors:

  1. Click on Aeration Tank
  2. Navigate to "Dynamic" tab in properties
  3. Choose initial condition source:

Option 1: From Steady-State

  • Use results from previous steady-state run
  • Recommended - provides realistic starting point

Option 2: Manual Entry

  • Enter concentrations manually
  • Use when steady-state not available

Option 3: Default Values

  • Use typical values from literature
  • Requires long equilibration period
ComponentDefaultTypical Range
X_H (heterotrophs)1,8001,000-3,000 mg COD/L
X_A (autotrophs)8020-150 mg COD/L
S_S (substrate)21-10 mg COD/L
S_O (oxygen)2.00-8 mg/L
S_NO (nitrate)00-20 mg N/L
S_NH (ammonia)10-5 mg N/L

Tip: Always use "From Steady-State" if possible. It eliminates equilibration time.

Screenshot placeholder: Reactor dynamic configuration tab showing "Initial Conditions" dropdown set to "From Steady-State" with preview of concentrations.

4.2 Clarifier Dynamic Settings ​

Secondary clarifiers have settling dynamics:

  1. Click on Secondary Clarifier
  2. Dynamic tab → Settling Model: Takács (dynamic)
  3. Configure layers:
ParameterValueDescription
Number of Layers10Vertical discretization
Hindered SettlingEnabledAccounts for concentration effects
CompressionEnabledBottom sludge thickening

Note: More layers = more accurate but slower. 10 layers is typically adequate.

4.3 Controller Settings ​

Controllers respond dynamically to process changes:

  1. Click on DO Controller (if present)
  2. Configure PID parameters:
ParameterTypical ValueRange
Setpoint2.0 mg/L1.0-4.0
Kp (proportional)101-50
Ki (integral)0.50.1-2.0
Kd (derivative)1.00-5.0
Sample Time5 min1-15 min

See Controller-Setup for detailed controller configuration.

Tip: Conservative controller tuning (lower gains) prevents oscillations during dynamic runs.

Screenshot placeholder: PID controller configuration panel showing setpoint, Kp, Ki, Kd parameters with sample time setting.

Step 5: Advanced Dynamic Settings ​

5.1 Integration Method Selection ​

Choose the numerical integration method:

MethodAccuracySpeedBest For
EulerLowFastQuick checks, stable systems
RK4HighMediumMost applications (recommended)
RosenbrockVery HighSlowStiff systems, high accuracy needs

Recommended: Start with RK4. Switch to Rosenbrock if you encounter:

  • Numerical instability
  • Concentration oscillations
  • Solver crashes

5.2 Adaptive Time-Stepping ​

Enable for automatic time step adjustment:

  1. Check ☑ "Enable Adaptive Time-Stepping"
  2. Configure parameters:
ParameterValueDescription
Min Time Step0.5 minSmallest allowed step
Max Time Step15 minLargest allowed step
Target Error1e-4Error tolerance
Max Step Increase2.0xMaximum step size growth

Adaptive stepping:

  • Reduces step size during rapid changes (storms, control actions)
  • Increases step size during stable periods
  • Improves both accuracy and performance

Tip: Adaptive stepping can reduce simulation time by 30-50% without sacrificing accuracy.

5.3 Output Configuration ​

Control how results are saved:

SettingValueImpact
Output Interval15 minHow often to save results
Save All State VariablesNoDisk space vs detail
Compress OutputYesReduce file size

Example file sizes (7-day simulation):

  • Output every 5 min, all variables: ~500 MB
  • Output every 15 min, key variables only: ~50 MB
  • Output every 30 min, key variables: ~25 MB

Warning: Saving every time step for long simulations generates huge files. Use output interval wisely.

Screenshot placeholder: Advanced dynamic settings showing integration method dropdown (RK4 selected) and adaptive time-stepping configuration.

Step 6: Run Dynamic Simulation ​

6.1 Pre-Flight Check ​

Before running, verify:

  • ✓ Steady-state simulation successful (for initial conditions)
  • ✓ Dynamic influent configured
  • ✓ Simulation duration appropriate for analysis
  • ✓ Time step selected (5-10 min recommended)
  • ✓ Output interval set
  • ✓ Sufficient disk space for results

6.2 Start Simulation ​

  1. Review all settings in the Run Simulation dialog
  2. Click "Start Dynamic Simulation"
  3. Progress dialog appears showing:
    • Current simulation time (e.g., "Day 2, 14:30")
    • Progress bar (% complete)
    • Elapsed real time
    • Estimated time remaining

Screenshot placeholder: Dynamic simulation progress dialog showing "Simulating: Day 2 14:30 / 7 days (35% complete)", progress bar, elapsed time: 8:23, estimated remaining: 15:12.

6.3 Monitor During Simulation ​

The progress dialog shows real-time monitoring:

Key Indicators (updated every 10 steps):

  • Current time in simulation
  • Solver status (Integrating / Adjusting Step / Converged)
  • Active time step size
  • Average iterations per step
  • Warning/error count

Common Progress Indicators:

  • "Integrating steadily" - Normal operation
  • "Reducing time step" - Handling rapid changes (expected during storms)
  • "Increasing time step" - Stable period, speeding up

Tip: Dynamic simulations take longer than steady-state. A 7-day simulation may take 10-30 minutes of real time.

6.4 Pause and Resume ​

You can pause long simulations:

  1. Click "Pause" in progress dialog
  2. Simulation pauses at next time step
  3. Click "Resume" to continue
  4. Or click "Stop and Save" to end early

Results are saved up to the paused time.

Note: You can close your browser and the simulation continues on the server (for server deployments). Check simulation status from Projects page.

Step 7: Analyze Dynamic Results ​

7.1 Results Dashboard ​

When simulation completes, the Results page shows dynamic-specific views:

Available Views:

  1. Time-Series Charts - Parameter vs time graphs
  2. Animations - Animated flow through process
  3. Snapshots - Results at specific times
  4. Statistics - Min/max/average over simulation
  5. Mass Balance - Time-integrated balances

Screenshot placeholder: Dynamic results dashboard with time-series chart showing effluent NH4-N varying over 7 days, with tabs for different view types.

7.2 Time-Series Charts ​

View how parameters change over time:

  1. Select "Time-Series" tab
  2. Choose location (e.g., "Effluent", "Aeration Tank")
  3. Select parameters to plot:
    • ☑ Flow
    • ☑ COD
    • ☑ NH₄-N
    • ☐ NO₃-N
    • ☑ TSS

The chart displays all selected parameters with dual Y-axes if units differ.

Interactive Features:

  • Zoom: Click and drag to zoom in
  • Pan: Shift+drag to pan
  • Cursor: Hover to see exact values
  • Export: Save chart as PNG or SVG

Tip: Look for patterns like diurnal cycles, storm response, and equilibration periods.

Screenshot placeholder: Time-series chart showing multiple parameters over 7 days. Flow (blue) shows daily peaks, NH4-N (red) shows slight variation following flow pattern.

7.3 Storm Event Analysis ​

For storm simulations, analyze:

During Storm (first 12 hours):

  • Peak flow rate and duration
  • Washout of solids from clarifier
  • DO drop in aeration (dilution effect)
  • Effluent quality degradation

After Storm (12-48 hours):

  • Return to normal concentrations
  • Time to recover effluent quality
  • Temporary nutrient accumulation

Example Storm Results:

ParameterPre-StormPeak Storm24h PostPermit Limit
Effluent NH₄-N0.8 mg/L15.2 mg/L1.2 mg/L2.0 mg/L
Effluent TSS10 mg/L48 mg/L12 mg/L30 mg/L
MLSS3,500 mg/L2,100 mg/L3,200 mg/L-
DO2.0 mg/L3.8 mg/L2.1 mg/L-

Interpretation:

  • ✓ NH₄-N recovers quickly, stays within permit
  • ✗ TSS exceeds limit during storm (peak 48 mg/L > 30 mg/L)
  • MLSS diluted by 40% during peak flow
  • DO increased due to reduced oxygen demand (dilution)

Action Items:

  • Consider flow equalization to dampen peaks
  • Evaluate clarifier capacity under wet weather
  • Implement bypass treatment for extreme events

7.4 Diurnal Pattern Analysis ​

For diurnal simulations, check:

Pattern Stabilization:

  • First 1-2 days: System equilibrates to dynamic pattern
  • Days 3-7: Steady repeating diurnal cycle

Daily Variation:

  • Identify minimum effluent quality time (usually morning)
  • Quantify range of variation (e.g., NH₄-N: 0.5-1.5 mg/L)
  • Verify all times stay within permits

Example Diurnal Results (Day 5):

TimeInfluent FlowEffluent NH₄-NEffluent TSSDO
00:006,000 m³/d0.6 mg/L8 mg/L2.5 mg/L
06:0014,000 m³/d1.2 mg/L12 mg/L1.8 mg/L
12:0011,000 m³/d1.0 mg/L10 mg/L2.0 mg/L
18:0013,000 m³/d1.1 mg/L11 mg/L1.9 mg/L

All values repeat daily after Day 3, indicating stable operation.

Tip: Export Day 5-7 data only to focus on stabilized behavior and exclude equilibration period.

7.5 Statistics Summary ​

View summary statistics across the entire simulation:

ParameterMinMaxMeanStd Dev95th %
Effluent BOD₅5.212.88.11.410.6
Effluent TSS7.518.311.22.114.8
Effluent NH₄-N0.41.80.90.31.4
MLSS3,2003,7503,480953,650
DO1.52.82.00.22.3

Permit Compliance Check:

  • 95th percentile values indicate worst-case normal operation
  • All 95th percentile values should be < permit limits
  • Maximum values may exceed limits briefly during upsets (check permit averaging period)

Screenshot placeholder: Statistics summary table showing min/max/mean/stdev for all effluent parameters, with permit limits column for comparison.

Step 8: Compare Scenarios ​

8.1 Run Multiple Scenarios ​

To compare control strategies or design alternatives:

  1. Create base project with dynamic configuration
  2. Run base case dynamic simulation
  3. Duplicate project (File → Duplicate)
  4. Modify scenario (e.g., add controller, increase volume)
  5. Run modified scenario
  6. Compare results side-by-side

Example Comparison: With vs Without DO Control

Screenshot placeholder: Side-by-side time-series charts comparing two scenarios: "Base Case" (red) and "With DO Control" (blue) showing effluent NH4-N over time.

8.2 Scenario Comparison Results ​

MetricBase CaseWith DO ControlImprovement
Avg NH₄-N1.2 mg/L0.6 mg/L50% reduction
Max NH₄-N2.8 mg/L1.4 mg/L50% reduction
Avg DO2.0 mg/L2.1 mg/LMaintained
Energy Use1,850 kWh/d1,780 kWh/d3.8% savings

Conclusion: DO control improves effluent quality AND reduces energy.

Step 9: Export Dynamic Results ​

9.1 Export Time-Series Data ​

Export to CSV for detailed analysis:

  1. Click "Export" → "Time-Series CSV"
  2. Select time range:
    • ○ Full simulation
    • ● Days 3-7 (exclude equilibration)
    • ○ Custom range
  3. Select parameters:
    • ☑ All effluent parameters
    • ☑ Reactor concentrations
    • ☐ Intermediate streams
  4. Click "Export"

Output: CSV file with columns:

csv
Time_days,Flow_m3d,COD_mgL,BOD_mgL,NH4N_mgL,TSS_mgL,MLSS_mgL,DO_mgL
3.00,10200,125,8.2,0.7,10.5,3520,2.0
3.01,10350,128,8.4,0.8,10.8,3515,1.9
...

Use this data in Excel, Python, MATLAB, or R for advanced analysis.

9.2 Generate Dynamic Report ​

Create PDF report with dynamic results:

  1. Click "Export" → "PDF Report"
  2. Select report template: "Dynamic Simulation Report"
  3. Configure report sections:
    • ☑ Executive Summary
    • ☑ Time-Series Charts (key parameters)
    • ☑ Statistical Summary
    • ☑ Event Analysis (storms, upsets)
    • ☑ Mass Balance
    • ☐ Full Time-Series Data Tables (can be very long)
  4. Click "Generate"

Report includes:

  • Project description and configuration
  • Influent pattern description
  • Key time-series charts (flow, effluent quality, reactor conditions)
  • Statistical tables
  • Permit compliance summary
  • Conclusions and recommendations

Tip: Generate separate reports for different stakeholders: detailed for engineers, summary for management.

Screenshot placeholder: PDF report preview showing executive summary page with time-series charts and statistical table.

Step 10: Advanced Topics ​

10.1 Plant Startup Simulation ​

Simulate bringing new plant online:

Configuration:

  • Duration: 30 days
  • Initial conditions: Empty tanks, no biomass
  • Seeding: Day 1, add seed sludge (200 mg/L)
  • Influent: Gradually increase from 50% to 100% over 7 days

Track:

  • Biomass growth (X_H, X_A)
  • Effluent quality improvement over time
  • Time to reach steady-state performance

Typical Results:

  • Day 1-7: Biomass acclimation, poor effluent
  • Day 7-14: Rapid biomass growth
  • Day 14-21: Nitrification establishment
  • Day 21-30: Stabilization at full performance

10.2 Process Upset Analysis ​

Simulate upsets to test resilience:

Toxic Shock:

  • Inject high concentration toxic substance at specific time
  • Observe biomass inhibition and recovery
  • Estimate recovery time

Power Outage:

  • Set DO = 0 for specified period
  • Watch denitrification and sulfide production
  • Analyze return to aerobic operation

Pump Failure:

  • Stop RAS pump for period
  • Observe solids accumulation in clarifier
  • Check if system recovers or fails

Warning: These scenarios may cause simulation instability. Save project before attempting.

10.3 Seasonal Variation ​

Simulate annual temperature variation:

Temperature Profile:

csv
Time_days,Temp_C
0,8
30,9
60,12
90,15
120,18
150,21
180,22
210,21
240,18
270,14
300,10
330,8

Effects to Observe:

  • Winter: Slower kinetics, poorer nitrification
  • Summer: Faster kinetics, potential DO limitation
  • Spring/Fall: Transition periods

Analysis:

  • Identify worst-case season for effluent quality
  • Size equipment for most challenging conditions
  • Plan operational adjustments (SRT, DO) seasonally

Summary ​

You've learned to:

  • ✓ Understand when to use dynamic vs steady-state simulation
  • ✓ Configure time-varying influent patterns (diurnal, storm, custom)
  • ✓ Set up process units for dynamic operation
  • ✓ Select integration methods and time steps
  • ✓ Run dynamic simulations and monitor progress
  • ✓ Analyze time-series results and statistics
  • ✓ Compare scenarios to evaluate alternatives
  • ✓ Export dynamic data and generate reports
  • ✓ Simulate special events (storms, upsets, startup)

Common Issues ​

IssueCauseSolution
Simulation crashes earlyInitial conditions unrealisticUse steady-state results for initial conditions
Results oscillateTime step too largeReduce time step to 2-5 min
Very slow simulationTime step too smallIncrease time step or enable adaptive stepping
Concentrations go negativeNumerical instabilitySwitch to Rosenbrock integrator, reduce time step
No diurnal pattern visibleSimulation too shortRun at least 3-5 days to see pattern stabilize
Huge result filesSaving too frequentlyIncrease output interval to 15-30 min

For more troubleshooting, see Troubleshooting.

Next Steps ​

Continue your learning with advanced topics:


Related Topics:


Last updated: December 2025Tutorial difficulty: AdvancedEstimated completion time: 45 minutes