I am using using pdepe to solve a 1D heat diffusion equation. My calling line looks like:

1 view (last 30 days)
I am using using pdepe to solve a 1D heat diffusion equation. My calling line looks like:
T=pdepe(m,@heateq,@heatic,@heatbc,xmesh,time);
@heateq=heat equation
@heatic=initial temperature
@heatbc=boundary condition
xmesh=1D vector with discreet points along length
time=1D vector with discreet time steps.
I wanted to know if pdepe solves the pde at the exact time steps provided as input or it uses those time steps as just recommendations?

Accepted Answer

Uday Pradhan
Uday Pradhan on 13 Aug 2020
Hi Swayam,
The mesh points given by the elements of vectors "xmesh" and "time" are the points where "pdepe" returns the solution of the problem described by pdefun and the initial and boundary conditions.
The "time" vector specifies the points at which a solution is requested for every value in "xmesh". The "pdepe" function performs the time integration with the ode15s solver that selects both the time step and the formula dynamically. The elements of "time" merely specify where you want answers.
The ode15s solver does not step precisely to each point specified in "time". Instead, it uses its own internal steps to compute the solution, then evaluates the solution at the requested points in "time". The solutions produced at the specified points (given by the "time" vector) are of the same order of accuracy as the solutions computed at each internal step (which are not necessarily the same as those in "time").
I hope this answers your question. For more information, please refer to the documentation of pdepe and ode15s.

More Answers (0)

Tags

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!