Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

How to define a function to enter a PDE in COMSOL

Please login with a confirmed email address before reporting spam

I have made a physics builder that solves an eigenvalue differential equation given some input geometry and input potential V(x,y,z). I would like to be able to set V to take different values in different parts of the domain. How can I set this? My script is attached. The geometry is two hexagons with common origin and a slab on the outer hexagon. I would like the function V which enters in my differential equation to take on three different values, one for each of the three geometries. How can I do that? Could anyone be so kind as to show how to do it in the attached script.
Edit: Right now I am trying with a geometry of two concentric circles with different radii. I am then using an expression like a + (b - a) * (x^2 + y^2 > R1^2) - b * (x^2 + y^2 > R2^2) for the stepwise potential. Is there any way to do this for a more complicated geometry like my hexagonal one?

0 Replies Last Post 26.05.2016, 08:42 GMT-4
COMSOL Moderator

Hello William Heinesen

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.