It may or may not make sense. I have read some discussions that say that it is more accurate and robust to take the Jacobian of the discretized equations, rather than do it analytically the way I have done (or tried to do, anyway). This approach has worked for me, but there may be treatments that converge faster.
> On May 13, 2016, at 2:25 PM, Kris Kuhlman <kristopher.kuhl...@gmail.com> > wrote: > > Thank you for posting this. > > I was initially figuring I would approximate the variation in x with a finite > difference approximation. This would be much less accurate but simple. Using > analytical derivatives makes sense, though. > > Kris > > On Fri, May 13, 2016 at 12:12 PM, Guyer, Jonathan E. Dr. (Fed) > <jonathan.gu...@nist.gov> wrote: > I have posted an implementation at > > https://gist.github.com/guyer/f29c759fd7f0f01363b8483c7bc644cb > > I'm not sure the way that I determine the Jacobian expression is completely > legitimate, but it seems to work. Please don't hesitate to ask any questions > (or offer corrections!). > > > > > On May 11, 2016, at 4:57 PM, Guyer, Jonathan E. Dr. (Fed) > > <jonathan.gu...@nist.gov> wrote: > > > > I'm not sure I have anything posted publicly. I will put together a minimal > > example. > > > >> On May 11, 2016, at 12:42 PM, Daniel Wheeler <daniel.wheel...@gmail.com> > >> wrote: > >> > >> Hi Kris, > >> > >> FiPy doesn't have an automated way to do Newton iterations. You can > >> always construct your own Newton iteration scheme using the terms and > >> equations as you would ordinarily, but then you have to do the > >> variational derivatives and the coupling by hand. This also assumes > >> that you are familiar with the Newton method. You can query an > >> equation for its residual which then needs to be added to the Newton > >> version of the equation. I think that means that each equation > >> requires two implementations, the regular and the Newton. > >> > >> Regarding examples of using FiPy with Newton iterations, I don't > >> believe that we have any examples in the source code although I do > >> know that some people have used it in this way including Jon Guyer. He > >> may have examples in Github somewhere that would help you get started, > >> but I'll let him point you to them. > >> > >> Cheers, > >> > >> Daniel > >> > >> On Tue, May 10, 2016 at 9:31 AM, Kris Kuhlman > >> <kristopher.kuhl...@gmail.com> wrote: > >>> I am interested in trying to use newton iterations, rather than simply > >>> fixed-point iterations, to speed up the convergence of the non-linear > >>> iterations in my fipy problem. > >>> > >>> I have found this mention of a term useful for newton iterations, > >>> > >>> http://www.ctcms.nist.gov/fipy/fipy/generated/fipy.terms.html#module-fipy.terms.residualTerm > >>> > >>> and I see this mention of an example using newton iterations > >>> > >>> https://github.com/usnistgov/fipy/wiki/ScharfetterGummel > >>> > >>> but I don't see the actual code it is talking about. Is there an example > >>> available somewhere? > >>> > >>> Kris > >>> > >>> _______________________________________________ > >>> fipy mailing list > >>> fipy@nist.gov > >>> http://www.ctcms.nist.gov/fipy > >>> [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > >>> > >> > >> > >> > >> -- > >> Daniel Wheeler > >> _______________________________________________ > >> fipy mailing list > >> fipy@nist.gov > >> http://www.ctcms.nist.gov/fipy > >> [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > > > > > > _______________________________________________ > > fipy mailing list > > fipy@nist.gov > > http://www.ctcms.nist.gov/fipy > > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > > > _______________________________________________ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > > _______________________________________________ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] _______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]