I am trying to solve a variational problem with two dependent variables, moving boundaries, and constraints. It is of the form:

V(f1(x), f2(x)) = Integral from 0 to a of  F1[x, f1(x)]   - lambda G1[x, f1(x)] - Integral from 0 to b of F2[x, f2(x)] + lambda G2[x, f2(x)].

1.) The first issue I encounter in the weak form module is that the weak form PDE is over a single domain, whereas my problem is over two overlapping domains. I can add a piecewise function that sets the functionals to zero outside of their respective domains, but I was wondering if there’s a better way to input a variational equation of this form.

2.) The second issue is that the endpoints a and b are dependent on f1(x) and f2(x) themselves. I have the constraint:

Integral from 0 to a of f1(x) = C,  Integral from 0 to b of f2(x) = C.

Ideally I would specify a and b as undefined parameters and COMSOL would choose parameters that satisfy that constraint. Right now I must specify a and b in the geometry node to define the interval, so I don’t see how I can vary a and b to satisfy the given constraint. In variational calculus jargon, I’m looking to find the “natural boundary condition” to the problem. How can I implement this in COMSOL? I couldn’t find any examples in the model library.

Similar questions and discussions