210 likes | 415 Views
CE5504 Surface Water Quality Modeling. Lab 2. Numerical Methods and Population Growth Modeling. CE5504 – Surface Water Quality Modeling. Begin with a mass balance on microbial growth. CE5504 – Surface Water Quality Modeling. Exponential growth model. (Mihelcic 1999, Figure 5.4).
E N D
CE5504 Surface Water Quality Modeling Lab 2. Numerical Methods and Population Growth Modeling CE5504 – Surface Water Quality Modeling
Begin with a mass balance on microbial growth CE5504 – Surface Water Quality Modeling
Exponential growth model (Mihelcic 1999, Figure 5.4) CE5504 – Surface Water Quality Modeling
Environmental Resistance (Mihelcic 1999, Figure 5.5) CE5504 – Surface Water Quality Modeling
Logistic growth model (Mihelcic 1999, Figure 5.7) CE5504 – Surface Water Quality Modeling
Example: carry capacity effects (Mihelcic 1999, Figure 5.6) CE5504 – Surface Water Quality Modeling
Monod Model (Mihelcic 1999, Figure 5.8) CE5504 – Surface Water Quality Modeling
Example: resource competition (Mihelcic 1999, Figure 5.9) CE5504 – Surface Water Quality Modeling
The Yield Coefficient CE5504 – Surface Water Quality Modeling
The Death (Respiration) Coefficient CE5504 – Surface Water Quality Modeling
Putting It All Together (Batch Reactor) (Mihelcic 1999, Figure 5.10) CE5504 – Surface Water Quality Modeling
Putting It All Together (Completely-Mixed Flow Reactor) CE5504 – Surface Water Quality Modeling
Numerical Integration • non-idealized loading functions • variable parameters • multi-segment systems • non-linear kinetics CE5504 – Surface Water Quality Modeling
The Euler Method CE5504 – Surface Water Quality Modeling
The Effect of Step Size (Spain 1982, Figure 5.1) CE5504 – Surface Water Quality Modeling
Code CE5504 – Surface Water Quality Modeling
Code (continued) CE5504 – Surface Water Quality Modeling
Code (continued) CE5504 – Surface Water Quality Modeling
Advanced Numerical Techniques The Heun’s Method For i = 0 To tmax For j = 1 To 1 / dt k1 = mu * x X1 = x + dt * k1 k2 = mu * X1 x = x + (k1 + k2) / 2 * dt Next j Next i CE5504 – Surface Water Quality Modeling
Advanced Numerical Techniques The 4th Order Runge Kutta Method For i = 0 To tmax For j = 1 To 1 / dt k1 = mu * x X1 = x + 0.5 * dt * k1 k2 = mu * X1 X2 = x + 0.5 * dt * k2 k3 = mu * X2 X3 = x + dt * k3 k4 = mu * X3 x = x + (k1 + 2 * k2 + 2 * k3 + k4) / 6 * dt Next j Next i CE5504 – Surface Water Quality Modeling
Advanced Numerical Techniques Error Comparison Error (%)for various values of dt at t = 5 days dt Euler Heun 4th RK 1 98.90 85.81 23.70 0.5 95.35 56.70 3.60 0.1 58.68 5.58 0.01 0.01 9.40 0.07 0.001 0.99 0.001 0.0001 0.10 0.00001 0.02 0.000001 0.001 Error criterion:<=0.01 % CE5504 – Surface Water Quality Modeling