0% found this document useful (0 votes)
4 views

EE407- Chap2

Uploaded by

mohdhaal2
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 views

EE407- Chap2

Uploaded by

mohdhaal2
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
You are on page 1/ 111

Chapter II: Roots of Equations

& Optimization
LECTURES:

5. BRACKETING METHODS I: GRAPHICAL & BISECTION


6. BRACKETING METHODS II: FALSE POSITION METHOD
7. OPEN METHOD I: FIXED POINT & NEWTON-RAPHSON
8. OPEN METHOD II: SECANT & BRENT METHODS
9. POLYNOMIAL METHODS: MÜLLER’S METHOD
10. UNCONSTRAINED OPTIMIZATION I
11. UNCONSTRAINED OPTIMIZATION II
12. CONSTRAINED OPTIMIZATION

Numerical Methods for EE (EE407) | Main


L05: Graphical Method & Bisection
74

 Outline of the lecture:

 Motivation.
 Important background.
 Graphical method.
 Bracketing methods.
 Bisection method.
 Matlab example.

Numerical Methods for EE (EE407) | Main


Motivation
75

 We all know that the solutions of a second order polynomial


equation of the form
𝑓 𝑥 = 𝑎𝑥 2 + 𝑏𝑥 + 𝑐 = 0
 are given by
−𝑏 ± 𝑏 2 − 4𝑎𝑐
𝑥=
2𝑎
 These are simply the intersection points of 𝑓 𝑥 with the 𝑥 –
axis, which is why they are called zeros.
 The zeros of more complicated functions may not be found
as easily as the quadratic polynomial above.
 A more general numerical method is required.

Numerical Methods for EE (EE407) | Main


Motivation
76

 Can you solve the following equation?


𝑓 𝑥 = 𝑒 −𝑥 − 𝑥 = 0
 It looks simple but, in fact, cannot be solved analytically.
 Graphical methods can be used. However, their precision is
usually not sufficient.
 Another method is trial and error, where you make
repetitive guesses and evaluate them.

Numerical Methods for EE (EE407) | Main


Important Background
77

 Functions (𝑦 = 𝑓 𝑥 ) can be classified into:


 Algebraic: these are functions that can be written as
𝑓𝑛 𝑦 𝑛 + 𝑓𝑛−1 𝑦 𝑛−1 + ⋯ + 𝑓1 𝑦 + 𝑓0 = 0,
where 𝑓𝑖 is an 𝑖 th order polynomial. One of the simplest
algebraic functions is polynomials.
 Transcendental: any function that is not algebraic
including trigonometric, exponential, logarithmic… etc.
 Also, the roots of equations may be real or complex. It is
more common to consider complex roots when the function
is algebraic. The complex roots of transcendental functions
are rarely of interest.

Numerical Methods for EE (EE407) | Main


The Graphical Approach
78

 Considering the same parachutist example


from earlier in the course, find the drag
coefficient 𝑐 if the parachutists speed after free
falling for 10𝑠 is 40𝑚/𝑠.

Numerical Methods for EE (EE407) | Main


The Graphical Approach
79

 Recall that the velocity given 𝑣 0 = 0 is of


the form
𝑔𝑚 𝑐
− 𝑡
𝑣 𝑡 = 1−𝑒 𝑚
𝑐
 We have 𝑡 = 10, 𝑔 = 9.81, and 𝑚 = 68.1.
Hence,
668.06
𝑓 𝑐 = 1 − 𝑒 −0.146843𝑐 − 40 = 0
𝑐
 We may substitute different values of 𝑐 and
obtain:
 Visual inspection of the curve yields
𝑐 ≈ 14.75 → 𝑣 10 = 40.1 ≈ 10𝑚/𝑠

Numerical Methods for EE (EE407) | Main


Graphical Solution Using Computers
80

 Consider the equation:


𝑓 𝑥 = sin 10𝑥 + cos 3𝑥
 Plotting over the range 𝑥 ∈ 0,5
yields →
 Redrawing yields more accurate
solutions.

Numerical Methods for EE (EE407) | Main


Bisection
81

 We know for sure that the function corresponding to our


equation changes sign when two points 𝑥𝑙 and 𝑥𝑢 are taken
on either side of the root, i.e.
𝑓 𝑥𝑙 𝑓 𝑥𝑢 < 0.
 Incremental methods: Once we determine an interval
for the root, we divide it into subintervals and repeat the
process each time refining the estimate.
 Bisection method: (binary chopping, Bolzano’s method)
This is an incremental method, in which the interval is
always divided in half. The process is repeated until an
accurate enough estimate is obtained.

Numerical Methods for EE (EE407) | Main


Bisection
82

 The following steps (algorithm) describe the repetitive


process of bisection:

Numerical Methods for EE (EE407) | Main


Example
83

 Consider the previous example where


668.06
𝑓 𝑐 = 1 − 𝑒 −0.146843𝑐 − 40 = 0
𝑐
 We know that the solution lies between 12 and 16.
12+16
 We take the first estimate as 𝑥𝑟 = = 14:
2
14−14.8011
𝜀𝑡 = × 100% ≈ 5.41%
14.8011
 We have 𝑓 12 𝑓 14 = 9.850. Hence, the solution is > 14.
The new estimate is 𝑥𝑟 = 15 with 𝜀𝑡 ≈ 1.34%.
 We have 𝑓 14 𝑓 15 = −0.619. Hence, the solution is < 15.
The new estimate is 𝑥𝑟 = 14.5 with 𝜀𝑡 ≈ 2.03%…

Numerical Methods for EE (EE407) | Main


Example
84

 The error measured above assumes


the true value is known.
 It is more suitable to use the
approximate error:
𝑥 new − 𝑥 old
𝜀𝑎 = new
× 100%
𝑥
 Note that always: 𝜀𝑎 > 𝜀𝑡 .

Numerical Methods for EE (EE407) | Main


Bisection in Matlab
85

g = 9.81; m = 68.1; t = 10; v = 40;


f = @(c) g*m/c*(1-exp(-c/m*t))-v;
C = [12 16]; true = 14.8011; N = 10;
approx = zeros(1,N);
Et = zeros(1,N);
Ea = zeros(1,N); Ea(1) = 16;
for i = 1:N
approx(i) = (C(1)+C(2))/2;
temp = f(C(1))*f(approx(i));
if(temp == 0)
break;

Numerical Methods for EE (EE407) | Main


Bisection in Matlab
86

