Docsity

Optimization of a Function using Steepest Descent Method and MathCAD's Built-in Solver - P, Assignments of Mechanical Engineering

Toggle sidebar
bg1
fx y,( ) 15.886−=y 2.056−=x 1.308=
yy
0dfdy x0y0
,
()
h⋅+:=xx
0dfdx x0y0
,
()
h⋅+:=
Taking the steepest descent step:
h 0.187−=h Minimize g h,():=
initial guess
h 0.1:=
g h() fx
0dfdx x0y0
,
()
h⋅+ y0dfdy x0y0
,
()
h⋅+,
()
:=
Finding the optimal step size numerically:
h
h
gh()
d
d
0=
solve h,.18689533861037818821−→:=
g h() fx
0dfdx x0y0
,
()
h⋅+ y0dfdy x0y0
,
()
h⋅+,
()
170 h⋅454.8 h2
⋅+→:=
Finding the optimal step size analytically:
dfdy x0y0
,
()
11=dfdx x0y0
,
()
7−=
Gradient direction:
fx
0y0
,
()
0=y00:=x00:=
Starting point:
First Step:
dfdy x y,()
y
fx y,()
d
d
11 4 y⋅2x⋅−+→:=
dfdx x y,()
x
fx y,()
d
d
7−2.4 x⋅2y⋅−+→:=
Gradient Components:
fx y,() 7−x⋅1.2 x2
⋅+ 11 y⋅+ 2y
2
⋅+ 2x⋅y⋅−:=
minimize:
14.7 Solution
pf3

Partial preview of the text

Download Optimization of a Function using Steepest Descent Method and MathCAD's Built-in Solver - P and more Assignments Mechanical Engineering in PDF only on Docsity!

x =1.308 y =−2.056 f x y( , ) =−15.

x :=x 0 +dfdx x( 0 ,y 0 ) ⋅h y :=y 0 +dfdy x( 0 ,y 0 ) ⋅h

Taking the steepest descent step:

h :=Minimize g h( , ) h =−0.

h :=0.1^ initial guess

g h( ) :=f x( 0 + dfdx x( 0 ,y 0 ) ⋅h,y 0 +dfdy x( 0 ,y 0 ) ⋅h)

Finding the optimal step size numerically:

h h

d g h( ) d

:= solve h, →−.

g h( ) :=f x( 0 + dfdx x( 0 ,y 0 ) ⋅h,y 0 +dfdy x( 0 ,y 0 ) ⋅h) →170 h⋅ +454.8 h ⋅ 2

Finding the optimal step size analytically:

dfdx x( 0 ,y 0 ) =− 7 dfdy x( 0 ,y 0 ) = 11

Gradient direction:

x 0 := 0 y 0 := 0 f x( 0 ,y 0 ) = 0

Starting point:

First Step:

dfdy x y( , ) y

d f x y( , ) d

:= → 11 +4 y⋅ −2 x⋅

dfdx x y( , ) x

d f x y( , ) d

:= →− 7 +2.4 x⋅ −2 y⋅

Gradient Components:

minimize: f x y( , ) :=− 7 ⋅ x+ 1.2 x ⋅ 2 + 11 y⋅ + 2 y ⋅ 2 −2 x⋅ ⋅y

14.7 Solution

x =1.071 y =−2.214 f x y( , ) =−15.

x y

:=Minimize f x( , ,y)

x := 1 y :=− 1 initial guesses

Using MathCAD's Built-in Solver:

x =1.069 y =−2.208 f x y( , ) =−15.

x :=x 0 +dfdx x( 0 ,y 0 ) ⋅h y :=y 0 +dfdy x( 0 ,y 0 ) ⋅h

New point (after step 2)

h :=Minimize g h( , ) h =−0.

h :=0.1 initial guess

g h( ) :=f x( 0 + dfdx x( 0 ,y 0 ) ⋅h,y 0 +dfdy x( 0 ,y 0 ) ⋅h)

Step Size (calculated numerically):

dfdx x( 0 ,y 0 ) =0.252 dfdy x( 0 ,y 0 ) =0.

Gradient direction:

x 0 :=x y 0 :=y

New Point (step 2 starting point):

Second Step: