Page 1 of 1

prescribed force

Posted: Mon Jul 19, 2010 6:42 pm
by ambaus
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.'

RE: prescribed force

Posted: Mon Jul 19, 2010 7:19 pm
by papaya
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

RE: prescribed force

Posted: Wed Aug 11, 2010 12:46 pm
by ambaus
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>