Hello,
I am trying to simulate a high ankle sprain injury mechanism by applying an external lateral force to the knee while my model is walking. I am using the Gait2392 model gait files and attempting to run forward dynamics with my model. I am adding the force to the GRF files, but when I use the RRA tool, I get this error and I am unsure how to resolve it.
How do I add an external force to my model?
- Yasniary Morales
- Posts: 4
- Joined: Mon Jan 06, 2020 7:10 am
How do I add an external force to my model?
- Attachments
-
- Screen Shot 2020-05-18 at 7.02.41 PM.png (298.91 KiB) Viewed 931 times
- Michael Asmussen
- Posts: 67
- Joined: Mon Jul 11, 2016 7:46 am
Re: How do I add an external force to my model?
Hi Yasniary,
How many data points are in your GRF file? Are you only putting in a single value or a time series of the force applied?
All the best,
Mike
How many data points are in your GRF file? Are you only putting in a single value or a time series of the force applied?
All the best,
Mike
- Yasniary Morales
- Posts: 4
- Joined: Mon Jan 06, 2020 7:10 am
Re: How do I add an external force to my model?
Hello Michael,
There are 1508 data points in the file. I am trying to add a lateral force to the right femur at the R.Knee.Lat marker location, which is defined as a single point throughout the simulation with respect to the femur. While the GRF forces vary with time, the external force is constant beginning at t=0.825s and zero before that. To the GRF.mot file, I added the force, point, and torque columns similar to the ground reaction forces except named "femur_r_force_vx...femur_r_torque_z"
My code in the GRF.xml file is the following:
<objects>
<ExternalForce name="ExternalForce_1">
<isDisabled> false </isDisabled>
<!--Name of the body the force is applied to.-->
<applied_to_body> calcn_r </applied_to_body>
<!--Name of the body the force is expressed in (default is ground).-->
<force_expressed_in_body> ground </force_expressed_in_body>
<!--Name of the body the point is expressed in (default is ground).-->
<point_expressed_in_body> ground </point_expressed_in_body>
<!--Identifier (string) to locate the force to be applied in the data
source.-->
<force_identifier> ground_force_v </force_identifier>
<!--Identifier (string) to locate the point to be applied in the data
source.-->
<point_identifier> ground_force_p </point_identifier>
<!--Identifier (string) to locate the torque to be applied in the data
source.-->
<torque_identifier> ground_torque_ </torque_identifier>
<!--Name of the data source (Storage) that will supply the force data.-->
<data_source_name> Unassigned </data_source_name>
</ExternalForce>
<ExternalForce name="ExternalForce_2">
<isDisabled> false </isDisabled>
<!--Name of the body the force is applied to.-->
<applied_to_body> calcn_l </applied_to_body>
<!--Name of the body the force is expressed in (default is ground).-->
<force_expressed_in_body> ground </force_expressed_in_body>
<!--Name of the body the point is expressed in (default is ground).-->
<point_expressed_in_body> ground </point_expressed_in_body>
<!--Identifier (string) to locate the force to be applied in the data
source.-->
<force_identifier> 1_ground_force_v </force_identifier>
<!--Identifier (string) to locate the point to be applied in the data
source.-->
<point_identifier> 1_ground_force_p </point_identifier>
<!--Identifier (string) to locate the torque to be applied in the data
source.-->
<torque_identifier> 1_ground_torque_ </torque_identifier>
<!--Name of the data source (Storage) that will supply the force data.-->
<data_source_name> Unassigned </data_source_name>
</ExternalForce>
<ExternalForce name="ExternalForce_3">
<isDisabled> false </isDisabled>
<!--Name of the body the force is applied to.-->
<applied_to_body> femur_r </applied_to_body>
<!--Name of the body the force is expressed in (default is ground).-->
<force_expressed_in_body> femur_r </force_expressed_in_body>
<!--Name of the body the point is expressed in (default is ground).-->
<point_expressed_in_body> femur_r </point_expressed_in_body>
<!--Identifier (string) to locate the force to be applied in the data
source.-->
<force_identifier> femur_r_force_v </force_identifier>
<!--Identifier (string) to locate the point to be applied in the data
source.-->
<point_identifier> femur_r_force_p </point_identifier>
<!--Identifier (string) to locate the torque to be applied in the data
source.-->
<torque_identifier> femur_r_torque_ </torque_identifier>
<!--Name of the data source (Storage) that will supply the force data.-->
<data_source_name> Unassigned </data_source_name>
</ExternalForce>
</objects>
There are 1508 data points in the file. I am trying to add a lateral force to the right femur at the R.Knee.Lat marker location, which is defined as a single point throughout the simulation with respect to the femur. While the GRF forces vary with time, the external force is constant beginning at t=0.825s and zero before that. To the GRF.mot file, I added the force, point, and torque columns similar to the ground reaction forces except named "femur_r_force_vx...femur_r_torque_z"
My code in the GRF.xml file is the following:
<objects>
<ExternalForce name="ExternalForce_1">
<isDisabled> false </isDisabled>
<!--Name of the body the force is applied to.-->
<applied_to_body> calcn_r </applied_to_body>
<!--Name of the body the force is expressed in (default is ground).-->
<force_expressed_in_body> ground </force_expressed_in_body>
<!--Name of the body the point is expressed in (default is ground).-->
<point_expressed_in_body> ground </point_expressed_in_body>
<!--Identifier (string) to locate the force to be applied in the data
source.-->
<force_identifier> ground_force_v </force_identifier>
<!--Identifier (string) to locate the point to be applied in the data
source.-->
<point_identifier> ground_force_p </point_identifier>
<!--Identifier (string) to locate the torque to be applied in the data
source.-->
<torque_identifier> ground_torque_ </torque_identifier>
<!--Name of the data source (Storage) that will supply the force data.-->
<data_source_name> Unassigned </data_source_name>
</ExternalForce>
<ExternalForce name="ExternalForce_2">
<isDisabled> false </isDisabled>
<!--Name of the body the force is applied to.-->
<applied_to_body> calcn_l </applied_to_body>
<!--Name of the body the force is expressed in (default is ground).-->
<force_expressed_in_body> ground </force_expressed_in_body>
<!--Name of the body the point is expressed in (default is ground).-->
<point_expressed_in_body> ground </point_expressed_in_body>
<!--Identifier (string) to locate the force to be applied in the data
source.-->
<force_identifier> 1_ground_force_v </force_identifier>
<!--Identifier (string) to locate the point to be applied in the data
source.-->
<point_identifier> 1_ground_force_p </point_identifier>
<!--Identifier (string) to locate the torque to be applied in the data
source.-->
<torque_identifier> 1_ground_torque_ </torque_identifier>
<!--Name of the data source (Storage) that will supply the force data.-->
<data_source_name> Unassigned </data_source_name>
</ExternalForce>
<ExternalForce name="ExternalForce_3">
<isDisabled> false </isDisabled>
<!--Name of the body the force is applied to.-->
<applied_to_body> femur_r </applied_to_body>
<!--Name of the body the force is expressed in (default is ground).-->
<force_expressed_in_body> femur_r </force_expressed_in_body>
<!--Name of the body the point is expressed in (default is ground).-->
<point_expressed_in_body> femur_r </point_expressed_in_body>
<!--Identifier (string) to locate the force to be applied in the data
source.-->
<force_identifier> femur_r_force_v </force_identifier>
<!--Identifier (string) to locate the point to be applied in the data
source.-->
<point_identifier> femur_r_force_p </point_identifier>
<!--Identifier (string) to locate the torque to be applied in the data
source.-->
<torque_identifier> femur_r_torque_ </torque_identifier>
<!--Name of the data source (Storage) that will supply the force data.-->
<data_source_name> Unassigned </data_source_name>
</ExternalForce>
</objects>
- Michael Asmussen
- Posts: 67
- Joined: Mon Jul 11, 2016 7:46 am
Re: How do I add an external force to my model?
Hi Yasniary,
My guess is that there might be a problem with the .mot file. Did you create the file programmatically? Sometimes even a small spacing error can cause issues with applying the force or moment to the model.
Maybe before you run the forward dynamics simulation you could assign kinematics to the model, apply your force, and run an inverse dynamics analysis to see if applied that force correctly. Or alternatively, you can use a very simplified model of a single joint first and apply a time series of a force or moment to see if you are applying it correctly.
I hope that is helpful!
All the best,
Mike
My guess is that there might be a problem with the .mot file. Did you create the file programmatically? Sometimes even a small spacing error can cause issues with applying the force or moment to the model.
Maybe before you run the forward dynamics simulation you could assign kinematics to the model, apply your force, and run an inverse dynamics analysis to see if applied that force correctly. Or alternatively, you can use a very simplified model of a single joint first and apply a time series of a force or moment to see if you are applying it correctly.
I hope that is helpful!
All the best,
Mike
- Yasniary Morales
- Posts: 4
- Joined: Mon Jan 06, 2020 7:10 am
Re: How do I add an external force to my model?
Hi Michael,
Thanks for your help! There was indeed an issue in the .mot file that I ended up correcting, but even if I am no longer receiving any error messages, the model acts as if there is no force being applied when I run RRA or Inverse Dynamics. I modified the point location to be directly on the bone, increased the force by 10X, and even applied it in the x and y directions as well, and nothing changes. I am now just trying to find the appropriate forward dynamics simulation which will allow me to use just the modified GRF files, my scaled model, and the rest of the unaltered Gait2392 models to obtain the model motion when that external force is applied to the model while the model is simulating gait.
Thanks for your help! There was indeed an issue in the .mot file that I ended up correcting, but even if I am no longer receiving any error messages, the model acts as if there is no force being applied when I run RRA or Inverse Dynamics. I modified the point location to be directly on the bone, increased the force by 10X, and even applied it in the x and y directions as well, and nothing changes. I am now just trying to find the appropriate forward dynamics simulation which will allow me to use just the modified GRF files, my scaled model, and the rest of the unaltered Gait2392 models to obtain the model motion when that external force is applied to the model while the model is simulating gait.
- Michael Asmussen
- Posts: 67
- Joined: Mon Jul 11, 2016 7:46 am
Re: How do I add an external force to my model?
Hi Yasniary,
Glad to hear you are no longer receiving error messages, but too bad you are not having any force applied to the model. Instead of applying the force directly to the bone, have you tried applying it to the foot just to see if the force behaves as you would expect?
Another suggestion might be to break down the model to a single joint, reduce the mass, remove any kinematics, remove the gravitational force, apply the force profile, perform the forward dynamics simulation, and see if you get the result you would expect.
If you try any of these out, please let me know how they work!
Mike
Glad to hear you are no longer receiving error messages, but too bad you are not having any force applied to the model. Instead of applying the force directly to the bone, have you tried applying it to the foot just to see if the force behaves as you would expect?
Another suggestion might be to break down the model to a single joint, reduce the mass, remove any kinematics, remove the gravitational force, apply the force profile, perform the forward dynamics simulation, and see if you get the result you would expect.
If you try any of these out, please let me know how they work!
Mike