# How to use time delays in the solvepde function in MATLAB for a system of PDEs?

The solvepde function was introduced in MATLAB R2016a. I am able to solve my system of PDEs if there are no time delays involved. Does anyone know how to include time delays in the solvepde function?

• What is a "time delay?" That is not a term I am familiar with. – Bill Greene Mar 19 '16 at 12:37
• Time delay is best explained by looking at examples of delay differential equations (DDEs) using the MATLAB function ddesd for general delays. I want to know if such an approach can be used to solve delayed PDEs? – Sven Delport Mar 21 '16 at 10:19
• Welcome to Scicomp.SE! You will have a better chance of getting answers if you describe in much more detail what you're trying to solve, ideally using mathematical notation. If it's really just about using a specific feature of Matlab, the question is off-topic here and should be asked at Matlab Answers (especially if it's about a new feature in a just released version). – Christian Clason Mar 21 '16 at 18:09

If you have constant time delays, you can introduce new variables for the delayed variables. For example, you can let $y = x(t-\tau)$. Then by the chain rule you get $\dot{y} = \dot{x}(t-\tau)$... so you end up with a lot of extra variables, but it will work if you aren't changing your timesteps around and make them a multiple / divisor of $\tau$ (if you have multiple $\tau$, then it has to be a common divisor or common multiple). If you set a good initial condition on $y$ you know have a system of non-delay equations which it can solve with chosen fixed timesteps.
(Almost forgot to note, if you use a divisor of $\tau$, then you need $\tau / h$ new variables in order to always hit one you know... this is easier to implement as an array that shifts everything down 1 rather than with a whole bunch of variables in a standard solver like solvepde, but YMMV)