Solutions For Exercises: Engineering Optimization by Ranjan Ganguli
Solutions For Exercises: Engineering Optimization by Ranjan Ganguli
com
WhatsApp: https://wa.me/message/2H3BV2L5TTSUF1 Telegram: https://t.me/solutionmanual
Chapter-1: Basic Concepts
Problems
ssm
1. Expand e x as a Maclaurin series. Estimate the value of e 0.5 , e 2 and e 5 using this series to get 1 per cent
mtt
accuracy with respect to the exact values. How many terms are required to achieve this accuracy level?
Repeat the problem by using a Taylor series expansion of e x about x 2.5 ? Comment on your results.
Solution:
bb99
2. Expand √ about x 1,2 and 4 to second order. Plot the function and the approximation and
comment on your results.
88@
Solution:
@
Taylor series expansion of the function √ around the point x=
We need the first and second order derivatives for the Taylor series expansion:
and
√
Now 2nd order approximation of the function around the point x=1
iill..cc
( )
√
⇒
oom
√ ( )
√
√ ( ) ⇒
√
Plots:
There are four plots i.e. f(x) vs. x; f(x) at x=1 vs. x; f(x) at x=2 vs. x; and f(x) at x=4 vs. x and these four plots
are shown in the Matlab as (f vs. x) ;(f1 vs. x) ;(f2 vs. x) ; (f4 vs. x) respectively.
Comment:
From plots it is observed that the 2nd order approximated functions are matching with the original function in
the neighbourhoods of the given points or around those points but then the approximated functions diverge from
the original one away from the points. This means they are good approximations of the original function locally
but not globally.
Thus Taylor’s series expansion is local and differs from point to point for most functions. Methods derived from
Taylor’s series are good locally. The local nature of Taylor’s series expansions is very important.
3. Expand the following function in a Taylor series about (1,1) up to two terms:
f ( x) x1e ( x1 x2 )
3
Solution:
4. Expand the following function in a Taylor series about (1,2) up to two terms
f (x) x14 x24 4 x13 x23
Solution:
( ) ( )
( ) ( )
( )
( )
( ) ( ) ( ) ( )( )
5. Expand the Rosenbrock function f (x) 100( x2 x12 ) (1 x1 )2 about (1,1) as a Taylor series retaining (a)
two terms and (b) three terms. Compare these approximations in the vicinity of (1, 1) with the actual
function. Comment on your results.
Solution:
Where R is the higher order terms (that are neglected) and n=2
Here,
, , [ ]
= =0
H = [ ]=[ ]
0+[ ][ ]
0+[ ][ ] [ ] [ ]
[ ]
Now we are considering the equations (1),(2) &(3) in the vicinity of (1,1), say at where
| |
From Eq (2), [ ] [ ]
From Eq (3), [ ] [ ]– [ ]
Comparing these approximations we conclude that evaluation of the Taylor Series expansion of function
in the vicinity of ( is more accurate (rather exact) when we retain 3 terms than in the case when we
retain 2 terms.
Solution:
Let f(x) is the cubic polynomial for which min is at 5 and max at -5.
f ‘(x) = 0
Roots of f ‘(x)=0 are x=5 and x=-5 (since min at 5 and max at -5)
f ‘(x)=(x+5)(x-5)
=x2 - 25
On integrating f ‘(x), gives
7. Find the stationary points of the following function and determine if they are minimum, maximum or
points of inflexion.
Solution: Given,
f (x) x 4 6x3 3x 2 10x
f ' (x) 0
4x 3 18x 2 6x 10 0.......................(1)
So, the stationary points of the given function are 3.962, -0.57 and 1.11
We need to find if they are minimum points, maximum points or points of inflexion. So, we determine the
From these values of f '' (x) we can comment that there are two local minimum points (at x=3.962 and -0.57)
and one local maximum point (at x=1.11). A global minimum or maximum for f (x) does not exist since the
domains as well as the function are not bounded.
Now,
So, we can say that one local minimum is at x=3.962 and the value of f(x) at that local minimum point is -40.04.
Another local minimum is at x=-0.57 and the value of f(x) at that local minimum point is -3.51. The local
maximum is at x=1.11 and the value of f(x) at that local maximum point is 8.11.
Graphical determination
Since the domain and the function f (x) are unbounded, ( i.e., x and f (x) are allowed to have any value between
and ) there is no global minimum or maximum for the function. Figure 1 is showing a plot between f(x)
and x, for the x values are ranging between -1.25 to 5.25. We can find that one local minimum is at x=3.962 and
the value of f(x) at local minimum point is -40.04, another local minimum is at x=-0.57 and the value of f(x) at
local minimum point is -3.51 and the local maximum is at x=1.11 and the value of f(x) at local maximum point
is 8.11. f(x) vs x graph
25
15
-1.25 -0.75 -0.25-5 0.25 0.75 1.25 1.75 2.25 2.75 3.25 3.75 4.25 4.75 5.25
f(x)
-15
-25
-35
-45
8. What are the stationary points of the function f as a function of the scalar c.
1 2
f ( x) cx12 x2 2 x1 x2 4 x2 .
2
For what value or values of c is the point a minima, maxima or a point of inflection?
Solution:
Determine if the points are minimum, maximum or points of inflexion. Plot the function to verify your
results. Conduct an exhaustive search of the design space by creating a grid in terms of the two design
variables and write a computer program to find the minimum and maximum points. Comment on your
results.
Solution:
{ }
( )
( )
Solving the above two equations for and we get the following feasible stationary points
0 0 0 1 -1
0 1 -1 1 0
[ ]
( )
( )
( )
Eigen values of
Conclusion
Hessian Indefinite.
clear;clc;
x1=-3:0.1:3;
x2=x1;
fmax(1)=0;
fmin(1)=0;
kk=1;mm=1;
changemin=0;
changemax=0;
for ii=1:length(x1)
for jj=1:length(x2)
f(ii,jj)=(x1(ii)^2-x2(jj)^2)*exp(-(x1(ii)^2+x1(jj)^2));
if f(ii,jj)>fmax(kk)
if changemax==1
kk=1;
fmax=[];
pmax=[];
changemax=0;
end
fmax(kk)=f(ii,jj);
pmax(kk,:)=[x1(ii) x2(jj)];
elseif f(ii,jj)==fmax(kk)
kk=kk+1;
changemax=1;
fmax(kk)=f(ii,jj);
pmax(kk,:)=[x1(ii) x2(jj)];
end
if f(ii,jj)<fmin(mm)
if changemin==1
mm=1;
fmin=[];
pmin=[];
change=0;
end
fmin(mm)=f(ii,jj);
pmin(mm,:)=[x1(ii) x2(jj)];
elseif f(ii,jj)==fmin(mm)
mm=mm+1;
changemin=1;
fmin(mm)=f(ii,jj);
pmin(mm,:)=[x1(ii) x2(jj)];
end
end
end
disp(pmax);
disp(fmax);
disp(pmin);
disp(fmin);
OUTPUT:
-1 0
1 0
0.3679 0.3679
0 1
0.3679 -0.3679
Solution:
( )
No constrain, Function Curve
From the above figure we can understand that the optimum value of the function comes at(1.882,3.764)while
the minimum valu of the function with out constrents is at(0,0)
Solution: First we need to convert the inequality constraint into the desired form:- x2 1 0
Here s is called a slack variable and can have any real value. Obviously, s 2 0
Now the constrained optimization problem is converted into unconstrained problem using Lagrangian function
as:
L ex u x2 1 s2
The Lagrange multipliers for each inequality constraint must be non-negative. i.e. u 0
. If the inequality constraint is inactive at the optimum, u 0 . If the inequality constraint
is active then u 0 .
L
e x 2ux 0
x
L
x2 1 s2 0
u
L
2us 0
s
Case I:
s 0, u 0
e 1 e 1
e x 2ux 0 u ,
2 2
x 2 1 0 x 1
us 0
e1 e1
Solving these equations yields x 1, s 2 0, u , . This solution corresponds to a case where the
2 2
inequality is active.
Case II: