explosion of values when simulation Kuramoto Sivashinsky Equation with demo setup #83
-
First of all, thank you for creating this amazing library! I have been learning about PDE solvers in the Python environment, and this package really helped me a lot. One thing I have a concern about is that when I was trying out the KSE solver provided in the demo, I ended up creating a video that has a scale bar that is drastically expanding. I thought it was because of the boundary condition, then I changed the boundary condition to 'periodic' for both axis, the same situation still persisted. Then I set the boundary condition to be constant 0's, the simulation still explodes until it hits 'nan' values. I copied the code I used, basically copied from the demo with slight changes that don't affect the mechanism. I looked into the source code for clues but I'm not that good at Python so I didn't figure out anything. If you could provide any information that can help me fix this it will be much appreciated! code: from pde import DiffusionPDE, PlotTracker, ScalarField, UnitGrid class KuramotoSivashinskyPDE(PDEBase):
def generate_batch(dim=[32, 32], period=6.4, sample_num=64, dt=0.01):
def main(): |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Could you please post a properly formatted minimal working example, so I can reproduce the problem? |
Beta Was this translation helpful? Give feedback.
So it turns out that the Kuramoto-Sivashinsky equation exists with different definitions of the squared term. Some use the square of the gradient$|\nabla c|^2$ (the example code does too!) and this equation is not conserved. So the behaviour observed by @deephog is correct. Others use the gradient of the square $\nabla (c^2)$ . With periodic boundary conditions this equation seems to be conserved.
This code will run a simulation with the second (i.e. conserved) equation and should yield the desired behaviour according to the OP: