Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net ›...

108
Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez advising Department of Chemical and Biological Engineering University of Colorado, Boulder May 16, 2007

Transcript of Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net ›...

Page 1: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Optimal Control using Iterative Dynamic Programming

Daniel M. Webb, W. Fred Ramirez advising

Department of Chemical and Biological EngineeringUniversity of Colorado, Boulder

May 16, 2007

Page 2: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Problem Introduction

ODE models:•X = f (X,ν(X,ω))

X(t = 0) = X0

Model uses (especially batch systems):Optimize yieldMinimize unwanted productsReduce run-to-run variationReal-time optimal control

Some basic modeling steps:FormulateTrain (identify model parameters)Offline optimizationOnline optimization (real-time optimal control)

Page 3: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Problem Introduction

ODE models:•X = f (X,ν(X,ω))

X(t = 0) = X0

Model uses (especially batch systems):Optimize yieldMinimize unwanted productsReduce run-to-run variationReal-time optimal control

Some basic modeling steps:FormulateTrain (identify model parameters)Offline optimizationOnline optimization (real-time optimal control)

Page 4: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Problem Introduction

ODE models:•X = f (X,ν(X,ω))

X(t = 0) = X0

Model uses (especially batch systems):Optimize yield

Minimize unwanted productsReduce run-to-run variationReal-time optimal control

Some basic modeling steps:FormulateTrain (identify model parameters)Offline optimizationOnline optimization (real-time optimal control)

Page 5: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Problem Introduction

ODE models:•X = f (X,ν(X,ω))

X(t = 0) = X0

Model uses (especially batch systems):Optimize yieldMinimize unwanted products

Reduce run-to-run variationReal-time optimal control

Some basic modeling steps:FormulateTrain (identify model parameters)Offline optimizationOnline optimization (real-time optimal control)

Page 6: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Problem Introduction

ODE models:•X = f (X,ν(X,ω))

X(t = 0) = X0

Model uses (especially batch systems):Optimize yieldMinimize unwanted productsReduce run-to-run variation

Real-time optimal controlSome basic modeling steps:

FormulateTrain (identify model parameters)Offline optimizationOnline optimization (real-time optimal control)

Page 7: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Problem Introduction

ODE models:•X = f (X,ν(X,ω))

X(t = 0) = X0

Model uses (especially batch systems):Optimize yieldMinimize unwanted productsReduce run-to-run variationReal-time optimal control

Some basic modeling steps:FormulateTrain (identify model parameters)Offline optimizationOnline optimization (real-time optimal control)

Page 8: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Problem Introduction

ODE models:•X = f (X,ν(X,ω))

X(t = 0) = X0

Model uses (especially batch systems):Optimize yieldMinimize unwanted productsReduce run-to-run variationReal-time optimal control

Some basic modeling steps:Formulate

Train (identify model parameters)Offline optimizationOnline optimization (real-time optimal control)

Page 9: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Problem Introduction

ODE models:•X = f (X,ν(X,ω))

X(t = 0) = X0

Model uses (especially batch systems):Optimize yieldMinimize unwanted productsReduce run-to-run variationReal-time optimal control

Some basic modeling steps:FormulateTrain (identify model parameters)

Offline optimizationOnline optimization (real-time optimal control)

Page 10: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Problem Introduction

ODE models:•X = f (X,ν(X,ω))

X(t = 0) = X0

Model uses (especially batch systems):Optimize yieldMinimize unwanted productsReduce run-to-run variationReal-time optimal control

Some basic modeling steps:FormulateTrain (identify model parameters)Offline optimization

Online optimization (real-time optimal control)

Page 11: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Problem Introduction

ODE models:•X = f (X,ν(X,ω))

X(t = 0) = X0

Model uses (especially batch systems):Optimize yieldMinimize unwanted productsReduce run-to-run variationReal-time optimal control

Some basic modeling steps:FormulateTrain (identify model parameters)Offline optimizationOnline optimization (real-time optimal control)

Page 12: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Problem Introduction

ODE models:•X = f (X,ν(X,ω))

X(t = 0) = X0

Model uses (especially batch systems):Optimize yieldMinimize unwanted productsReduce run-to-run variationReal-time optimal control

Some basic modeling steps:FormulateTrain (identify model parameters)Offline optimizationOnline optimization (real-time optimal control)

Page 13: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V =

q

•X =

µX - qV X

•S =

−Y µX + qV Sf - q

V S

•PT =

fPX - qV PT

•PM =

φ(PT −PM) - qV PM

Page 14: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X =

µX - qV X

•S =

−Y µX + qV Sf - q

V S

•PT =

fPX - qV PT

•PM =

φ(PT −PM) - qV PM

Page 15: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X =

µX - qV X

•S =

−Y µX + qV Sf - q

V S

•PT =

fPX - qV PT

