You are on page 1of 43

Lecture - 2

Reference: Book Chapter 2


Op#miza#on  in  Prac#ce  with  MATLAB:  
for  Engineering  Students  and  Professionals  
§  A  scalar  is  a  quan#ty  that  is  solely  defined  by  its  magnitude.  
§  A  vector  is  a  quan#ty  that  is  determined  by  both  its  magnitude  and  
its  direc#on,  and  is  a  directed  line  segment.  
§  A   space   vector   can   be   expressed   in   terms   of   its   components   in   a  
Cartesian   Coordinate   system   as   a   =   a1i+a2   j+a3k.   The   magnitude   of  
this  vector  is  given  as  

§  The  length  of  a  vector  x  is  also  called  the  norm  (or  Euclidean  norm)  
of  the  vector,  denoted  as  |x|.  The  posi#on  vector  of  a  given  point  A  :  
{x,  y,  z}  is  the  vector  from  the  origin  of  the  axes  to  the  point  A.  

Op#miza#on  in  Prac#ce  with  MATLAB:   2  


for  Engineering  Students  and  Professionals  
§  The  dot  product  or  inner  product  gives  a  scalar,  as  the  product  of  
two  similarly-­‐sized  vectors.  

§  Two   vectors   are   said   to   be   orthogonal   if   their   dot   product   is  


equal  to  zero.  

Op#miza#on  in  Prac#ce  with  MATLAB:   3  


for  Engineering  Students  and  Professionals  
§  The   slope-­‐intercept   form   of   the   equa#on   of   a   line   that   has   a   slope   of  
m  and  a  y-­‐intercept  c  is:  

§  The  point-­‐slope  form  of  the  equa#on  of  a  line  that  passes  through  a  
point  P  :  (x1,  y1),  and  has  a  slope  m  is  

§  The  two-­‐point  form  of  the  equa#on  of  a  line  that  passes  through  two  
points  P1  :  (x1,  y1)  and  P2  :  (x2,  y2)  is  

§  The  two-­‐intercept  form  of  a  line  with  x  intercept  a  and  y  intercept  b  
is  given  as  

Op#miza#on  in  Prac#ce  with  MATLAB:   4  


for  Engineering  Students  and  Professionals  
§  The  equa#on  of  a  plane  with  a  nonzero  normal  vector  n  =  [a,  b,  
c]T  passing  through  the  point  V0=(x0,  y0,  z0)  is  given  as  

§  The  general  form  is:    


     
   where  d  =  −ax0  −  by0  −  cz0.    

§  The  plane  specified  in  this  form  has  its  X,  Y  and  Z  intercepts  at    

Op#miza#on  in  Prac#ce  with  MATLAB:   5  


for  Engineering  Students  and  Professionals  
§  In   the   intercept   form,   a   plane   passing   through   the   points   (a,   0,  
0),  (0,  b,  0),  and  (0,  0,  c)  is  given  by  

§  The  plane  through  (x1,  y1,  z1)  and  (x2,  y2,  z2),  and  parallel  to  the  
direc#on  [a,  b,  c]T  is  given  by  

Op#miza#on  in  Prac#ce  with  MATLAB:   6  


for  Engineering  Students  and  Professionals  
§  The   plane   that   goes   through   three   points   (x1,   y1,   z1),   (x2,   y2,   z2),  
and  (x3,  y3,  z3)  is  given  by  

Op#miza#on  in  Prac#ce  with  MATLAB:   7  


for  Engineering  Students  and  Professionals  
§  Addi+on:  

§  Subtrac+on:  

Only   matrices   of   the   same   order   can   undergo   addiFon/subtracFon  


operaFons.  
 
§  Scalar  Mul+plica+on:  

§  Matrix  Mul+plica+on:  


  The   product   of   these   two   matrices,   AB,   is   defined   only   if   the  
