Yes realised that now of course!




From: firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> on behalf of Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk>
Sent: Tuesday, May 15, 2018 12:01 PM
To: firedrake@imperial.ac.uk
Subject: Re: [firedrake] nonlinear diffusion with space-time Robin condition
 


> On 15 May 2018, at 11:49, Onno Bokhove <O.Bokhove@leeds.ac.uk> wrote:
>
> HI David and Stephan,
>
> Thanks.
>
> Per the below:
> (i) The expression is a^1.5 but was written as a*sqrt(a); now that is corrected the nonlinear solver seems to work fine; apparently that rewrite matters for the Newton iteration.

The Jacobian is computed by automatic differentiation, so although mathematically a^1.5 and a*sqrt(a) are the same, they are differentiated differently to:

1.5 a^0.5

or

0.5 a / sqrt(a) + sqrt(a)

The latter has a numerical singularity at 0.  In floating point, if a is zero, you compute 0.0 / 0.0 => NaN

Lawrence
_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake