On Fri, Aug 5, 2016 at 12:15 PM, Nils Becker
<nils.bec...@bioquant.uni-heidelberg.de> wrote:
>
> ok. it seems that you have not changed the iteration, only added print
> functions. so my code seems to be converging, yes?

Absolutely. Appears to be converging well.

> that's also what i thought. however testing the solution externally, it
> seems that the solution is not quite accurate (as time progresses, it
> seems to get worse).

It could converge well to the wrong solution. Convergence and accuracy
are different.

> of course, this external test could be buggy -- however the fact that it
> shows that lhs = rhs quite accurately in the beginning makes me think
> that it could be correct.

I'm not sure that comparing the residual across time steps is
indicative of anything useful. For example, the residual for a large
and small time step could be entirely different, but converge equally
well and also be just as accurate in terms of the actually variable
values. It's more the amount of convergence at a given time step
that's useful (i.e. the residual after normalization by the first
sweep).

> so what sweep returns is basically A(n) * x(n-1) - b(n), yes?

Yup.

> as far as
> i can tell, i always collect the last one of these values in each step.
> they do get small, i also see the convergence to below 1e-9 when i set
> the tolerance that low.

I see. The version of the code that I got from you only ever did one sweep.

> yes. this also surprised me. the potential phi and the growth rate
> lambda_ are of course non-linear functions of space. but all
> coefficients are independent of the density, and the density rho should
> be really appearing only linearly in the equation. so unless i
> constructed the equation or the loop wrong, the system should really be
> linear. no idea why it would require sweeps. do linear equations with an
> implicit source term require sweeping? am i doing the sweep wrong?

No they shouldn't require any sweeps. It's probably that the LU solver
has a slightly more accurate starting condition and thus the
normalization of the error is different. The matrix and b vector
aren't changing. See,

https://github.com/usnistgov/fipy/blob/develop/fipy/solvers/pysparse/linearLUSolver.py#L80

-- 
Daniel Wheeler
_______________________________________________
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to