OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
-
Chonghui Zhang
- Posts: 10
- Joined: Wed May 19, 2021 1:58 am
Post
by Chonghui Zhang » Fri Dec 09, 2022 5:49 am
Hi all,
I would like to ask two questions about body mass optimization in Moco.
1. I wish to get the maximum weight of a barbell that a human model can lift. Is the following code correct?
Code: Select all
param = MocoParameter('barbell_mass', '/bodyset/barbell', 'mass', MocoBounds(1,500));
problem.addParameter(param)
2. If maximizing the mass is a cost function, how to set its weighting coefficient when it is combined with other cost functions (e.g. MocoControlGoal)?
Thanks,
Chonghui
-
Nicholas Bianco
- Posts: 1050
- Joined: Thu Oct 04, 2012 8:09 pm
Post
by Nicholas Bianco » Mon Dec 12, 2022 1:27 pm
Hi Chonghui,
Your code looks correct.
Unfortunately, there's no way to directly maximize the value of a parameter in the model. If the Moco problem you're running solves quickly, it might be easiest to optimize the mass using a two-level optimization approach.
-Nick
-
Chonghui Zhang
- Posts: 10
- Joined: Wed May 19, 2021 1:58 am
Post
by Chonghui Zhang » Tue Dec 13, 2022 11:13 pm
Hi Nick,
Thanks for your reply. But I'm not sure how to conduct a two-level optimization. Could you please give me some tips?
Thanks,
Chonghui