Presentation is loading. Please wait.

Presentation is loading. Please wait.

Numerical Integration CE5504 – Surface Water Quality Modeling  non-idealized loading functions  variable parameters  multi-segment systems  non-linear.

Similar presentations


Presentation on theme: "Numerical Integration CE5504 – Surface Water Quality Modeling  non-idealized loading functions  variable parameters  multi-segment systems  non-linear."— Presentation transcript:

1 Numerical Integration CE5504 – Surface Water Quality Modeling  non-idealized loading functions  variable parameters  multi-segment systems  non-linear kinetics

2 The Euler Method CE5504 – Surface Water Quality Modeling

3 The Effect of Step Size CE5504 – Surface Water Quality Modeling (Spain 1982, Figure 5.1)

4 Code CE5504 – Surface Water Quality Modeling

5 Code (continued) CE5504 – Surface Water Quality Modeling

6 Code (continued) CE5504 – Surface Water Quality Modeling

7 Advanced Numerical Techniques The Heun’s Method CE5504 – Surface Water Quality Modeling 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

8 CE5504 – Surface Water Quality Modeling Advanced Numerical Techniques The 4 th 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

9 Advanced Numerical Techniques Error Comparison CE5504 – Surface Water Quality Modeling Error (%) for various values of dt at t = 5 days dtEulerHeun4th RK 198.9085.8123.70 0.595.3556.703.60 0.158.685.580.01 0.019.400.07 0.0010.990.001 0.00010.10 0.000010.02 0.0000010.001 Error criterion: <=0.01 %


Download ppt "Numerical Integration CE5504 – Surface Water Quality Modeling  non-idealized loading functions  variable parameters  multi-segment systems  non-linear."

Similar presentations


Ads by Google