Lecture 06
September 6, 2023
Text: VSRIKRISH to 22333
Simulation: evaluating a model to understand how a system might evolve under a particular set of conditions.
Think of simulation as data generation (or generative modeling).
The model represents a particular data-generating process.
For the shallow lake model
\[X_{t+1} = X_t + a_t + y_t + \frac{X_t^q}{1 + X_t^q} - bX_t, \quad y_t \sim \text{LogNormal}(\mu, \sigma^2). \]
we need to simulate because:
Text: VSRIKRISH to 22333
Variable | Value | Units |
---|---|---|
\(X_0\) | \(0\) | dimensionless |
\(\mu\) | \(\log(0.03)\) | dimensionless |
\(\sigma^2\) | \(0.1\) | dimensionless |
\(q\) | \(2.5\) | dimensionless |
\(b\) | \(0.4\) | dimensionless |
Simulation also facilitates analyses of multiple outcomes of interest, which can involve tradeoffs.
For example:
Box models are a common building block of simulation models.
Box models are all about mass-balance (mass \(m\)), assume well-mixed within box.
Can be steady-state \((\dot{m} = 0)\) or not.
Many simulation models are built by:
Some applications of box models include:
Let’s look at a simple steady-state box model of an airshed.
Variable | Meaning | Units |
---|---|---|
\(m\) | mass of some air pollutant | g |
\(C\) | concentration in box | g/m\(^3\) |
\(S, D\) | source, deposition rate within the box | g/s |
\(u\) | wind speed | m/s |
\(L, W, H\) | box dimensions | m |
What is relevant for the box dimensions \(L\), \(W\), and \(H\)? Primarily the assumption(s) about mixing.
Steady-state box ⇒ \(\dot{m} = 0\).
\[\begin{align} 0 &= m_\text{in} - m_\text{out} + S - D \\[0.5em] &\class{\fragment}{{} = (u WH) C_\text{in} - (u WH) C + S - D } \\[0.5em] \end{align}\]
Solving for \(C\): \[C = C_{in} + \frac{S-D}{uWH}\]
Now let’s assume some process affecting \(m\) depends on time.
For example: let’s say we care about an air pollutant which has a first-order decay rate \(k\), so \(L(t) = -km_\text{box}(t)\).
\[\Rightarrow \dot{m} = m_\text{in} - m_\text{out} + S - km_\text{box}(t)\]
\[\begin{gather} &\dot{m} = \frac{d(CV)}{dt} = \overbrace{(u WH) C_\text{in}}^{\text{inflow}} - \overbrace{(u WH) C}^{\text{outflow}} + \overbrace{S - D}^{\text{net emissions}} - \overbrace{kCV}^{\text{mass decay}} \\[0.5em] &\class{fragment}{{} \frac{dC}{dt} = \underbrace{\frac{u WH}{V} C_\text{in} + \frac{S - D}{V}}_{\Large =P} - \underbrace{\left(\frac{u WH}{V} + k\right)}_{\Large =l} C} \\[0.5em] &\class{fragment}{{} \frac{dC}{dt} = P - l C} \end{gather}\]
\[\begin{gather} &\frac{dC}{dt} = P - l C \\[0.5em] &\class{fragment}{{} \int \frac{dC}{P-lC} = \int dt} \\[0.5em] &\class{fragment}{{} -\frac{1}{l} \ln\left(P-lC\right) = t + A} \\[0.5em] &\class{fragment}{{} \underbrace{C(0) = C_0}_\text{initial condition} \Rightarrow A = -\frac{1}{l} \ln\left(P-lC_0\right)} \end{gather}\]
\[\begin{gather} &-\frac{1}{l} \ln\left(P-lC\right) = t - \frac{1}{l} \ln\left(P-lC_0\right) \\[0.5em] &\class{fragment}{{} -\frac{1}{l} \ln\left(\frac{P-lC}{P-lC_0}\right) = t} \\[0.5em] &\class{fragment}{{} C = -\frac{1}{l} \left(P - e^{-lt}\left(P-lC_0\right)\right)} \\[0.5em] &\class{fragment}{{} C(t) = C_0 e^{-lt} + \frac{P}{l}\left(1 - e^{-lt}\right) } \end{gather}\]
\[C(t) = \color{red}C_0 e^{-lt} \color{black}+ \color{blue}\frac{P}{l}\left(1 - e^{-lt}\right)\]
Can also incorporate more complex in/outflow dynamics:
To make this into a multi-box model, we can string together boxes to account for fluxes between them.
But this lets us account for spatially-heterogeneous flows.
Example: Two-box “simple” climate models which model the ocean and atmosphere as separate boxes.
More boxes (higher resolution) typically allows us to simulate more detailed dynamics.
But each box needs to be resolved in sequence to generate fluxes, so more boxes results in greater computational complexity.
Friday: Building a Model for Dissolved Oxygen
Homework: