Static Optimization, failure to activate muscles

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Yong Cho
Posts: 27
Joined: Wed Sep 21, 2016 4:45 pm

Static Optimization, failure to activate muscles

Post by Yong Cho » Fri Jul 14, 2017 9:17 am

Hello, I am trying to do a static optimization using a modified arms26.osim model as the basis. I added a prescribed force of (100, 0, 0) through matlab code. However, when I ran the simulation, the muscle activations of all muscles were 0.00551048 meaning that the muscles were not activated at all from the force. I would be thankful for any suggestions in regards to this problems. Below is my code and results.

Code: Select all

import org.opensim.modeling.*

model = Model('C:\Users\Yong Cho\Documents\OpenSim 3.3\Models\Arm26\arm26.osim');
cSet = model.getCoordinateSet()


r_shoulder_elevation = cSet.get(0)
r_elbow_flex = cSet.get(1)

r_shoulder_elevation.setDefaultLocked(1)
r_elbow_flex.setDefaultLocked(1)


body  = model.getBodySet().get('r_ulna_radius_hand');
force = PrescribedForce(body);

force.setForceFunctions(Constant(100), Constant(0), Constant(0));
force.setPointFunctions(Constant(0), Constant(-0.180496), Constant(0))


force.setPointIsInGlobalFrame(0);
force.setForceIsInGlobalFrame(0);

model.addForce(force)

initState = model.initSystem()

model.print('C:\Users\Yong Cho\Documents\OSFolder\arm26e2PrescribedForce1.osim');

SetUp File
1. Input
- Used model file created from the above code
- Motion loaded was created from the motion simulation
2. Static Optimization
- Sum of (muscle activation)^2 and use muscle force length velocity was checked
- Step Interval was 1 second
3. TIme
- Time range was from 0 to 3 seconds

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Static Optimization, failure to activate muscles

Post by Dimitar Stanev » Sun Jul 16, 2017 9:52 am

From the code it is not clear if you run SO or Forward Dynamics. If it is the second case, FD does not estimate the muscle activations but requires them as input.

User avatar
Yong Cho
Posts: 27
Joined: Wed Sep 21, 2016 4:45 pm

Re: Static Optimization, failure to activate muscles

Post by Yong Cho » Mon Jul 17, 2017 6:10 am

I'm not running SO or FD from the code. I'm running Static Optimization from the gui. The code above only adds a prescribed force to a certain body part. That's all it does.

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Static Optimization, failure to activate muscles

Post by Dimitar Stanev » Mon Jul 17, 2017 11:46 pm

For SO you need to have a motion as an input, since it is purely an inverse dynamics method. You can generate a motion in a forward manner and use it as input to SO. After you generate the motion with the prescribed force, remove the force and run SO!

User avatar
Yong Cho
Posts: 27
Joined: Wed Sep 21, 2016 4:45 pm

Re: Static Optimization, failure to activate muscles

Post by Yong Cho » Tue Jul 18, 2017 7:32 am

Thank you for your help!

POST REPLY