# pdepe or Crank-Nicolson? How much is pdepe good?

I am beginner in MATLAB and similar. I sow and discussed with my professors doing simulations some times: they wrote down a lot of calculus, most of them using Crank-Nicolson Method and so implement them on MATLAB.

Until now, I could not imagine that MATLAB has pdepe. Today I've learned about pdepe and try to code a PDE that my professor coded with Crank-Nicolson. The result was absolutely the same and I had less calculus.

I am thinking about the difference between the two methods. In fact, I'd like to know when is not so good use pdepe (once I thought this is marvelous, very easy...!). What can be the benefits of other methods on simple researchs?

• Well, so your question is basically why people write their own code while there is pdepe class in MATLAB available right? There could be a lot of reasons for that. For example, maybe pdepe doesn't scale well when the size of the system goes up and people use to write their own code to make it more efficient/accurate. I mean as long as I don't see your professor's code based on Crank-Nicolson, it's a bit difficult to say why, but there must be reason that you could easily ask your professor. Regarding your question: How good is pdepe? Good with what sense? Speed? Accuracy? Scaling? – Alone Programmer Jan 16 at 23:19
• @AloneProgrammer, right. Many thanks for your answer! Maybe I could try ask just one more time on these terms: In generally, pdepe is a good choice or most of time researches have to wrti their codes? – Na'omi Jan 16 at 23:29

• Please, could you give me some more details if is not much work...? I thank you so much. 1) The convection term is $\partial u/\partial x$, isn't? In which is it related with hyperbolity...? 2) Could you tell me a solver for hyperbolic equation? – Na'omi Jan 18 at 22:50