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 05.09.2012, 11:18 GMT-4
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 17.07.2012, 01:27 GMT-4
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 17.07.2012, 13:45 GMT-4
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 17.07.2012, 13:54 GMT-4
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 17.07.2012, 13:56 GMT-4
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 05.09.2012, 10:01 GMT-4
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 05.09.2012, 10:25 GMT-4
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 05.09.2012, 10:34 GMT-4
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 05.09.2012, 11:18 GMT-4
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.