0% found this document useful (0 votes)
4 views49 pages

Chapter Three

Chapter Three discusses optimization techniques using calculus, focusing on functions of a single variable and their properties, including local and global maxima and minima. It explains concepts such as convex and concave functions, critical points, and the use of derivatives to find optimal values. The chapter also covers examples related to hydropower release optimization and extends to functions of multiple variables, including the Hessian matrix for determining convexity or concavity.

Uploaded by

kalkidan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views49 pages

Chapter Three

Chapter Three discusses optimization techniques using calculus, focusing on functions of a single variable and their properties, including local and global maxima and minima. It explains concepts such as convex and concave functions, critical points, and the use of derivatives to find optimal values. The chapter also covers examples related to hydropower release optimization and extends to functions of multiple variables, including the Hessian matrix for determining convexity or concavity.

Uploaded by

kalkidan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CHAPTER THREE

OPTIMIZATION BY CALCULUS
METHOD
Function of a single variable

 Let f(x) be a function of a single variable x, defined


in the range of a<x<b

Local Maximum: value higher than that at any


other value of x in the neighborhood of x1, x3 and
x4. The function is local maximum at x1, if f(x1 -
Δx1) < f(x1) > f(x1 + Δx1)
Cont.

 Local Minimum: value lower than that at any


other value of x in the neighborhood of x2 and
x5 are local minima.
 The function is local minimum at x2, if f(x2 -
Δx2) > f(x2) <f(x2 + Δx2)
 Saddle point: The slope of the function at
saddle point x3.
 The value of the function is lower on one side
of x3 and higher on the other (vice-versa).
f(x3 - Δx3) <f(x3) <f(x3 + Δx3); slope of f(x) at x =
x3 is zero
Cont.

 Global maximum: where the value of the


function is higher than that at any other
value of x in the defined range (point x4
in the figure).
 Global minimum: where the value of the
function is lower than that at any other
value of x in the defined range (point x2
in the figure).
Cont.

Convex functions:
 Any straight line (AB) drawn between any two
points is above the curve

 f (x) is said to be strictly convex if,

 f[ax1+(l - a)x2] < a f (x1) + (l - a)f(x2); where 0 ≤ a≤ 1


Cont.

 In the context of water resources optimization, the


terms "concave upward" and "concave downward"
refer to the shape of a function, just as in general
mathematics.

 However, their implications become very specific


and meaningful when these functions represent real-
world aspects of water systems, such as benefits,
costs, efficiencies, or utility.
Cont.

Concave Upward Concave Downward


Feature
(Convex Function) (Concave Function)
Inverted U-shaped, dome-
Shape U-shaped, bowl-like
like
Second f′′(x)≤0
f′′(x)≥0
Derivative
Could imply decreasing
Typically implies marginal costs (e.g., bulk
increasing marginal costs purchasing discounts,
Costs
(e.g., pollution removal, economies of scale for very
infrastructure expansion). large projects in some
phases).
Cont. Typically implies
diminishing marginal
Not typical for benefits
benefits/utility (e.g.,
Benefits/Utility (unless discussing
water consumption,
"disutility" or cost).
flood protection
levels).
Often implies increasing
marginal risk/damage (e.g., Not typical, as risk usually
Risk/Damage
flood damage intensity, accelerates.
ecosystem degradation).
Often implies diminishing
Production/Yield Not typical. returns (e.g., crop yield
vs. water input).
Often minimized (e.g., total Often maximized (e.g.,
Optimization Goal
cost, total risk). total benefit, total yield).
Cont.

• If the inequality sign< is replaced by ≤ sign, then f(x) is

said to be convex, but not strictly convex.

• If the inequality sign < is replaced by = sign, f(x) is a

straight line and satisfies the condition for convexity


mentioned above. A straight line is a convex function.

• If a function is strictly convex, slope increases


continuously,

 For a strictly convex function, d2 f/d2x > 0.