elseif(temp < 0)
C(2) = approx(i);
else
C(1) = approx(i);
end
Et(i) = abs((true-approx(i))/true)*100;
if(i > 1)
Ea(i) = abs((approx(i)-approx(i-1))
/approx(i))*100;
end
end

Numerical Methods for EE (EE407) | Main


Bisection in Matlab
87

 .

Numerical Methods for EE (EE407) | Main


End of Lecture!
88

Any Questions?

Numerical Methods for EE (EE407) | Main


L06: False Position Method
89

 Outline of the lecture:

 Shortcomings of the bisection method.


 The false position method.
 Numerical example.
 Is false position always better?

Numerical Methods for EE (EE407) | Main


The Bisection Method
90

 In the previous lecture, we saw the bisection method, which


works iteratively by halving the solution interval after each
iteration and taking the midpoint is our estimate.
 As we saw through the numerical example, bisection is
perfectly fine and leads to a good approximation of the
solution.
 However, it is a brute force approach and thus inefficient.
 It does not take into account the magnitudes of 𝑓 𝑥𝑙 and
𝑓 𝑥𝑢 .
 An alternative method is the false position method, which is
more efficient and benefits from the graphical insight.

Numerical Methods for EE (EE407) | Main


The False Position Method
91

 This method works by drawing a straight line between 𝑓 𝑥𝑙


and 𝑓 𝑥𝑢 and the intersection of this line with the 𝑥-axis is
our new estimate.
 Of course, our function is most likely not a straight line,
thus the name false position (linear interpolation).
 The intersection of the straight line with the 𝑥-axis is
estimated as
𝑓 𝑥𝑙 𝑓 𝑥𝑢 𝑓 𝑥𝑢 𝑥𝑙 − 𝑥𝑢
= → 𝑥𝑟 = 𝑥𝑢 −
𝑥𝑟 − 𝑥𝑙 𝑥𝑟 − 𝑥𝑢 𝑓 𝑥𝑙 − 𝑓 𝑥𝑢
 The reason for using this last form of 𝑥𝑟 is that it involves
one less function evaluation than the direct solution.

Numerical Methods for EE (EE407) | Main


The False Position Method
92

 Notice how the value of 𝑥𝑟 is closer to the true solution than


the midpoint adopted in the bisection method.
 This makes the false position faster.
 The remainder of the method
is identical to the bisection
method.
 We consider the same previous
example in the following slides.

Numerical Methods for EE (EE407) | Main


Example
93

 We start with 𝑥 ∈ 12,16 .


 Then,
𝑓 16 12 − 6
𝑥𝑟 = 16 − = 14.309
𝑓 12 − 𝑓 16
14.8011 − 14.309
𝜀𝑡 = × 100 = 0.88%
14.8011
 Clearly, after the first step, the error
is already much lower than with the
bisection method.
 The second step yields 𝑥𝑟 = 14.8151
with 𝜀𝑡 = 0.09% and 𝜀𝑎 = 0.78%.

Numerical Methods for EE (EE407) | Main


Example
94

 Only one line needs to be modified from the previous code:


approx(i) = (C(1)+C(2))/2; --->
approx(i) = C(2)-f(C(2))*(C(1)-C(2))/(f(C(1))-
f(C(2)));

Numerical Methods for EE (EE407) | Main


False Position vs. Bisection
95

 We saw in the previous example that the false position


method requires less time to converge towards the true
solution.
 This comes at the expense of added complexity.
 Is false position always better? In order to answer this
question, consider as an example finding the roots of
𝑓 𝑥 = 𝑥 10 − 1
in the interval 𝑥 ∈ 0,1.3 .
 We simply modify the anonymous function from the
previous code to:

Numerical Methods for EE (EE407) | Main


False Position vs. Bisection
96

 We observe that the


bisection method
performs well and
achieves a reasonably
accurate approximation
within less than 10
iterations.
 On the other hand, the
false position method
requires around 30
iterations to achieve the
same level of precision.
Numerical Methods for EE (EE407) | Main
Justification
97

 The reason why the false position


method performs worse in this case is
the highly nonlinear nature of the
function at hand.
 Also, notice how the approximate error
𝜀𝑎 < 𝜀𝑡 , which is misleading.
 The false position method was based
on the premise that the magnitude of
the function at the two ends is
indicative of where the solutions is
leaning, which is not the case here.

Numerical Methods for EE (EE407) | Main


Another Example
98

 .

True solution ≈ 1.4659

Numerical Methods for EE (EE407) | Main


End of Lecture!
99

Any Questions?

Numerical Methods for EE (EE407) | Main


L07: Fixed Point & Newton-Raphson
100

 Outline of the lecture:

 Bracketing vs. open methods.


 The fixed point method.
 Intersection of two curves.
 Newton-Raphson method.
 Pitfalls of the Newton-Raphson Method.
 Examples.

Numerical Methods for EE (EE407) | Main


Bracketing vs. Open Methods
101

 The bisection and false


position methods require an
initial interval for the
solution. They work by
narrowing the interval after
each iteration.
 Open methods such as the
fixed point, Newton-
Raphson, Secant, and Brent
methods do not require an
initial interval but rather a
single point.
Numerical Methods for EE (EE407) | Main
The Fixed Point Method
102

 This method works by rearranging the equation such that 𝑥


is on one side of it. The general form is
𝑥=𝑔 𝑥
 If the algebraic manipulation is not easy, one may simply
add 𝑥 to both sides.
 We, then, use the following formula to calculate a new
estimate based on an old one:
𝑥𝑖+1 = 𝑔 𝑥𝑖
 Recall that the approximate error and its bound are
𝑥𝑖+1 − 𝑥𝑖
𝜀𝑎 = × 100% < 𝜀𝑠 = 0.5 × 102−𝑛 %
𝑥𝑖+1

Numerical Methods for EE (EE407) | Main


Example
103

 Example:
𝑓 𝑥 = 𝑒 −𝑥 − 𝑥 = 0
 We can set the formula:
𝑥𝑖+1 = 𝑒 −𝑥𝑖

Numerical Methods for EE (EE407) | Main


Example
104

f = @(xi) exp(-xi);
true = 0.5671433;
N = 20;
x = zeros(1,N);
Et = zeros(1,N);
Ea = zeros(1,N); Ea(1) = 100;
for i = 2:N
x(i) = f(x(i-1));
Et(i) = abs((true-x(i))/true)*100;
Ea(i) = abs((x(i)-x(i-1))/x(i))*100;
end