number   of   columns   in   A   is   equal   to   the   number   of   rows   in   B.   If   A  
is  a  m  ×  n  matrix,  and  B  is  a  n  ×  p  matrix,  then  the  product  of  A  
and  B  has  an  order  of  m  ×  p.  

Op#miza#on  in  Prac#ce  with  MATLAB:   8  


for  Engineering  Students  and  Professionals  
1.  AB              BA  in  general  
2.  AI=  IA  =  A  
3.  AB  =  0  does  not  necessarily  imply  A  =  0  or  B  =  0  
4.  k(AB)  =(kA)B=A(kB)  
5.  A(BC)  =(AB)C  
6.  (A  +  B)C=AC  +  BC  
7.  A(B  +  C)  =AB  +  AC  
 

Op#miza#on  in  Prac#ce  with  MATLAB:   9  


for  Engineering  Students  and  Professionals  
§  The  transpose  of  a  matrix  is  obtained  by  interchanging  its  
rows  and  columns.  
§  Example:    

1.   If  AT  =  A,  then  A  is  called  a  Symmetric  Matrix.  If  AT  =  
−A,  then  A  is  called  a  Skew  Symmetric  Matrix.  
2. (AT  )T  =  A  
3. (A  +  B)T  =  AT  +  BT  
4. (AB)T  =  BTAT  
5. (cA)T  =cAT  

Op#miza#on  in  Prac#ce  with  MATLAB:   10  


for  Engineering  Students  and  Professionals  
Cij  is  called  the  cofactor  of  A,  and  Mij  is  the  corresponding  minor.  

Op#miza#on  in  Prac#ce  with  MATLAB:   11  


for  Engineering  Students  and  Professionals  
§  Example:  

Op#miza#on  in  Prac#ce  with  MATLAB:   12  


for  Engineering  Students  and  Professionals  
§  det(AT  )  =  det(A)  
§  det(I)  =  1  
§  If  two  rows  or  columns  of  a  matrix  are  iden#cal,  
 then  det(A)  =  0.  
§  If  all  entries  of  a  row  or  column  are  all  zeros,    
 then  det(A)  =  0.  
§  If  B  is  obtained  by  interchanging  any  two  rows  or  columns  of  A,    
 then  det(B)  =  −det(A)  
 

Op#miza#on  in  Prac#ce  with  MATLAB:   13  


for  Engineering  Students  and  Professionals  
§  If  a  row  or  column  of  a  matrix  is  a  linear  combina#on  of  two  or  more  
columns,  then  det(A)  =  0  
§  det(AB)  =  det(A)det(B)  

§  c  is  a  scalar,  and  A  is  a  n×n  matrix.  det(cA)  =  cndet(A)  


§  If   the   determinant   of   a   matrix   is   0,   the   matrix   is   said   to   be   singular.  
Otherwise,  the  matrix  is  said  to  be  non-­‐singular.  
§  If   a   matrix   is   upper   triangular   or   lower   triangular,   the   determinant   of  
that   matrix   is   simply   equal   to   the   product   of   the   elements   in   the  
principal  diagonal.  

Op#miza#on  in  Prac#ce  with  MATLAB:   14  


for  Engineering  Students  and  Professionals  
§  For  a  square  matrix  A,  if  there  exists  a  matrix  B,  such  that,    
     AB  =  BA  =  I,  then  B  is  the  inverse  of  A.  
   

 where  Adjoint(A)  =  CT  ,  and  C  is  the  matrix  of  co-­‐factors  of  A.  
1. AA−1  =  I  
2.  (AB)−1  =  B−1A−1  
3.  (AT  )−1  =  (A−1)T  

Op#miza#on  in  Prac#ce  with  MATLAB:   15  


for  Engineering  Students  and  Professionals  
§  Example:  

.   .  

Op#miza#on  in  Prac#ce  with  MATLAB:   16  


