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.

Exporting complex electric field from mode solver

Please login with a confirmed email address before reporting spam

Hi all,

I am using mode analysis in RF module for obtaining a guided mode. (COMSOL 4.0a)

From the analysis, I tried to export field data and it seemed like it was giving me magnitude value instead of raw complex value.

For instance, if I tried to export x-component of E-field, say Ex(x,y) = Ex_real(x,y) + j Ex_imag(x,y), it seems like the data I am getting from COMSOL is sqrt( abs(Ex_real(x,y) + j Ex_imag(x,y)) ).

Does anyone know if I can export complex field values from mode analysis? not its magnitude?

Thanks!

8 Replies Last Post Sep 5, 2012, 11:18 a.m. EDT
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jul 17, 2012, 1:27 a.m. EDT
Hi

I believe it was already implemented in 4.0 then you can export the data set with real(Ex) and imag(Ex), but real nad imaginary part separately as 2 scalars

--
Good luck
Ivar
Hi I believe it was already implemented in 4.0 then you can export the data set with real(Ex) and imag(Ex), but real nad imaginary part separately as 2 scalars -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jul 17, 2012, 1:45 p.m. EDT
You might want to check the exported file manually. When I export imaginary data, it exports as the number followed immediately by 'i' without any spaces or other characters; e.g. 4.0023*i exports as '4.0023i'. Many automated import scripts would recognize this number as '4.0023' (truncating the 'i') and not as '4.0023*i'.
You might want to check the exported file manually. When I export imaginary data, it exports as the number followed immediately by 'i' without any spaces or other characters; e.g. 4.0023*i exports as '4.0023i'. Many automated import scripts would recognize this number as '4.0023' (truncating the 'i') and not as '4.0023*i'.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jul 17, 2012, 1:54 p.m. EDT
Thank you Ivar,

Now I can obtain real and imaginary part separately.
Thank you Ivar, Now I can obtain real and imaginary part separately.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jul 17, 2012, 1:56 p.m. EDT
Thank you for your comment.

I imported it through Matlab and there was no "i" attached. Thanks for noting that!!
Thank you for your comment. I imported it through Matlab and there was no "i" attached. Thanks for noting that!!

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 5, 2012, 10:01 a.m. EDT
hi how do you export the electric field from the mode solver? what i get has no imaginary part. can you tell me how to do that, looking forward to your reply!!thanks!

hualong
hi how do you export the electric field from the mode solver? what i get has no imaginary part. can you tell me how to do that, looking forward to your reply!!thanks! hualong

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 5, 2012, 10:25 a.m. EDT
can you tell me how you get the imaginary part of the electric field,looking forward form you. thank you!
can you tell me how you get the imaginary part of the electric field,looking forward form you. thank you!

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 5, 2012, 10:34 a.m. EDT
Hello,

I used real() or imag() in the evaluation section to extract complex field components.
For instance, if you want to extract real and imaginary part of Ex field, use real(Ex) and imag(Ex).


Hello, I used real() or imag() in the evaluation section to extract complex field components. For instance, if you want to extract real and imaginary part of Ex field, use real(Ex) and imag(Ex).

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 5, 2012, 11:18 a.m. EDT
Hi Min,

first, many thanks!!

that means if want to extract the imaguinary data of Ex, the sentence i should write on comsol-matlab is following
yy=postplot(fem,'tridata',{'imag(Ey)','cont','internal','unit','V/m'},'solnum',index,'outtype','postdataonly');
then I can find my data in yy, is that right?

looking forward to your reply

Br,
hualong
Hi Min, first, many thanks!! that means if want to extract the imaguinary data of Ex, the sentence i should write on comsol-matlab is following yy=postplot(fem,'tridata',{'imag(Ey)','cont','internal','unit','V/m'},'solnum',index,'outtype','postdataonly'); then I can find my data in yy, is that right? looking forward to your reply Br, hualong

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.