Custom Static Optimization in MATLAB

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Hazimah Mahmud
Posts: 14
Joined: Mon Jan 20, 2020 9:16 am

Custom Static Optimization in MATLAB

Post by Hazimah Mahmud » Thu Sep 10, 2020 7:28 am

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

Tags:

User avatar
Carmichael Ong
Posts: 401
Joined: Fri Feb 24, 2012 11:50 am

Re: Custom Static Optimization in MATLAB

Post by Carmichael Ong » Tue Sep 15, 2020 11:49 pm

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.

User avatar
Hazimah Mahmud
Posts: 14
Joined: Mon Jan 20, 2020 9:16 am

Re: Custom Static Optimization in MATLAB

Post by Hazimah Mahmud » Mon Sep 21, 2020 1:14 pm

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

POST REPLY