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
How can I add additional forces besides GRF's to my model?
- Dmytro Radevych
- Posts: 3
- Joined: Tue Dec 04, 2018 12:43 pm
- 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?
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
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
- 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?
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
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
- 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?
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>
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?
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
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 amHello,
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?
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?
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?