Numerical Methods for EE (EE407) | Main


An Alternative Method
105

 An alternative method is to separate


the function into two curves:
𝑓1 𝑥 = 𝑥 𝑓2 𝑥 = 𝑒 −𝑥
 The solution is the intersection of the
two curves.
 The intersection can be found by
means of a graphical method.
 Variations of the bisection and false
position methods can be used.

 Question is: HOW?

Numerical Methods for EE (EE407) | Main


Newton-Raphson Method
106

 We now get to the Newton-


Raphson method, which is
considered the most widely
used numerical method for
solving equations.
 The general idea is that we
take an estimate 𝑥𝑖 and
draw the tangent.
 The intersection of the
tangent with the 𝑥-axis is
our new estimate 𝑥𝑖+1 .

Numerical Methods for EE (EE407) | Main


Newton-Raphson Method
107

 From the figure above, we can estimate the derivative by


means of the Newton-Raphson formula

𝑓 𝑥𝑖 − 0 𝑓 𝑥𝑖
𝑓 𝑥𝑖 = → 𝑥𝑖+1 = 𝑥𝑖 − ′
𝑥𝑖 − 𝑥𝑖+1 𝑓 𝑥𝑖
 Consider the same previous example 𝑓 𝑥 = 𝑒 −𝑥 − 𝑥 = 0.
 The formula is:
𝑒 −𝑥𝑖 − 𝑥𝑖
𝑥𝑖+1 = 𝑥𝑖 −
−𝑒 −𝑥𝑖 − 1
 In the following table, we
start from 0 as our initial
estimate.

Numerical Methods for EE (EE407) | Main


Example
108

f = @(xi) exp(-xi)-xi;
fp = @(xi) -exp(-xi)-1;
true = 0.5671433;
N = 20;
x = zeros(1,N); Et = zeros(1,N);
Ea = zeros(1,N); Ea(1) = 100;
for i = 2:N
x(i) = x(i-1)-f(x(i-1))/fp(x(i-1));
Et(i) = abs((true-x(i))/true)*100;
Ea(i) = abs((x(i)-x(i-1))/x(i))*100;
end

Numerical Methods for EE (EE407) | Main


Example
109

Numerical Methods for EE (EE407) | Main


Problems with Newton-Raphson
110

 The sketches below depict some of the main pitfalls of the


Newton-Raphson method.
 These are special cases but are not very uncommon.

Numerical Methods for EE (EE407) | Main


Example
111

 Example:
𝑓 𝑥 = 𝑥 10 − 1 = 0
 We can set the formula:
𝑥𝑖10 − 1
𝑥𝑖+1 = 𝑥𝑖 −
10𝑥𝑖9

Numerical Methods for EE (EE407) | Main


End of Lecture!
112

Any Questions?

Numerical Methods for EE (EE407) | Main


L08: Secant & Brent Methods
113

 Outline of the lecture:

 Review of the Newton-Raphson method.


 The secant method (linear interpolation).
 Comparison between the secant and false position methods.
 Brent’s method (inverse quadratic interpolation).
 Examples.

Numerical Methods for EE (EE407) | Main


Recall the Newton-Raphson Method
114

 Takes the intersection of


the tangent at current
estimate 𝑥𝑖 with the 𝑥-axis
as the new estimate 𝑥𝑖+1 ,
i.e.

𝑓 𝑥𝑖 − 0
𝑓 𝑥𝑖 =
𝑥𝑖 − 𝑥𝑖+1
𝑓 𝑥𝑖
→ 𝑥𝑖+1 = 𝑥𝑖 − ′
𝑓 𝑥𝑖
 Evaluating the derivative
may be problematic!

Numerical Methods for EE (EE407) | Main


The Secant Method
115

 Instead of using the true


derivative, we can use a
backward finite difference
estimate as follows:

𝑓 𝑥𝑖−1 − 𝑓 𝑥𝑖
𝑓 𝑥𝑖 =
𝑥𝑖−1 − 𝑥𝑖
 This leads to the new
approximation
𝑓 𝑥𝑖 𝑥𝑖−1 − 𝑥𝑖
𝑥𝑖+1 = 𝑥𝑖 −
𝑓 𝑥𝑖−1 − 𝑓 𝑥𝑖
 We now need 2 points.

Numerical Methods for EE (EE407) | Main


Example
116

 Consider the same example


from the previous lecture.
𝑓 𝑥 = 𝑒 −𝑥 − 𝑥 = 0
 It is easy to see that the secant
and false position methods are
closely related.
 The main difference is that the
new estimate here replaces the
previous one whereas in the
false position method it
replaced on of the interval
bounds.
Numerical Methods for EE (EE407) | Main
Comparison
117

𝑓 𝑥 = 𝑒 −𝑥 − 𝑥

Numerical Methods for EE (EE407) | Main


Brent’s Method
118

 In the secant method, a line was drawn across two


estimates. The intersection of this line with the 𝑥-axis forms
the new estimate. For this reason, the secant method is
sometimes called the linear interpolation method.
 What if instead of a line going through two points we had a
quadratic curve going through three points?

Numerical Methods for EE (EE407) | Main


Brent’s Method
119

 The main problem with using a parabola is that it may not


intersect with the 𝑥-axis.
 To overcome this, Brent’s method uses inverse quadratic
interpolation, i.e. we fit the three points with a parabola in
𝑦.
 Given three points 𝑥𝑖−2 , 𝑦𝑖−2 , 𝑥𝑖−1 , 𝑦𝑖−1 , and 𝑥𝑖 , 𝑦𝑖 , we
calculate
𝑦𝑖−1 𝑦𝑖
𝑥𝑖+1 = 𝑥𝑖−2
𝑦𝑖−2 − 𝑦𝑖−1 𝑦𝑖−2 − 𝑦𝑖
𝑦𝑖−2 𝑦𝑖
+ 𝑥𝑖−1
𝑦𝑖−1 − 𝑦𝑖−2 𝑦𝑖−1 − 𝑦𝑖
𝑦𝑖−2 𝑦𝑖−1
+ 𝑥𝑖
𝑦𝑖 − 𝑦𝑖−2 𝑦𝑖 − 𝑦𝑖−1
Numerical Methods for EE (EE407) | Main
Brent’s Method
120

 Example:
𝑓 𝑥 = 𝑒 −𝑥 − 𝑥 = 0
 We may initially take three
