On Jan 27, 2014, at 4:34 PM, yuan wang <rose.w...@tufts.edu> wrote: > I've already solved the previous problem. But now I have some new problems. > My research is about solving a series (about 10) of coupled nonlinear partial > differential equations. They are coupled in the reaction term (implicit > source and source term). The reaction is second order reaction, which causes > the non-linearity. Because of that, I need to solve them iteratively. I use > sweep to do that but could not get convergence out of it. I'm not sure > whether it's because of the mechanism set up is not correct, or because I > didn't use fipy correctly. Would you mind taking a look at my code? Based on > your experience, would that many pdes have good convergence?
Based on what you sent me offline, there's no fundamental reason that you can't solve that many coupled equations, but solving steady state PDEs, much less coupled steady state PDEs is challenging. It's likely that you'll need to use something like Newton iterations, or relaxing the time dependent equations in pseudo-time, or both, to achieve stable solutions. This is far too complicated a code to try to analyze off the cuff, but I can make a couple of observations: Start with a *much* simpler system of equations; two or three reactions at first, then gradually add more. There is no hope of figuring out such a complicated system, particularly when you're still learning your way around FiPy. Are all of the Sec[i].var concentration variables? Several of the solutions have negative values after one sweep. If these are concentrations, then something is wrong from the beginning and will never recover. I would look carefully at your boundary conditions to ensure that none of them are forcing unphysical (and inconsistent) solutions. ImplicitDiffusionTerm and DiffusionTerm are the same thing, so you're not getting Crank-Nicholson when you add eqI and eqE. There's no real harm in this, but there's no point, either. Just do the normal implicit equations. _______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]