•PM =

φ(PT −PM) - qV PM

Page 16: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X = µX - q

V X•S =

−Y µX + qV Sf - q

V S

•PT =

fPX - qV PT

•PM =

φ(PT −PM) - qV PM

Page 17: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

S ( gL )

µ(

1 hr)

109876543210

0.4

0.3

0.2

0.1

0

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X = µX - q

V X•S =

−Y µX + qV Sf - q

V S

•PT =

fPX - qV PT

•PM =

φ(PT −PM) - qV PM

Page 18: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

S ( gL )

µ(

1 hr)

109876543210

0.4

0.3

0.2

0.1

0

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X = µX - q

V X•S =

−Y µX + qV Sf - q

V S

•PT =

fPX - qV PT

•PM =

φ(PT −PM) - qV PM

Page 19: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

S ( gL )

µ(

1 hr)

109876543210

0.4

0.3

0.2

0.1

0

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X = µX - q

V X•S = −Y µX + q

V Sf - qV S

•PT =

fPX - qV PT

•PM =

φ(PT −PM) - qV PM

Page 20: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X = µX - q

V X•S = −Y µX + q

V Sf - qV S

•PT =

fPX - qV PT

•PM =

φ(PT −PM) - qV PM

Page 21: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X = µX - q

V X•S = −Y µX + q

V Sf - qV S

•PT = fPX - q

V PT

•PM =

φ(PT −PM) - qV PM

Page 22: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

S ( gL )

f P(

1 hr)

1010.10.010.001

0.3

0.2

0.1

0

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X = µX - q

V X•S = −Y µX + q

V Sf - qV S

•PT = fPX - q

V PT

•PM =

φ(PT −PM) - qV PM

Page 23: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X = µX - q

V X•S = −Y µX + q

V Sf - qV S

•PT = fPX - q

V PT

•PM =

φ(PT −PM) - qV PM

Page 24: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X = µX - q

V X•S = −Y µX + q

V Sf - qV S

•PT = fPX - q

V PT

•PM = φ(PT −PM) - q

V PM

Page 25: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

S ( gL )

φ(

1 hr)

109876543210

5

4

3

2

1

0

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X = µX - q

V X•S = −Y µX + q

V Sf - qV S

•PT = fPX - q

V PT

•PM = φ(PT −PM) - q

V PM

Page 26: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

The optimal control problem:MAX(Φ)

Φ = PM(tf ) ·V (tf )

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X = µX - q

V X•S = −Y µX + q

V Sf - qV S

•PT = fPX - q

V PT

•PM = φ(PT −PM) - q

V PM

Page 27: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Park-Ramirez Bioreactor Model

For genetically modified yeast in a fed-batch reactor, predict:

cell growth,

substrate consumption,

foreign protein production,

and foreign protein secretion.

Time (hr)

q(L hr

)

14121086420

32.5

21.5

10.5

0

Accu

mul

atio

nG

ener

atio

n

Inpu

t

Dilu

tion

•V = q•X = µX - q

V X•S = −Y µX + q

V Sf - qV S

•PT = fPX - q

V PT

•PM = φ(PT −PM) - q

V PM

Page 28: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:

1 Control vector parametrization (CVP)Break the control u(t) into piecewise vectors.Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).Find the sensitivities ∂Φ

∂ω.

Solve for ω using a NLP solver.2 Collocation

Similar to control vector parametrization except discretizing states too.Seems to be much less common than control vector parametrization.

3 Necessary conditions and Pontryagin’s Maximum PrincipleCan provide much more insight into the problem solution.Requires more skill/education than parametrization methods.Difficult to apply to singular control problems.

4 Iterative dynamic programming (IDP)

Page 29: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:1 Control vector parametrization (CVP)

Break the control u(t) into piecewise vectors.Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).Find the sensitivities ∂Φ

∂ω.

Solve for ω using a NLP solver.2 Collocation

Similar to control vector parametrization except discretizing states too.Seems to be much less common than control vector parametrization.

3 Necessary conditions and Pontryagin’s Maximum PrincipleCan provide much more insight into the problem solution.Requires more skill/education than parametrization methods.Difficult to apply to singular control problems.

4 Iterative dynamic programming (IDP)

Page 30: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:1 Control vector parametrization (CVP)

Break the control u(t) into piecewise vectors.

Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).Find the sensitivities ∂Φ

∂ω.

Solve for ω using a NLP solver.2 Collocation

Similar to control vector parametrization except discretizing states too.Seems to be much less common than control vector parametrization.

3 Necessary conditions and Pontryagin’s Maximum PrincipleCan provide much more insight into the problem solution.Requires more skill/education than parametrization methods.Difficult to apply to singular control problems.

4 Iterative dynamic programming (IDP)

Page 31: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:1 Control vector parametrization (CVP)

Break the control u(t) into piecewise vectors.Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).