arbitrary points
𝑥0 = 0.5
𝑥1 = 0.6
𝑥2 = 0.4
 The complete algorithm is
lengthy. However, we can take
the same code for the secant
method and replace the
formula.
Numerical Methods for EE (EE407) | Main
End of Lecture!
121

Any Questions?

Numerical Methods for EE (EE407) | Main


L09: Müller’s Method
122

 Outline of the lecture:

 Polynomials in engineering.
 Evaluation of polynomials.
 Deflation of polynomials (synthetic division).
 Müller’s method.
 Examples.
 Matlab functions for solving equations.

Numerical Methods for EE (EE407) | Main


Polynomials in Engineering:
123

 Polynomials are very important in engineering.


 Take, for instance, a general second-order ODE that may
represent several natural phenomena:
𝑑2 𝑦 𝑑𝑦
𝑎2 2 + 𝑎1 + 𝑎0 = 𝐹 𝑡
𝑑𝑡 𝑑𝑡
 Here: 𝑎𝑖 are constant coefficients, 𝑦 is the dependent
variable, 𝑡 is an independent variable, and 𝐹 𝑡 is the
forcing function representing the effect of the outside world.
 Usually, to study this phenomenon, we start with the
homogeneous case 𝐹 𝑡 = 0, which has a general solution of
the form 𝑦 𝑡 = 𝑒 𝑟𝑡 .

Numerical Methods for EE (EE407) | Main


Polynomials in Engineering:
124

 Substituting in the equation yields the characteristic


equation:
𝑎2 𝑟 2 + 𝑎1 𝑟 + 𝑎0 = 0
 Note how this is a quadratic polynomial in 𝑟.
 The roots of this polynomial are the characteristic values
(eigenvalues) of the system, which give us fundamental
information regarding the system.
 In this case, finding the eigenvalues analytically is easy:
−𝑎1 ± 𝑎12 − 4𝑎2 𝑎0
𝑟= = 𝜆 ± 𝜇𝑖
2𝑎2
𝑦 = 𝑐1 𝑒 𝜆+𝜇𝑖 𝑡 + 𝑐2 𝑒 𝜆−𝜇𝑖 𝑡
 Higher orders are more difficult to solve analytically.
Numerical Methods for EE (EE407) | Main
Example
125

 Consider:
𝑑2 𝑦 𝑑𝑦 2 − 3𝑟 + 2 = 0
− 3 + 2𝑦 = 0 → 𝑟
𝑑𝑡 2 𝑑𝑡
 The eigenvalues are
3 ± 32 − 8 1
𝑟= =ቊ → 𝑦 𝑡 = 𝑐1 𝑒 𝑡 + 𝑐2 𝑒 2𝑡
2 2
 Assuming 𝑦 0 = 1 and 𝑦 ′ 0 = 0, we get the exact solution:
𝑦 𝑡 = 2𝑒 𝑡 − 𝑒 2𝑡
 Verification:
2𝑒 𝑡 − 4𝑒 2𝑡 − 3 2𝑒 𝑡 − 2𝑒 2𝑡 + 2 2𝑒 𝑡 − 𝑒 2𝑡 = 0

Numerical Methods for EE (EE407) | Main


Evaluating a Polynomial
126

 Writing programs that deal with


polynomials is easy but not
necessarily efficient.
 We want to evaluate 𝑓 𝑥 at 𝑥0 with
𝑓 𝑥 = 𝑎3 𝑥 3 + 𝑎2 𝑥 2 + 𝑎1 𝑥 + 𝑎0
 The direct substitution involves
𝑛 𝑛 + 1 Τ2 = 6 multiplications and 𝑛
= 3 additions.
 This can be reduced as follows:
𝑓 𝑥 = 𝑎0 + 𝑥 𝑎1 + 𝑥 𝑎2 + 𝑥𝑎3
 𝑛 multiplications & 𝑛 additions.

Numerical Methods for EE (EE407) | Main


Polynomial Deflation
127

 Let us say we known that we know 𝑥 = 2 is a root of


𝑓 𝑥 = 𝑥 5 − 7𝑥 4 − 3𝑥 3 + 79𝑥 2 − 46𝑥 − 120
 We may divide 𝑓 𝑥 by 𝑥 − 2 to obtain
𝑓 𝑥 = 𝑥 − 2 𝑥 4 − 5𝑥 3 − 13𝑥 2 + 53𝑥 + 60
 Repeating this process for the remaining roots yields the
factored form
𝑓 𝑥 = 𝑥−2 𝑥+3 𝑥−5 𝑥−4 𝑥+1
 How can this be done in Matlab?
 We can use synthetic division as will be seen in the next
slide.

Numerical Methods for EE (EE407) | Main


?
128

a = [-120 -46 79 -3 -7 1];


t = 2;
n = 5;
r = a(n+1); a(n+1) = 0;
for i = n-1:-1:0
s = a(i+1);
a(i+1) = r;
r = s + r*t;
end
 Result:

Numerical Methods for EE (EE407) | Main


Müller’s Method
129

 Recall that the secant draws a straight line through two


guesses and chooses the intersection of the line with the x-
axis as the new estimate.
 Müller’s method uses a parabola instead.

Müller

Secant

Numerical Methods for EE (EE407) | Main


Müller’s Method
130

 We use three known points 𝑥0 , 𝑓 𝑥0 , 𝑥1 , 𝑓 𝑥1 , and


𝑥2 , 𝑓 𝑥2 . Three evaluations are given by
𝑓 𝑥0 = 𝑎 𝑥0 − 𝑥2 2 + 𝑏 𝑥0 − 𝑥2 + 𝑐
𝑓 𝑥1 = 𝑎 𝑥1 − 𝑥2 2 + 𝑏 𝑥1 − 𝑥2 + 𝑐
𝑓 𝑥2 = 𝑎 𝑥2 − 𝑥2 2 + 𝑏 𝑥2 − 𝑥2 + 𝑐 = 𝑐
 Since 𝑐 is known, we can solve for 𝑎 and 𝑏 as:
𝛿1 − 𝛿0
𝑎= , 𝑏 = 𝑎ℎ1 − 𝛿1
ℎ1 + ℎ0
 The constants are given by: ℎ0 = 𝑥1 − 𝑥0 , ℎ1 = 𝑥2 − 𝑥1 ,
𝑓 𝑥1 − 𝑓 𝑥0 𝑓 𝑥2 − 𝑓 𝑥1
𝛿0 = , 𝛿1 =
𝑥1 − 𝑥0 𝑥2 − 𝑥1

Numerical Methods for EE (EE407) | Main


Müller’s Method
131

 Once we have 𝑎, 𝑏, and 𝑐, we have our parabola.


 We, then, find the intersection with the 𝑥-axis.
 The new estimate is given by
−2𝑐
𝑥3 = 𝑥2 +
𝑏 ± 𝑏 2 − 4𝑎𝑐
 Recall that the approximate error and its bound are given
by
𝑥𝑖+1 − 𝑥𝑖
𝜀𝑎 = × 100% < 𝜀𝑠 = 0.5 × 102−𝑛 %
𝑥𝑖+1
 𝑛 represents the number of significant figures.

Numerical Methods for EE (EE407) | Main


Example
132

 Consider the function


𝑓 𝑥 = 𝑥 3 − 13𝑥 − 12
 Let us start with three guesses: 4.5, 5.5, and 5.
 We have
𝑓 𝑥0 = 𝑓 4.5 = 20.625
𝑓 𝑥1 = 82.875
𝑓 𝑥2 = 48.000
 Based on these values, we have
ℎ0 = 𝑥1 − 𝑥0 = 1
ℎ1 = 𝑥2 − 𝑥1 = −0.5

Numerical Methods for EE (EE407) | Main


Example
133

𝑓 𝑥1 − 𝑓 𝑥0 𝑓 𝑥2 − 𝑓 𝑥1
𝛿0 = = 62.25, 𝛿1 = = 69.75
𝑥1 − 𝑥0 𝑥2 − 𝑥1
 We can now find the parabola coefficients as
𝛿1 − 𝛿0
𝑎= = 15, 𝑏 = 𝑎ℎ1 − 𝛿1 = 62.25, 𝑐 = 48
ℎ1 + ℎ0
 Hence, the new estimate is
−2𝑐
𝑥3 = 𝑥2 + = 3.976487
2
𝑏 ± 𝑏 − 4𝑎𝑐
𝑥3 − 𝑥2
𝜀𝑎 = × 100% = 25.74%
𝑥3

Numerical Methods for EE (EE407) | Main


Example
134

 Repeating the process yields


the results in the table below:

 Can you write the Matlab


code to obtain the following
figures?

Numerical Methods for EE (EE407) | Main


Example
135

f = @(xi) xi^3-13*xi-12;
true = 4; N = 8;
x = zeros(1,N); x(1) = 4.5; x(2) = 5.5; x(3) = 5;
Et = zeros(1,N); Ea = zeros(1,N); Ea(3) = 100;
for i = 4:N
h0 = x(i-2)-x(i-3); h1 = x(i-1)-x(i-2);
delta0 = (f(x(i-2))-f(x(i-3)))/h0;
delta1 = (f(x(i-1))-f(x(i-2)))/h1;
a = (delta1-delta0)/(h1+h0);
b = a*h1+delta1; c = f(x(i-1));
x(i) = x(i-1)-2*c/(b+sqrt(b^2-4*a*c));
Et(i) = abs((true-x(i))/true)*100;
Ea(i) = abs((x(i)-x(i-1))/x(i))*100;
end

Numerical Methods for EE (EE407) | Main


Solving Equations in Matlab
136

 Matlab provides many functions that can be used solve


equations whether polynomial or more general. The
following is a list of some of these functions:

Numerical Methods for EE (EE407) | Main


End of Lecture!
137

Any Questions?

Numerical Methods for EE (EE407) | Main


L10: Unconstrained Optimization I
138

 Outline of the lecture:

 What is optimization?
 Types of optimization.
 Unconstrained optimization of one-dimensional functions.
 The golden section method.
 Newton’s optimization method.
 Solved examples and Matlab code.

Numerical Methods for EE (EE407) | Main


Introduction
139

 Recall that in Chapter II we were interested in searching for


a point on a certain curve (intersection with 𝑥-axis).
 Optimization is similar but the type of point we are
interested in is different.

Numerical Methods for EE (EE407) | Main


Introduction
140

 A point is said to be an optimum for a function if the curve


is flat, which corresponds to 𝑓 ′ 𝑥 = 0.
 The optimum is a maximum if 𝑓 ′′ 𝑥 < 0 and a minimum if
𝑓 ′′ 𝑥 > 0.
 An easy way to find the optimum of a function is to solve
the equation 𝑓 ′ 𝑥 = 0 using the methods we saw in chapter
II. However, this may be expensive and 𝑓 ′ 𝑥 may not not
always be available analytically.
 Hence, it is more convenient to use finite difference
approximations of the derivative instead.
 Other methods use different ideas.

Numerical Methods for EE (EE407) | Main


Why Optimize?
141

Numerical Methods for EE (EE407) | Main


Optimization Problems
142

 The general form of an optimization problem is:


 Find 𝑥 ∈ ℝ𝑛 , which minimizes or maximizes 𝑓 𝑥 subject to
𝑑𝑖 𝑥 ≤ 𝑎𝑖 for 𝑖 = 1,2, … , 𝑚
𝑒𝑖 𝑥 = 𝑏𝑖 for 𝑖 = 1,2, … , 𝑝
 Here, 𝑥 is an n-dimensional vector, 𝑓 𝑥 is called the
objective function, 𝑑𝑖 𝑥 are inequality constraints, 𝑒𝑖 𝑥 are
equality constraints, and 𝑎𝑖 and 𝑏𝑖 are constants.
 The objective function 𝑓 𝑥 and the constraints 𝑑𝑖 𝑥 and
𝑒𝑖 𝑥 may be linear, quadratic, or generally nonlinear.
 We will start this chapter with unconstrained optimization
methods and then move to include constraints.

Numerical Methods for EE (EE407) | Main


Optimization Problems
143

Numerical Methods for EE (EE407) | Main


Local and Global Optima
144

 Before we have a look at optimization methods, it is


important to note that functions often have multiple
minima and maxima.
 Hence, we often have local and global optima.

Numerical Methods for EE (EE407) | Main


Golden-Section Search
145

 The golden-section search is a simple, general-purpose,


single-variable search technique.
 It is similar in spirit to the bisection approach for locating
roots.
 Let us consider the problem of finding a maximum. Finding
minima is similar.
 We start by defining an interval that contains a single
maximum (unimodal). We denote the lower and upper
bounds by 𝑥𝑙 and 𝑥𝑢 . This is not sufficient to ensure the
existence of a maximum. We need a third point within the
interval. We will, then, use the three points to approximate
the maximum.
Numerical Methods for EE (EE407) | Main
Golden-Section Search
146

 The golden-section method calculates


two points
𝑥1 = 𝑥𝑙 + 𝑑 and 𝑥2 = 𝑥𝑢 − 𝑑
where
5−1
𝑑= 𝑥𝑢 − 𝑥𝑙
2
 Then, the function is evaluated at these
two points and:
 If 𝑓 𝑥1 > 𝑓 𝑥2 , then 𝑥𝑙 = 𝑥2 and .
 If 𝑓 𝑥1 < 𝑓 𝑥2 , then 𝑥𝑢 = 𝑥1 .

Numerical Methods for EE (EE407) | Main


Example
147

 We want to find the maximum of the following function in


the interval 𝑥𝑙 = 0 and 𝑥𝑢 = 4:
𝑥2
𝑓 𝑥 = 2 sin 𝑥 −
10
 Step 𝟏:
5−1
 𝑑= 4 − 0 = 2.4721 → 𝑥1 = 2.4721, 𝑥2 = 1.5279 → 𝑓 𝑥1
2
= 0.6300, 𝑓 𝑥2 = 1.7647.
 Since 𝑓 𝑥1 < 𝑓 𝑥2 , the maximum is in the interval defined by
𝑥𝑙 , 𝑥1 , and 𝑥2 .
 Hence, we keep 𝑥𝑙 and let 𝑥𝑢 = 𝑥1 = 2.4721 and 𝑥1 = 𝑥2
= 1.5279.

Numerical Methods for EE (EE407) | Main


Example
148

 We continue the iterative process to obtain the results in the


table below:

 We see that the approximation 𝑥2 remains at 1.4427, which


is where the maximum is.
Numerical Methods for EE (EE407) | Main
Matlab Code
149

f = @(x) 2*sin(x)-x^2/10;
syms x;
fx = 2*sin(x)-x^2/10;
fxp = diff(fx,x);
true = vpasolve(fxp==0,[0 4]);
xl = 0; xu = 4;
N = 6; es = 0.5*10^(2-N);
maxiter = 50;
R = (sqrt(5)-1)/2;
iter = 1;
d = R*(xu-xl);
x1 = xl+d; x2 = xu-d;
f1 = f(x1); f2 = f(x2);

Numerical Methods for EE (EE407) | Main


Matlab Code
150

if(f1 > f2)


x_opt(iter) = x1; fx = f1;
else
x_opt(iter) = x2; fx = f2;
end
while(1)
d = R*d; x_int = xu-xl;
if(f1 > f2)
xl = x2; x2 = x1; x1 = xl+d;
f2 = f1; f1 = f(x1);
else
xu = x1; x1 = x2; x2 = xu-d;
f1 = f2; f2 = f(x2);
end

Numerical Methods for EE (EE407) | Main


Matlab Code
151

iter = iter + 1;
if(f1 > f2)
x_opt(iter) = x1; fx = f1;
else
x_opt(iter) = x2; fx = f2;
end
if(x_opt(iter) ~= 0)
Ea(iter) = (1-R)*abs(x_int/x_opt(iter))*100;
Et(iter) = (true-x_opt(iter))/true*100;
end
if(Ea(iter) <= es || iter >= maxiter)
break;
end
end

Numerical Methods for EE (EE407) | Main


Results
152

 We see that the


approximate error
goes below the
bound (with 6
significant figures)
after 34 iterations.
 The approximate
error is clear and
logarithmically
linear.
 The true error
remains below.

Numerical Methods for EE (EE407) | Main


Newton’s Open Method
153

 Recall that the Newton-Raphson method for finding the


intersection of a function with the x-axis used the rule:
𝑓 𝑥𝑖
𝑥𝑖+1 = 𝑥𝑖 − ′
𝑓 𝑥𝑖
 Newton’s method for finding extrema uses a similar rule:
𝑓 ′ 𝑥𝑖
𝑥𝑖+1 = 𝑥𝑖 − ′′
𝑓 𝑥𝑖
 Consider the same example from earlier. We have:
𝑥2
𝑓 𝑥 = 2 sin 𝑥 − →
10

𝑥 ′′
1
𝑓 𝑥 = 2 cos 𝑥 − → 𝑓 𝑥 = −2 sin 𝑥 −
5 5
Numerical Methods for EE (EE407) | Main
Example:
154

 This method is rather


simple and actually
yields good results.
However, we must have
the analytical first and
second derivatives,
which is a major
limitation.

Numerical Methods for EE (EE407) | Main


Matlab Code
155

fp = @(x) 2*cos(x)-x/5;
fpp = @(x) -2*sin(x)-1/5;
syms x;
fx = 2*sin(x)-x^2/10;
fxp = diff(fx,x);
true = vpasolve(fxp==0,[0 4]);
N = 7;
x = zeros(1,N); x(1) = 2.5;
Et = zeros(1,N);
Ea = zeros(1,N); Ea(1) = 100;
for k = 2:N
x(k) = x(k-1)-fp(x(k-1))/fpp(x(k-1));
Et(k) = abs((true-x(k))/true)*100;
Ea(k) = abs((x(k)-x(k-1))/x(k))*100;
end

Numerical Methods for EE (EE407) | Main


End of Lecture!
156

Any Questions?

Numerical Methods for EE (EE407) | Main


L11: Unconstrained Optimization II
157

 Outline of the lecture:

 Plotting a multidimensional function.


 Non-gradient methods: random search & univariate search.
 The gradient of a function.
 The Hessian matrix and minimum/maximum criteria.
 The gradient ascent method.
 Examples and Matlab code.

Numerical Methods for EE (EE407) | Main


Multidimensional Optimization
158

 In the previous lecture we examined two methods for the


unconstrained optimization of one-dimensional functions,
the golden section method and Newton’s method.
 Let us now consider higher dimensions.

Numerical Methods for EE (EE407) | Main


Multidimensional Optimization
159

 For simplicity and ease of conceptualization, we will limit


our discussion to two-dimensional methods.
 In general multidimensional optimization algorithms can
be classified into:
 Nongradient (direct) methods: these do not require derivative
evaluation.
 Gradient descent (or ascent) methods: these require knowledge
of the gradient.
 In this lecture, we will consider some simple methods that
fall under these two main categories.

Numerical Methods for EE (EE407) | Main


1 − Random Search
160

 This is a simple brute force approach that evaluates the


function at randomly selected values of the independent
variables. If the process is repeated for a sufficient number
of samples, the optimum will eventually be located.
 Consider the function
𝑓 𝑥, 𝑦 = 𝑦 − 𝑥 − 2𝑥 2 − 2𝑥𝑦 − 𝑦 2
 The true optimum here is at 𝑥 = −1 and 𝑦 = 1.5.
 Random generators usually generate numbers between 0
and 1.
 If we choose the interval 𝑥 ∈ −2,2 , then we can write
𝑥 = 𝑥𝑙 + 𝑥𝑢 − 𝑥𝑙 𝑟 = −2 + 2 − −2 𝑟 = 4𝑟 − 2

Numerical Methods for EE (EE407) | Main


1 − Random Search
161

 Similarly, if we choose the interval 𝑦 ∈ 1,3 , then we can


write
𝑦 = 𝑦𝑙 + 𝑦𝑢 − 𝑦𝑙 𝑟 = 1 + 3 − 1 𝑟 = 2𝑟 + 1
 This will give us a pair of random numbers where we can
evaluate the function iteratively.

Numerical Methods for EE (EE407) | Main


Matlab Code
162

f = @(x,y) y-x-2*x.^2-2*x.*y-y.^2;
xl = -2; xu = 2; yl = 1; yu = 3;
N = 100000; maxf = -1e9;
for i = 1:N
x = xl + (xu-xl)*rand;
y = yl + (yu-yl)*rand;
fn = f(x,y);
if(fn > maxf)
maxf = fn;
maxx = x; maxy = y;
end
end
X1 = xl:0.01:xu; Y1 = yl:0.01:yu;
[X,Y] = meshgrid(X1,Y1);
figure; contourf(X,Y,f(X,Y)); hold on;
scatter(maxx,maxy);

Numerical Methods for EE (EE407) | Main


2 − Univariate Search
163

 The random search method is not very efficient as it


requires a very large sample.
 In the univariate case, we fix one variable and search along
the second variable using one of the methods we discussed
in the previous lecture.
 Then, we fix the second
variable and search along the
first.
 The process is repeated until a
good enough approximation is
obtained.

Numerical Methods for EE (EE407) | Main


Gradient Methods
164

 Suppose we have a two-dimensional function


𝑓(𝑥, 𝑦).
 The gradient is a directional derivative at a 𝜕𝑓
single point in 𝑛-dimensional space. It is 𝒙
𝜕𝑥1
calculated as
𝜕𝑓 𝜕𝑓 𝜕𝑓
𝛻𝑓 = 𝑖Ԧ + 𝑗Ԧ 𝛻𝑓 𝒙 = 𝒙
𝜕𝑥 𝜕𝑦 𝜕𝑥1

 This is pronounced del 𝑓. 𝜕𝑓
 Imagine the objective function as a mountain 𝒙
𝜕𝑥1
and you want to move from the current position
in the direction with the steepest ascent slope.
That is the direction of the gradient.
Numerical Methods for EE (EE407) | Main
Example
165

 Consider the function


𝑓 𝑥, 𝑦 = 𝑥𝑦 2
 We want to evaluate the gradient at the single point 2,2 .
 We have
𝑓 2,2 = 8
𝜕𝑓 2
𝜕𝑓 4
2,2 = 𝑦 = 4, 2,2 = 2𝑥𝑦 = 8 → 𝛻𝑓 2,2 =
𝜕𝑥 𝜕𝑦 8
 This tells us that the direction we need to move in is
−1
8
𝜃 = tan = 1.107rad ≈ 63.4°
4
 The slope in this direction is 42 + 82 = 8.944.

Numerical Methods for EE (EE407) | Main


Example
166

 Evaluating the gradient for 𝜃


= 1.107 yields the norm
4 cos 1.107 + 8 sin 1.107 = 8.944
 Any other angle will give a lower
gradient.
 For instance choosing 𝜃 = 0.5 and
𝜃 = 1.5 yields:
4 cos 0.5 + 8 sin 0.5 = 7.3457
4 cos 1.5 + 8 sin 1.5 = 8.2629
 What remains is to determine
whether this is a minimum or
maximum.
Numerical Methods for EE (EE407) | Main
The Hessian Matrix
167

 The Hessian matrix is made up of the second derivatives:


𝜕2𝑓 𝜕2𝑓
𝜕𝑥 2 𝜕𝑥𝜕𝑦
𝐻=
𝜕2𝑓 𝜕2𝑓
𝜕𝑦𝜕𝑥 𝜕𝑦 2
 The determinant 𝐻 tells us the nature of the extremum:
𝜕2 𝑓
 If 𝐻 > 0 and > 0, then 𝑓 𝑥, 𝑦 has a local minimum.
𝜕𝑥 2
𝜕2 𝑓
 If 𝐻 > 0 and < 0, then 𝑓 𝑥, 𝑦 has a local maximum.
𝜕𝑥 2
 If 𝐻 < 0, then 𝑓 𝑥, 𝑦 has a saddle point.

Numerical Methods for EE (EE407) | Main


3 − Steepest Ascent Method
168

 In the steepest ascent method, we start from a point 𝑥0 , 𝑦0


and move a step in the direction of the gradient.
 We use the formulas
𝜕𝑓
𝑥 = 𝑥0 + ℎ
𝜕𝑥
𝜕𝑓
𝑦 = 𝑦0 + ℎ
𝜕𝑦
 where ℎ is a sufficiently small
step. The aim is to re-evaluate
the gradient again after each
step travelled.

Numerical Methods for EE (EE407) | Main


3 − Steepest Ascent Method
169

 Consider the function


𝑓 𝑥, 𝑦 = 2𝑥𝑦 + 2𝑥 − 𝑥 2 − 2𝑦 2
 We will use the initial guesses 𝑥, 𝑦 = −1,1 . We have
𝜕𝑓
= 2𝑦 + 2 − 2𝑥
𝜕𝑥
𝜕𝑓
= 2𝑥 − 4𝑦
𝜕𝑦
 We assume a constant ℎ = 0.25.
 Note that the optimal steepest ascent method finds the
optimal value of ℎ by mapping 𝑓 𝑥, 𝑦 onto the ℎ-axis and
finding it maximum ℎ∗ .

