This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #= | |
| Example Source: http://www.matthewpeterkelly.com/tutorials/trajectoryOptimization/cartPoleCollocation.svg | |
| Learning trajectory optimization with a simple cartpole system | |
| =# | |
| using JuMP, Ipopt | |
| using Plots | |
| # Number of time steps, increase to reduce error at computation expense | |
| N = 39 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using ForwardDiff | |
| using LinearAlgebra | |
| using StaticArrays | |
| using BenchmarkTools | |
| function levenberg_marquardt(func, desired::SVector, θ_init::SVector, debug=false) | |
| """ | |
| Finds the optimal input values θ to a function to approximate desired output values | |
| using the Levenberg-Marquardt Algorithm | |
| # Arguments |