Direct Collocation Presentation

download Direct Collocation Presentation

of 38

Transcript of Direct Collocation Presentation

  • 8/12/2019 Direct Collocation Presentation

    1/38

    IntroductionMaths

    ExampleConclusion

    The Direct Collocation Method for OptimalControl

    Gilbert Gede

    May 26, 2011

    Gilbert Gede The Direct Collocation Method for Optimal Control

    http://find/http://goback/
  • 8/12/2019 Direct Collocation Presentation

    2/38

    IntroductionMaths

    ExampleConclusion

    Outline1 Introduction

    Why?Background

    2 MathsImplicit Runge-Kutta

    PolynomialsReformulationNonLinear Programming

    3 Example

    DescriptionImplementationResults

    4 ConclusionConclusion

    ReferencesGilbert Gede The Direct Collocation Method for Optimal Control

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    3/38

    IntroductionMaths

    ExampleConclusion

    Why?Background

    What is This?

    A method to solve optimal controlproblems.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    4/38

    IntroductionMaths

    ExampleConclusion

    Why?Background

    Which Optimal Control

    Problems?

    Usually, trajectory optimization, parameteroptization, or a combination thereof.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    5/38

    I t d ti

  • 8/12/2019 Direct Collocation Presentation

    6/38

    IntroductionMaths

    ExampleConclusion

    Why?Background

    Why This Method?

    From what I understand, the current optimization

    softwares are better as you add constraints, even ifthe dimensionality increases.

    This method does that, in addition to better

    relating the states to the augmented cost function.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    7/38

    Introduction

  • 8/12/2019 Direct Collocation Presentation

    8/38

    IntroductionMaths

    ExampleConclusion

    Why?Background

    History

    From what I can tell, Hargraves 1987 paper in

    J.G.C.D. seems to be the first major publication ofthis method.

    I think use of the collocation method for optimalcontrol goes back to the 1970s, and for general useto the 1960s.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    9/38

    Introduction Implicit Runge-Kutta

  • 8/12/2019 Direct Collocation Presentation

    10/38

    IntroductionMaths

    ExampleConclusion

    Implicit Runge KuttaPolynomialsReformulationNonLinear Programming

    ODEs

    The collocation method is a way of solving

    ODEs numerically.

    This is actually an implicit Runge-Kutta

    method.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    http://find/http://goback/
  • 8/12/2019 Direct Collocation Presentation

    11/38

    Introduction Implicit Runge-Kutta

  • 8/12/2019 Direct Collocation Presentation

    12/38

    MathsExample

    Conclusion

    p gPolynomialsReformulationNonLinear Programming

    ODEs

    With the collocation method the states aredefined as functions of states and derivatives

    (they are implicit).

    Gilbert Gede The Direct Collocation Method for Optimal Control

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    13/38

    Introduction Implicit Runge-Kutta

  • 8/12/2019 Direct Collocation Presentation

    14/38

    MathsExample

    Conclusion

    PolynomialsReformulationNonLinear Programming

    Polynomial Representation

    With the prior knowledge of x (an x0 an x1) and f(x)(derivatives at those points), at s = 0 and s = 1, anddifferentiation of the polynomial, we can calculate thecoefficients.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionM h

    Implicit Runge-KuttaP l i l

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    15/38

    MathsExample

    Conclusion

    PolynomialsReformulationNonLinear Programming

    Polynomial Representation

    We can make things simpler by examing midpoint of thisinterval. (s = 0.5)

    This simplifies to:

    xc=1

    2(x1+ x2) +

    t

    8 (f1 f2) xc=

    3

    2t(x1 x2)

    1

    4(f1+ f2)

    where f is the derivative of x, evaluated at x1 and x2.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionM ths

    Implicit Runge-KuttaP l i ls

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    16/38

    MathsExample

    Conclusion

    PolynomialsReformulationNonLinear Programming

    Polynomial Representation

    Now we have an expression for the states and their

    derivatives at the interval midpoint, as representedby a cubic polynomial.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    17/38

    IntroductionMaths

    Implicit Runge-KuttaPolynomials

  • 8/12/2019 Direct Collocation Presentation

    18/38

    MathsExample

    Conclusion

    PolynomialsReformulationNonLinear Programming

    Polynomial Defects

    We now are going to add equality constraints to theoptimization problem: the error in the polynomialrepresentation of the states.

    This error is described by defects:

    =f(xc) xc

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionMaths

    Implicit Runge-KuttaPolynomials

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    19/38

    MathsExample

    Conclusion

    PolynomialsReformulationNonLinear Programming

    Polynomial Defects

    This defect is the difference between the derivative evaluated atthe approximated midpoint state, and the differentiation of theapproxiation.

    Hargraves1987

    Gilbert Gede The Direct Collocation Method for Optimal Control

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    20/38

    IntroductionMaths

    Implicit Runge-KuttaPolynomials

  • 8/12/2019 Direct Collocation Presentation

    21/38

    ExampleConclusion

    yReformulationNonLinear Programming

    NonLinear Programming

    Nonlinear programming (NLP) is optimization of

    nonlinear objective and constraint functions.

    This is typically done by linearizing the functions ata point, then taking steps in the appropriatedirections.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionMaths

    Implicit Runge-KuttaPolynomials

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    22/38

    ExampleConclusion

    ReformulationNonLinear Programming

    NonLinear Programming

    NLP is the most general case of local

    optimization.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionMaths

    Implicit Runge-KuttaPolynomials

    http://find/http://goback/
  • 8/12/2019 Direct Collocation Presentation

    23/38

    ExampleConclusion

    ReformulationNonLinear Programming

    NonLinear Programming

    NLP is the most general case of local

    optimization.All functions can be nonlinear, and theconstraints can be inequality and/or

    inequality constraints, allowing bounds to beplaced on variables.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionMaths

    E l

    Implicit Runge-KuttaPolynomialsR f l i

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    24/38

    ExampleConclusion

    ReformulationNonLinear Programming

    Using NLP

    Now it is clear what the previously defined defectswill be used for: inputs into the NLP problem asequality constraints.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionMaths

    E l

    Implicit Runge-KuttaPolynomialsR f l ti

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    25/38

    ExampleConclusion

    ReformulationNonLinear Programming

    Using NLP

    Now it is clear what the previously defined defectswill be used for: inputs into the NLP problem asequality constraints.

    These will be driven to 0 and this must bemaintained, as the solver is free to explore different

    areas in the input vector space in an attempt tominimize the objective function.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionMaths

    Example

    Implicit Runge-KuttaPolynomialsReformulation

    http://find/http://goback/
  • 8/12/2019 Direct Collocation Presentation

    26/38

    ExampleConclusion

    ReformulationNonLinear Programming

    Using NLP

    I wont discuss too much mroe detail about usingNLP for these problems; it is simply the solver whichyou give your objective and constraint functions toand it returns an optimal result (hopefully).

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionMaths

    Example

    DescriptionImplementation

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    27/38

    ExampleConclusion

    Results

    Simple Example

    This is example is from vonStryk1993, which

    was from Bryson before that.

    We have a double integrator with specifiedboundary conditions.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    28/38

    IntroductionMaths

    Example

    DescriptionImplementationR l

  • 8/12/2019 Direct Collocation Presentation

    29/38

    ExampleConclusion

    Results

    Simple Example Cost and

    Constraint

    Cost function:min w (1)

    Additional constraints:

    l x(t) 0

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionMaths

    Example

    DescriptionImplementationR lt

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    30/38

    pConclusion

    Results

    What is This System?

    This system is analogous to a mass with velocity in onedirection.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionMaths

    Example

    DescriptionImplementationResults

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    31/38

    pConclusion

    Results

    What is This System?

    This system is analogous to a mass with velocity in onedirection.

    We want to switch the sign of that velocity within the timeinterval, and end at the starting position.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionMaths

    Example

    DescriptionImplementationResults

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    32/38

    ConclusionResults

    What is This System?

    This system is analogous to a mass with velocity in onedirection.

    We want to switch the sign of that velocity within the timeinterval, and end at the starting position.

    The mass isnt allowed to move further than laway from thestarting position in the positive direction.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionMathsExample

    C l i

    DescriptionImplementationResults

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    33/38

    ConclusionResults

    What is This System?

    This system is analogous to a mass with velocity in onedirection.

    We want to switch the sign of that velocity within the timeinterval, and end at the starting position.

    The mass isnt allowed to move further than laway from thestarting position in the positive direction.

    We want to minizie the integral of force over this time interval.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    34/38

  • 8/12/2019 Direct Collocation Presentation

    35/38

    IntroductionMathsExample

    Conclusion

    ConclusionReferences

  • 8/12/2019 Direct Collocation Presentation

    36/38

    Conclusion

    Conclusion

    The Direct Collocation Method has considerableadvantages over simpler shooting methods due to

    the additionaly constraints (even when adding morevariables.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionMathsExample

    Conclusion

    ConclusionReferences

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    37/38

    Conclusion

    Conclusion

    The Direct Collocation Method has considerableadvantages over simpler shooting methods due to

    the additionaly constraints (even when adding morevariables.

    While it has shortcomings, it is very good at

    problems which do not encounter a lot of inequalityconstraints.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    IntroductionMathsExample

    Conclusion

    ConclusionReferences

    http://find/
  • 8/12/2019 Direct Collocation Presentation

    38/38

    Conclusion

    References

    Hargraves, C. R., & Paris, S. W. (1987). Direct trajectory optimizationusing nonlinear programming and collocation. Journal of Guidance,Control, and Dynamics, 10(4), 338-342. doi: 10.2514/3.20223.

    Von Stryk, O. (1993). Numerical solution of optimal control problems bydirect collocation. International Series of Numerical Mathematics,111(4), 1-13.

    Runge-Kutta Methods Wikipedia, the Free Encyclopedia. 25 May2011. http://en.wikipedia.org/wiki/Runge-Kutta_methods.

    Gilbert Gede The Direct Collocation Method for Optimal Control

    http://en.wikipedia.org/wiki/Runge-Kutta_methodshttp://en.wikipedia.org/wiki/Runge-Kutta_methodshttp://en.wikipedia.org/wiki/Runge-Kutta_methodshttp://find/