Cont.

• Concave functions:

• The line AB connecting any two points A and B on

the function is completely below the curve

• f (x) is said to be strictly concave if,

 f[ax1+(l - a)x2] > af (x1) + (l - a)f(x2); where 0 ≤ a≤

1
Cont.

 If the inequality sign > is replaced by ≥ sign, then


f(x) is said to be concave, but not strictly concave.
• If the inequality sign > is replaced by = sign, f(x) is
a straight line and satisfies the condition for
concavity mentioned above. A straight line is a
concave function.
• If a function is strictly concave, slope increases
continuously,
• For a strictly concave function, d2 f/d2x < 0.
Cont.
Cont.

 Stationary point may be a minimum, maximum or


an inflection (saddle) point.

• If d2f/dx2<0 for all x, f(x) is concave and the


stationary point is a global maximum.
• If d2f/dx2=0, we should investigate further.
Key Calculus Concepts:

 To find the optimal (maximum or minimum) value of


a function, we rely on differential calculus.
# Derivatives
 The derivative of a function `f(x)`, denoted as `f'(x)`
or `df/dx`, represents the instantaneous rate of
change or the slope of the function at a point `x`.
 Minimum, the slope of the function is zero.
Therefore, a necessary condition for an optimum is
`f'(x) = 0`. Points where this occurs are called
critical points.
Partial Derivatives

 When a function depends on multiple variables, say


`f(x, y)`, we use partial derivatives.
 The partial derivative with respect to one variable
(e.g., `x`) is found by treating all other variables
(e.g., `y`) as constants.
 Notation: `∂f/∂x` and `∂f/∂y`.
 Key Principle: For a multi-variable function to be
at a local maximum or minimum, all of its partial
derivatives must be equal to zero.
Cont.

 `∂f/∂x = 0`
 `∂f/∂y = 0'
 Concept of Maxima and Minima (Second
Derivative Test)
 The first derivative test (`f'(x) = 0`) only identifies
critical points; it doesn't tell us if they are maxima,
minima, or saddle points.
 The second derivative test helps us classify them.
 For a single variable function `f(x)`:
 If `f''(x) < 0` at a critical point, it is a local maximum.
(The curve is concave down).
Cont.

 If `f''(x) > 0` at a critical point, it is a local


minimum. (The curve is concave up).
 If `f''(x) = 0`, the test is inconclusive.
 Unconstrained Optimization
 Unconstrained optimization deals with finding the
maximum or minimum of a function without any
limitations on the variables.
Methodology

 1. Define the Objective Function: Formulate a


mathematical function f(x) that represents the quantity
to be optimized (e.g., net benefit).
 2. Find Critical Points: Calculate the first derivative
f'(x) and set it to zero (f'(x) = 0). Solve for x.
 3. Classify the Points: Calculate the second
derivative f''(x) and evaluate it at the critical point(s).
 Use the second derivative test to determine if the point
is a maximum or minimum.
Example: Optimizing Hydropower Release from a
Single Reservoir

 Problem: The net benefit N (in thousands of


dollars) from releasing Q units (in million m³) of
water for hydropower generation is described by the
function:
 N(Q) = 80Q - 0.2Q²
 This function implies that benefits increase with
water release, but at a decreasing rate (diminishing
returns, perhaps due to turbine efficiency limits or
electricity price saturation).
 Find the water release Q that maximizes the net
benefit.
Solution:

 1. Objective Function:
 Maximize N(Q) = 80Q - 0.2Q²
 2. Find Critical Points (First Derivative
Test):
 Calculate the first derivative of N(Q) with respect
to Q :
 N (Q) = dN/dQ = 80 - 2 * 0.2Q = 80 - 0.4Q
Classify the point (second derivative Test)

 Calculate the second derivative of N(Q):


 N''(Q) = d/dQ (80 - 0.4Q) = -0.4
 Since N''(Q) = -0.4, which is less than 0, the
