https://github.com/baggepinnen/differentialdynamicprogramming.jl

A package for solving Differential Dynamic Programming and trajectory optimization problems.

https://github.com/baggepinnen/differentialdynamicprogramming.jl

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary

Keywords

ddp dynamic-programming model-predictive-control optimal-control trajectory-optimization
Last synced: 5 months ago · JSON representation

Repository

A package for solving Differential Dynamic Programming and trajectory optimization problems.

Basic Info
  • Host: GitHub
  • Owner: baggepinnen
  • License: other
  • Language: Julia
  • Default Branch: master
  • Size: 271 KB
Statistics
  • Stars: 77
  • Watchers: 8
  • Forks: 15
  • Open Issues: 4
  • Releases: 0
Topics
ddp dynamic-programming model-predictive-control optimal-control trajectory-optimization
Created almost 10 years ago · Last pushed almost 5 years ago
Metadata Files
Readme License

README.md

DifferentialDynamicProgramming

Build Status

Coverage Status

Installation

The package is registered and can be added with
] add DifferentialDynamicProgramming
The latest version is formally compatible with Julia v1.1+ (but probably works well for julia v1.0 as well if you dev it).

Demo functions

The following demo functions are provided

demo_linear() To run the iLQG DDP algorithm on a simple linear problem
demoQP To solve a demo quadratic program
demo_pendcart() Where a pendulum attached to a cart is simulated.

Usage

Demo linear

See demo file demo_linear.jl for a usage example.

```julia

make stable linear dynamics

h = .01 # time step n = 10 # state dimension m = 2 # control dimension A = randn(n,n) A = A-A' # skew-symmetric = pure imaginary eigenvalues A = exp(hA) # discrete time B = hrandn(n,m)

quadratic costs

Q = heye(n) R = .1h*eye(m)

control limits

lims = [] #ones(m,1)[-1 1].6

T = 1000 # horizon x0 = ones(n,1) # initial state u0 = .1*randn(m,T) # initial controls

optimization problem

N = T+1 fx = A fu = B cxx = Q cxu = zeros(size(B)) cuu = R

Specify dynamics functions

function lindyndf(x,u,Q,R) u[isnan(u)] = 0 cx = Qx cu = Ru fxx=fxu=fuu = [] return fx,fu,fxx,fxu,fuu,cx,cu,cxx,cxu,cuu end function lindynf(x,u,A,B) u[isnan(u)] = 0 xnew = Ax + Bu return xnew end

function lindyncost(x,u,Q) c = 0.5sum(x.(Qx)) + 0.5sum(u.(Ru)) return c end

f(x,u,i) = lindynf(x,u,A,B,Q,R) costfun(x,u) = lindyncost(x,u,Q) df(x,u) = lindyndf(x,u,Q,R)

run the optimization

@time x, u, L, Vx, Vxx, cost, otrace = iLQG(f, costfun ,df, x0, u0, lims=lims); ```

Demo pendulum on cart

There is an additional demo function demo_pendcart(), where a pendulum attached to a cart is simulated. In this example, regular LQG control fails in stabilizing the pendulum at the upright position due to control limitations. The DDP-based optimization solves this by letting the pendulum fall, and increases the energy in the pendulum during the fall such that it will stay upright after one revolution.

window window

Citing

This code consists of a port and extensions of a MATLAB library provided by the autors of BIBTeX: @INPROCEEDINGS{ author = {Tassa, Y. and Mansard, N. and Todorov, E.}, booktitle = {Robotics and Automation (ICRA), 2014 IEEE International Conference on}, title = {Control-Limited Differential Dynamic Programming}, year = {2014}, month={May}, doi={10.1109/ICRA.2014.6907001}} http://www.mathworks.com/matlabcentral/fileexchange/52069-ilqg-ddp-trajectory-optimization http://www.cs.washington.edu/people/postdocs/tassa/

The code above was extended with KL-divergence constrained optimization for the thesis Bagge Carlson, F., "Machine Learning and System Identification for Estimation in Physical Systems" (PhD Thesis 2018). bibtex @thesis{bagge2018, title = {Machine Learning and System Identification for Estimation in Physical Systems}, author = {Bagge Carlson, Fredrik}, keyword = {Machine Learning,System Identification,Robotics,Spectral estimation,Calibration,State estimation}, month = {12}, type = {PhD Thesis}, number = {TFRT-1122}, institution = {Dept. Automatic Control, Lund University, Sweden}, year = {2018}, url = {https://lup.lub.lu.se/search/publication/ffb8dc85-ce12-4f75-8f2b-0881e492f6c0}, }

Owner

  • Name: Fredrik Bagge Carlson
  • Login: baggepinnen
  • Kind: user
  • Location: Lund, Sweden

Control systems, system identification, signal processing and machine learning

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 0
  • Total pull requests: 16
  • Average time to close issues: N/A
  • Average time to close pull requests: 8 days
  • Total issue authors: 0
  • Total pull request authors: 6
  • Average comments per issue: 0
  • Average comments per pull request: 0.31
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • acxz (1)
Pull Request Authors
  • baggepinnen (11)
  • acxz (1)
  • femtocleaner[bot] (1)
  • tkelman (1)
  • staticfloat (1)
  • JuliaTagBot (1)
Top Labels
Issue Labels
Pull Request Labels