Adjusting the resolution of the time vector

Dear Matlab community,
I am solving heat transfer problems using the pdepe solver. Our problems require a very fine resolution regarding the time vector at certain points during our simulations (due to time-dependent boundary conditions). To ensure this fine resolution we currently use the 'MaxStep' option to restrict the δt for the whole simulation. This works really well but, as you can imagine, increases the computational time immensely since this measure would be necessary only during comparatively short time frames within the whole simulation (only at certain boundary conditions). Therefore my question, is it possible to have a time vector with varying δt as an input to the pdepe solver, or in other words, is there a possibility to set different 'MaxStep' options?
Thanks in advance.
Best regards
Christoph

Answers (1)

Try pdeval and supply the solution of pdepe

4 Comments

Thanks for the quick reply, but i might have to reframe my question. The problem i am facing is that during my heat transfer simulation the boundary conditions change in a repetitive manner, depending on the current time within the simualtion, with certain conditions only applying for a few ms. Therefore if the 'MaxStep' setting is not set in the same magnitude (current step size δt = 1ms) the pdepe independently changes the stepsize to timesteps where this boundary conditions can no longer occur. Or in other words, they are simply skipped because the timestep is to big and the criteria for them to occur is not met. Therefore, even if i use pdeval with the needed timestep, the solution simply doesn't contain the "regions" i am looking for because they where skipped within the solving. I hope my problem is more clear now. Thanks again.
Best regards
Christoph
Got it. I can give a try to "ODE Event Location"
To give a rule to identify when you have a change of the boundary condition. Then restart the integration with the previous final solution as intial conditions.
Thanks for this approach, while this would work great for short simulations i am not sure if this solution will work time-efficient if i have to restart the integration a thousand times in an automated way during longer heat transfer problems. I am running my pdepe within a lsqnonlin optimizer and therefore being able to reliably integrate without my input during the whole simulation is of utmost importance. I am really struggeling to estimate the benefit regarding computational time when the solver has to be started over and over again and the added complexity that comes with this approach seems to exceed the benefits. I am just not sure if implementing this solution would be less effort than changing the ode15s (used by the pdepe) to fixed time steps. I don't want to overstrain your cooperativeness but maybe you could provide your thoughts on that. Anyway, thanks very much for your help. I really appreciate your support regarding this "special" problem.
Christoph
The overhead shouldn't be excessive, especially if the problem is very complex. Maybe someone from the community can help in this direction: I am quite surprised I am the only one replying to your post.
Btw: it seems that the previous one is the only possibility in Matlab: https://it.mathworks.com/matlabcentral/answers/84749-best-ode-solver-when-there-is-a-parameter-discontinuity

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Products

Release

R2018a

Tags

Asked:

on 9 Oct 2019

Edited:

on 14 Oct 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!