Skip to main content
15 events
when toggle format what by license comment
Jun 2, 2020 at 11:29 history edited xzczd CC BY-SA 4.0
added 101 characters in body
Nov 28, 2016 at 21:10 comment added bbgodfrey @xzczd I employed an alternative approach to solve this problem. Agreement between our two results is reasonably good.
Nov 28, 2016 at 3:22 history bounty ended Buddhapus
Nov 28, 2016 at 3:22 vote accept Buddhapus
Nov 29, 2016 at 17:56
Nov 28, 2016 at 3:22 comment added Buddhapus @xzczd I remember reading somewhere that for Pseudospectral method you want the number of points equal to a factor of 2, for example, 512 or 1024. Maybe that has something to do with it. I do need the whole thing as a function of time, but you are probably right about the relative error. It's a trade-off either way. Thank you for your answer.
Nov 28, 2016 at 2:47 comment added xzczd @bbgodfrey Yeah, I should admit choosing proper grid size for this equation turns out to be a bit of an art. The only thing I'm relatively sure is, when the calculation becomes very slow, it'll probably produce a seriously incorrect result.
Nov 28, 2016 at 2:39 comment added bbgodfrey Nice computation. However, when I increased the grid size to 1000, the height == 2 calculation became very slow at around t == 4.8, and produced a seriously incorrect answer at t == 5. Perhaps, this is related to the issue you had with a grid size of 552.
Nov 28, 2016 at 2:31 comment added xzczd @Buddhapus Do you need the solution for the whole time range? If you just need the result at the end time, you can use something like solfunc[8, 550, 4, 20], this will save a lot of memory. Also, I'd like to point out (of course I think you've already noticed) even if the eerr warning comes out, the result is still not too bad when the error isn't too large.
Nov 27, 2016 at 23:47 comment added Buddhapus Okay, thanks! I keep running and re-running it for a larger domain, and with more MinPoints and MaxPoints, but either of two things happen - either I run out of memory because there are too many points, or there is error that accumulates because there are too few points. In general the trends definitely look better though. Before I accept your answer would you have any recommendations to help larger domain calculations? The only thing I can think of to try is increase the memory that Mathematica uses on my computer. Not sure of the default.
Nov 27, 2016 at 9:21 comment added xzczd @Buddhapus Yes, MaxSteps->Infinity allows NDSolve to use infinite steps on the direction of t (The solution of your equation is so complicated that without this option NDSolve isn't able to evaluate to $t=20$ in 10000 steps), "MaxPoints" and "MinPoints" specify the number of points used for spatial discretization. Notice "method of lines" is a method solving PDE by discretizing it to a set of ODEs with finite difference formula. For more information you can search MethodOfLines in the document.
Nov 27, 2016 at 9:05 comment added Buddhapus Can you please explain why you chose an infinite number of steps but you specify the number of points? Is one for time and the other for space discretization?
Nov 27, 2016 at 8:35 history edited xzczd CC BY-SA 3.0
edited body
Nov 27, 2016 at 8:30 history edited xzczd CC BY-SA 3.0
added 168 characters in body
Nov 27, 2016 at 7:20 history edited xzczd CC BY-SA 3.0
deleted 111 characters in body
Nov 27, 2016 at 6:49 history answered xzczd CC BY-SA 3.0