This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Adding Noise to a Neumann boundary.

0 votes

How can I add noise to a Neumann boundary? Usually we take care of the Neumann boundary by adding another term in the linear form. (See attached link to FEniCS demo with Poisson equation and Neuman boundaries.) In the attached demo the normal derivative is set equal to g = Expression("-sin(5*x[0])"). How can I add noise to this boundary condition?

Poisson with Neumann.
http://fenicsproject.org/documentation/dolfin/1.6.0/python/demo/documented/neumann-poisson/python/documentation.html

asked Jun 21, 2016 by aldenpack FEniCS User (1,450 points)

It depends on the kind of noise you want to add. Is it white noise? Or it is spatially correlated?
Do you need to be consistent with an infinite dimensional stochastic PDE?
Or any random forcing term is ok with you?

1 Answer

0 votes
 
Best answer
answered Jun 22, 2016 by Jan Blechta FEniCS Expert (51,420 points)
selected Jun 30, 2016 by aldenpack

I don't see how this corresponds to the weak form. The InitialCondition class is used to initialize u0. How do I alter the weak form to introduce noise? I'd like to modify the gvds term in the demo I referenced.

It's an Expression which can be used for initial condition, boundary condition, or as a coefficient in a form, etc.

class G(Expression):
    # implementation, see e.g. use of random in InitialCondition

g = G()
L = f*v*dx \
  + g*v*ds # Neumann term
...