Find the sensitivities ∂Φ∂ω

.Solve for ω using a NLP solver.

2 CollocationSimilar to control vector parametrization except discretizing states too.Seems to be much less common than control vector parametrization.

3 Necessary conditions and Pontryagin’s Maximum PrincipleCan provide much more insight into the problem solution.Requires more skill/education than parametrization methods.Difficult to apply to singular control problems.

4 Iterative dynamic programming (IDP)

Page 32: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:1 Control vector parametrization (CVP)

Break the control u(t) into piecewise vectors.Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).Find the sensitivities ∂Φ

∂ω.

Solve for ω using a NLP solver.2 Collocation

Similar to control vector parametrization except discretizing states too.Seems to be much less common than control vector parametrization.

3 Necessary conditions and Pontryagin’s Maximum PrincipleCan provide much more insight into the problem solution.Requires more skill/education than parametrization methods.Difficult to apply to singular control problems.

4 Iterative dynamic programming (IDP)

Page 33: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:1 Control vector parametrization (CVP)

Break the control u(t) into piecewise vectors.Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).Find the sensitivities ∂Φ

∂ω.

Solve for ω using a NLP solver.

2 CollocationSimilar to control vector parametrization except discretizing states too.Seems to be much less common than control vector parametrization.

3 Necessary conditions and Pontryagin’s Maximum PrincipleCan provide much more insight into the problem solution.Requires more skill/education than parametrization methods.Difficult to apply to singular control problems.

4 Iterative dynamic programming (IDP)

Page 34: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:1 Control vector parametrization (CVP)

Break the control u(t) into piecewise vectors.Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).Find the sensitivities ∂Φ

∂ω.

Solve for ω using a NLP solver.2 Collocation

Similar to control vector parametrization except discretizing states too.Seems to be much less common than control vector parametrization.

3 Necessary conditions and Pontryagin’s Maximum PrincipleCan provide much more insight into the problem solution.Requires more skill/education than parametrization methods.Difficult to apply to singular control problems.

4 Iterative dynamic programming (IDP)

Page 35: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:1 Control vector parametrization (CVP)

Break the control u(t) into piecewise vectors.Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).Find the sensitivities ∂Φ

∂ω.

Solve for ω using a NLP solver.2 Collocation

Similar to control vector parametrization except discretizing states too.

Seems to be much less common than control vector parametrization.3 Necessary conditions and Pontryagin’s Maximum Principle

Can provide much more insight into the problem solution.Requires more skill/education than parametrization methods.Difficult to apply to singular control problems.

4 Iterative dynamic programming (IDP)

Page 36: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:1 Control vector parametrization (CVP)

Break the control u(t) into piecewise vectors.Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).Find the sensitivities ∂Φ

∂ω.

Solve for ω using a NLP solver.2 Collocation

Similar to control vector parametrization except discretizing states too.Seems to be much less common than control vector parametrization.

3 Necessary conditions and Pontryagin’s Maximum PrincipleCan provide much more insight into the problem solution.Requires more skill/education than parametrization methods.Difficult to apply to singular control problems.

4 Iterative dynamic programming (IDP)

Page 37: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:1 Control vector parametrization (CVP)

Break the control u(t) into piecewise vectors.Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).Find the sensitivities ∂Φ

∂ω.

Solve for ω using a NLP solver.2 Collocation

Similar to control vector parametrization except discretizing states too.Seems to be much less common than control vector parametrization.

3 Necessary conditions and Pontryagin’s Maximum Principle

Can provide much more insight into the problem solution.Requires more skill/education than parametrization methods.Difficult to apply to singular control problems.

4 Iterative dynamic programming (IDP)

Page 38: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:1 Control vector parametrization (CVP)

Break the control u(t) into piecewise vectors.Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).Find the sensitivities ∂Φ

∂ω.

Solve for ω using a NLP solver.2 Collocation

Similar to control vector parametrization except discretizing states too.Seems to be much less common than control vector parametrization.

3 Necessary conditions and Pontryagin’s Maximum PrincipleCan provide much more insight into the problem solution.

Requires more skill/education than parametrization methods.Difficult to apply to singular control problems.

4 Iterative dynamic programming (IDP)

Page 39: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:1 Control vector parametrization (CVP)

Break the control u(t) into piecewise vectors.Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).Find the sensitivities ∂Φ

∂ω.

Solve for ω using a NLP solver.2 Collocation

Similar to control vector parametrization except discretizing states too.Seems to be much less common than control vector parametrization.

3 Necessary conditions and Pontryagin’s Maximum PrincipleCan provide much more insight into the problem solution.Requires more skill/education than parametrization methods.

Difficult to apply to singular control problems.4 Iterative dynamic programming (IDP)

Page 40: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:1 Control vector parametrization (CVP)

