# time-dependent nonlinear pde in fenics

I am interesting in solving the following nonlinear, time-dependent pde in 2 spatial dimensions (complex Gross-Pitaevskii eq):

$$i \frac{\partial \psi}{\partial t} = \left[ -\nabla^2 + (1-i \sigma)(|\psi|^2-1) \right] \psi$$

The goal is to find steady state solutions for the function $\psi(x,y,t)$, for different parameters $\sigma$. Here $\sigma$ is a positive real-valued parameter. The boundary conditions can initially be of the Dirichlet type, setting the function $\psi$ to zero on the contour of a square, but later on I plan to implement some absorbing BC (perhaps using the perfectly matched layer method?). I am also considering solving the equation in a different geometry later on, on a disk using polar coordinates.

For the time-dependence, I plan to use the Gryphon module of Erik Skare (https://launchpad.net/gryphonproject), which is basically a Runge-Kutta solver and for the spatial part Fenics.

So the question is, do you think this is feasible to do with Fenics, and if so, how would one proceed?

## 1 Answer

I would try pushing this form

V = VectorFucntioSpace(mesh, 'CG', 1, dim=2)
u = Function(V)
v = TestFunction(V)
sigma = Constant(0.1)
F = inner(grad(u), grad(v))*dx \
+ (inner(u, u)-1.0)*((u[0]+sigma*u[1])*v[0] + (u[1]-sigma*u[0])*v[1])*dx


into nonlinear-poisson demo. But note that this would yield trivial solution if you start from zero field with zero Dirichlet.

• Actually, as initial condition I would like to take a vortex in the center, $\psi(r,0)=r e^{-\frac{r^2}{2 c^2}}e^{i \phi(r)}$, where the azimuthal angle $\phi(r)$ varies from 0 to 2$\pi$ around the vortex core. The natural way to do this would be to use polar coordinates, but I have no idea how to do that in Fenics.. Commented Jun 28, 2013 at 8:29
• This initial condition can be easily achieved also in Cartesian coordinates. But I see no problem with polar coordinates in FEniCS. You just need to replace Laplace term with appropriate term valid in polar coordinates and add Jacobian of volume integral. Commented Jun 28, 2013 at 12:51
• so is there any worked out example of using polar coordinates in Fenics, for solving an eq. on a disk? Commented Jun 28, 2013 at 13:18
• besides, the equation is in the complex domain, and as far as i know fenics does not support complex numbers! Commented Jun 28, 2013 at 15:42
• No. It is especially worth for 2D problems involving rotational symmetry which would yield 1D problem so it is ODR instead of PDR. I don't think it is much useful to use polar coordinates for your problem unless boundary conditions implies rotationally-symmetric solution in which case you should reduce your problem to ODR. DOLFIN is able to create spherical meshes in Cartesian coordinates. Commented Jun 28, 2013 at 15:43