function is concave down everywhere.
 Therefore, the critical point Q = 200 corresponds
to a global maximum.
 Conclusion: The maximum net benefit is
achieved when 200 million m³ of water is released.
Cont.

 Set the derivative to zero to find the critical


point:
 80 - 0.4Q = 0
 `0.4Q = 80`
 `Q = 80 / 0.4 = 200`
 The critical point is a release of 200
million m³.
Example

 Example: Locate the stationary points of


and find out if the
function is convex, concave or neither at
the points of optima based on the testing
rules discussed above.
Difference between Critical, max and min points
Feature Critical Point Maximum Point Minimum Point

Threshold, trigger, Lowest undesirable


Highest desirable
Primary Role stress point, turning outcome (cost/loss)
outcome or benefit
point or baseline

A significant state The best possible The best possible


What it reduction for a
Represents
or condition of the achievement for a negative goal; a
system positive goal required floor
Sought after as the
Optimization Indicates a need for Sought after as the
optimal "least bad"
Implication policy change, alert optimal "good" result
result

Not necessarily Is an optimal


Is an optimal
Relation to optimal itself; a point solution (worst
Optimality of interest for
solution (best
possible
decision-making possible)
cost/impact)
Derivative at Point Zero (and second Zero (and second
Zero or undefined
(if differentiable) derivative negative) derivative positive)
Let we see scenario

 Managing a Reservoir for Water Supply


 Objective: Ensure adequate water supply to a city
while managing costs.
 Critical Point Example:
 Reservoir Level at 30% Capacity: This is the
trigger for Stage 2 water restrictions (e.g.,
banning lawn watering).
 It's a critical point because the management
strategy changes significantly at this threshold,
indicating system stress.
Cont.

 It's not a maximum (we don't want the reservoir to


be 30% full) nor a minimum (we don't want it to
drop below this if possible without severe
consequences).
 Maximum Point Example:
 Maximum Water Supply Reliability (e.g.,
99%):
 The operational plan (release schedule, demand
management) that ensures the city's water
demand is met 99% of the time over a multi-year
period.
Cont.

 This is the highest reliability we can achieve given all


constraints.
 Minimum Point Example:
 Minimum Pumping Costs:
 The pumping schedule from various sources (e.g.,
river intake, well field) that meets the city's demand
using the least amount of electricity and
maintenance, resulting in the lowest total
operational cost.
Function of a Multiple variables:

• Let f(X) be a function of n variables represented by


the vector X = (x1, x2,……., x n).
• Necessary condition for stationary point X
=X0 is, each first partial derivative of f(X)
should be zero

• H[f(X)] is Hessian matrix of function f(X)

• Hessian matrix is defined as :


Cont.

• The Eigen values of H [f(X)] are given by the roots of

the characteristic equation,|λI – H [f(X)]| = 0;


Where: I is an identity matrix, and λ is the vector of
Eigen values.
 Hessian Matrix for f(x,y)
Example
 Example: Examine the function for the
convexity / concavity and determine the value
at extreme

The stationary point is obtained by solving


𝜕𝑓 𝜕𝑓
= 2x1 – 4 = 0 and = 2x2 – 2 = 0
𝜕𝑥1 𝜕𝑥2

x1 = 2, x2 = 1; X = (2,1)
Cont.

𝜕𝑓 𝜕𝑓 𝜕2 𝑓
= 2x1 – 4 , =0 =2
𝜕𝑥1 𝜕𝑥1 𝑥2 𝜕𝑥1 2

𝜕𝑓 𝜕𝑓 𝜕2 𝑓
= 2x2 – 2 , =0 =2
𝜕𝑥2 𝜕𝑥2 𝑥1 𝜕𝑥2 2

2 0
 H[f(X)] =
0 2
 Eigen values of Hessian matrix

 |λI – H [f(X)]| = 0
Cont.

• Sufficiency condition:
• H positive definite at X =Xo …….Minimum

