Page 1 of 1

How can I add additional forces besides GRF's to my model?

Posted: Mon Feb 04, 2019 5:21 am
by radevychfhdo
Hello OpenSim community,

I would like to know how can I add correctly additional external loads besides GRF's to my model?

What I would like to do in my workflow is quite simple: I would like to simulate the running in water (water level reaches knee) or running with head wind.
I would like to run through the whole workflow with theese additional external forces in OpenSim: IK, ID, RRA and CMC. At the end I would like to caltulate the gain of metabolic costs depending on these additional external forces.

Thanks in advance!

DR

Re: How can I add additional forces besides GRF's to my model?

Posted: Tue Feb 05, 2019 1:36 am
by mitkof6
You could apply different forces directly in the .osim model

https://simtk-confluence.stanford.edu/d ... Sim+Models

by adding the xml code of the force that you want to apply

https://simtk.org/api_docs/opensim/api_ ... Force.html (check inheritance diagram)

Check the xml browser in the GUI (Window->XML Browser)

https://simtk-confluence.stanford.edu/d ... nSim/Menus

Re: How can I add additional forces besides GRF's to my model?

Posted: Tue Feb 05, 2019 8:27 am
by saeedaram
hello dmytro

you can add external loads in GUI and xml code of opensim but in your model that is in water i think you should get resultant loads to apply in your model because in opensim external loads apply on point.

good luck

Re: How can I add additional forces besides GRF's to my model?

Posted: Wed Feb 13, 2019 6:09 am
by radevychfhdo
Hello,

Thank you for your help. I decided to add PrescribedForce to my model and it seems to work correctly, so I would like to close this post with my working xml-code, if someone will need it oneday too.

Good luck!

<PrescribedForce name="testforce">
<socket_frame>/bodyset/femur_r</socket_frame>
<pointIsGlobal>false</pointIsGlobal>
<forceIsGlobal>true</forceIsGlobal>
<FunctionSet name="forceFunctions">
<objects>
<Constant name="forceX">
<value>0</value>
</Constant>
<Constant name="forceY">
<value>10000</value>
</Constant>
<Constant name="forceZ">
<value>0</value>
</Constant>
</objects>
<groups />
</FunctionSet>
<FunctionSet name="pointFunctions">
<objects>
<Constant name="pointX">
<value>0</value>
</Constant>
<Constant name="pointY">
<value>0</value>
</Constant>
<Constant name="pointZ">
<value>0</value>
</Constant>
</objects>
<groups />
</FunctionSet>
<FunctionSet name="torqueFunctions">
<objects>
<Constant name="aroundX">
<value>0</value>
</Constant>
<Constant name="aroundY">
<value>0</value>
</Constant>
<Constant name="aroundZ">
<value>0</value>
</Constant>
</objects>
<groups />
</FunctionSet>
</PrescribedForce>

Re: How can I add additional forces besides GRF's to my model?

Posted: Sun May 05, 2019 10:22 pm
by wopt
Hi, Dmytro Radevych
Your reply helped me a lot. However, I have another question to ask you. If i want to use a linear force changing with time to replace the constant force, such as Fx=2*time +1(N) i.e. Fx=1N(t=0s) and Fx=3N(t=1s). How should I change the .xml file to adopt to the force change.
Hope your reply! Thanks very much!

Best wishes!
Qianwen Nie

radevychfhdo wrote:
Wed Feb 13, 2019 6:09 am
Hello,

Thank you for your help. I decided to add PrescribedForce to my model and it seems to work correctly, so I would like to close this post with my working xml-code, if someone will need it oneday too.

Good luck!

<PrescribedForce name="testforce">
<socket_frame>/bodyset/femur_r</socket_frame>
<pointIsGlobal>false</pointIsGlobal>
<forceIsGlobal>true</forceIsGlobal>
<FunctionSet name="forceFunctions">
<objects>
<Constant name="forceX">
<value>0</value>
</Constant>
<Constant name="forceY">
<value>10000</value>
</Constant>
<Constant name="forceZ">
<value>0</value>
</Constant>
</objects>
<groups />
</FunctionSet>
<FunctionSet name="pointFunctions">
<objects>
<Constant name="pointX">
<value>0</value>
</Constant>
<Constant name="pointY">
<value>0</value>
</Constant>
<Constant name="pointZ">
<value>0</value>
</Constant>
</objects>
<groups />
</FunctionSet>
<FunctionSet name="torqueFunctions">
<objects>
<Constant name="aroundX">
<value>0</value>
</Constant>
<Constant name="aroundY">
<value>0</value>
</Constant>
<Constant name="aroundZ">
<value>0</value>
</Constant>
</objects>
<groups />
</FunctionSet>
</PrescribedForce>

Re: How can I add additional forces besides GRF's to my model?

Posted: Thu Jun 27, 2019 9:54 pm
by srihari18mcd
Thank you Dmytro Radevych for the code.

But in which part of the model code do I add this specific force code? If I want to add it in the femur , how do I do it?