Page 1 of 1

Static Optimization, failure to activate muscles

Posted: Fri Jul 14, 2017 9:17 am
by ync8yy
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

Re: Static Optimization, failure to activate muscles

Posted: Sun Jul 16, 2017 9:52 am
by mitkof6
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.

Re: Static Optimization, failure to activate muscles

Posted: Mon Jul 17, 2017 6:10 am
by ync8yy
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.

Re: Static Optimization, failure to activate muscles

Posted: Mon Jul 17, 2017 11:46 pm
by mitkof6
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!

Re: Static Optimization, failure to activate muscles

Posted: Tue Jul 18, 2017 7:32 am
by ync8yy
Thank you for your help!