Explaining The Optimal Control Problem

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
POST REPLY
User avatar
Jayson Mintz
Posts: 14
Joined: Mon Aug 28, 2023 7:02 am

Explaining The Optimal Control Problem

Post by Jayson Mintz » Thu Nov 30, 2023 12:44 pm

Hello, I am currently running upper arm extremity simulations using the MOBL-arms dynamic musculoskeletal model, and am trying to understand the theory behind the prediction algorithms. I see the Optimal Control Problem page under Moco Theory in the documentation, which just lists the cost that wants to be minimized and the variables it relates to, but I am having difficulty finding any links that goes more in-depth into how the prediction algorithm is actually calculating the motion. Is there a specific file in the GitHub that could explain this process better, or is there another place I could look?

-Jayson

User avatar
Ross Miller
Posts: 375
Joined: Tue Sep 22, 2009 2:02 pm

Re: Explaining The Optimal Control Problem

Post by Ross Miller » Fri Dec 01, 2023 10:03 am

Hi Jayson,

Are you referring to the optimization algorithm? Moco uses IPOPT, which is explained here:

https://link.springer.com/article/10.10 ... 004-0559-y

For more information on the direct collocation method, these papers are good. Moco doesn't use exactly the methods described in these papers, but it's conceptually similar:

https://doi.org/10.1016/S0021-9290(01)00057-4
https://doi.org/10.1002/zamm.200610290
https://doi.org/10.1016/j.piutam.2011.04.027

Ross

User avatar
Jayson Mintz
Posts: 14
Joined: Mon Aug 28, 2023 7:02 am

Re: Explaining The Optimal Control Problem

Post by Jayson Mintz » Fri Dec 01, 2023 10:12 am

Thanks so much Ross! I will give this papers a read.

-Jayson

User avatar
Jayson Mintz
Posts: 14
Joined: Mon Aug 28, 2023 7:02 am

Re: Explaining The Optimal Control Problem

Post by Jayson Mintz » Tue Dec 19, 2023 6:42 am

After reading the above papers I believe I have a better understanding of IPOPT and Direct Collocation. I wanted to confirm something though, is direct collocation called for each individual iteration within the IPOPT method?

-Jayson

User avatar
Nicholas Bianco
Posts: 1056
Joined: Thu Oct 04, 2012 8:09 pm

Re: Explaining The Optimal Control Problem

Post by Nicholas Bianco » Tue Dec 19, 2023 11:56 am

Hi Jayson,

Direct collocation is a method used to convert an optimal control problem (OCP) into a non-linear optimization problem (NLP), which is then solved with Ipopt. This conversion, we call often call it "transcription", is performed one time before the NLP is sent off to Ipopt.

Direct collocation is one of several methods for solving optimal control problems with numerical optimizers. The term "collocation" refers to the method of converting the differential constraints in the OCP (e.g., the model dynamics) to constraints in the NLP. The term "direct" refers to the in order in which apply 1) discretization and 2) optimality conditions to the OCP. "Indirect" methods reverse the order of these steps to perform the transcription. I highly recommend the Betts (2010) book for a summary of these concepts.

Single-shooting and multiple-shooting are alternative methods to collocation methods for solving OCPs that you can find in the literature.

Best,
Nick

POST REPLY