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.

confusion between comsol 3.5a and 4.3a

Please login with a confirmed email address before reporting spam

hello everyone,

It might be a noob question, but could anyone please tell me how this should work in comsol 4.3a.

So in comsol 3.5a in order to save the normalized electric field i just did this:

created the mesh:

x1=0:1.5e-9:150e-9;
y1=0:1.5e-9:150e-9;
z1=-150e-9:1.5e-9:150e-9;


Then had the export function (comsol_feldexport) as .m file which had the inerpolation done with postinterp.

After that, i saved the field at the grid points by using the following line:

results = comsol_feldexport(fem,filename,x1,y1,z1);

After that I had my fields and i was all happy.

I do not know how i could access fem anymore in comsol 4.3a, as after solving the Mfile, I only get 'ans' in the workspace and fem is not there anymore.

Please let me know if you have any information.

thanks in advance,

2 Replies Last Post Feb 11, 2013, 6:18 a.m. EST
Niklas Rom COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 11, 2013, 4:01 a.m. EST
Hello,
in the latest COMSOL version (4.3a), do this:

- Right-click the tree node Results > Export, and select Data.
- Change "Points to evaluate in" to Grid.
- Enter in x-, y- och z-coordinates. Click the button beside the range edit field to get different range options.
- Complete the other inputs such as export file name and click Export.

If you want to do this programatically in your MATLAB function, I suggest you do it like above in the GUI first, and then save as Model-M file.
-Niklas



hello everyone,

It might be a noob question, but could anyone please tell me how this should work in comsol 4.3a.

So in comsol 3.5a in order to save the normalized electric field i just did this:

created the mesh:

x1=0:1.5e-9:150e-9;
y1=0:1.5e-9:150e-9;
z1=-150e-9:1.5e-9:150e-9;


Then had the export function (comsol_feldexport) as .m file which had the inerpolation done with postinterp.

After that, i saved the field at the grid points by using the following line:

results = comsol_feldexport(fem,filename,x1,y1,z1);

After that I had my fields and i was all happy.

I do not know how i could access fem anymore in comsol 4.3a, as after solving the Mfile, I only get 'ans' in the workspace and fem is not there anymore.

Please let me know if you have any information.

thanks in advance,


Hello, in the latest COMSOL version (4.3a), do this: - Right-click the tree node Results > Export, and select Data. - Change "Points to evaluate in" to Grid. - Enter in x-, y- och z-coordinates. Click the button beside the range edit field to get different range options. - Complete the other inputs such as export file name and click Export. If you want to do this programatically in your MATLAB function, I suggest you do it like above in the GUI first, and then save as Model-M file. -Niklas [QUOTE] hello everyone, It might be a noob question, but could anyone please tell me how this should work in comsol 4.3a. So in comsol 3.5a in order to save the normalized electric field i just did this: created the mesh: x1=0:1.5e-9:150e-9; y1=0:1.5e-9:150e-9; z1=-150e-9:1.5e-9:150e-9; Then had the export function (comsol_feldexport) as .m file which had the inerpolation done with postinterp. After that, i saved the field at the grid points by using the following line: results = comsol_feldexport(fem,filename,x1,y1,z1); After that I had my fields and i was all happy. I do not know how i could access fem anymore in comsol 4.3a, as after solving the Mfile, I only get 'ans' in the workspace and fem is not there anymore. Please let me know if you have any information. thanks in advance, [/QUOTE]

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 11, 2013, 6:18 a.m. EST
Thank you for your kind reply. I did that. Now Let's say I have exported the data (emw.normE) with the following grid points:

x1=0:1.5e-9:150e-9;
y1=0:1.5e-9:150e-9;
z1=-150e-9:1.5e-9:150e-9;

After loading this data, I don't know how to recreate the surface plot in Matlab. Can someone give me an example of commands to deal with this issue, please?

regards,
Thank you for your kind reply. I did that. Now Let's say I have exported the data (emw.normE) with the following grid points: x1=0:1.5e-9:150e-9; y1=0:1.5e-9:150e-9; z1=-150e-9:1.5e-9:150e-9; After loading this data, I don't know how to recreate the surface plot in Matlab. Can someone give me an example of commands to deal with this issue, please? regards,

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.