I’m totally new to FEM and FENICS, and wanting to find a numerical method to optimize a function(s) with an integral form.
I have a function (bulk energy density) f depending on a scalar q and a 2nd order tensor Q in 3D space, as
f = q - q^2 + \nable \cdot Q \cdot\nabla q (1)
and a function (surface density) depending on the scalar q on the surface of the bulk
s = \vec{n} \cdot \nabla q, (2)
where \vec{n} is the surface norm vector.
I want to find the q and Q that optimize the total energy
F = \int f d^3r + \int s d^2r. (3)
There is no boundary condition on q or Q.
I checked some posts about using variational calculus to convert the integral form into a differential form, or using built-in derivative function, like in this post
(Runtime Error: Minimization of Energy Functional),
and they make sense to me. However, I’m not sure how to deal with the boundary condition (BC). I heard that it is impossible to solve a PDE without a BC or the solution is unstable. I’m wondering if there is any better way, or the problem itself is ill-defined.
Thanks a lot!