Appearance
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
- Completed Running-Simulations (steady-state)
- Understanding of First-Simulation
- Familiarity with Building-Process-Diagrams
- Basic knowledge of wastewater treatment dynamics
- Time-series data (optional, but helpful)
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
| Aspect | Steady-State | Dynamic |
|---|---|---|
| Time | Single point in time | Time-series over hours/days |
| Inputs | Constant values | Time-varying profiles |
| Outputs | Single set of results | Temporal profiles |
| Computation | Algebraic equations | Differential equations |
| Solve Time | Seconds to minutes | Minutes to hours |
| Use Case | Design, avg performance | Operations, 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:
- Create and configure a steady-state project first (see Creating-Projects)
- Run steady-state simulation successfully
- 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
- Open your configured project
- Click "Run Simulation" in the toolbar
- Select "Dynamic" as simulation type
- 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:
| Parameter | Typical Value | Range | Use Case |
|---|---|---|---|
| Duration | 7 days | 6 hours - 30 days | Length of simulation |
| Time Step | 5 minutes | 1-30 minutes | Calculation interval |
| Output Interval | 15 minutes | 5-60 minutes | Results 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:
- Diurnal Pattern - Daily repeating pattern (typical day)
- Storm Event - Wet weather hydrograph
- Custom Time-Series - Import from CSV file
- Synthesized Pattern - Generate from parameters
3.2 Configure Diurnal Pattern
Most WWTPs experience daily flow and load patterns:
- Click on the Influent stream
- In properties panel, click "Dynamic Configuration"
- Select "Diurnal Pattern"
- Configure the pattern:
Typical Municipal Diurnal Pattern:
| Time of Day | Flow Multiplier | COD Multiplier | TKN Multiplier |
|---|---|---|---|
| 00:00 - 06:00 | 0.6 | 0.5 | 0.5 |
| 06:00 - 09:00 | 1.4 | 1.3 | 1.4 |
| 09:00 - 12:00 | 1.2 | 1.1 | 1.2 |
| 12:00 - 15:00 | 1.1 | 1.0 | 1.1 |
| 15:00 - 18:00 | 1.0 | 0.9 | 1.0 |
| 18:00 - 21:00 | 1.3 | 1.2 | 1.3 |
| 21:00 - 24:00 | 0.8 | 0.7 | 0.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:
- Select "Storm Event" pattern type
- Choose storm characteristics:
| Parameter | Value | Description |
|---|---|---|
| Storm Type | Design Storm | Type of event |
| Return Period | 10 years | Frequency (2, 5, 10, 25, 50, 100 yr) |
| Duration | 6 hours | Length of storm |
| Peak Intensity | 50 mm/hr | Maximum rainfall rate |
| Pattern | SCS Type II | Temporal distribution |
- Configure I&I (Inflow & Infiltration):
| Parameter | Value | Unit |
|---|---|---|
| I&I Coefficient | 2.5 | - |
| Response Time | 2 | hours |
| Decay Time | 12 | hours |
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:
- Select "Import Time-Series"
- Click "Choose File"
- 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
- Click "Import and Validate"
- Preview shows the imported data graphically
- 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:
- Click on Aeration Tank
- Navigate to "Dynamic" tab in properties
- 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
| Component | Default | Typical Range |
|---|---|---|
| X_H (heterotrophs) | 1,800 | 1,000-3,000 mg COD/L |
| X_A (autotrophs) | 80 | 20-150 mg COD/L |
| S_S (substrate) | 2 | 1-10 mg COD/L |
| S_O (oxygen) | 2.0 | 0-8 mg/L |
| S_NO (nitrate) | 0 | 0-20 mg N/L |
| S_NH (ammonia) | 1 | 0-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:
- Click on Secondary Clarifier
- Dynamic tab → Settling Model: Takács (dynamic)
- Configure layers:
| Parameter | Value | Description |
|---|---|---|
| Number of Layers | 10 | Vertical discretization |
| Hindered Settling | Enabled | Accounts for concentration effects |
| Compression | Enabled | Bottom sludge thickening |
Note: More layers = more accurate but slower. 10 layers is typically adequate.
4.3 Controller Settings
Controllers respond dynamically to process changes:
- Click on DO Controller (if present)
- Configure PID parameters:
| Parameter | Typical Value | Range |
|---|---|---|
| Setpoint | 2.0 mg/L | 1.0-4.0 |
| Kp (proportional) | 10 | 1-50 |
| Ki (integral) | 0.5 | 0.1-2.0 |
| Kd (derivative) | 1.0 | 0-5.0 |
| Sample Time | 5 min | 1-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:
| Method | Accuracy | Speed | Best For |
|---|---|---|---|
| Euler | Low | Fast | Quick checks, stable systems |
| RK4 | High | Medium | Most applications (recommended) |
| Rosenbrock | Very High | Slow | Stiff 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:
- Check ☑ "Enable Adaptive Time-Stepping"
- Configure parameters:
| Parameter | Value | Description |
|---|---|---|
| Min Time Step | 0.5 min | Smallest allowed step |
| Max Time Step | 15 min | Largest allowed step |
| Target Error | 1e-4 | Error tolerance |
| Max Step Increase | 2.0x | Maximum 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:
| Setting | Value | Impact |
|---|---|---|
| Output Interval | 15 min | How often to save results |
| Save All State Variables | No | Disk space vs detail |
| Compress Output | Yes | Reduce 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
- Review all settings in the Run Simulation dialog
- Click "Start Dynamic Simulation"
- 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:
- Click "Pause" in progress dialog
- Simulation pauses at next time step
- Click "Resume" to continue
- 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:
- Time-Series Charts - Parameter vs time graphs
- Animations - Animated flow through process
- Snapshots - Results at specific times
- Statistics - Min/max/average over simulation
- 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:
- Select "Time-Series" tab
- Choose location (e.g., "Effluent", "Aeration Tank")
- 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:
| Parameter | Pre-Storm | Peak Storm | 24h Post | Permit Limit |
|---|---|---|---|---|
| Effluent NH₄-N | 0.8 mg/L | 15.2 mg/L | 1.2 mg/L | 2.0 mg/L |
| Effluent TSS | 10 mg/L | 48 mg/L | 12 mg/L | 30 mg/L |
| MLSS | 3,500 mg/L | 2,100 mg/L | 3,200 mg/L | - |
| DO | 2.0 mg/L | 3.8 mg/L | 2.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):
| Time | Influent Flow | Effluent NH₄-N | Effluent TSS | DO |
|---|---|---|---|---|
| 00:00 | 6,000 m³/d | 0.6 mg/L | 8 mg/L | 2.5 mg/L |
| 06:00 | 14,000 m³/d | 1.2 mg/L | 12 mg/L | 1.8 mg/L |
| 12:00 | 11,000 m³/d | 1.0 mg/L | 10 mg/L | 2.0 mg/L |
| 18:00 | 13,000 m³/d | 1.1 mg/L | 11 mg/L | 1.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:
| Parameter | Min | Max | Mean | Std Dev | 95th % |
|---|---|---|---|---|---|
| Effluent BOD₅ | 5.2 | 12.8 | 8.1 | 1.4 | 10.6 |
| Effluent TSS | 7.5 | 18.3 | 11.2 | 2.1 | 14.8 |
| Effluent NH₄-N | 0.4 | 1.8 | 0.9 | 0.3 | 1.4 |
| MLSS | 3,200 | 3,750 | 3,480 | 95 | 3,650 |
| DO | 1.5 | 2.8 | 2.0 | 0.2 | 2.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:
- Create base project with dynamic configuration
- Run base case dynamic simulation
- Duplicate project (File → Duplicate)
- Modify scenario (e.g., add controller, increase volume)
- Run modified scenario
- 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
| Metric | Base Case | With DO Control | Improvement |
|---|---|---|---|
| Avg NH₄-N | 1.2 mg/L | 0.6 mg/L | 50% reduction |
| Max NH₄-N | 2.8 mg/L | 1.4 mg/L | 50% reduction |
| Avg DO | 2.0 mg/L | 2.1 mg/L | Maintained |
| Energy Use | 1,850 kWh/d | 1,780 kWh/d | 3.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:
- Click "Export" → "Time-Series CSV"
- Select time range:
- ○ Full simulation
- ● Days 3-7 (exclude equilibration)
- ○ Custom range
- Select parameters:
- ☑ All effluent parameters
- ☑ Reactor concentrations
- ☐ Intermediate streams
- 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:
- Click "Export" → "PDF Report"
- Select report template: "Dynamic Simulation Report"
- 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)
- 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,8Effects 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
| Issue | Cause | Solution |
|---|---|---|
| Simulation crashes early | Initial conditions unrealistic | Use steady-state results for initial conditions |
| Results oscillate | Time step too large | Reduce time step to 2-5 min |
| Very slow simulation | Time step too small | Increase time step or enable adaptive stepping |
| Concentrations go negative | Numerical instability | Switch to Rosenbrock integrator, reduce time step |
| No diurnal pattern visible | Simulation too short | Run at least 3-5 days to see pattern stabilize |
| Huge result files | Saving too frequently | Increase output interval to 15-30 min |
For more troubleshooting, see Troubleshooting.
Next Steps
Continue your learning with advanced topics:
- Controller-Setup - Implement PID control for dynamic response
- Multi-Scenario - Advanced scenario comparison techniques
- Model-Calibration - Calibrate dynamic models to plant data
- Analyzing-Results - Advanced results interpretation
- Exporting-Data - Automation and batch export
Related Topics:
- Running-Simulations - Steady-state simulation fundamentals
- Biokinetic-Models - Understanding model dynamics
- Performance-Tips - Optimize long simulations
Last updated: December 2025Tutorial difficulty: AdvancedEstimated completion time: 45 minutes