Decision Models and Optimization


Lecture 11

October 15, 2025

Review of Last Class

Last Class

  • Prescriptive Modeling: For Decision-Making
  • Many approaches to optimization, including gradient descent and “random” search.

Questions?

Poll Everywhere QR Code

Text: VSRIKRISH to 22333

URL: https://pollev.com/vsrikrish

See Results

Optimization Example

Decision Modeling for Wastewater Treatment

Wastewater Release Model

Goal: Identify treatment levels for each release which ensure compliance with regulatory standard of \(1 \ \text{mg}/\text{L}\).

Optimization Problem Formulation

Need 3 components:

  1. Decision variable(s)
  2. Objective function(s)
  3. Constraint(s)

Decision Variables

Wastewater Release Model

What are the decision variables?

Formulating The Objective

What might our objective be?

What information do we need?

Suppose treatment costs \[\$50 E^2 \text{ per } 1000 \ \text{m}^3,\] where \(E\) is the treatment efficiency.

Objectives and Metrics

Objectives are goals, such as “minimize cost” or “maximize environmental quantity”.

Metrics are functions which measure some relevant quantity, in this case the specific cost function.

Many different metrics can be used to specify an objective function!

Objective Function

The objective function includes a goal and a metric:

\[\begin{align*} \min_{E_1, E_2} \quad &50(100)E_1^2 + 50(60)E_2^2 \\ = \min_{E_1, E_2} \quad &5000E_1^2 + 3000E_2^2. \end{align*}\]

Identifying Constraints

Wastewater Release Model

What are relevant constraints?

What information do we need?

Constraint for First Segment

Where does the maximum value of the first segment occur?

Wastewater Schematic

Constraint for First Segment

Where does the maximum value of the first segment occur?

\[100 + 1000(1-E_1) \leq 600 \]

\[\Rightarrow \boxed{1000E_1 \geq 500}\]

Constraint for Second Segment

What is the concentration at the second release with treatment level \(E_2\)?

Wastewater Schematic

Constraint for Second Segment

Assume decay rate of \(0.45\ \text{d}^{-1}\):

\[ \begin{aligned} \frac{dM}{dt} &= -0.45 M \Rightarrow \frac{dM}{M} = -0.45 dt \\[0.5em] M(t) &= M(0) \exp\left(-0.45 t\right) \\[0.5em] M(x) &= M_0 \exp\left(-\frac{0.45 x}{25}\right), \quad x \leq 10 \ \text{km} \\[0.5em] M(10) &= (1100 - 1000E_1) \exp(-0.18) \ \text{kg} \end{aligned} \]

Constraint for Second Segment

What is the concentration at the second release with treatment level \(E_2\)?

\[(1100 - 1000E_1) \exp(-0.18) + 1200(1 - E_2) \leq 660 \]

\[\begin{aligned} (1100 - 1000E_1) 0.835 + 1200(1 - E_2) &\leq 660 \\[0.5em] 2119 - 835E_1 - 1200E_2 &\leq 660 \end{aligned}\]

\[\Rightarrow \boxed{835E_1 + 1200E_2 \geq 1459}\]

Additional Constraints?

We have two concentration compliance constraints:

\[\begin{align*} 1000 E_1 &\geq 500\\[0.5em] 835E_1 + 1200E_2 &\geq 1459 \end{align*}\]

Are these a complete set?

Boundary Constraints

We need to add boundary constraints for \(E_1\), \(E_2\) to avoid implausible treatment levels.

\[\begin{align*} 1000 E_1 &\geq 500\\[0.5em] 835E_1 + 1200E_2 &\geq 1459\\[0.5em] \color{purple}E_1, E_2 &\;\color{purple}\geq 0 \\[0.5em] \color{purple}E_1, E_2 &\;\color{purple}\leq 1 \end{align*}\]

Final Problem

\[\begin{alignat}{3} & \min_{E_1, E_2} &\quad 5000E_1^2 + 3000E_2^2 & \\\\ & \text{subject to:} & 1000 E_1 &\geq 500 \\ & & 835E_1 + 1200E_2 &\geq 1459 \\ & & E_1, E_2 &\;\geq 0 \\ & & E_1, E_2 &\;\leq 1 \end{alignat}\]

Solving The Problem

Plotting the Decision Space

Plotting the Feasible Region

The Solution!

So the solution occurs at the intersection of the two constraints, where:

\[E_1 = 0.5, E_2 = 0.85\]

and the cost of this treatment plan is

\[C(0.5, 0.85) = \$ 3417.\]

Does this solution make sense?

Waste Load Allocation Problem

This is an example of a waste load allocation problem.

Each source is allocated a “load” they can discharge based on waste fate and transport.

