Thanks a lot. It is now working.

Cheers.

David

On 19 Feb 2016, at 16:36, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:

phin.assign(phin_1 - (dt * theta * pn + dt * (1 - theta) * pn_1))