# CST E-Field Export - Calculate Magnitude of complex field export

#### hfield

##### Newbie Hello,

after simulation I can export the electric field values in CST Microwave Studio Suite.
The e-field is exported in complex form, to be specific in the folowing form:

x | y | z | ExRe | ExIm | EyRe | EyIm | EzRe | EzIm

As you can see, for every spatial point in 3D volume (x,y,z) the e-field yields a real and imaginary part for every coordinate point respectively.
Now I would like to calculate the magnitude of the e-field, how would I do that?
I tried:

ex = sqrt( ExRe² + ExIm² )
ey = sqrt( EyRe² + EyIm² )
ez = sqrt( EzRe² + EzIm² )
Emag = sqrt( ex² + ey² + ez² )

But when I place an e-field probe in CST and check its recorded e-field magnitude at the same position, it shows slightly different results compared to my calculation above.
Where is my mistake?

Thank you very much.

-hfield

#### stenzer

##### Full Member level 6 Hi,

how large is the difference? Your "slightly" deviation might be caused by a precision difference of CST and your "calculation" program e.g. MATLAB uses 16 Bit precision by default. Maybe the fractional digits of your exported data is limited/croped. Are you able to extract the individual directional field components by the use of a E-field probe? If so use this values to exclude the data export function.

BR