Waste Load Allocation Problem

Waste loads affect quality \(Q\) based on F&T model:

\[Q=f(W_1, W_2, \ldots, W_n)\]

So the general form for a prescriptive waste load allocation model:

\[\begin{aligned} \text{determine} & \quad W_1, W_2, \ldots, W_n \notag \\\\ \text{subject to:} & \quad f(W_1, W_2, \ldots, W_n) \geq Q^* \notag \end{aligned}\]

Linear Programming

What is Linear Programming?

Linear programming refers to optimization for linear models.

As we will see over the next few weeks, linear models are:

  • relatively simple (which lets us solve and analyze them “easily”);
  • surprisingly applicable to many contexts!

Linear Functions

Recall that a function \(f(x_1, \ldots, x_n)\) is linear if \[f(x_1, \ldots, x_n) = a_1x_1 + a_2x_2 + \ldots + a_n x_n.\]

The key is that linear models are very simple geometrically:

  • Define hyperplanes;
  • Constant derivatives/gradients.

Linear Programs

A linear program (LP), or a linear optimization model, has the following characteristics:

  • Linearity: The objective function and constraints are all linear;
  • Divisibility: The decision variables are continuous (they can be fractional levels);
  • Certainty: The problem is deterministic.

Why Is Solving LPs Straightforward?

All solutions must exist on the boundary of the feasible region (which must be a polytope).

Why Is Solving LPs Straightforward?

More specifically:

  • an optimum solution must occur at the intersection of constraints;
  • can focus on finding and analyzing the corners.

Why Is Solving LPs Straightforward?

This is the basis of all simplex methods for solving LPs.

These methods go back to George Dantzig in the 1940s and are still widely used today.

Why Do LPs Have A Corner Solution?

Can a solution be in the interior?

Why Do LPs Have A Corner Solution?

What about along an edge but not a corner?

Example: Solving an LP

\[\begin{alignedat}{3} & \max_{x_1, x_2} & 230x_1 + 120x_2 & \\\\ & \text{subject to:} & &\\ & & 0.9x_1 + 0.5x_2 &\leq 600 \\ & & x_1 + x_2 &\leq 1000 \\ & & x_1, x_2 &\geq 0 \end{alignedat}\]

Code
x1 = 0:1200
x2 = 0:1400
f1(x) = (600 .- 0.9 .* x) ./ 0.5
f2(x) = 1000 .- x

p = plot(0:667, min.(f1(0:667), f2(0:667)), fillrange=0, color=:lightblue, grid=true, label="Feasible Region", xlabel=L"x_1", ylabel=L"x_2", xlims=(-50, 1200), ylims=(-50, 1400), framestyle=:origin, minorticks=4, right_margin=4mm, left_margin=4mm)
plot!(0:667, f1.(0:667), color=:brown, linewidth=3, label=false)
plot!(0:1000, f2.(0:1000), color=:red, linewidth=3, label=false)
annotate!(400, 1100, text(L"0.9x_1 + 0.5x_2 = 600", color=:purple, pointsize=18))
annotate!(1000, 300, text(L"x_1 + x_2 = 1000", color=:red, pointsize=18))
plot!(size=(600, 500))

Example: Solving an LP

\[\begin{alignedat}{3} & \max_{x_1, x_2} & 230x_1 + 120x_2 & \\\\ & \text{subject to:} & &\\ & & 0.9x_1 + 0.5x_2 &\leq 600 \\ & & x_1 + x_2 &\leq 1000 \\ & & x_1, x_2 &\geq 0 \end{alignedat}\]

Code
Z(x1,x2) = 230 * x1 + 120 * x2
contour!(0:660,0:1000,(x1,x2)->Z(x1,x2), levels=5, c=:devon, linewidth=2, colorbar = false, clabels = true)

Examining Corner Points

Corner \((x_1, x_2)\) Objective
\((0,0)\) \(0\)
\((0, 1000)\) \(12000\)
\((667, 0)\) \(153410\)
\((250, 750)\) \(147500\)
Code
scatter!(p, [0, 0, 667, 250], [0, 1000, 0, 750], markersize=10, z=2, label="Corner Point", markercolor=:orange)

Solving an LP

Manually checking the corner points is all well and good for this simple example, but does it scale well?

LP solvers (often based off the simplex method) automate this process.

Key Takeaways

Key Takeaways

  • Linear Programs: straightforward to solve!
  • For an LP, an optimum must occur at a corner of the feasible polytope.

Upcoming Schedule

Next Classes

Monday: More Linear Programming and Electric Power Systems

Assessments

HW3: Due next Thursday (10/23) at 9pm.

HW4: Will Be Released On 10/27.

Project Proposal: Due 10/24.

References