for  Engineering  Students  and  Professionals  
§  For  an  n  ×  n  matrix,  find  all  scalars  λ  such  that  the  equa#on  

 has  a  nonzero  solu#on  x.  Such  a  scalar  λ  is  called  the  eigenvalue  
of   A,   and   any   nonzero   n   ×   1   vector,   x,   is   called   the   eigenvector  
corresponding  to  λ.  
§  Given   a   matrix   A,   the   eigenvalues   of   A,   denoted   by   λ,   can   be  
computed  by  finding  the  roots  of  the  equa#on  |A  −  λI|  =  0.  

Op#miza#on  in  Prac#ce  with  MATLAB:   17  


for  Engineering  Students  and  Professionals  
 Given  a  matrix  A,  consider  the  equa#on  (A  −  λI)x  =  0,  where  λ  is  
an   eigenvalue   of   A.   The   non   zero   values   of   x   that   sa#sfy   the  
above  equa#on  for  each  eigenvalue  are  called  Eigenvectors  of  A.  

Op#miza#on  in  Prac#ce  with  MATLAB:   18  


for  Engineering  Students  and  Professionals  
§  Example:  

Op#miza#on  in  Prac#ce  with  MATLAB:   19  


for  Engineering  Students  and  Professionals  
§  A   matrix   is   said   to   be   posi#ve   definite   if   all   its   eigenvalues   are  
posi#ve.  
§  A  matrix  is  said  to  posi#ve  semi  definite  if  all  its  eigenvalues  are  
nonnega#ve  (that  is,  including  zero).  
§  A   matrix   is   said   to   be   nega#ve   definite   if   all   its   eigenvalues   are  
nega#ve.    
§  A   matrix   is   said   to   nega#ve   semi   definite   if   all   its   eigenvalues   are  
non-­‐posi#ve  (that  is,  including  zero).  

Op#miza#on  in  Prac#ce  with  MATLAB:   20  


for  Engineering  Students  and  Professionals  
Op#miza#on  in  Prac#ce  with  MATLAB:   21  
for  Engineering  Students  and  Professionals  
Op#miza#on  in  Prac#ce  with  MATLAB:   22  
for  Engineering  Students  and  Professionals  
Op#miza#on  in  Prac#ce  with  MATLAB:   23  
for  Engineering  Students  and  Professionals  
Op#miza#on  in  Prac#ce  with  MATLAB:   24  
for  Engineering  Students  and  Professionals  
§  The  func#on  f(x)  reaches  a  value  L  as  x  approaches  the  value  x0.  

§  Example:  

Op#miza#on  in  Prac#ce  with  MATLAB:   25  


for  Engineering  Students  and  Professionals  
§  The  deriva#ve  of  a  func#on  f(x)  at  a  certain  point  x  is  a  measure  
of   the   rate   at   which   that   func#on   is   changing   as   the   variable   x  
changes  at  that  point.  

Op#miza#on  in  Prac#ce  with  MATLAB:   26  


for  Engineering  Students  and  Professionals  
§  Par#al   deriva#ves   are   defined   as   deriva#ves   of   a   func#on   of  
mul#ple  variables  when  all  but  the  variable  of  interest  are  held  
fixed  during  the  differen#a#on.  

Op#miza#on  in  Prac#ce  with  MATLAB:   27  


for  Engineering  Students  and  Professionals  
§  Let  us  assume  that  the  deriva#ve  of  a  func#on  f(x)  is  F(x).  

§  Example:  

Op#miza#on  in  Prac#ce  with  MATLAB:   28  


for  Engineering  Students  and  Professionals  
§  Definite   integra#on   is   the   integra#on   of   a   func#on,   F(x),   over   a  
par#cular  range  of  the  variable  x.  

§  Example:  

Op#miza#on  in  Prac#ce  with  MATLAB:   29  


