-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate trapezoidal collocation constraints #41
Comments
Hi @DeepaMahm -- short answer: Yes.
Good luck! |
Hi @MatthewPeterKelly Thanks a lot for the response. I'm referring to the user guide for setting p the problem.
In my objective function, I try to find a D_hat the minimizes the difference between the time course data predicted by equation 1 and 2. So, D_hat is not essentially a function of time. (D_hat is a diagonal matrix and the diagonal entries are the edge weights of a graph) For a detailed explanation of the above system, please check here In such a case, I would like to know how Second doubt:
If my understanding is right, x and f should be returned from equation 1 Could you please clarify if computed at stored at each time step. Also, I could understand that Could you please clarify? |
Hello @MatthewPeterKelly Could you please explain? |
Here are some quick answers that should help you make progress in the right direction:
|
Quick follow-up on 2: I have not tried this with OptimTraj, and may be forgetting some detail. The software GPOPS-II has good support for this type of optimization, and they clearly explain in their user guide (or at least used to) how it was implemented internally. I suggest that you look up some of their papers or at least read their user guide if you want to go down this route. |
Hi @MatthewPeterKelly A simplified explanation of the problem that I am trying to solve.
I've done this in the following function
I've a doubt in how
are computed in are pre-computed by solving the dynamics with control parameters (equation 2 in my system) using ode solver.
Also, I would like to know if I can contribute this to OptiTraj demo examples if I can successfully set up and solve. |
Hi @MatthewPeterKelly Sorry for bothering you. I tried to implement the defects in my problem, adapting the function available in OptimTraj. I could get the optimal solution without constraints, but with constraints, there is a problem. I am also attaching the code here for your kind reference. |
I quickly skimmed through the math of your problem statement. I see two
issues with your implementation:
1) You should not be discretizing the problem yourself - that it the job of
OptimTraj. Let it do the work for you. If you want to have the output of
Eqn1 and Eqn2 match, then make each of them into a state variable, let
OptimTraj do the dynamics, and then put a cost between them. As a general
rule, if you are ever trying to guess how the discretization works in order
to write your own objective or constraint, then you're setting something up
wrong.
2) Calling any of Matlab's ode*() functions inside of a function handle
that is passed into OptimTraj will cause poor results. This is because all
of the ode*() functions are accurate but not consistent: they perform a
different sequence of operations on each call. This causes discontinuities
in gradients between iterations and dramatically slows down FMINCON. You
can get rid of this "simulation" step by using the integration that is
built into OptimTraj - it will make your code easier to write, the solution
will be more accurate, and it will run much faster.
Good luck!
Matt
…On Tue, Mar 31, 2020 at 11:38 AM DeepaMahm ***@***.***> wrote:
Hi @MatthewPeterKelly <https://github.com/MatthewPeterKelly> Sorry for
bothering you. I tried to implement the defects in my problem, adapting the
function available in OptimTraj. I could get the optimal solution without
constraints, but with constraints, there is a problem. I am also attaching
the code here
<https://github.com/DeepaMahm/misc/blob/master/cse_03_19_20.m>for your
kind reference.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6CWOIMTBAKUN36NP7CNFDRKIE6XANCNFSM4LQMNEHQ>
.
|
Hi @MatthewPeterKelly ,
Excuse me fro the naive question. I'm new here
I'd like to know if the user should always define the constraints (eg. non-linear equality constraints)
for solving the trajectory optimization problem.
For example, The system dynamics that I want to provide as a set of constraints is of the form
dS/dt = -AS. (this represents the dynamics of a graph network)
S is a vector and A is a matrix.
I would like to know if it is possible to automatically generate trapezoidal collocation constraints using OptimTraj. I'd like to supply these constraints to fmincon
The complete description of the problem can be found here
The text was updated successfully, but these errors were encountered: