How to get the time step used in PDEPE solver?

16 visualizaciones (últimos 30 días)
Gopinath NK
Gopinath NK el 10 de Ag. de 2022
Comentada: Torsten el 10 de Ag. de 2022
For PDEPE, Matlab guide says. "The pdepe function performs the time integration with an ODE solver that selects both the time step and the formula dynamically."
How to get the actual time step used by PDEPE as an ouput?

Respuestas (1)

Torsten
Torsten el 10 de Ag. de 2022
Editada: Torsten el 10 de Ag. de 2022
pdepe uses ode15s as solver for the arising differential equations.
This solver uses adaptive time stepping - thus if the problem is difficult, small time steps are chosen, if the problem is easy, large time steps are chosen.
The basic time steps (time steps that led to a successful integration step because the error tolerance was satisfied) can be seen after integration has finished if you choose only start and end point of integration for the definition of tspan:
tspan = [tstart tend]
Getting time steps to modify your equations during integration is almost impossible.
Could you explain why you want to get the time steps as output ?
  6 comentarios
Gopinath NK
Gopinath NK el 10 de Ag. de 2022
Thanks. I shall give this a try.
"If inputs to radiative or convective heat flux depend on time (external temperature, heat transfer coefficients,...), it's of course different" - Yes, this is my case.
Torsten
Torsten el 10 de Ag. de 2022
I'd simply use "tspan" according to your needs and calculate the heat fluxes from the solution "sol" (which is supplied for the times defined in "tspan"). Then you don't need the "OutputFcn".

Iniciar sesión para comentar.

Categorías

Más información sobre Partial Differential Equation Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by