Timeline for Using NeumannValue in finite element method to replace a derivative boundary condition in NDSolve to overcome a computational overflow
Current License: CC BY-SA 4.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 5, 2022 at 12:42 | comment | added | xzczd♦ |
Seems to be version related. In v13.1 I cannot reproduce the warning, but in v12.3.1 I get General::unfl and General::ovfl . If I remove the Method->StiffnessSwitching in v12.3.1, the warning no longer pops up. Is StiffnessSwitching necessary for you?
|
|
Jul 5, 2022 at 8:02 | comment | added | ellipse314 |
Try higher input values of psi0 (>15) to try to reproduce the Overflow .
|
|
Jul 5, 2022 at 8:00 | history | edited | ellipse314 | CC BY-SA 4.0 |
Changing \[Prime] to ' on the request of a comment
|
Jul 5, 2022 at 7:55 | comment | added | ellipse314 |
For me, the Overflow warning occurs almost instantaneously after pressing shift + Enter . When Overflow does not occur, it takes some time to do the calculation, which could be more than 10 minutes depending on the value of psi0 . Also, I have an 8GB RAM on my computer - don't know if this makes a difference or not.
|
|
Jul 5, 2022 at 3:23 | comment | added | xzczd♦ |
How does it take to reproduce the Overflow ? I've waited for about 10 minutes, the calculation doesn't stop. Also, you haven't copied those ' properly. I know we can press Ctrl+Shift+N to transform the code to working code, but not everybody knows. I suggest using the solution here to copy those ' properly. Finally, if you're sure the system itself is correct, a higher WorkingPrecision may help. (You may also need Rationalize[…, 0] to avoid floating numbers. )
|
|
Jul 5, 2022 at 2:39 | comment | added | xzczd♦ |
Sadly you don't interpret it correctly. That problem is a nonlinear boundary value problem (BVP). Overflow appears there because certain internal issue of "Shooting" method. (If I have to speculate, Shooting method has turned to improper initial guesses internally. ) But your problem is initial value problem (IVP), there's no initial guess here.
|
|
Jul 4, 2022 at 16:46 | comment | added | ellipse314 |
@xzczd Here is the post where user21 uses FiniteElement method. The question was regarding an Overflow issue. I hope I interpreted this correctly.
|
|
Jul 4, 2022 at 15:56 | comment | added | ellipse314 |
@xzczd Overflow doesn't occur for values smaller than 15 for the first argument (psi0 ) of the function GeneratePsiOfX . So, I think that the ODE equation may be fine. Also, I can' locate it at the moment but I saw a post in this site that suggested using FiniteElement to overcome the Overflow problem.
|
|
Jul 4, 2022 at 15:14 | comment | added | ellipse314 |
@MarcoB Would you be able to suggest how to use NeumannValue as part of the ODE equation. I tried ic2 = NeumannValue[D[Soln, x] /. x -> xstart, x == xstart]; and ode1=2 (\[Psi]^\[Prime])[x]+x (\[Psi]^\[Prime]\[Prime])[x]+3x E^\[Psi][x] Sqrt[\[Pi]] Erf[Sqrt[\[Psi][x]]]-2 Sqrt[\[Psi][x]] (3+2 \[Psi][x])x == ic2; and Soln2 = NDSolve[{ode1,\[Psi][xstart]==Soln/.x->xstart},\[Psi][x],{x,xstart,xstop},MaxSteps->maxsteps,Method->method][[1,1,2]]; . But that didn't work.
|
|
Jul 4, 2022 at 2:11 | comment | added | xzczd♦ |
In addition to @MarcoB's comment: 1. Most of all, I don't think Overflow is something can be overcomed by method changing, better to doubt-check if the equation itself is correct or not. 2. FiniteElement method isn't designed for IVP, if you insist on using it, check this post: mathematica.stackexchange.com/q/172972/1871
|
|
Jul 3, 2022 at 23:18 | comment | added | MarcoB |
As the error message suggests, NeumannValue should be used as part of an equation, and not on its own as you have it.
|
|
Jul 3, 2022 at 21:36 | history | edited | ellipse314 | CC BY-SA 4.0 |
edited title
|
S Jul 3, 2022 at 21:19 | review | First questions | |||
Jul 3, 2022 at 23:18 | |||||
S Jul 3, 2022 at 21:19 | history | asked | ellipse314 | CC BY-SA 4.0 |