Dear fipy community,
I’m new to FiPy, so forgive me if this is a trivial question.
I’m trying to find the kink solution to the (static) sine-gordon equation using
this simply piece of code.
import numpy as np
from fipy import *
nx = 10000
dx = 0.01
mesh = Grid1D(nx=nx,dx=dx)
phi = CellVariable(mesh=mesh, name=“Phi")
phi.constrain(2*np.pi, where=mesh.facesLeft)
phi.constrain(0., where=mesh.facesRight)
eq = (DiffusionTerm(coeff=(1.0), var=phi) - numerix.sin(phi) == 0.0)
sweeps=10
for i in range(sweeps):
eq.sweep(var=phi)
MatplotlibViewer(phi)
Unfortunately, I do not manage to get a numerically stable solution, the first
sweep gives me a straight line and additional sweeps lead to numerical
instabilities without convergence.
I would be very thankful if someone could hint me to what I’m doing wrong.
Best wishes,
Quintin Meier
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
[ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]