prescribed force

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Anne Schmitz
Posts: 76
Joined: Thu May 31, 2007 7:44 am

prescribed force

Post by Anne Schmitz » Mon Jul 19, 2010 6:42 pm

Does anyone have an example of how to add a prescribed force to my .osim model? I tried looking at the online documentation but I get an OpenSim message that says 'illegal tag body_name.'

User avatar
Nur Adila Faruk Senan
Posts: 75
Joined: Tue Apr 06, 2010 8:20 pm

RE: prescribed force

Post by Nur Adila Faruk Senan » Mon Jul 19, 2010 7:19 pm

Hey Anne,
I don't know if this is the easiest way, but I used it a while ago and it works so i'm just passign it along. Just ad this piece of code in the middle of the
<ForceSet>
<Objects>
...
</Objects>
<ForceSet> section of the .osim file.


<PrescribedForce name= "prescribedF">
<body>lumbar1</body>
<pointIsGlobal>true</pointIsGlobal>
<forceIsGlobal>true</forceIsGlobal>
<forceFunctions>
<function>
<Constant name="Fx">
<value> 100.00000000000000000000 </value>
</Constant>
</function>
<function>
...repeat for Fy, Fz
</forceFunctions>
<pointFunctions>
<function>
<Constant name="Px">
<value> 0.00000000000000000000 </value>
</Constant>
</function>
...repeat for Py, Pz
</pointFunctions>
<torqueFunctions>
<function>
<Constant name="Mx">
<value> 0.00000000000000000000 </value>
</Constant>
</function>
...repeat for My, Mz
</torqueFunctions>
</PrescribedForce>

and change the numbers/parameters as fit (i.e. if the force is local, that is, it changes its direction as the lumbar1 body changes orientation, then
set "forceIsGlobal" to false, etc. The "body" is the body you want the force/moment applied to.

i haven't figured out how to write a separate .xml file that'll do it though, since this way, you have to keep changing the .osim file every time you want to change the force, but it gets the job done.

adila

User avatar
Anne Schmitz
Posts: 76
Joined: Thu May 31, 2007 7:44 am

RE: prescribed force

Post by Anne Schmitz » Wed Aug 11, 2010 12:46 pm

I tried that syntax and it didn't work. Here is a snippet that runs on the newest version of OpenSim.

<PrescribedForce name= "prescribedF">
<body>tibia_r</body>
<pointIsGlobal>true</pointIsGlobal>
<forceIsGlobal>false</forceIsGlobal>
<FunctionSet name="forceFunctions">
<objects>
<NaturalCubicSpline name="Fx">
<x> 0.0 1 </x>
<y> 0.00000000 100 </y>
</NaturalCubicSpline>
<Constant name="Fy">
<value> 0.00000000000000000000 </value>
</Constant>
<Constant name="Fz">
<value> 0.00000000000000000000 </value>
</Constant>
</objects>
</FunctionSet>
</PrescribedForce>

POST REPLY