Numerical Methods for EE (EE407) | Main


3 − Steepest Ascent Method
170

 Repeating the process yields the following results


𝜕𝑓 𝜕𝑓
𝒏 𝒙𝒊 𝒚𝒊 𝒙𝒊+𝟏 𝒚𝒊+𝟏 𝜺𝒕,𝒙 𝜺𝒂,𝒙
𝜕𝑥 𝜕𝑦
1 0 0 0 2 0 0.5 75 100
2 0 0.5 1 1 0.25 0.75 62.5 33.33
3 0.25 0.75 1 0.5 1 0.375 50 25
4 1 0.375 0.75 0.5 1.1875 0.5 40.62 15.79
5 1.1875 0.5 0.625 0.375 1.3438 0.5938 32.81 11.63
6 1.3438 0.5938 0.5 0.3125 1.4688 0.9719 26.56 8.51

 We see that the errors are monotonically decreasing.

Numerical Methods for EE (EE407) | Main


Matlab Code
171

f = @(x,y) 2*x.*y+2*x-x.^2-2*y.^2;
fg = @(x,y) [2*y+2-2*x;2*x-4*y];
true = [2;1];
N = 50;
XY = zeros(2,N);
Et = XY; Ea = XY;
h = 0.25;
for i = 2:N
XY(:,i) = XY(:,i-1)+h*fg(XY(1,i-1),XY(2,i-1));
Et(:,i) = abs((true-XY(:,i))./true)*100;
Ea(:,i) = abs((XY(:,i)-XY(:,i-1))./XY(:,i))*100;
end

Numerical Methods for EE (EE407) | Main


Results
172

 We see how the


errors decrease
monotonically
decreasing.
 We also see how
the approximation
proceeds towards
the true maximum
over time.
 Should the true
error be higher
than the approx.?
Numerical Methods for EE (EE407) | Main
End of Lecture!
173

Any Questions?

Numerical Methods for EE (EE407) | Main


L12: Constrained Optimization
174

 Outline of the lecture:

 Constrained optimization.
 Linear Programming.
 Graphical solution.
 Alternative scenarios.
 An overview of the simplex method.

Numerical Methods for EE (EE407) | Main


Linear Programming
175

 In the previous lectures, we saw optimization methods for a


1D or 2D function without any constraints from outside.
 Let us now consider the constrained case.
 We limit our talk to linear programming (LP) given by
maximize 𝐹 = 𝑐1 𝑥1 + 𝑐2 𝑥2 + ⋯ + 𝑐𝑛 𝑥𝑛
subject to multiple constraints
𝑎𝑖1 𝑥1 + 𝑎𝑖2 𝑥2 + ⋯ + 𝑎𝑖𝑛 𝑥𝑛 ≤ 𝑏𝑖
 The objective function 𝑓 𝑥 represents the total payoff due
when 𝑛 activities are undertaken each with a magnitude 𝑥𝑗
and the corresponding payoff of 𝑐𝑗 . Also, 𝑎𝑖𝑗 is the amount
of resource 𝑖 consumed in activity 𝑗 and 𝑏𝑖 is the total
available amount.
Numerical Methods for EE (EE407) | Main
Example
176

 Suppose that a gas-processing plant receives a fixed


amount of raw gas each week. The raw gas is processed
into two grades of heating gas, regular and premium
quality. These grades of gas are in high demand (that is,
they are guaranteed to sell) and yield different profits to
the company.
 However, their production involves both time and on-site
storage constraints.
 For example, only one of the grades can be produced at a
time, and the facility is open for only 80 hr/week.
Further, there is limited on-site storage for each of the
products. All these factors are listed below (note that a
metric ton, or tonne, is equal to 1000 kg).
Numerical Methods for EE (EE407) | Main
Example
177

 We want to develop a linear programming formulation to


maximize the profits of this operation.
 Let the amounts of regular and premium gas produced
weekly be denoted by 𝑥1 and 𝑥2 , respectively.

Numerical Methods for EE (EE407) | Main


Example
178

 Ideally, we want to maximize the total profit


𝐹 = 150𝑥1 + 175𝑥2
 By taking into account the available resources, we have the
constraints
7𝑥1 + 11𝑥2 ≤ 77 (1)
10𝑥1 + 8𝑥2 ≤ 80 (2)
 By taking into account the storage available, we have
𝑥1 ≤ 9 (3)
𝑥2 ≤ 6 (4)
 We also know that
𝑥1 , 𝑥2 ≥ 0 (5,6)
 We now have an LP problem with 5 inequality constraints.
Numerical Methods for EE (EE407) | Main
Graphical Solution
179

 The five constraints are represented by straight lines in the


𝑥1 - 𝑥2 plane enclosing the allowable area (dark blue).
 Then, we find the maximum of 𝐹 by sweeping the line.

Numerical Methods for EE (EE407) | Main


Graphical Solution
180

 Other possible cases:


a) Alternative optima.
b) No feasible solution.
c) An unbounded result.

Numerical Methods for EE (EE407) | Main


The Simplex Method
181

 The simplex method works by defining slack variables that


measure the available amount of each resource.
 For instance, if the amount of raw gas remaining is 𝑆1 , then
7𝑥1 + 11𝑥2 ≤ 77 → 7𝑥1 + 11𝑥2 + 𝑆1 = 77
 We end up with the new constraints
7𝑥1 + 11𝑥2 + 𝑆1 = 77
10𝑥1 + 8𝑥2 + 𝑆2 = 80
𝑥1 + 𝑆3 ≤ 9
𝑥2 + 𝑆4 ≤ 6
𝑥1 , 𝑥2 , 𝑆1 , 𝑆2 , 𝑆3 , 𝑆4 ≥ 0
 This is called the fully-augmented version of the LP
problem.
Numerical Methods for EE (EE407) | Main
The Simplex Method
182

 Note that now we have 𝑚 = 4


equations with 𝑛 = 6
unknowns, which is an
underdetermined problem.
 The simplex method works
𝑛
by solving up to 𝐶𝑚 LE
systems with
𝑛
𝑛!
𝐶𝑚 =
𝑚! 𝑛 − 𝑚 !
 For the example at hand, we have 𝐶46 = 15 systems each
resulting from two variables being zero. However, only 5 of
these are feasible as they lie within the constrained area.
Numerical Methods for EE (EE407) | Main
End of Lecture!
183

Any Questions?

Numerical Methods for EE (EE407) | Main

You might also like