Break the control u(t) into piecewise vectors.Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).Find the sensitivities ∂Φ

∂ω.

Solve for ω using a NLP solver.2 Collocation

Similar to control vector parametrization except discretizing states too.Seems to be much less common than control vector parametrization.

3 Necessary conditions and Pontryagin’s Maximum PrincipleCan provide much more insight into the problem solution.Requires more skill/education than parametrization methods.Difficult to apply to singular control problems.

4 Iterative dynamic programming (IDP)

Page 41: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Optimal Control Solution Methods

The four primary ways currently used to solve optimal control problems:1 Control vector parametrization (CVP)

Break the control u(t) into piecewise vectors.Each piecewise vector is a function approximation ν(ω)(ie. constant, linear, polynomial).Find the sensitivities ∂Φ

∂ω.

Solve for ω using a NLP solver.2 Collocation

Similar to control vector parametrization except discretizing states too.Seems to be much less common than control vector parametrization.

3 Necessary conditions and Pontryagin’s Maximum PrincipleCan provide much more insight into the problem solution.Requires more skill/education than parametrization methods.Difficult to apply to singular control problems.

4 Iterative dynamic programming (IDP)

Page 42: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Dynamic Programming

What is dynamic programming?

A way to solve discrete multi-stage decision problem by:

Breaking the problem into smaller subproblems.

Remembering the best solutions to the subproblems.

Combining the solutions to the subproblems to get the overall solution.

Page 43: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Dynamic Programming

What is dynamic programming?

A way to solve discrete multi-stage decision problem by:

Breaking the problem into smaller subproblems.

Remembering the best solutions to the subproblems.

Combining the solutions to the subproblems to get the overall solution.

Page 44: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Dynamic Programming

What is dynamic programming?

A way to solve discrete multi-stage decision problem by:

Breaking the problem into smaller subproblems.

Remembering the best solutions to the subproblems.

Combining the solutions to the subproblems to get the overall solution.

Page 45: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Dynamic Programming

What is dynamic programming?

A way to solve discrete multi-stage decision problem by:

Breaking the problem into smaller subproblems.

Remembering the best solutions to the subproblems.

Combining the solutions to the subproblems to get the overall solution.

Page 46: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Iterative Dynamic Programming (IDP)

What is iterative dynamic programming (IDP)?

A type of dynamic programming to solve the optimal control problem by:

Breaking the control u(t) into k stages.

Guess several profiles for the stagewise constant controls uk .

Use the guessed controls uk to calculate a guessed continuous stateprofiles X(t), S(t), etc.

Starting at the final time and working backward, find out which of theguessed controls was the best and remember it for the next iteration.

Animation 1: Basic IDP algorithm

Page 47: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Iterative Dynamic Programming (IDP)

What is iterative dynamic programming (IDP)?

A type of dynamic programming to solve the optimal control problem by:

Breaking the control u(t) into k stages.

Guess several profiles for the stagewise constant controls uk .

Use the guessed controls uk to calculate a guessed continuous stateprofiles X(t), S(t), etc.

Starting at the final time and working backward, find out which of theguessed controls was the best and remember it for the next iteration.

Animation 1: Basic IDP algorithm

Page 48: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Iterative Dynamic Programming (IDP)

What is iterative dynamic programming (IDP)?

A type of dynamic programming to solve the optimal control problem by:

Breaking the control u(t) into k stages.

Guess several profiles for the stagewise constant controls uk .

Use the guessed controls uk to calculate a guessed continuous stateprofiles X(t), S(t), etc.

Starting at the final time and working backward, find out which of theguessed controls was the best and remember it for the next iteration.

Animation 1: Basic IDP algorithm

Page 49: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Iterative Dynamic Programming (IDP)

What is iterative dynamic programming (IDP)?

A type of dynamic programming to solve the optimal control problem by:

Breaking the control u(t) into k stages.

Guess several profiles for the stagewise constant controls uk .

Use the guessed controls uk to calculate a guessed continuous stateprofiles X(t), S(t), etc.

Starting at the final time and working backward, find out which of theguessed controls was the best and remember it for the next iteration.

Animation 1: Basic IDP algorithm

Page 50: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Iterative Dynamic Programming (IDP)

What is iterative dynamic programming (IDP)?

A type of dynamic programming to solve the optimal control problem by:

Breaking the control u(t) into k stages.

Guess several profiles for the stagewise constant controls uk .

Use the guessed controls uk to calculate a guessed continuous stateprofiles X(t), S(t), etc.

Starting at the final time and working backward, find out which of theguessed controls was the best and remember it for the next iteration.

Animation 1: Basic IDP algorithm

Page 51: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

Iterative Dynamic Programming (IDP)

What is iterative dynamic programming (IDP)?

A type of dynamic programming to solve the optimal control problem by:

Breaking the control u(t) into k stages.

