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

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Dmytro Radevych
Posts: 3
Joined: Tue Dec 04, 2018 12:43 pm

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

Post by Dmytro Radevych » Mon Feb 04, 2019 5:21 am

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

Tags:

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

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

Post by Dimitar Stanev » Tue Feb 05, 2019 1:36 am

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

User avatar
saeed aram
Posts: 20
Joined: Mon Oct 09, 2017 2:26 pm

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

Post by saeed aram » Tue Feb 05, 2019 8:27 am

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

User avatar
Dmytro Radevych
Posts: 3
Joined: Tue Dec 04, 2018 12:43 pm

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

Post by Dmytro Radevych » 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>

User avatar
聂 倩文
Posts: 11
Joined: Tue Oct 30, 2018 4:21 am

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

Post by 聂 倩文 » Sun May 05, 2019 10:22 pm

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>

User avatar
Srihari A
Posts: 3
Joined: Sun Jun 16, 2019 11:38 pm

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

Post by Srihari A » Thu Jun 27, 2019 9:54 pm

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?

POST REPLY