Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Scalar Product of Electric Field, Exporting Data

Please login with a confirmed email address before reporting spam

Hi

I am trying to calculate the Scalar Product of the electic field of two mode solutions.

My simulation calculates different mode profiles for photonic waveguides, where I vary one parameter (width) and solve for a number of modes along the way. I now need to calculate the intergral over the scalar product of two different modes (different paramter) over the whole simulation space.

As I could not find any option inside Comsol for that, I exported the Data and want to do the product and integral in Matlab. During this process I encountered a number of problems:

-The data always gets exported in form of a spreadsheet, with the colums being x,y,Data1,Data2,... Does anybody knows how to change the format in such a way that the output is 2d (i.e Data1 is presenting in a table, where the columns represent a specific x-coordinate and the rows a y-coordinate)?

-Both the resolution and the order of the coordinates changes between exports of modes with different parameters. Is there a way to give a specific resolution and Comsol then integrates a number of values?

-Can I automatize the whole process? At the moment I have to manual select every single parameter value and give it one name. Can I instead say, export all e-fields in this resolution into files, where the file name is: w=x.txt Where x is replaced by the value I had in the specific simulation?

For your information, I am currently not connected to matlab. I tried to but I then did not get the graphical interface of Comsol and had problems setting up the simulation.

Thanks
Niklas

0 Replies Last Post Jan 25, 2011, 11:50 a.m. EST
COMSOL Moderator

Hello Jan Niklas Caspers

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.