Page 1 of 1

Custom Static Optimization in MATLAB

Posted: Thu Sep 10, 2020 7:28 am
by hazimahm
Hi,

Has anybody performed static optimisation via MATLAB using the CustomStaticOptimization.m file given in the Advanced Examples? I have managed to complete all the tasks but the optimiser was not able to reach a feasible solution, despite increasing or decreasing the options appropriately. Instead of focusing on the example model, I am using 'Thoracoscapular Model' with 17 coordinates.

To check if my optimiser is giving out the correct solution, I carried out static optimisation on a simple arm model 'Arm26', and obtained successful optimisation. The muscle forces were also similar as those when optimised via OpenSIM. This indicates that my MATLAB script can optimise correctly. The SO for 'Arm26' has only 2 constraints, based on 2 coordinates.

I don't see what could go wrong with the Thoracoscapular Model, other than having more constraints from the 17 coordinates. I have also tried a joint-by-joint method, in which I constraint the optimisation to only 1 joint at a time. It seems that the optimisation worked for certain joints only but I can't figure out why.

I hope you can help me with this matter :)

Thanks,
Hazimah

Re: Custom Static Optimization in MATLAB

Posted: Tue Sep 15, 2020 11:49 pm
by ongcf
We've found when using this example that when you use a model as simple as arm26, that for some reason you can get a good answer without it being fully correct.

It would be good to double check the different input changes (e.g., joint positions, joint velocities, other inputs to the muscle force equations) to debug which part is not working correctly. Setting up a few "gets" and "sets" often can help you debug which part of the inputs might be set incorrectly. There are a lot of different terms to get right, so taking it slow and double checking some of your work is important.

Re: Custom Static Optimization in MATLAB

Posted: Mon Sep 21, 2020 1:14 pm
by hazimahm
Hi Carmichael,

I decided to optimise the muscle forces in MATLAB because optimising in OpenSIM always failed due to 'acceleration constraint violation at the ground_thorax_rot_x' (which has been discussed in the previous forum viewtopicPhpbb.php?f=91&t=12083&p=34162&start=0&view= but I couldn't find the solution). I assumed it would definitely work in MATLAB because the force equation equilibrate the joint moments instead of the joint accelerations as in OpenSIM. Is it possible for the optimisation to fail in MATLAB because it also failed in OpenSIM? The author have used this model to perform CMC but is not ideal for my study.

Thanks,
Hazimah