Guess several profiles for the stagewise constant controls uk .

Use the guessed controls uk to calculate a guessed continuous stateprofiles X(t), S(t), etc.

Starting at the final time and working backward, find out which of theguessed controls was the best and remember it for the next iteration.

Animation 1: Basic IDP algorithm

Page 52: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

CVP vs. IDP

CVP seems to be more popular than IDP. Why?

Fast! At least 4x faster than IDP, often 20x faster.

Easy (Matlab optimization toolbox, etc).

Gradient method: fast in general, very fast near the solution.

IDP sometimes has noisy controls.

What’s good about IDP though?

Stochastic method: if sufficient samples are taken, likely to find globaloptimum.

No sensitivity derivatives needed.

Obtains an approximate solution very quickly.

Very simple algorithm (although maybe not after I’m done with it).

Page 53: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

CVP vs. IDP

CVP seems to be more popular than IDP. Why?

Fast! At least 4x faster than IDP, often 20x faster.

Easy (Matlab optimization toolbox, etc).

Gradient method: fast in general, very fast near the solution.

IDP sometimes has noisy controls.

What’s good about IDP though?

Stochastic method: if sufficient samples are taken, likely to find globaloptimum.

No sensitivity derivatives needed.

Obtains an approximate solution very quickly.

Very simple algorithm (although maybe not after I’m done with it).

Page 54: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

CVP vs. IDP

CVP seems to be more popular than IDP. Why?

Fast! At least 4x faster than IDP, often 20x faster.

Easy (Matlab optimization toolbox, etc).

Gradient method: fast in general, very fast near the solution.

IDP sometimes has noisy controls.

What’s good about IDP though?

Stochastic method: if sufficient samples are taken, likely to find globaloptimum.

No sensitivity derivatives needed.

Obtains an approximate solution very quickly.

Very simple algorithm (although maybe not after I’m done with it).

Page 55: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

CVP vs. IDP

CVP seems to be more popular than IDP. Why?

Fast! At least 4x faster than IDP, often 20x faster.

Easy (Matlab optimization toolbox, etc).

Gradient method: fast in general, very fast near the solution.

IDP sometimes has noisy controls.

What’s good about IDP though?

Stochastic method: if sufficient samples are taken, likely to find globaloptimum.

No sensitivity derivatives needed.

Obtains an approximate solution very quickly.

Very simple algorithm (although maybe not after I’m done with it).

Page 56: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

CVP vs. IDP

CVP seems to be more popular than IDP. Why?

Fast! At least 4x faster than IDP, often 20x faster.

Easy (Matlab optimization toolbox, etc).

Gradient method: fast in general, very fast near the solution.

IDP sometimes has noisy controls.

What’s good about IDP though?

Stochastic method: if sufficient samples are taken, likely to find globaloptimum.

No sensitivity derivatives needed.

Obtains an approximate solution very quickly.

Very simple algorithm (although maybe not after I’m done with it).

Page 57: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

CVP vs. IDP

CVP seems to be more popular than IDP. Why?

Fast! At least 4x faster than IDP, often 20x faster.

Easy (Matlab optimization toolbox, etc).

Gradient method: fast in general, very fast near the solution.

IDP sometimes has noisy controls.

What’s good about IDP though?

Stochastic method: if sufficient samples are taken, likely to find globaloptimum.

No sensitivity derivatives needed.

Obtains an approximate solution very quickly.

Very simple algorithm (although maybe not after I’m done with it).

Page 58: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

CVP vs. IDP

CVP seems to be more popular than IDP. Why?

Fast! At least 4x faster than IDP, often 20x faster.

Easy (Matlab optimization toolbox, etc).

Gradient method: fast in general, very fast near the solution.

IDP sometimes has noisy controls.

What’s good about IDP though?

Stochastic method: if sufficient samples are taken, likely to find globaloptimum.

No sensitivity derivatives needed.

Obtains an approximate solution very quickly.

Very simple algorithm (although maybe not after I’m done with it).

Page 59: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

CVP vs. IDP

CVP seems to be more popular than IDP. Why?

Fast! At least 4x faster than IDP, often 20x faster.

Easy (Matlab optimization toolbox, etc).

Gradient method: fast in general, very fast near the solution.

IDP sometimes has noisy controls.

What’s good about IDP though?

Stochastic method: if sufficient samples are taken, likely to find globaloptimum.

No sensitivity derivatives needed.

Obtains an approximate solution very quickly.

Very simple algorithm (although maybe not after I’m done with it).

Page 60: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

CVP vs. IDP

CVP seems to be more popular than IDP. Why?

Fast! At least 4x faster than IDP, often 20x faster.

Easy (Matlab optimization toolbox, etc).

Gradient method: fast in general, very fast near the solution.

IDP sometimes has noisy controls.

What’s good about IDP though?

