Lab 1 - Introduction to Mathematical Modeling
1. Introduction to Operations Research Modeling
Operations Research (OR) is a scientific approach to decision-making using mathematical models.
A typical OR model consists of:
- Decision variables → what we control (e.g. production quantity)
- Objective function → what we optimize (profit, cost, service level)
- Constraints → limitations (resources, demand, capacity)
- Parameters → fixed input data
The OR modeling cycle
- Define the problem
- Build a mathematical model
- Solve using an algorithm/solver
- Interpret results and validate

3. Model vs. Language vs. Solver
Mathematical Model (Abstract)
The mathematical formulation: - decision variables - objective function - constraints
Modeling Language (Implementation)
How we write the model: - Excel, Python, GAMS, AMPL
Solver (Engine)
The algorithm that computes the solution: - Simplex method - Interior point methods - Branch-and-bound (for integer problems)
4. Example Problem: Giapetto’s Woodcarving
Each soldier generates a profit of $3, and each train generates a profit of $2. The company must decide how many soldiers and trains to produce in order to maximize total profit.
The production process is limited by available resources and demand conditions. In particular, the finishing department has at most 100 available hours, and the carpentry department has at most 80 available hours. Additionally, market demand restricts soldier production to no more than 40 units.
The objective is to determine the production quantities of soldiers and trains that maximize total profit.
Mathematical Model (Linear Program)
Let:
- \(x_1\) = number of soldiers
- \(x_2\) = number of trains
Objective:
Maximize profit:
\[ \max Z = 3x_1 + 2x_2 \]
Subject to:
\[ 2x_1 + x_2 \le 100 \]
\[ x_1 + x_2 \le 80 \]
\[ x_1 \le 40 \]
\[ x_1, x_2 \ge 0 \]
Implementation
Excel Solver
- Define decision variables in cells
- Set objective cell
- Add constraints
- Solve
Python (PuLP example)
import pulp
x1 = pulp.LpVariable("soldiers", lowBound=0)
x2 = pulp.LpVariable("trains", lowBound=0)
prob = pulp.LpProblem("Giapetto", pulp.LpMaximize)
prob += 3*x1 + 2*x2
prob += 2*x1 + x2 <= 100
prob += x1 + x2 <= 80
prob += x1 <= 40
prob.solve()
print("Status:", pulp.LpStatus[prob.status])
print("Z =", pulp.value(prob.objective))
print("x1 =", pulp.value(x1))
print("x2 =", pulp.value(x2))View Slides
Materials
Excel file [Completed]
Google Colab
- Follow Along
- Completed
GAMS Code
References
- Stanke, B. (n.d.). Operations research overview. Bob Stanke.
https://www.bobstanke.com/blog/operations-research-overview
(accessed January 29, 2026)