Page 1 of 1

Minimize Initial or Final States

Posted: Tue May 26, 2020 4:26 pm
by jonmortensen
I am just getting starting with MOCO. I am impressed with the large range of problems that can be solved with the existing goals. It might just be that I do not know how to use it well enough yet, but I am struggling to find a way to minimize initial or final states. I would like to include the initial speed of particular coordinates in the cost function. If I understand it correctly, I should be able to use the MocoSumSquaredStateGoal to minimize speeds over the entire simulation. However, I only want to minimize speeds at the beginning of the simulation. Is this possible without writing a custom goal?

Re: Minimize Initial or Final States

Posted: Tue May 26, 2020 5:33 pm
by aafox
Hi Jonathan,

It looks like there are some initial/final goals for things like markers and activation, but not for joint coordinate speeds. You'd probably be able to adapt one of these (e.g. MocoInitialActivationGoal) to suit your needs. Another option though is if you want this initial state to be an exact value (or as close to this as possible) you can set it in the problem using MocoInitialBounds for that state. I'm not sure whether it works for your problem, but I guess if you bound this state to be zero at the start of the simulation then this may achieve the desired behaviour of this speed being 'minimised.' I've used this approach for final joint velocities being zero, and for the most part it gets pretty close but isn't always exactly zero (e.g. sometimes can be 1e-5 or similar).

Aaron

Re: Minimize Initial or Final States

Posted: Tue May 26, 2020 5:57 pm
by chrisdembia
Thanks, Aaron, for that great answer.

Jonathan, can you provide more background about why you want to minimize initial/final quantities? Such goals should be easy for us to add, but I want to make sure I understand why you want them.

Re: Minimize Initial or Final States

Posted: Fri May 29, 2020 12:56 pm
by jonmortensen
Thanks Aaron and Christopher.

I am interested in performing forensic analysis on falls from height. I am hoping to be able to input constraints, such as initial height and landing location/orientation, and solving for a most probable initial posture/speed. I am theorizing that minimal joint speeds will result in the most natural initial states. Of course this may take a lot of fine tuning to be accurate, and muscle activation during the fall may confound results, but I am hoping this will be a useful starting point.

Thanks again!

Re: Minimize Initial or Final States

Posted: Mon Jun 01, 2020 5:03 pm
by chrisdembia
It seems to me that you could simply enforce that the model starts from rest (all initial speeds are 0).

I recommend conducting a grid convergence study to ensure your solutions are accurate (viewtopicPhpbb.php?f=1815&t=11937&p=0&s ... 67e4ce14e8)