Page 1 of 1

Integrate over short transients

Posted: Fri Aug 02, 2024 3:55 am
by simonehendriks
Hi,

I have a system upon which a force of the following type is exerted:
Screenshot 2024-08-02 123917.png
Screenshot 2024-08-02 123917.png (13.24 KiB) Viewed 1505 times
That is, at a certain point, the force smoothly increases from 0 to its peak during a very short transient of a few milliseconds. In most scenarios, I guess this transient is irrelevant, but in my particular case I want to study the dynamics of the system in the red area.

(a) My idea was to detect the event where the transient starts, and then reduce the maximum integration step size until the transient is over, and then reset the maximum step size to its original value. Even if this seems plausible, is there a more direct way of doing this? My concern is that, in spite of using an adaptive step-size integrator, it could be that it "skips" the red area directly to the yellow one.

(b) Another question that arises is the following: if I have an event handler or reporter triggering more often than the actual integration steps, how is this handled under the hood? Is there some kind of interpolation going on, or is the system forced to be solved at the time stamp given by the event handler/reporter? Sorry if this is already explained in the documentation, I might have missed it.

Thanks a lot for your invaluable support!

Best regards,
Simone

Re: Integrate over short transients

Posted: Wed Aug 07, 2024 2:20 pm
by sherm
Hi Simone. If you use one of SImbody's variable step integrators, it should be able to figure out to take small steps over the rapid transition automatically.

Regards,
Sherm

Re: Integrate over short transients

Posted: Wed Sep 04, 2024 9:29 am
by simonehendriks
Hi Sherm,

Thanks for the feedback. With sufficiently tight accuracy values (1e-6 in my case), the integrator takes enough steps during the transition. Regarding question (b), if the reporting period is much smaller than the average step size, is the system solved at the reporting step, or is interpolation used instead?

Best regards,
Simone

Re: Integrate over short transients

Posted: Wed Sep 04, 2024 11:40 am
by sherm
Hi, Simone. Simbody's integrators interpolate when a reporting time doesn't coincide with a step completion.

That's on by default but can be controlled by Integrator methods like setAllowInterpolation().

Regards,
Sherm

Re: Integrate over short transients

Posted: Fri Sep 06, 2024 10:43 am
by simonehendriks
Hi Sherm,

It's all clear now, thank you for your help! :)

Best regards,
Simone