Static Optimization, failure to activate muscles
Posted: 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.
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
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