Stochastic method: if sufficient samples are taken, likely to find globaloptimum.

No sensitivity derivatives needed.

Obtains an approximate solution very quickly.

Very simple algorithm

(although maybe not after I’m done with it).

Page 61: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Problem IntroductionPark-Ramirez Model

Optimal Control Solution Methods

CVP vs. IDP

CVP seems to be more popular than IDP. Why?

Fast! At least 4x faster than IDP, often 20x faster.

Easy (Matlab optimization toolbox, etc).

Gradient method: fast in general, very fast near the solution.

IDP sometimes has noisy controls.

What’s good about IDP though?

Stochastic method: if sufficient samples are taken, likely to find globaloptimum.

No sensitivity derivatives needed.

Obtains an approximate solution very quickly.

Very simple algorithm (although maybe not after I’m done with it).

Page 62: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

Speeding up IDP

IDP is slow, how can we speed it up?

Reduce integrator relative tolerance.

Use my new adaptive region sizeupdate methods.

Page 63: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

Speeding up IDP

IDP is slow, how can we speed it up?

Reduce integrator relative tolerance.

Use my new adaptive region sizeupdate methods.

Page 64: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

Speeding up IDP

IDP is slow, how can we speed it up?

Reduce integrator relative tolerance.

Use my new adaptive region sizeupdate methods.

Integrator Relative ToleranceC

PU

time

(sec

onds

)10−110−310−510−7

100

10

1

Page 65: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

Speeding up IDP

IDP is slow, how can we speed it up?

Reduce integrator relative tolerance.

Use my new adaptive region sizeupdate methods.

Page 66: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

Speeding up IDP

IDP is slow, how can we speed it up?

Reduce integrator relative tolerance.

Use my new adaptive region sizeupdate methods.

Page 67: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

First-order Control Filter

IDP often leads to noisy controls:

Animation 3: Basic IDP with 50 stages

Try a first-order control filter after every iteration.

Animation 4: First-order control filter

Page 68: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

First-order Control Filter

IDP often leads to noisy controls:

Animation 3: Basic IDP with 50 stages

Try a first-order control filter after every iteration.

Animation 4: First-order control filter

Page 69: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

First-order Control Filter

IDP often leads to noisy controls:

Animation 3: Basic IDP with 50 stages

Try a first-order control filter after every iteration.

Animation 4: First-order control filter

Page 70: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Simulated Annealing Control Filter

First-order control filter can over-filter.

How about filtering more where Φ is hurt less?

1: if no test controls improve Φ then2: for each test control do3: if test control leads to a smoother control profile then

4: γs = exp[−∆ΦT ·MΦ

]−R(0,1)

5: end if6: end for7: Choose the test control with the largest γs8: end if

Temperature cools with control region size and number of iterations.Animation 5: Simulated annealing filterLess likely to find local minima for this problem.

Page 71: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Simulated Annealing Control Filter

First-order control filter can over-filter.How about filtering more where Φ is hurt less?

1: if no test controls improve Φ then2: for each test control do3: if test control leads to a smoother control profile then

4: γs = exp[−∆ΦT ·MΦ

]−R(0,1)

5: end if6: end for7: Choose the test control with the largest γs8: end if

Temperature cools with control region size and number of iterations.Animation 5: Simulated annealing filterLess likely to find local minima for this problem.

Page 72: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Simulated Annealing Control Filter

First-order control filter can over-filter.How about filtering more where Φ is hurt less?

1: if no test controls improve Φ then

2: for each test control do3: if test control leads to a smoother control profile then

4: γs = exp[−∆ΦT ·MΦ

]−R(0,1)

5: end if6: end for7: Choose the test control with the largest γs8: end if

Temperature cools with control region size and number of iterations.Animation 5: Simulated annealing filterLess likely to find local minima for this problem.

Page 73: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Simulated Annealing Control Filter

First-order control filter can over-filter.How about filtering more where Φ is hurt less?

1: if no test controls improve Φ then2: for each test control do

3: if test control leads to a smoother control profile then

4: γs = exp[−∆ΦT ·MΦ

]−R(0,1)

5: end if6: end for7: Choose the test control with the largest γs8: end if

Temperature cools with control region size and number of iterations.Animation 5: Simulated annealing filterLess likely to find local minima for this problem.

Page 74: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Simulated Annealing Control Filter

First-order control filter can over-filter.How about filtering more where Φ is hurt less?

1: if no test controls improve Φ then2: for each test control do3: if test control leads to a smoother control profile then

4: γs = exp[−∆ΦT ·MΦ

]−R(0,1)

5: end if6: end for7: Choose the test control with the largest γs8: end if

Temperature cools with control region size and number of iterations.Animation 5: Simulated annealing filterLess likely to find local minima for this problem.

Page 75: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Simulated Annealing Control Filter

First-order control filter can over-filter.How about filtering more where Φ is hurt less?

1: if no test controls improve Φ then2: for each test control do3: if test control leads to a smoother control profile then

4: γs = exp[−∆ΦT ·MΦ

]−R(0,1)

5: end if

6: end for7: Choose the test control with the largest γs8: end if

Temperature cools with control region size and number of iterations.Animation 5: Simulated annealing filterLess likely to find local minima for this problem.

Page 76: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Simulated Annealing Control Filter

First-order control filter can over-filter.How about filtering more where Φ is hurt less?

1: if no test controls improve Φ then2: for each test control do3: if test control leads to a smoother control profile then

4: γs = exp[−∆ΦT ·MΦ

]−R(0,1)

5: end if6: end for7: Choose the test control with the largest γs8: end if

Temperature cools with control region size and number of iterations.Animation 5: Simulated annealing filterLess likely to find local minima for this problem.

Page 77: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Simulated Annealing Control Filter

First-order control filter can over-filter.How about filtering more where Φ is hurt less?

1: if no test controls improve Φ then2: for each test control do3: if test control leads to a smoother control profile then

4: γs = exp[−∆ΦT ·MΦ

]−R(0,1)

5: end if6: end for7: Choose the test control with the largest γs8: end if

Temperature cools with control region size and number of iterations.

Animation 5: Simulated annealing filterLess likely to find local minima for this problem.

Page 78: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Simulated Annealing Control Filter

First-order control filter can over-filter.How about filtering more where Φ is hurt less?

1: if no test controls improve Φ then2: for each test control do3: if test control leads to a smoother control profile then

4: γs = exp[−∆ΦT ·MΦ

]−R(0,1)

5: end if6: end for7: Choose the test control with the largest γs8: end if

Temperature cools with control region size and number of iterations.Animation 5: Simulated annealing filter

Less likely to find local minima for this problem.

Page 79: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Simulated Annealing Control Filter

First-order control filter can over-filter.How about filtering more where Φ is hurt less?

1: if no test controls improve Φ then2: for each test control do3: if test control leads to a smoother control profile then

4: γs = exp[−∆ΦT ·MΦ

]−R(0,1)

5: end if6: end for7: Choose the test control with the largest γs8: end if

Temperature cools with control region size and number of iterations.Animation 5: Simulated annealing filterLess likely to find local minima for this problem.

Page 80: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Control Damping

How about punishing control activity directly?

Φ∗ = Φ−Φd

Φd = discrete second derivative of controls.

Animation 6: Damping

Changes the problem!

Was often harmful to solution if large enough to filter well.

Good in small doses in combination with other methods.

Page 81: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Control Damping

How about punishing control activity directly?

Φ∗ = Φ−Φd

Φd = discrete second derivative of controls.

Animation 6: Damping

Changes the problem!

Was often harmful to solution if large enough to filter well.

Good in small doses in combination with other methods.

Page 82: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Control Damping

How about punishing control activity directly?

Φ∗ = Φ−Φd

Φd = discrete second derivative of controls.

Animation 6: Damping

Changes the problem!

Was often harmful to solution if large enough to filter well.

Good in small doses in combination with other methods.

Page 83: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Control Damping

How about punishing control activity directly?

Φ∗ = Φ−Φd

Φd = discrete second derivative of controls.

Animation 6: Damping

Changes the problem!

Was often harmful to solution if large enough to filter well.

Good in small doses in combination with other methods.

Page 84: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Control Damping

How about punishing control activity directly?

Φ∗ = Φ−Φd

Φd = discrete second derivative of controls.

Animation 6: Damping

Changes the problem!

Was often harmful to solution if large enough to filter well.

Good in small doses in combination with other methods.

Page 85: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Control Damping

How about punishing control activity directly?

Φ∗ = Φ−Φd

Φd = discrete second derivative of controls.

Animation 6: Damping

Changes the problem!

Was often harmful to solution if large enough to filter well.

Good in small doses in combination with other methods.

Page 86: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Pivot Point Test Controls

Regular test controls work backwards one stage at a time.

Why not change two stage controls at a time?

Animation 7: Pivot points (show every test control)

Animation 8: Pivot points (show every stage)

Very fast convergence (to local minima).

Page 87: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Pivot Point Test Controls

Regular test controls work backwards one stage at a time.

Why not change two stage controls at a time?

Animation 7: Pivot points (show every test control)

Animation 8: Pivot points (show every stage)

Very fast convergence (to local minima).

Page 88: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Pivot Point Test Controls

Regular test controls work backwards one stage at a time.

Why not change two stage controls at a time?

Animation 7: Pivot points (show every test control)

Animation 8: Pivot points (show every stage)

Very fast convergence (to local minima).

Page 89: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Pivot Point Test Controls

Regular test controls work backwards one stage at a time.

