Exponential expressions and forward dynamic simulation
Posted: Wed Aug 08, 2018 8:35 am
Hello,
I've been looking at the incorporation of passive joint moments into my model. Presently, I have been using the CoordinateLimitForce class to represent these passive moments, but as I understand this only involves a single DOF, whereas ideally I would like to involve all DOFs at a joint (up to three for e.g., the hip) simultaneously. So I have been looking at using the ExpressionBasedBushingForce class, which does allow for multiple DOFs to be handled at once (i.e., the passive moment about one coordinate/axis can be a function of the values of multiple coordinates). Moreover, as passive joint moments have typically been represented with double exponential functions in the literature, I am seeking to implement this kind of function in my ExpressionBasedBushingForce.
The form of the function I have been testing is: Moment = a*exp(b*theta1-c)-d*exp(e*theta1-f), for a single angle. If Moment is a function of multiple angles, then I have additional terms for theta2, theta3, etc.
I've tested how this implementation performs, and it behaves exactly as expected in some basic inverse dynamics test. However, when I try to perform a forward dynamic simulation, I run into problems. Even in a basic 'drop test' (and I've got appropriate passive forces on the pelvis segment which, are a function of vertical displacement and so prevent the pelvis falling through the floor), the simulation will progress so far and then it 'fails' - the model disappears from view and all coordinate values/speeds just become question marks. In the output states file, at these time instances all values are reported as "-1.#IND0000", something I've never come across before. I get the same problem whether I have ground contact forces enabled or not.
If I force the integrator to use smaller timesteps (i.e., reduce the maximum step size value to something like 0.001), this ameliorates the situation somewhat: more of the simulation will now run/solve properly, but sooner or later (if I have set a long enough time range) the problem happens.
If I use a polynomial-based function in my ExpressionBasedBushingForce, I don't run into these problems. I am therefore wondering if the use of the exponential function here is causing the problems, even though it's a 'legal' function, and works fine in inverse dynamics. I am hoping to use exponential functions in some way, because like I said that's how empirical passive joint moment data has been typically modelled previously.
If anybody has any suggestions for what I can do to fix this, I would be most appreciative!
Many thanks,
Peter Bishop.
I've been looking at the incorporation of passive joint moments into my model. Presently, I have been using the CoordinateLimitForce class to represent these passive moments, but as I understand this only involves a single DOF, whereas ideally I would like to involve all DOFs at a joint (up to three for e.g., the hip) simultaneously. So I have been looking at using the ExpressionBasedBushingForce class, which does allow for multiple DOFs to be handled at once (i.e., the passive moment about one coordinate/axis can be a function of the values of multiple coordinates). Moreover, as passive joint moments have typically been represented with double exponential functions in the literature, I am seeking to implement this kind of function in my ExpressionBasedBushingForce.
The form of the function I have been testing is: Moment = a*exp(b*theta1-c)-d*exp(e*theta1-f), for a single angle. If Moment is a function of multiple angles, then I have additional terms for theta2, theta3, etc.
I've tested how this implementation performs, and it behaves exactly as expected in some basic inverse dynamics test. However, when I try to perform a forward dynamic simulation, I run into problems. Even in a basic 'drop test' (and I've got appropriate passive forces on the pelvis segment which, are a function of vertical displacement and so prevent the pelvis falling through the floor), the simulation will progress so far and then it 'fails' - the model disappears from view and all coordinate values/speeds just become question marks. In the output states file, at these time instances all values are reported as "-1.#IND0000", something I've never come across before. I get the same problem whether I have ground contact forces enabled or not.
If I force the integrator to use smaller timesteps (i.e., reduce the maximum step size value to something like 0.001), this ameliorates the situation somewhat: more of the simulation will now run/solve properly, but sooner or later (if I have set a long enough time range) the problem happens.
If I use a polynomial-based function in my ExpressionBasedBushingForce, I don't run into these problems. I am therefore wondering if the use of the exponential function here is causing the problems, even though it's a 'legal' function, and works fine in inverse dynamics. I am hoping to use exponential functions in some way, because like I said that's how empirical passive joint moment data has been typically modelled previously.
If anybody has any suggestions for what I can do to fix this, I would be most appreciative!
Many thanks,
Peter Bishop.