eren darici


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:

The OR modeling cycle

  1. Define the problem
  2. Build a mathematical model
  3. Solve using an algorithm/solver
  4. Interpret results and validate
Operations Research overview diagram

3. Model vs. Language vs. Solver

Mathematical Model (Abstract)

The mathematical formulation:

Modeling Language (Implementation)

How we write the model:

Solver (Engine)

The algorithm that computes the solution:


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:

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

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


References


← Back to Course Home: