On Fri, Dec 20, 2013 at 9:13 AM, Jane Hung <[email protected]> wrote:
> That definitely helps the simulation run, but the behavior is different from
> what I've seen with other methods. So I'm wondering if you think the way I'm
> rewriting the equations is alright http://pastebin.com/buFS1NRu

I didn't check each equation against the maths, but the sweep loop is
definitely wrong. You have

    for sweep in range(sweeps):
        res0=res1 = 1e100
        phi.updateOld()
        psi.updateOld()
        while max(res0, res1)>.1:
            res0= eq11.sweep(var=phi, dt=dt)
            print(res0)
            res1= eq21.sweep(var=psi, dt=dt)
            print(res1)

I'm surprised that it even worked. It should be

    for sweep in range(sweeps):
        res0=res1 = 1e100
        for v in all_variables:
            v.updateOld()
        while res > 0.1:
            res= eq.sweep(dt=dt)
            print(res)


where 'all_variables' is a list of all 6 variables that need to be
solved (regardless of whether you care about their values.

Hope that helps.
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to