SlideShare a Scribd company logo
1 of 73
EPE-821
1
Dr. Muhammad Naeem
Optimization and Economics of Integrated
Power Systems
2
Course Outline
Review of Math
Basics of Optimization
Power systems basics
Review of Matlab
Examples of Optimization in Power systems
Graphical Optimization
Optimization Types Constraint and Unconstraint
Optimization Problem Types Linear NonLinear etc
Linear Optimization and Power Systems Applications
Non Linear Optimization and Power Systems Applications
Integer and Mixed integer programming and Power Systems Applications
Complexity Analysis
Quiz next week
3
MATLAB
 MATLAB is an interactive environment
 Commands are interpreted one line at a time
 Commands may be scripted to create your own functions or
procedures
 Variables are created when they are used
 Variables are typed, but variable names may be reused for different
types
 Basic data structure is the matrix
 Matrix dimensions are set dynamically
 Operations on matrices are applied to all elements of a matrix at
once
 Removes the need for looping over elements one by one!
 Makes for fast & efficient programmes
4
MATLAB
Command
Window
Workspa
ce
Command
History
5
MATLAB
 Variables
 Names
 Can be any string of upper and lower case
letters along with numbers and underscores but
it must begin with a letter
 Reserved names are IF, WHILE, ELSE, END,
SUM, etc.
 Names are case sensitive
 Value
 This is the data the is associated to the
variable; the data is accessed by using the
name.
 Variables have the type of the last thing assigned
to them
 Re-assignment is done silently – there are no
warnings if you overwrite a variable with
something of a different type.
 To assign a value to a variable use the
equal symbol ‘=‘
 >> A = 32
 To find out the value of a variable simply
type the name in
6
MATLAB
7
MATLAB
 A MATLAB matrix is a rectangular array of numbers
 Scalars and vectors are regarded as special cases of matrices
 MATLAB allows you to work with a whole array at a time
You can also use built in functions to create a matrix
 >> A = zeros(2, 4)
 creates a matrix called A with 2 rows and 4 columns
containing the value 0
 >> A = zeros(5) or >> A = zeros(5, 5)
 creates a matrix called A with 5 rows and 5 columns
You can also use:
 >> ones(rows, columns)
 >> rand(rows, columns)
Note: MATLAB always refers to the first value as the
number of Rows then the second as the number of
Columns
8
MATLAB
 The colon : is actually an operator, that generates a row vector
 This row vector may be treated as a set of indices when accessing a
elements of a matrix
 The more general form is
 [start:stepsize:end]
 >> [11:2:21]
 11 13 15 17 19 21
 >>
 Stepsize does not have to be integer (or positive)
 >> [22:-2.07:11]
 22.00 19.93 17.86 15.79 13.72 11.65
9
MATLAB
Mathematical Operators:
 Add: +
 Subtract: -
 Divide: ./
 Multiply: .*
 Power: .^ (e.g. .^2 means squared)
You can use round brackets to specify the order in
which operations will be performed
Note that preceding the symbol / or * or ^ by a ‘.’
means that the operator is applied between pairs of
corresponding elements of vectors of matrices
10
MATLAB
 Combining this with methods from Accessing Matrix Elements
gives way to more useful operations
>> results = zeros(3, 5)
>> results(:, 1:4) = rand(3, 4)
>> results(:, 5) = results(:, 1) + results(:, 2) + results(:, 3) + results(:, 4)
or
>> results(:, 5) = results(:, 1) .* results(:, 2) .* results(:, 3) .* results(:, 4)
11
MATLAB
Logical Operators:
 Greater Than: >
 Less Than: <
 Greater Than or Equal To: >=
 Less Than or Equal To: <=
 Is Equal: ==
 Not Equal To: ~=
For example, you can find data that is above a certain limit:
>> r = results(:,1)
>> ind = r > 0.2
Boolean Operators:
AND: &
OR: |
NOT: ~
12
MATLAB
 There are a number of special functions that provide useful constants
 pi = 3.14159265….
 i or j = square root of -1
 Inf = infinity
 NaN = not a number
 Passing a vector to a function like sum, mean, std will calculate the
property within the vector
 >> sum([1,2,3,4,5])
 = 15
 >> mean([1,2,3,4,5])
 = 3
 >> max([1,2,3,4,5])
 = 5

13
MATLAB
 The plot function can be used in different ways:
 >> plot(data)
 >> plot(x, y)
 >> plot(data, ‘r.-’)
 In the last example the line style is defined
 Colour: r, b, g, c, k, y etc.
 Point style: . + * x o > etc.
 Line style: - -- : .-
A basic plot
 >> x = [0:0.1:2*pi]
 >> y = sin(x)
 >> plot(x, y, ‘r.-’)
0 1 2 3 4 5 6 7
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
14
MATLAB
>> x = [0:0.1:2*pi];
>> y = sin(x);
>> plot(x, y, 'b*-')
>> hold on
>> plot(x, y*2, ‘r.-')
>> title('Sin Plots');
>> legend('sin(x)', '2*sin(x)');
>> axis([0 6.2 -2 2])
>> xlabel(‘x’);
>> ylabel(‘y’);
>> hold off
0 1 2 3 4 5 6
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
Sin Plots
x
y
sin(x)
2*sin(x)
15
MATLAB
 For command
 Use a for loop to repeat one or more statements
 The end keyword tells Matlab where the loop finishes
 You control the number of times a loop is repeated by defining the
values taken by the index variable
 This uses the colon operator again, so index values do not need
to be integer
 For example
 >> for i = 1:4
 a(i) = i * 2
 end
16
MATLAB
 The counter can be used to index different rows or columns
 E.g.
 >> results = rand(10,3)
 >> for i = 1:3
 m(i) = mean(results(:, i))
 end
 ..although you could do this in one step
 m = mean(results);
17
MATLAB
 The ‘if’ command is used with logical operators
 Again, the end command is used to tell Matlab where the statement
ends.
 For example, the following code loops through a matrix performing
calculations on each column
 >> for i = 1:size(results, 2)
 m = results(:, i)
 if m > 1
 do something
 else
 do something different
 end
 end
Calculus for Continuous Optimization
Calculus and Analytic Geometry By Thomas and Finney 9th
Edition
Introduction of Optimum Design By Jasbir S. Arora
Some figure from Web
http://www.ece.mcmaster.ca/~xwu/part4.pdf
18
Calculus for Continuous Optimization
Calculus and Analytic Geometry By Thomas and Finney 9th Edition
Shifting of Graph
19
Calculus for Continuous Optimization
Shifting of Graph
20
Calculus for Continuous Optimization
Shifting of Graph
21
Calculus for Continuous Optimization
Shifting of Graph
22
Calculus for Continuous Optimization
Slope
23
Calculus for Continuous Optimization
Slope
24
Calculus for Continuous Optimization
Tangent and Normal
25
We make use of the fact that if two lines with
gradients m1 and m2 respectively are
perpendicular, then m1 m2 = −1.
The equation of the tangent line to y = f(x) at the point (x1,y1):
( 'm' is the gradient at (x1,y1) )
The equation of the normal line to y = f(x) at (x1,y1) is:
The derivative of y = f(x) at (x1,y1)
gives us the gradient 'm'.
Calculus for Continuous Optimization
Max/Min
26
Calculus for Continuous Optimization
Rolle’s Theorem
27
Calculus for Continuous Optimization
28
Calculus for Continuous Optimization
Increasing/Decreasing Functions
29
Calculus for Continuous Optimization
First Derivative
30
Calculus for Continuous Optimization
First Derivative test
31
Calculus for Continuous Optimization
Second Derivative Test
32
Calculus for Continuous Optimization
33
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4
-20
-15
-10
-5
0
5
10
15
20
x4
- 4*x3
+ 10
Orig
1st Derv.
2nd Derv.
Calculus for Continuous Optimization
34
Calculus for Continuous Optimization
What Derivative Tells us About any Graph
35
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4
-20
-15
-10
-5
0
5
10
15
20
x4
- 4*x3
+ 10
Orig
1st Derv.
2nd Derv.
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4
-20
-15
-10
-5
0
5
10
15
20
-x4
+ 4*x3
- 10
Orig
1st Derv.
2nd Derv.
Calculus for Continuous Optimization
36
0 2 4 6 8 10 12 14 16 18 20
-1
0
1
2
3
4
5
exp(x/15)+sin(x)
Orig
1st Derv.
2nd Derv.
0 1 2 3 4 5 6 7
-1000
-500
0
500
1000
1500
x4
+500 sin(x)
Orig
1st Derv.
2nd Derv.
-4 -3 -2 -1 0 1 2 3 4 5
-20
-10
0
10
20
30
40
50
60
70
80
exp(3*x/2)+2x2
Orig
1st Derv.
2nd Derv.
Calculus for Continuous Optimization
Taylor Series
37
Calculus for Continuous Optimization
38
Calculus for Continuous Optimization
39
Calculus for Continuous Optimization
40
Calculus for Continuous Optimization
41
Taylor’s expansion for f(x) about the point x* is
where R is the remainder term that is smaller in magnitude than the
previous terms if x is sufficiently close to x*.
Summation notation
For Two Variable
Matrix notation
Calculus for Continuous Optimization
42
Often a change in the function is desired when x* moves to a
neighboring point x. Defining the change as Δf=f(x)-f(x*)
A first-order change in f(x) at x* (denoted as δf ) is obtained by retaining
only the first term
where δx is a small change in x* (δx=x-x*). Note that the first-order
change in the function given in above equation is simply a dot product
of the vectors rf and δx. A first-order change is an acceptable
approximation for change in the original function when x is near x*.
Calculus for Continuous Optimization
Gradient
43
The gradient of a line is a specific term for the steepness of a straight line.
gradient =
vertical change
horizontal change
Gradient AB = vertical
horizontal
=
6
4
= 1.5
4
6
A
B
Note: A negative gradient means that the
line is travelling downhill or a decline.
Calculus for Continuous Optimization
44
Gradient from co-ordinates
This can be achieved in two ways:
1. Draw the co-ordinates on a grid and use the
previous method.
Gradient = Change in y
Change in x
Vertical
horizontal
=
Pairs (1,2) and (5,18)
Y2 - Y1
X2 - X1
=
m 18 - 2
5 - 1
= =
16
4
= 4
(X2,Y2)
Y2 - Y1
(X1,Y1) X2 - X1
Calculus for Continuous Optimization
45
 Notations and definitions:
 Let x = (x1,…,xn) be the vector of design variables.
 The gradient vector, f, and Hessian, 2f, of f(x) are the
column vector and nn symmetric matrix defined by
.
,
2
2
2
2
1
2
2
2
2
2
2
1
2
2
1
2
2
1
2
2
1
2
2
1










































































n
n
n
n
n
n
x
f
x
x
f
x
x
f
x
x
f
x
f
x
x
f
x
x
f
x
x
f
x
f
f
x
f
x
f
f








Calculus for Continuous Optimization
46
Geometrically, the gradient vector is normal to the tangent plane at the
point x*
Calculus for Continuous Optimization
47
Calculus for Continuous Optimization
48
Calculus for Continuous Optimization
49
Calculus for Continuous Optimization
50
-8 -6 -4 -2 0 2 4 6 8
-20
-15
-10
-5
0
5
X: 0.01681
Y: 0.9999
x
cos(x)
Taylor Approx.
Calculus for Continuous Optimization
51
52
0
0.5
1
1.5
2
0
0.5
1
1.5
2
-10
0
10
20
30
40
X: 1
Y: 1
Z: 3
9X2
+9XY-18X-6Y+9
0
0.5
1
1.5
2
0
0.5
1
1.5
2
0
10
20
30
40
50
X: 1
Y: 1
Z: 3
3 X.3
Y
Calculus for Continuous Optimization
Calculus for Continuous Optimization
53
Assignment 1 Problem 1
54
Plot the functions of above examples
and their Taylor approximations in Matlab
For example 4.7 x* = 2
For example 4.8 x* = (1,2)
For example 4.8 x* = (2,2)
For example 4.8 x* = (3,2)
For example 4.9 x* = (1,1)
For example 4.9 x* = (2,2)
For example 4.9 x* = (3,2)
Due in two weeks
Some Objective Functions
55
 Monotonic and unimodal functions
 Monotonic:
 Unimodal:
ƒ(x) is unimodal on the interval if and only if it is
monotonic on either side of the single optimal point x* in the
interval.
A monotonic increasing function Unimodal function
Some Objective Functions
56
0 0.5 1 1.5 2 2.5 3
0
1
2
3
4
5
6
(i) a discrete function (ii) a discontinuous function
Y
x
(iii) a continuous function
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
-40
-20
0
20
40
60
80
100
Some Objective Functions
57
Functions can be categorized as
 Separable or nonseparable – for example, (x+y) vs. xy
 Regular or irregular – for example, x vs. abs(x)
 Unimodal or multimodal – for example, x2 vs. cos x
Some Objective Functions
58
nonseparable, regular, unimodal
Step function:
separable, irregular, unimodal
2
1
]
)
5
.
0
(
[floor
)
( 



n
i
i
x
x
f
Rastrigin:
nonseparable, regular, multimodal





n
i
i
i x
x
n
x
f
1
2
)]
2
cos(
10
[
10
)
( 
Some Objective Functions
59
Rosenbrock:
nonseparable, regular, unimodal



 



1
1
2
2
2
1 ]
)
1
(
)
(
100
[
)
(
n
i
i
i
i x
x
x
x
f
Schwefel 2.22:
nonseparable, irregular, unimodal

 



n
i
i
n
i
i x
x
x
f
1
1
|
|
|
|
)
(
Schwefel 2.26:
separable, irregular, multimodal




n
i
i
i x
x
x
f
1
|
|
sin
)
(
60
Assignment 1 Problem 2
Plot the functions in matlab
Step function
Rastrigin
Rosenbrock
Schwefel 2.22
Schwefel 2.26
Due in two weeks
Calculus for Continuous Optimization
Contour Plot
61
A level curve: Each horizontal plane z=k intersects the surface in a curve.
The projection of this curve on the xy-plane is called a level curve
Calculus for Continuous Optimization
Contour Plot
62
1
1
1
1
1
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
4
4
4
4
4
4
4
4
4
5
5
5
5
6
6
6
6
7
7
7
7
z = x2
+y2
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
-2
-1
0
1
2
-2
-1
0
1
2
0
2
4
6
8
z = x2
+y2
-2
-1
0
1
2
-2
-1
0
1
2
-4
-2
0
2
4
z = -x2
+y2
-
3
-
3
-
3
-
3
-
2
-
2
-
2
-
2
-
1
-
1
-1
-
1
-
1
-1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
2
2
2
2
2
2
3
3
3
3
z = -x2
+y2
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
Calculus for Continuous Optimization
Contour Plot
63
-2
-1
0
1
2
-2
-1
0
1
2
-1
-0.5
0
0.5
1
z = cos(x2
+y2
)
-0.8
-0.8
-0.8
-0
.8
-0.8
-
0
.
8
-0.8
-
0
.
8
-
0
.
8
-0.8
-0.6
-0.6
-0
.6
-
0
.
6
-0.6 -0.6
-
0
.
6
-0.6
-
0
.
6
-0.4
-0.4
-0.4
-0.
4
-0.4
-0.4
-0.4
-0.4
-0
.2
-0.2
-0.2
-0.2
-
0
.2
-0.2
-0.2
-
0
.
2
0
0
0
0
0
0
0 0
0
0
.2
0.2
0.2
0
.
2
0.2
0.2
0
.
2
0.
4
0.4
0.4
0
.
4
0.4
0.4
0
.
4
0.6
0.6
0.6
0
.
6
0.6
0.6
0.8
0.8
0
.
8
0.8
0.8
z = cos(x2
+y2
)
-1.5 -1 -0.5 0 0.5 1
-1.5
-1
-0.5
0
0.5
1
-2
-1
0
1
2
-2
-1
0
1
2
-1
-0.5
0
0.5
1
z = sin(x2
+y2
)
-0.8
-0.6
-0.6
-0.6
-
0
.
4
-0.4
-0.4
-
0
.
2
-
0
.
2
-0.2
-0.2
0
0
0
0
0
.
2
0.2
0.2
0.2
0.2
0
.
2
0
.2
0
.
4
0.4
0
.
4
0.4
0
.
4
0.4
0
.
4
0.4
0
.
4
0.6
0
.
6
0.6
0
.
6
0.6
0
.
6
0
.
6
0
.
6
0.6
0.
6
0.6
0
.
6
0.8
0
.8
0
.
8
0.8 0.8
0
.
8
0.8
0
.
8
0.8
0.8
0.8
0.8
0.8
0
.
8
z = sin(x2
+y2
)
-1.5 -1 -0.5 0 0.5 1
-1.5
-1
-0.5
0
0.5
1
Calculus for Continuous Optimization
Contour Plot
64
-2
-1
0
1
2
-2
-1
0
1
2
0
2
4
6
8
10
z = exp(x)+exp(y)
1
1
2
2
2
2
3
3
3
3
4
4
4
4
4
5
5
5
6
6
7
8
z = exp(x)+exp(y)
-1.5 -1 -0.5 0 0.5 1
-1.5
-1
-0.5
0
0.5
1
-4
-2
0
2
4
-4
-2
0
2
4
-20
-10
0
10
20
z = xy
-10
-10
-
5
-5
-
5
-5
0
0
0
0
0 0
5
5
5
5
10
10
z = xy
-4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
0
1
2
3
4
Calculus for Continuous Optimization
Contour Plot
65
-
1
.
5
-1
.5
-
1
.
5
-1
.5
-1
.5
-1
.5
-
1
-1
-
1
-
1
-1
-
1
-
1
-
1
-
0
.
5
-0.5
-0.5
-
0
.
5
-0.5
-0
.5
-0.5
-0.5
0
0
0
0
0
0
0
0
0
0
0
0.5
0.5
0
.
5
0.5
0
.
5
0.5
0.5
1
1
1
1
1
1
.
5
1.
5
1
.
5
1.5
Z = sin(X)+cos(Y)
-3 -2 -1 0 1 2 3
-3
-2
-1
0
1
2
3
-4
-2
0
2
4
-4
-2
0
2
4
-2
-1
0
1
2
Z = sin(X)+cos(Y)
-4
-2
0
2
4
-4
-2
0
2
4
-2
-1
0
1
2
3
Z = sin(X)+cos(Y)+0.25*rand
-
1
.
5
-1.5
-1.5
-
1
.
5
-1
-1
-1
-
1
-1
-
1
-1
-
1
-
0
.
5
-0.5
-0
.5
-
0
.
5
-0.5
-
0
.
5
-0.5
-0.5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.5
0.5 0.5
0.5
0
.5
0.5
0
.
5
1
1
1
1
1
1
1
.
5
1.5
1
.
5
1
.
5
2
2
2
Z = sin(X)+cos(Y)+0.25*rand
-3 -2 -1 0 1 2 3
-3
-2
-1
0
1
2
3
66
Assignment 1 Problem 3
Plot the contour of Step function
Rastrigin
Rosenbrock
Schwefel 2.22
Schwefel 2.26
In Matlab
Due in two weeks
Necessary and Sufficient Conditions
67
Example: If a number is divisible by 4(call this H), then it is divisible by 2
(call this C). H implies C but C is not strong enough to imply H for example
6 is divisible by 2 but not by 4
Therefore C is necessary for H but not sufficient for H.
Example: In Euclidean geometry, a triangle has equal sides (call this H) if
and only if the triangle has equal angles (call this C). This means
H if C: H is necessary for C since C implies H
H only if C: C is necessary for H since H implies C
H if and only if C: H and C imply each other and are both necessary and
sufficient conditions for each other.
68
Unconstraint Optimization
One-dimensional unconstrained optimization
– Analytical method
– Newton’s method
– Golden-section search method
Multidimensional unconstrained optimization
– Analytical method
– Gradient method—steepest ascent (descent) method
– Newton’s method
69
Unconstraint Optimization
Calculus for Continuous Optimization
Newton’s Method
70
Calculus for Continuous Optimization
71
Newton’s Method
Calculus for Continuous Optimization
Title
72
Calculus for Continuous Optimization
Title
73

More Related Content

Similar to Optimization and Economics of Power Systems

MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docxMATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docxandreecapon
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabBilawalBaloch1
 
Basics of matlab
Basics of matlabBasics of matlab
Basics of matlabAnil Maurya
 
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulinkMATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulinkreddyprasad reddyvari
 
An Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersAn Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersMurshida ck
 
Intro to MATLAB and K-mean algorithm
Intro to MATLAB and K-mean algorithmIntro to MATLAB and K-mean algorithm
Intro to MATLAB and K-mean algorithmkhalid Shah
 
COMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptxCOMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptximman gwu
 
MATLAB-Introd.ppt
MATLAB-Introd.pptMATLAB-Introd.ppt
MATLAB-Introd.pptkebeAman
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxDevaraj Chilakala
 

Similar to Optimization and Economics of Power Systems (20)

MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
MatlabIntro.ppt
MatlabIntro.pptMatlabIntro.ppt
MatlabIntro.ppt
 
Matlab
MatlabMatlab
Matlab
 
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docxMATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
MATLAB sessions Laboratory 2MAT 275 Laboratory 2Matrix .docx
 
Matlab Tutorial
Matlab TutorialMatlab Tutorial
Matlab Tutorial
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Basics of matlab
Basics of matlabBasics of matlab
Basics of matlab
 
Matlab variables
Matlab variablesMatlab variables
Matlab variables
 
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulinkMATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
 
Matlab1
Matlab1Matlab1
Matlab1
 
An Introduction to MATLAB for beginners
An Introduction to MATLAB for beginnersAn Introduction to MATLAB for beginners
An Introduction to MATLAB for beginners
 
Matlabch01
Matlabch01Matlabch01
Matlabch01
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Intro to MATLAB and K-mean algorithm
Intro to MATLAB and K-mean algorithmIntro to MATLAB and K-mean algorithm
Intro to MATLAB and K-mean algorithm
 
COMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptxCOMPANION TO MATRICES SESSION II.pptx
COMPANION TO MATRICES SESSION II.pptx
 
MATLAB-Introd.ppt
MATLAB-Introd.pptMATLAB-Introd.ppt
MATLAB-Introd.ppt
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptx
 

Recently uploaded

Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 

Recently uploaded (20)

Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 

Optimization and Economics of Power Systems

  • 1. EPE-821 1 Dr. Muhammad Naeem Optimization and Economics of Integrated Power Systems
  • 2. 2 Course Outline Review of Math Basics of Optimization Power systems basics Review of Matlab Examples of Optimization in Power systems Graphical Optimization Optimization Types Constraint and Unconstraint Optimization Problem Types Linear NonLinear etc Linear Optimization and Power Systems Applications Non Linear Optimization and Power Systems Applications Integer and Mixed integer programming and Power Systems Applications Complexity Analysis Quiz next week
  • 3. 3 MATLAB  MATLAB is an interactive environment  Commands are interpreted one line at a time  Commands may be scripted to create your own functions or procedures  Variables are created when they are used  Variables are typed, but variable names may be reused for different types  Basic data structure is the matrix  Matrix dimensions are set dynamically  Operations on matrices are applied to all elements of a matrix at once  Removes the need for looping over elements one by one!  Makes for fast & efficient programmes
  • 5. 5 MATLAB  Variables  Names  Can be any string of upper and lower case letters along with numbers and underscores but it must begin with a letter  Reserved names are IF, WHILE, ELSE, END, SUM, etc.  Names are case sensitive  Value  This is the data the is associated to the variable; the data is accessed by using the name.  Variables have the type of the last thing assigned to them  Re-assignment is done silently – there are no warnings if you overwrite a variable with something of a different type.  To assign a value to a variable use the equal symbol ‘=‘  >> A = 32  To find out the value of a variable simply type the name in
  • 7. 7 MATLAB  A MATLAB matrix is a rectangular array of numbers  Scalars and vectors are regarded as special cases of matrices  MATLAB allows you to work with a whole array at a time You can also use built in functions to create a matrix  >> A = zeros(2, 4)  creates a matrix called A with 2 rows and 4 columns containing the value 0  >> A = zeros(5) or >> A = zeros(5, 5)  creates a matrix called A with 5 rows and 5 columns You can also use:  >> ones(rows, columns)  >> rand(rows, columns) Note: MATLAB always refers to the first value as the number of Rows then the second as the number of Columns
  • 8. 8 MATLAB  The colon : is actually an operator, that generates a row vector  This row vector may be treated as a set of indices when accessing a elements of a matrix  The more general form is  [start:stepsize:end]  >> [11:2:21]  11 13 15 17 19 21  >>  Stepsize does not have to be integer (or positive)  >> [22:-2.07:11]  22.00 19.93 17.86 15.79 13.72 11.65
  • 9. 9 MATLAB Mathematical Operators:  Add: +  Subtract: -  Divide: ./  Multiply: .*  Power: .^ (e.g. .^2 means squared) You can use round brackets to specify the order in which operations will be performed Note that preceding the symbol / or * or ^ by a ‘.’ means that the operator is applied between pairs of corresponding elements of vectors of matrices
  • 10. 10 MATLAB  Combining this with methods from Accessing Matrix Elements gives way to more useful operations >> results = zeros(3, 5) >> results(:, 1:4) = rand(3, 4) >> results(:, 5) = results(:, 1) + results(:, 2) + results(:, 3) + results(:, 4) or >> results(:, 5) = results(:, 1) .* results(:, 2) .* results(:, 3) .* results(:, 4)
  • 11. 11 MATLAB Logical Operators:  Greater Than: >  Less Than: <  Greater Than or Equal To: >=  Less Than or Equal To: <=  Is Equal: ==  Not Equal To: ~= For example, you can find data that is above a certain limit: >> r = results(:,1) >> ind = r > 0.2 Boolean Operators: AND: & OR: | NOT: ~
  • 12. 12 MATLAB  There are a number of special functions that provide useful constants  pi = 3.14159265….  i or j = square root of -1  Inf = infinity  NaN = not a number  Passing a vector to a function like sum, mean, std will calculate the property within the vector  >> sum([1,2,3,4,5])  = 15  >> mean([1,2,3,4,5])  = 3  >> max([1,2,3,4,5])  = 5 
  • 13. 13 MATLAB  The plot function can be used in different ways:  >> plot(data)  >> plot(x, y)  >> plot(data, ‘r.-’)  In the last example the line style is defined  Colour: r, b, g, c, k, y etc.  Point style: . + * x o > etc.  Line style: - -- : .- A basic plot  >> x = [0:0.1:2*pi]  >> y = sin(x)  >> plot(x, y, ‘r.-’) 0 1 2 3 4 5 6 7 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
  • 14. 14 MATLAB >> x = [0:0.1:2*pi]; >> y = sin(x); >> plot(x, y, 'b*-') >> hold on >> plot(x, y*2, ‘r.-') >> title('Sin Plots'); >> legend('sin(x)', '2*sin(x)'); >> axis([0 6.2 -2 2]) >> xlabel(‘x’); >> ylabel(‘y’); >> hold off 0 1 2 3 4 5 6 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 Sin Plots x y sin(x) 2*sin(x)
  • 15. 15 MATLAB  For command  Use a for loop to repeat one or more statements  The end keyword tells Matlab where the loop finishes  You control the number of times a loop is repeated by defining the values taken by the index variable  This uses the colon operator again, so index values do not need to be integer  For example  >> for i = 1:4  a(i) = i * 2  end
  • 16. 16 MATLAB  The counter can be used to index different rows or columns  E.g.  >> results = rand(10,3)  >> for i = 1:3  m(i) = mean(results(:, i))  end  ..although you could do this in one step  m = mean(results);
  • 17. 17 MATLAB  The ‘if’ command is used with logical operators  Again, the end command is used to tell Matlab where the statement ends.  For example, the following code loops through a matrix performing calculations on each column  >> for i = 1:size(results, 2)  m = results(:, i)  if m > 1  do something  else  do something different  end  end
  • 18. Calculus for Continuous Optimization Calculus and Analytic Geometry By Thomas and Finney 9th Edition Introduction of Optimum Design By Jasbir S. Arora Some figure from Web http://www.ece.mcmaster.ca/~xwu/part4.pdf 18
  • 19. Calculus for Continuous Optimization Calculus and Analytic Geometry By Thomas and Finney 9th Edition Shifting of Graph 19
  • 20. Calculus for Continuous Optimization Shifting of Graph 20
  • 21. Calculus for Continuous Optimization Shifting of Graph 21
  • 22. Calculus for Continuous Optimization Shifting of Graph 22
  • 23. Calculus for Continuous Optimization Slope 23
  • 24. Calculus for Continuous Optimization Slope 24
  • 25. Calculus for Continuous Optimization Tangent and Normal 25 We make use of the fact that if two lines with gradients m1 and m2 respectively are perpendicular, then m1 m2 = −1. The equation of the tangent line to y = f(x) at the point (x1,y1): ( 'm' is the gradient at (x1,y1) ) The equation of the normal line to y = f(x) at (x1,y1) is: The derivative of y = f(x) at (x1,y1) gives us the gradient 'm'.
  • 26. Calculus for Continuous Optimization Max/Min 26
  • 27. Calculus for Continuous Optimization Rolle’s Theorem 27
  • 28. Calculus for Continuous Optimization 28
  • 29. Calculus for Continuous Optimization Increasing/Decreasing Functions 29
  • 30. Calculus for Continuous Optimization First Derivative 30
  • 31. Calculus for Continuous Optimization First Derivative test 31
  • 32. Calculus for Continuous Optimization Second Derivative Test 32
  • 33. Calculus for Continuous Optimization 33 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 -20 -15 -10 -5 0 5 10 15 20 x4 - 4*x3 + 10 Orig 1st Derv. 2nd Derv.
  • 34. Calculus for Continuous Optimization 34
  • 35. Calculus for Continuous Optimization What Derivative Tells us About any Graph 35 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 -20 -15 -10 -5 0 5 10 15 20 x4 - 4*x3 + 10 Orig 1st Derv. 2nd Derv. -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 -20 -15 -10 -5 0 5 10 15 20 -x4 + 4*x3 - 10 Orig 1st Derv. 2nd Derv.
  • 36. Calculus for Continuous Optimization 36 0 2 4 6 8 10 12 14 16 18 20 -1 0 1 2 3 4 5 exp(x/15)+sin(x) Orig 1st Derv. 2nd Derv. 0 1 2 3 4 5 6 7 -1000 -500 0 500 1000 1500 x4 +500 sin(x) Orig 1st Derv. 2nd Derv. -4 -3 -2 -1 0 1 2 3 4 5 -20 -10 0 10 20 30 40 50 60 70 80 exp(3*x/2)+2x2 Orig 1st Derv. 2nd Derv.
  • 37. Calculus for Continuous Optimization Taylor Series 37
  • 38. Calculus for Continuous Optimization 38
  • 39. Calculus for Continuous Optimization 39
  • 40. Calculus for Continuous Optimization 40
  • 41. Calculus for Continuous Optimization 41 Taylor’s expansion for f(x) about the point x* is where R is the remainder term that is smaller in magnitude than the previous terms if x is sufficiently close to x*. Summation notation For Two Variable Matrix notation
  • 42. Calculus for Continuous Optimization 42 Often a change in the function is desired when x* moves to a neighboring point x. Defining the change as Δf=f(x)-f(x*) A first-order change in f(x) at x* (denoted as δf ) is obtained by retaining only the first term where δx is a small change in x* (δx=x-x*). Note that the first-order change in the function given in above equation is simply a dot product of the vectors rf and δx. A first-order change is an acceptable approximation for change in the original function when x is near x*.
  • 43. Calculus for Continuous Optimization Gradient 43 The gradient of a line is a specific term for the steepness of a straight line. gradient = vertical change horizontal change Gradient AB = vertical horizontal = 6 4 = 1.5 4 6 A B Note: A negative gradient means that the line is travelling downhill or a decline.
  • 44. Calculus for Continuous Optimization 44 Gradient from co-ordinates This can be achieved in two ways: 1. Draw the co-ordinates on a grid and use the previous method. Gradient = Change in y Change in x Vertical horizontal = Pairs (1,2) and (5,18) Y2 - Y1 X2 - X1 = m 18 - 2 5 - 1 = = 16 4 = 4 (X2,Y2) Y2 - Y1 (X1,Y1) X2 - X1
  • 45. Calculus for Continuous Optimization 45  Notations and definitions:  Let x = (x1,…,xn) be the vector of design variables.  The gradient vector, f, and Hessian, 2f, of f(x) are the column vector and nn symmetric matrix defined by . , 2 2 2 2 1 2 2 2 2 2 2 1 2 2 1 2 2 1 2 2 1 2 2 1                                                                           n n n n n n x f x x f x x f x x f x f x x f x x f x x f x f f x f x f f        
  • 46. Calculus for Continuous Optimization 46 Geometrically, the gradient vector is normal to the tangent plane at the point x*
  • 47. Calculus for Continuous Optimization 47
  • 48. Calculus for Continuous Optimization 48
  • 49. Calculus for Continuous Optimization 49
  • 50. Calculus for Continuous Optimization 50 -8 -6 -4 -2 0 2 4 6 8 -20 -15 -10 -5 0 5 X: 0.01681 Y: 0.9999 x cos(x) Taylor Approx.
  • 51. Calculus for Continuous Optimization 51
  • 52. 52 0 0.5 1 1.5 2 0 0.5 1 1.5 2 -10 0 10 20 30 40 X: 1 Y: 1 Z: 3 9X2 +9XY-18X-6Y+9 0 0.5 1 1.5 2 0 0.5 1 1.5 2 0 10 20 30 40 50 X: 1 Y: 1 Z: 3 3 X.3 Y Calculus for Continuous Optimization
  • 53. Calculus for Continuous Optimization 53
  • 54. Assignment 1 Problem 1 54 Plot the functions of above examples and their Taylor approximations in Matlab For example 4.7 x* = 2 For example 4.8 x* = (1,2) For example 4.8 x* = (2,2) For example 4.8 x* = (3,2) For example 4.9 x* = (1,1) For example 4.9 x* = (2,2) For example 4.9 x* = (3,2) Due in two weeks
  • 55. Some Objective Functions 55  Monotonic and unimodal functions  Monotonic:  Unimodal: ƒ(x) is unimodal on the interval if and only if it is monotonic on either side of the single optimal point x* in the interval. A monotonic increasing function Unimodal function
  • 56. Some Objective Functions 56 0 0.5 1 1.5 2 2.5 3 0 1 2 3 4 5 6 (i) a discrete function (ii) a discontinuous function Y x (iii) a continuous function 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -40 -20 0 20 40 60 80 100
  • 57. Some Objective Functions 57 Functions can be categorized as  Separable or nonseparable – for example, (x+y) vs. xy  Regular or irregular – for example, x vs. abs(x)  Unimodal or multimodal – for example, x2 vs. cos x
  • 58. Some Objective Functions 58 nonseparable, regular, unimodal Step function: separable, irregular, unimodal 2 1 ] ) 5 . 0 ( [floor ) (     n i i x x f Rastrigin: nonseparable, regular, multimodal      n i i i x x n x f 1 2 )] 2 cos( 10 [ 10 ) ( 
  • 59. Some Objective Functions 59 Rosenbrock: nonseparable, regular, unimodal         1 1 2 2 2 1 ] ) 1 ( ) ( 100 [ ) ( n i i i i x x x x f Schwefel 2.22: nonseparable, irregular, unimodal       n i i n i i x x x f 1 1 | | | | ) ( Schwefel 2.26: separable, irregular, multimodal     n i i i x x x f 1 | | sin ) (
  • 60. 60 Assignment 1 Problem 2 Plot the functions in matlab Step function Rastrigin Rosenbrock Schwefel 2.22 Schwefel 2.26 Due in two weeks
  • 61. Calculus for Continuous Optimization Contour Plot 61 A level curve: Each horizontal plane z=k intersects the surface in a curve. The projection of this curve on the xy-plane is called a level curve
  • 62. Calculus for Continuous Optimization Contour Plot 62 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 z = x2 +y2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1 0 1 2 -2 -1 0 1 2 0 2 4 6 8 z = x2 +y2 -2 -1 0 1 2 -2 -1 0 1 2 -4 -2 0 2 4 z = -x2 +y2 - 3 - 3 - 3 - 3 - 2 - 2 - 2 - 2 - 1 - 1 -1 - 1 - 1 -1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 z = -x2 +y2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
  • 63. Calculus for Continuous Optimization Contour Plot 63 -2 -1 0 1 2 -2 -1 0 1 2 -1 -0.5 0 0.5 1 z = cos(x2 +y2 ) -0.8 -0.8 -0.8 -0 .8 -0.8 - 0 . 8 -0.8 - 0 . 8 - 0 . 8 -0.8 -0.6 -0.6 -0 .6 - 0 . 6 -0.6 -0.6 - 0 . 6 -0.6 - 0 . 6 -0.4 -0.4 -0.4 -0. 4 -0.4 -0.4 -0.4 -0.4 -0 .2 -0.2 -0.2 -0.2 - 0 .2 -0.2 -0.2 - 0 . 2 0 0 0 0 0 0 0 0 0 0 .2 0.2 0.2 0 . 2 0.2 0.2 0 . 2 0. 4 0.4 0.4 0 . 4 0.4 0.4 0 . 4 0.6 0.6 0.6 0 . 6 0.6 0.6 0.8 0.8 0 . 8 0.8 0.8 z = cos(x2 +y2 ) -1.5 -1 -0.5 0 0.5 1 -1.5 -1 -0.5 0 0.5 1 -2 -1 0 1 2 -2 -1 0 1 2 -1 -0.5 0 0.5 1 z = sin(x2 +y2 ) -0.8 -0.6 -0.6 -0.6 - 0 . 4 -0.4 -0.4 - 0 . 2 - 0 . 2 -0.2 -0.2 0 0 0 0 0 . 2 0.2 0.2 0.2 0.2 0 . 2 0 .2 0 . 4 0.4 0 . 4 0.4 0 . 4 0.4 0 . 4 0.4 0 . 4 0.6 0 . 6 0.6 0 . 6 0.6 0 . 6 0 . 6 0 . 6 0.6 0. 6 0.6 0 . 6 0.8 0 .8 0 . 8 0.8 0.8 0 . 8 0.8 0 . 8 0.8 0.8 0.8 0.8 0.8 0 . 8 z = sin(x2 +y2 ) -1.5 -1 -0.5 0 0.5 1 -1.5 -1 -0.5 0 0.5 1
  • 64. Calculus for Continuous Optimization Contour Plot 64 -2 -1 0 1 2 -2 -1 0 1 2 0 2 4 6 8 10 z = exp(x)+exp(y) 1 1 2 2 2 2 3 3 3 3 4 4 4 4 4 5 5 5 6 6 7 8 z = exp(x)+exp(y) -1.5 -1 -0.5 0 0.5 1 -1.5 -1 -0.5 0 0.5 1 -4 -2 0 2 4 -4 -2 0 2 4 -20 -10 0 10 20 z = xy -10 -10 - 5 -5 - 5 -5 0 0 0 0 0 0 5 5 5 5 10 10 z = xy -4 -3 -2 -1 0 1 2 3 4 -4 -3 -2 -1 0 1 2 3 4
  • 65. Calculus for Continuous Optimization Contour Plot 65 - 1 . 5 -1 .5 - 1 . 5 -1 .5 -1 .5 -1 .5 - 1 -1 - 1 - 1 -1 - 1 - 1 - 1 - 0 . 5 -0.5 -0.5 - 0 . 5 -0.5 -0 .5 -0.5 -0.5 0 0 0 0 0 0 0 0 0 0 0 0.5 0.5 0 . 5 0.5 0 . 5 0.5 0.5 1 1 1 1 1 1 . 5 1. 5 1 . 5 1.5 Z = sin(X)+cos(Y) -3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3 -4 -2 0 2 4 -4 -2 0 2 4 -2 -1 0 1 2 Z = sin(X)+cos(Y) -4 -2 0 2 4 -4 -2 0 2 4 -2 -1 0 1 2 3 Z = sin(X)+cos(Y)+0.25*rand - 1 . 5 -1.5 -1.5 - 1 . 5 -1 -1 -1 - 1 -1 - 1 -1 - 1 - 0 . 5 -0.5 -0 .5 - 0 . 5 -0.5 - 0 . 5 -0.5 -0.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0.5 0.5 0.5 0 .5 0.5 0 . 5 1 1 1 1 1 1 1 . 5 1.5 1 . 5 1 . 5 2 2 2 Z = sin(X)+cos(Y)+0.25*rand -3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3
  • 66. 66 Assignment 1 Problem 3 Plot the contour of Step function Rastrigin Rosenbrock Schwefel 2.22 Schwefel 2.26 In Matlab Due in two weeks
  • 67. Necessary and Sufficient Conditions 67 Example: If a number is divisible by 4(call this H), then it is divisible by 2 (call this C). H implies C but C is not strong enough to imply H for example 6 is divisible by 2 but not by 4 Therefore C is necessary for H but not sufficient for H. Example: In Euclidean geometry, a triangle has equal sides (call this H) if and only if the triangle has equal angles (call this C). This means H if C: H is necessary for C since C implies H H only if C: C is necessary for H since H implies C H if and only if C: H and C imply each other and are both necessary and sufficient conditions for each other.
  • 68. 68 Unconstraint Optimization One-dimensional unconstrained optimization – Analytical method – Newton’s method – Golden-section search method Multidimensional unconstrained optimization – Analytical method – Gradient method—steepest ascent (descent) method – Newton’s method
  • 70. Calculus for Continuous Optimization Newton’s Method 70
  • 71. Calculus for Continuous Optimization 71 Newton’s Method
  • 72. Calculus for Continuous Optimization Title 72
  • 73. Calculus for Continuous Optimization Title 73