The Mathematical Modeling Process
Mathematical modeling turns a real engineering question into equations, solves them, and checks the answer against reality. Learn the modeling cycle (problem → assumptions → variables → equations → solution → validation → refinement), conservation-law thinking, choosing model complexity, non-dimensionalisation, analytic versus numerical solution, and validation — worked through on a draining tank.
Every engineering calculation is a model: a beam formula assumes small deflections, a circuit diagram assumes ideal wires, a traffic simulation assumes drivers follow rules. Modeling is the skill of choosing what to keep and what to ignore so the mathematics is solvable yet still answers the question.
Good models are as simple as possible but no simpler. They are built from conservation laws (mass, momentum, energy, charge) plus constitutive relations (Hooke's law, Ohm's law, Fourier's law), then tested against measurements.
An analogy
A model is a map: a road map ignores trees and buildings because you need routes, not scenery. The right map depends on the journey — and a map is only trusted after someone has driven the roads.
The modeling cycle
Modeling is iterative — expect to go round the loop several times.
- 1. Define the question: what number or decision is needed, and how accurately?
- 2. State assumptions: e.g. incompressible water, constant C_d, no inflow.
- 3. Choose variables and parameters: state h(t); parameters A, a, C_d, g.
- 4. Formulate equations from balance laws + constitutive relations.
- 5. Solve analytically or numerically.
- 6. Validate against data or known limits; check units and sanity.
- 7. Refine or simplify, then report with stated limitations.
Types of models
Pick the type that matches the question and the data available.
- Deterministic vs stochastic (random inputs, Monte Carlo)
- Static (algebraic) vs dynamic (ODE/PDE)
- Lumped (ODEs, one value per component) vs distributed (PDEs, fields)
- Mechanistic (first principles) vs empirical (fitted curves, ML)
- Linear vs nonlinear; continuous vs discrete-time
Verification and validation
Verification: are we solving the equations right? (code checks, convergence, comparing with analytic cases like the drain time above). Validation: are we solving the right equations? (comparing with experiments). A perfectly verified model can still be invalid if the assumptions are wrong.
Complexity, identifiability and sensitivity
Adding detail is not free: more parameters need more data and can make the model non-identifiable (different parameter sets fit equally well). Sensitivity analysis shows which parameters matter; non-dimensionalisation reveals the few groups that control behaviour. Digital twins keep models continuously calibrated with live sensor data.
Formulas
- Conservation (balance) law:
Rate of accumulation = In − Out + Generation − Consumption - Tank mass balance:
A dh/dt = Q_in − C_d a √(2gh) - Draining solution (Q_in = 0):
√h = √h₀ − (C_d a √(2g) / 2A) t - Drain time:
T = (A / C_d a) √(2h₀/g) - Equilibrium level:
h* = (Q_in / C_d a)² / (2g) - Validation metric:
RMSE = √[Σ(y_meas − y_model)² / n]
Worked example: Drain time
Given: A = 1 m², a = 10 cm², C_d = 0.62, h₀ = 2 m
Find: Time to empty.
- T = (A/C_d a)√(2h₀/g)
- = (1/0.00062) × √(4/9.81) = 1613 × 0.6386
Answer: T ≈ 1030 s (17 min)
Worked example: Equilibrium with inflow
Given: Q_in = 2 L/s, same tank
Find: Steady level h*.
- Q_in = C_d a √(2gh*)
- h* = (0.002/0.00062)² / 19.62
Answer: h* ≈ 0.530 m
Worked example: Checking assumptions
Given: Model ignores the pipe friction downstream of the orifice
Find: How to validate?
- Measure h(t) in a test
- Plot √h vs t — the model predicts a straight line
- Slope gives effective C_d
Answer: Linearity of √h vs t validates the form; slope calibrates C_d.
Tank-draining model: simulate and compare with theory
import numpy as np
# Model: A dh/dt = -Cd * a * sqrt(2 g h) (Torricelli draining)
A, a, Cd, g, h0 = 1.0, 0.001, 0.62, 9.81, 2.0
def f(h):
return -Cd * a * np.sqrt(2 * g * max(h, 0.0)) / A
# Simulate with RK4 until the tank is (nearly) empty
dt, t, h = 1.0, 0.0, h0
while h > 1e-4:
k1 = f(h); k2 = f(h + dt*k1/2); k3 = f(h + dt*k2/2); k4 = f(h + dt*k3)
h += dt * (k1 + 2*k2 + 2*k3 + k4) / 6
t += dt
T_exact = (A / (Cd * a)) * np.sqrt(2 * h0 / g)
print(f"simulated drain time = {t:.0f} s")
print(f"analytic drain time = {T_exact:.0f} s")
print(f"h after 300 s (analytic) = {(np.sqrt(h0) - Cd*a*np.sqrt(2*g)/(2*A)*300)**2:.3f} m")
# simulated drain time = 1023 s
# analytic drain time = 1030 s
# h after 300 s (analytic) = 1.005 mThe simulation stops at h = 0.1 mm; the last 0.1 mm takes about 7 s because outflow slows as √h — a nice reminder to understand a model's behaviour near its limits. The same code structure works for any tank shape A(h), where no analytic answer exists.
Common mistakes
- Wrong: Starting with the most detailed model possible. — Right: Start simple; add detail only when validation demands it.
- Wrong: Validating with the same data used to fit. — Right: Keep independent validation data.
- Wrong: Not stating assumptions. — Right: Every model result must carry its assumptions and range of validity.
Applications
- Process engineering: Tank, reactor and pipeline dynamics for control design.
- Structural design: Beam/frame idealisations before detailed FEM.
- Energy systems: Battery, building-thermal and grid models.
- Digital twins: Continuously calibrated models of live assets.
Key takeaways
- Question → assumptions → equations → solve → validate → refine.
- Build from conservation laws.
- Simple first; complexity only when needed.
- Verify the maths, validate the physics.
Going further
- Parameter estimation: Nonlinear least squares and Bayesian calibration.
- Reduced-order models: POD and surrogate models replace expensive simulations.
- Model uncertainty: Structural (form) error vs parameter error.