1) This would be possible but not necessary since such computations are built-in to the Wave Optics Module in the very powerful port type boundary conditions. For example, the Wave Optics Module functionality allows you to compute the field at a port using a mode analysis or by defining a known electromagnetic field shape using mathematical expressions.

2) Yes, the Parameters list doesn’t “understand” the units of x and y since p=x*y is defined globally and does not belong to a particular model component. The model could, in principle, contain a mixture of 1D, 2D, and 3D components where there could be any number of spatial variables defined. Instead, to get unit handling on an expression like p=x*y you can define it as a Variable under Component->Definitions. This way the x and y variables are bound to one particular component. (The Parameters list was used here as a very quick way of achieving the results.)

I hope this helps,

Bjorn

2) I have COMSOL 4.3b and having problems with defining constant p=x*y in parameters. x*y look just red. How can I tell COMSOL that these are the coordinates?

Thanks for your answer

]]>