for  Engineering  Students  and  Professionals  
§  The  Taylor  series  is  a  way  of  approxima#ng  a  func#on  in  terms  of  its  
deriva#ves.   The   approxima#on   is   accurate   around   a   chosen   point,  
and   become   progressively   inaccurate   as   we   move   away   from   that  
point.  

§  The  2nd  order  Taylor  series  expansion:  

Op#miza#on  in  Prac#ce  with  MATLAB:   30  


for  Engineering  Students  and  Professionals  
§  Example:  

Op#miza#on  in  Prac#ce  with  MATLAB:   31  


for  Engineering  Students  and  Professionals  
§  Unconstrained  Op#miza#on:  no  constraints  on  the  values  x.  
§  Constrained  Op#miza#on:  constraints  on  the  values  x.  

Op#miza#on  in  Prac#ce  with  MATLAB:   32  


for  Engineering  Students  and  Professionals  
§  The  func#on  f(x)  is  said  to  be  at  a  global  minimum  at  a  point  x∗  ∈  S  if  
f(x∗)  ≤  f(x),  for  all  x  ∈  S.  
§  The   func#on   f(x)   is   said   to   be   at   a   local   minimum   at   a   point   x∗   ∈   S   if  
f(x∗)  ≤  f(x)  for  all  x  within  a  distance  ǫ  from  x∗,  that  is,  there  exists  a      
ǫ  >  0  such  that  for  all  x  sa#sfying  |x  −  x∗|  <  ǫ,  f(x∗)  ≤  f(x).  

Op#miza#on  in  Prac#ce  with  MATLAB:   33  


for  Engineering  Students  and  Professionals  
§  Assuming   that   the   first   and   second   deriva#ves   of   the   func#on   f(x)  
exist,  the  necessary  condi#ons  for  x∗  to  be  a  local  minimum  of  the  
func#on  f(x)  on  an  interval  (a,  b)  are:  

§  The   necessary   condi#ons   for   x∗   to   be   a   local   maximum   of   the  


func#on  f(x)  on  an  interval  (a,  b)  are:  

Op#miza#on  in  Prac#ce  with  MATLAB:   34  


for  Engineering  Students  and  Professionals  
§  A  StaFonary  point  is  a  point  x∗  that  sa#sfies  the  following  equa#on:  

§  If  a  sta#onary  point  is  not  a  local  minimum  or  maximum,  it  is  an  inflecFon  point.  
The   sufficient   condi#ons   of   op#mality   can   be   used   to   differen#ate   between  
sta#onary  points  and  inflec#on  points.  
§  An   inflec#on   point   is   a   point   on   a   con#nuously   differen#able   plane   curve   at  
which   the   curve   crosses   its   tangent,   that   is,   the   curve   changes   from   being  
concave  (concave  downward)  to  convex  (concave  upward),  or  vice  versa.  
§  Points  of  inflec#on  can  also  be  categorized  according  to  whether  fʹ′(x)  is  zero  or  
not  zero.  
§  if  fʹ′(x)  is  zero,  the  point  is  a  sta#onary  point  of  inflec#on  
§  if  fʹ′(x)  is  not  zero,  the  point  is  a  non-­‐sta#onary  point  of  inflec#on  

Op#miza#on  in  Prac#ce  with  MATLAB:   35  


for  Engineering  Students  and  Professionals  
 Consider  a  point  x∗,  at  which  the  first  deriva#ve  of  f(x)  is  equal  to  zero,  
and   the   order   of   the   first   nonzero   higher   deriva#ve   is   n.   The   following  
are  the  sufficient  condi#ons  for  x∗  to  be  a  local  op#mum.  
1.  If  n  is  odd,  then  x∗  is  an  inflecFon  point.  
2.  If  n  is  even,  then  x∗  is  a  local  opFmum.  Also,  
a. If  the  value  of  that  derivaFve  of  f(x)  at  x∗  is  posiFve,  then  the  point  
x∗  is  a  local  minimum.  
b. If   the   value   of   that   derivaFve   of   f(x)   at   x∗   is   negaFve,   then   the  
point  x∗  is  a  local  maximum.  

