Closed hect1995 closed 4 years ago
These questions are better posted on our user forum: https://discourse.julialang.org/c/domain/opt/13
You're looking for @NLexpression
: https://www.juliaopt.org/JuMP.jl/v0.20.0/expressions/#Nonlinear-expressions-1
The Rocket Control tutorial is a good example to follow of nonlinear MPC.
Thanks a lot, Ill ask over there
Hey people, sorry to bother again, but I want to optimize the path of a vehicle consisting on an array/vector of state states of the form [x_i,y_i,theta_i] and my control inputs are [kappa_i,dS_i]. As I am dealing with Mixed Integer representation (for obstacle collision avoidance) I have to set as a constraint that each [x_i,y_i] pair is collision free, which adds a lot of constraints and variables to my problem. My question is, as I know how x_i,y_i,theta_i evolve based on f(kappa_i,dSi), i.e. x(i+1) = x_i + dS_i*cos(theta_i), I was trying to remove x_i, y_i and theta_i from being @variables and represent all the obstacle avoidance steps and final position (my final position is fixed) based on my initial position and just the control inputs. The problem is that in the for loop I am trying to equal a JuMP variable into a Julia variable, which throws the error:
ERROR: LoadError: UndefVarError: new_x not defined
My code is attached below. I would appreciate if you could tell me any trick to reduce the amount of variables while still considering obstacle avoidance and a fixed final position (without having to consider the array of x_i,y_i,theta_i as @variables of the problem which makes it extremely slow or any other way to speed up the optimization (consider gradients?)).My original working but infite slow solution was this: