Fixed step size and end-of-step event
Posted: Tue Jun 18, 2024 3:47 am
Hi,
I have two questions about the integration of the EOM:
a) The system under study implements a force F=-A*sign(v), where A is a constant and v is the speed of the point where the force acts. The actual implementation smoothes the sign() function to avoid integration issues. The problem of the latter is that it introduces an additional parameter (a "smoothing stiffness") which is not always easy to set, and it leads anyway to small step sizes when the stiffness parameter is large. CPODES already performs better for this particular system, but my question is, would it make sense to use the unsmoothed sign() function and fix the integration step size? I am not particularly concerned about the sign() transition, but I need to avoid the integrator to reduce the step size. For the most part, this system has v around 0, which leads to too small step sizes for most of the integration. How would you approach this?
b) Unrelated to the previous question, is there a way to call a function after an integration step has completed? I am aware of the auto-update state variables, but for a particular application it would be easier to do it so.
Thank you in advance!
Best regards,
Simone
I have two questions about the integration of the EOM:
a) The system under study implements a force F=-A*sign(v), where A is a constant and v is the speed of the point where the force acts. The actual implementation smoothes the sign() function to avoid integration issues. The problem of the latter is that it introduces an additional parameter (a "smoothing stiffness") which is not always easy to set, and it leads anyway to small step sizes when the stiffness parameter is large. CPODES already performs better for this particular system, but my question is, would it make sense to use the unsmoothed sign() function and fix the integration step size? I am not particularly concerned about the sign() transition, but I need to avoid the integrator to reduce the step size. For the most part, this system has v around 0, which leads to too small step sizes for most of the integration. How would you approach this?
b) Unrelated to the previous question, is there a way to call a function after an integration step has completed? I am aware of the auto-update state variables, but for a particular application it would be easier to do it so.
Thank you in advance!
Best regards,
Simone