Op#miza#on  in  Prac#ce  with  MATLAB:   36  


for  Engineering  Students  and  Professionals  
The  roots,  turning  points,  
sta#onary  points,  inflec#on  
point  and  concavity  of  a  cubic  
polynomial  x3  −  3x2  −  144x  +  432  
(black  line)  and  its  first  and  
second  deriva#ves  (red  and  
blue).  

Op#miza#on  in  Prac#ce  with  MATLAB:   37  


for  Engineering  Students  and  Professionals  
For   a   func#on   f(x),   its   gradient   is   the   vector   of   the   1st   order   par#al  
deriva#ves,  and  is  given  by  
 
 
 
 
Example:    

Op#miza#on  in  Prac#ce  with  MATLAB:   38  


for  Engineering  Students  and  Professionals  
The   Hessian   of   a   func#on   f(x)   is   the   matrix   of   the   2nd   order   par#al  
deriva#ves  of  the  func#on,  and  is  given  by  the  following  matrix  

Op#miza#on  in  Prac#ce  with  MATLAB:   39  


for  Engineering  Students  and  Professionals  
Example:    

Op#miza#on  in  Prac#ce  with  MATLAB:   40  


for  Engineering  Students  and  Professionals  
Let  f(x)  =  2x3  −  3x2  −  12x  +  1.    
Determine   the   minimum   of   f(x)   by   hand.   Report   the   values   of   the  
op#mum  x  and  the  func#on  value  at  this  point.    
  y=2x 3-3x 2-12x+1

fʹ′(x)  =  6x2  −  6x  −  12  =  6(x  −  2)(x  +  1)  =  0  


120

x1  =  2  and  x2  =  −1.  f(x1)  =  −19,  f(x2)  =  8  


100

fʹ′ʹ′(x)  =  12x  −  6   80

  60

Y-axis
At  point  x1  =  2,  fʹ′ʹ′(x)  =  18  >  0,  f(x)  =  −19.     40

It  is  the  local  minimum.   20

  0

At  point  x2  =  −1,  fʹ′ʹ′(x)  =  −18  <  0,  f(x)  =  8.     -20
-2 -1 0 1 2 3 4 5

It  is  the  local  maximum.  


X-axis

 
  Op#miza#on  in  Prac#ce  with  MATLAB:  
for  Engineering  Students  and  Professionals  
41  
§  This   sub-­‐problem   is   a   simple   demonstra#on   of   how   constrained  
op#miza#on  is  some#mes  performed.    
§  Let   us   add   another   component   to   the   previous   func#on,   giving   it   the  
form,  f(x)  =  2x3  −  3x2  −  12x+  1  +  R(x  −  6)2,  where  R  is  a  constant.    

§  Plot   this   new   func#on   for   R  


=  0,  1,  10,  100,  and  1000,  for  
0   ≤   x   ≤   8   on   the   same   figure.  
Use   different   line   types   for  
each   R.   Keep   your   ver#cal  
axis  between  −100  and  800.    

Op#miza#on  in  Prac#ce  with  MATLAB:   42  


for  Engineering  Students  and  Professionals  
§  By   looking   at   the   plot,   can   you   tell   what   the   minimum   of   the   new  
func#on   is,   for   the   different   values   of   R?   Indicate   these   minima   on  
the   plot,   and   compare   them   with   the   minimum   of   the   original  
func#on.  What  is  the  minimum  of  the  new  func#on  if  R  =  ∞?  

§  The   minimum   of   the   func#on  


f(x)   approaches   x   =   6   as   R  
increases.   As   R   tends   to   ∞,  
the   minimum   of   f(x)   =   f(6)   =  
253.  

Op#miza#on  in  Prac#ce  with  MATLAB:   43  


for  Engineering  Students  and  Professionals  

You might also like