Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • $\begingroup$ Thanks for your answer! I clarified the parameters a bit. Perhaps it helps. $\endgroup$ Commented Dec 12, 2017 at 9:37
  • $\begingroup$ Learned again the importance of good initial guess. BTW, I previously mentioned trying to use the Logistic function to generate a nonuniform grid (sparse in middle) for the FDM on the pure ODE. But it seems that even if a tiny nonuniformity slows down the solution a lot, which doesn't happen in your previous Gauss rule grid. Do you know any reason or have any comments. Like this one. Logistic[x_, s_] = 1/(1 + Exp[-(x - 1)/(10 Sqrt[s])]); grid = Rescale[Table[Logistic[x, s], {x, 0, 2, 2/points}], {Logistic[0, s], Logistic[2, s]}, domain]; $\endgroup$ Commented Dec 12, 2017 at 10:24
  • $\begingroup$ +1. It's me. The question arises: why isn't it implemented in Mathematica yet? $\endgroup$ Commented Dec 12, 2017 at 10:48
  • 2
    $\begingroup$ @xiaohuamiao I'm not sure if it's the whole reason, but it's related to the issue mentioned in this post. Specifically speaking, the exact form of your grid is complicated, so the deduced difference equation becomes complicated and hard for Mathematica to handle. If you modify the code to SetAttributes[#, NHoldAll] & /@ {p, q}; ……FindRoot[N@{ae, bc}…… it'll be much faster. $\endgroup$ Commented Dec 12, 2017 at 12:39
  • 1
    $\begingroup$ @user64494 I sincerely believe it's because of some deep reasons that are beyond the understanding of us average users, rather than something like they think FDM is… not cool. $\endgroup$ Commented Dec 12, 2017 at 12:46