Why not change two stage controls at a time?

Animation 7: Pivot points (show every test control)

Animation 8: Pivot points (show every stage)

Very fast convergence (to local minima).

Page 90: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Pivot Point Test Controls

Regular test controls work backwards one stage at a time.

Why not change two stage controls at a time?

Animation 7: Pivot points (show every test control)

Animation 8: Pivot points (show every stage)

Very fast convergence (to local minima).

Page 91: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Big Problem with Smoothing

All the smoothing techniques caused local minima to be found.

Solve using two-step process:1 Solve most of the way using basic IDP.2 Solve some more with smoothed IDP.

The two-step results?

Page 92: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Big Problem with Smoothing

All the smoothing techniques caused local minima to be found.

Solve using two-step process:1 Solve most of the way using basic IDP.2 Solve some more with smoothed IDP.

The two-step results?

Page 93: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Big Problem with Smoothing

All the smoothing techniques caused local minima to be found.

Solve using two-step process:

1 Solve most of the way using basic IDP.2 Solve some more with smoothed IDP.

The two-step results?

Page 94: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Big Problem with Smoothing

All the smoothing techniques caused local minima to be found.

Solve using two-step process:1 Solve most of the way using basic IDP.

2 Solve some more with smoothed IDP.

The two-step results?

Page 95: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Big Problem with Smoothing

All the smoothing techniques caused local minima to be found.

Solve using two-step process:1 Solve most of the way using basic IDP.2 Solve some more with smoothed IDP.

The two-step results?

Page 96: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Big Problem with Smoothing

All the smoothing techniques caused local minima to be found.

Solve using two-step process:1 Solve most of the way using basic IDP.2 Solve some more with smoothed IDP.

The two-step results?

Page 97: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Big Problem with Smoothing

All the smoothing techniques caused local minima to be found.

Solve using two-step process:1 Solve most of the way using basic IDP.2 Solve some more with smoothed IDP.

The two-step results?

Page 98: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Stagewise Linear Continuous Controls

Why not try a stagewise linear discretization of controls?

Animation 9: Continuous linear controls (show every stage)

Useful; seems to obtain equivalent Φ but smoother.

Page 99: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Stagewise Linear Continuous Controls

Why not try a stagewise linear discretization of controls?

Animation 9: Continuous linear controls (show every stage)

Useful; seems to obtain equivalent Φ but smoother.

Page 100: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

Speeding up IDPSmoothing IDP

First-order FilterSimulated Annealing FilterDampingPivot Point Test ControlsLinear Controls

Stagewise Linear Continuous Controls

Why not try a stagewise linear discretization of controls?

Animation 9: Continuous linear controls (show every stage)

Useful; seems to obtain equivalent Φ but smoother.

Page 101: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

ConclusionsAcknowledgments

Conclusions

Several smoothing methods were developed for IDP which greatlyincrease convergence speed. If used with the two-step procedure, youget the best of both worlds:

Resistance to local minima.Fast convergence near the solution.

Page 102: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

ConclusionsAcknowledgments

Conclusions

Several smoothing methods were developed for IDP which greatlyincrease convergence speed. If used with the two-step procedure, youget the best of both worlds:

Resistance to local minima.

Fast convergence near the solution.

Page 103: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

ConclusionsAcknowledgments

Conclusions

Several smoothing methods were developed for IDP which greatlyincrease convergence speed. If used with the two-step procedure, youget the best of both worlds:

Resistance to local minima.Fast convergence near the solution.

Page 104: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

ConclusionsAcknowledgments

Acknowledgments

Dr. W. Fred Ramirez

National Science Foundation (funding)

The Free software community for the software tools I used.

My wife Janet and daughter Ani for being patient with me.

Page 105: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

ConclusionsAcknowledgments

Acknowledgments

Dr. W. Fred Ramirez

National Science Foundation (funding)

The Free software community for the software tools I used.

My wife Janet and daughter Ani for being patient with me.

Page 106: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

ConclusionsAcknowledgments

Acknowledgments

Dr. W. Fred Ramirez

National Science Foundation (funding)

The Free software community for the software tools I used.

My wife Janet and daughter Ani for being patient with me.

Page 107: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

ConclusionsAcknowledgments

Acknowledgments

Dr. W. Fred Ramirez

National Science Foundation (funding)

The Free software community for the software tools I used.

My wife Janet and daughter Ani for being patient with me.

Page 108: Optimal Control using Iterative Dynamic Programminghybopt.sourceforge.net › presentation-idp.pdf · Optimal Control using Iterative Dynamic Programming Daniel M. Webb, W. Fred Ramirez

ConclusionsAcknowledgments

Acknowledgments

Dr. W. Fred Ramirez

National Science Foundation (funding)

The Free software community for the software tools I used.

My wife Janet and daughter Ani for being patient with me.