optimizing path spring variables

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
vahid F
Posts: 19
Joined: Mon Jul 23, 2018 8:02 am

optimizing path spring variables

Post by vahid F » Wed May 27, 2020 12:42 pm

Hi
I want to add a path spring to a 3D walking model and optimize stiffness and rest length while tracking kinematic file (joints angle). I found that this task can be done using MOCO. I am not familiar with MOCO. Can you guide me step by step on this task?
I appreciate any helps

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

Re: optimizing path spring variables

Post by Nicholas Bianco » Wed May 27, 2020 12:58 pm

Hi Vahid,

You can optimize spring stiffness and rest length using MocoParameters. To get started, check out the cheat sheet on the "User Guide" page of our documentation (https://opensim-org.github.io/opensim-moco-site/docs/).

We have two solvers in Moco: MocoTropterSolver and MocoCasADiSolver. When optimizing many parameters, it is advised to use MocoTropterSolver, since MocoCasADiSolver can require extra calls to update the model for parameters that change the underlying Simbody system (e.g., mass parameters), which can slow things down.

However, if you are using an OpenSim PathSpring, using MocoCasADiSolver is fine to optimize stiffness and rest length (these only get changed at the OpenSim level). If you do use MocoCasADiSolver (which is faster if your machine can exploit parallelization), then be sure to set the property 'parameters_require_initsystem()' to false before solving your problem.

-Nick

POST REPLY