Vous êtes sur la page 1sur 7

-Not possible to find model you want to solve

-Not available create one


-Available use available
Types of Models:
Many ways to create models
-Mechanistic: Observed phenomena on the basis of underlying fundamental concepts
-Phenomenological: Describe observed phenomena with empirical equations (be derived from
fundamental concepts)
Examples: Darcys law, Green-Amp infiltration model.
* It may be necessary to include aspects of both to simulate real phenomena
Examples: Including the temperature-dependence of viscosity shouldnt simulate at molecular level
would use empirical equations
Focus on mechanistic model primary emphasis: Models where all the physical phenomena can be
described by interlinked equations that b=must be solved simultaneously.

The Model Development Process


- Usually an intensive process, usually with flaws at first unrealistic behavior, conceptual error
seldom obvious until we solve the equations
- Almost always revise and improve your model based on preliminary result (you may discover the
mechanism you thought was important isnt cant describe observed data
Development: Formulation Coding and Solution Validation Use: Calibration Prediction
Sensitivity Analysis Development Use
I. Formulation:
- Describe problem you want to solve as specific as possible
What are the output? What value do you expect to get?
What to input into the model
- Break down the problem into individual mechanistic components that can be described by equations
Often best to include the smallest number of phenomena possible
Balance with amount, variety of data available for calibration
Fewer adjustable parameter = more reliable calibration of prediction
(if you simulate 18 different mechanisms)
Example: Consider a regression fit of a polynomial to measure data higher
polynomial may fit the data more closely (better r^2) but wont extrapolate well beyond
data
- Write equations for each part
Really study the form of each equation is it what you expect? Plot over range of
variables to look for potential problems
- Count variables and equations
Do you have enough equations? 1 for each unknown
Do you have too many equations? Possible to write EQNs that are over-constrained
* Has anyone done this before do this before the previous steps? Can come up with better approach
* In a better position to evaluate & learn from published papers after gone through those steps
II. Coding and Solutions:
- Particularly if you are solving PDEs
- Arrange the equations in a form for solution
- Solve them (with python and numpy)
Approach depends on the linearity of the solutions
- Start with the simplest version of your model, adding component at a time and testing as you go to
make your model realistic to make sure results realistic after each addition

III. Validation:
- Check the solution against analytical solution if possible (likely need to test subset of model)
- Check things like mass balance, energy balance
- If model solutions depend on a grid spacing or time step, etc check the independence of the
selected results
- Big picture: Are you fooling yourself? Look for confirmation bias Favoring results that agree with
your hypothesis
Go to step I to fix any problem
IV. Calibration:
- Determine model parameters from a data set (could me manual or automatic)
V. Predictions:
- Make predictions for an entirely different data set. If your mechanistic model corrects, your prediction
should be reasonable (Non mechanistic models often bad at prediction outside of range of calibration
data)
VI. Sensitivity Analysis:
- How sensitive is prediction to individual parameters?
- Is calibration unique? (Different set of parameters give the same solution?)
- Can you remove mechanisms from model and get the same results
step I
Binary XOR
100 = 4 in binary
010 = 2 in binary
110 = 6 in binary

Equilibrium Models
Many interesting problems involve equilibrium. In environmental problems, components distribute
between compartments. Compartment may be soil, water, air, fish, etc.
Closed vs Open systems
Closed systems All mass added to the system remains in the system (may be transformed).
Open systems One or more components may leave or enter the system
Mass Balances
Many models involve the concept of mass balances Tracking total mass of components added to the
system.
In a closed system, mass will still be there after equilibrium
For modeling: This concept provide an essential equation: mass at equilibrium = initial mass in
system compartment.
Oil Water: Kp = C0/Cw
Air Water: Kh = Cq/Cw (Dimensionless Henry Constant)
Example:
1. Closed bottle, 1L total volume 598 mL of water, 302 mL air, add 1 mg PCE (Kh = 0.724)
-2 unknowns Conc in air, Conc in water
-Eqn 1: Kh = 0.724 = Cg/Cw
-Eqn 2: after equilibrium = mass added <=> CwVw + CgVg = m0 =1mg <=> Cw(698 mL) + Cg(302
mL) = m0
Cw = 0.00109 mg = 1.09 mg/L, Cg = 0.790 mg/L.
2. Same system, but 698 mL water, 300 mL air and 2 mL octanol PCE logKow = 3.40. Same
question as 1.
3 unknowns: Cw, Cair, Coct.
Kh = 0.724 = Cg/Cw
Kow = 10^3.40 = 2512 = Co/Cw
CwVw + CgVg + CoVo = m0 = 1mg
Cw = 0.168 mg/L
Cg = 0.122 mg/L
Co = 422 mg/L
mw = CwVw = 0.117g
mg = CgVg = 0.036g
mo = CoVo = 0.844g

Equilibrium Relationships (Cont)


Chemical Equilibria (Reverse Reaction)
pA +qB rC +sD Keq = ({C}^r {D}^s) / ({A}^q {B}^q)
{} = activity. If sufficiently dilute, activity = concentration
Common example: acid-base equilibria
HA = H+ + A- <=> Ka = [H] [A]/ [HA] (protonated form of some chemicals)
* Ka is often listed as pKa (pKa = 10^-Ka)
* Ka varies by chemicals
* pH = -log{H+}
* Above pKa, A- is the main form
* Below pKa, HA is the main form
* At pKa, two are equal
Many organic compounds have multiple pKa
Activity of Solid = 1
Special case non-ionizable solid
Complexation
M+ + L- = MLcomplex
Ks =[ML] / [M][L]
For dissolution, complexation, acid-base calculation, besure to include rxns for all possible species
Many inorganic chems have dozens of possible aqueous and solid species (wrong answer if you cant
leave them out)
For organic compounds, Kh, Kp are different for different forms.
* Example: Rule of thump is Kp is ^3 of magnitude greater for neutral vs ionic species.
Acid/base equilibria revisited:
Example: 0.001M naproxen, added to 1L of water, pH is fixed at 5.1. What is the concentration of each
species. Pka = 4.18
Eqn: HA = (H+) + (A-) Ka = 10^(-4.18) = [H+][A-]/[HA]
[H+] = 10^(-5.1) M
(A-) + (HA0= 0.001M
Rewrite 1 and plug in the definition in 2: 10^(-4.18)[HA] [H+][A-] = 0
->10^(-5.1)

Adsorptions at interfaces
Definition: surface excess, capital gamma = amount of adsorbed stuff per amount of stuffit is
adsorbed to. (more complicated than this).
Common unit: mole/m^2 or mole/g or mg (sorbate)/g (sorbent)
Linear adsorption:
capital gamma = Kd*C
Langmuir model: capital gamma = (capital gamma 0)(Kl)/(1 + (Kl)*C)
Freundlich model: capital gamma = (Kf)*(C^n)
Notes on adsorption: Freundlich is entirely phenomenological (however can be shown to be asum of
multiple langmuir eqns)
(The other two can be derived)
In some cases, may need the derivations instead of final eqns use for simulating kinetics of
adsorption
Freundlich and Langmuir are non linear complicate solutions
mass of sand in a jar w/ Vw water and add m0 of chemical msand(capital gamma) +VwC = m0
gamma = Kf(C^n) Freundlich msKfC^n + VwC = m0 there is a solution but except for certain
n, there is no analytical solutions cant use linear algebra.
Useful info about adsorption:
Major mechanisms of adsorption:
1. Hydrophobicity (high logKow) dont like water to adsorb to a greater extent, dont like dissolve
2. Charge-charge interactions soils typically negative charged positive charges often adsorb
strongly
3. Gamma max is typically on the order of 10^-6 mole/m^2 for anything that adsorb. (if gamma is
much less than this, you dont notice the adsorption, much higher no room on surface for
adsorption)
4. Solid specific area (Asolid/mass) can be estimated from d50 for non-porous materials: Asp =
6/rho(s)*d50 (rhos = surface density)
%finer (y) log(diameter) (x)
0.001M of naproxen to 1L water at pH fixed = 5.1. concentration is ?
If pH is not known? (add naproxen as acid (HA)). What is the pH and the concentration of the species.
Equilibrium equations:
Kw= 10^-14 = [H+][OH-]
Ka= 10^-4.18 = [H+][A-]/[HA]
Mass balance: Atot = 0.001M = [A-] +[HA] Dont need volume/only one phase
To get the 4th equation 0 = [H+] - [OH-] - [A-] electroneutrality in aqueous solution
There are other way to get the 4th equation (electroneutrality is easiest without pre-planning)
If something has multivalent charge, concentration is multiplied by charge:

Models involving variation in time


Models involving variation in time but not space can be formulated as ordinary differential equations
example: First order decay of chemical
dC/dt = -kC (1)
(More about where this come from later)
can solve by integrating dC/dt = -kC <=> ln(C) = -kt
ln(C/C0) = -kt <=> C/C0 = e^-kt
Simple numerical solution of ODE
To solve ode, Eulers method: Replace dt with delta(t) and integrate numerically.
For example: dC/dt = delta(C)/delta(t) => (Cnew Cold)/delta(t) = -kCold
<=> Cnew = Cold k.Cold.delta(t) <=> C/C0
Eulers method: Not very good, some systems of ODEs will fail completely w/ eulers method, there
are issues of accuracy and stability (related to step size), takes more steps to get the same level of
accuracy as many other methods (4th order runge-kutta)
problems based on mass balances can be solved reasonably well with Eulers method make sure
delta(t) is small enough)
dC/dt = -kC
write a program to solve eqn by Eulers method plot result and analytical solution on the same axis

Vous aimerez peut-être aussi