• H negative definite at X =Xo …… Maximum

• A square matrix is positive definite if all the Eigen

values are positive

• A square matrix is negative definite if all the Eigen


values are negative
Cont.

• If all Eigen values of the Hessian matrix are

positive, the function is strictly convex.

• If all the Eigen values of the Hessian matrix

are negative, the function is strictly concave.

• If some Eigen values are positive and some

negative, or if some are zero, then the function is


neither strictly convex nor strictly concave.
Cont.

Example: Examine the function for the convexity /


concavity and determine the value at extreme points

• Eigen values of Hessian matrix

• |λI – H [f(X)]| = 0

λ−2 0
• | λI – H [f(X)] | = | | =0
0 λ−2
• (λ – 2)2 = 0

• Eigen values are λ1 = λ2 = 2


Cont.

• As both the eigen values are positive, the

matrix is positive definite

• Hence, the function has local maximum at X

= (2,1)
 As the Hessian matrix does not depend on x1
and x2 and it is positive definite matrix, the
function is strictly convex and therefore, the
local minimum is also the global minimum
Constrained optimization

• Let f(X) be a function of n variables


represented by the vector X = (x1,
x2,……., x n).
 Maximize or Minimize f(X)
 Subject to (S.t.) g j(X) ≤ 0 j = 1,2,3,….m
m≤ 𝑛
 f(X) and g(x) may or may not be linear
function
Cont.

 If the m> 𝑛 the problem is over defined and


there shall be no solution unless redundant
constraint removed
• Function with equality constraints

• Function with inequality constraints


 Function with equality constraints
• Let f(X) be a function of n variables represented
by the vector X = (x1, x2,……., x n).
Cont.

 Maximize or Minimize f(X)


 S.t. g j(X) = 0 j = 1,2,3,….m
 The method discussed is Lagrange Multiplier

LANGRANGE MULTIPLIER
 Maximize or Minimize f(X)
 S.t. g j(X) = 0 j = 1,2,3,….m
• Introduce one additional variable corresponding
to each constraint
Cont.

Home STUDY:
HESSIAN MATRIX
LAGRANGE MULTPLIER
Kuhn Tucker (KT)
Cont..

• Lagrange function f(x) is written as

 L = f(x) – λj g j(X)

 When g (X) = 0, optimizing L is the same as

optimizing f(X).

• The original problem of constrained is now

transformed into an unconstrained


optimization problem
Cont.

 Lf(X, λ) =f(X) — λg1(X) — λ 2 g2(X) — ...,


1
λmgm(X), where: λ = (λ 1, λ 2... λ m)

 NECESSARY CONDITIONS
 For function of f(X) Subject to the constraint
gp(X) = 0, p = 1, 2…n, to have a relative
optimum at a point X is the first partial
derivative of the Lagrange and function with
respect to each of its argument must be zero.
Cont.

 Function f(x) of n variables with m equality constraints

• The (n + m) simultaneous equations are solved

to get a solution, (X0, λ0).


Cont.

• This lead to the polynomial in 𝜇 of order (n - m)

 Solve for 𝜇:
 If all 𝜇 values are positive ……. Xo corresponds to
minimum
 If all 𝜇 values are negative….. Xo corresponds to
maximum
 If some values are positive and some are negative
……. Xo is neither minimum nor maximum
Cont.
Cont.

 These equations yield x1 = x2= 2, λ=-4

 Now we shall determine if this is a

maximum.
Kuhn-Tucker (KT) Conditions:

 These conditions are necessary for a function


f(X) to be a local maximum or a local
minimum.
 Maximize f(X)

 S.t gj(X) ≤ 0, j= 1,2,3…...m.


 The Kuhn-Tucker conditions are as follows:
Cont.

 In addition if f(X) is concave, and the


constraints form a convex set, these
conditions are sufficient for a global
maximum.
Cont.

You might also like