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.

integration and complex numbers

Please login with a confirmed email address before reporting spam

Hi all,

I am using comsol 4.2 with the AC/DC module (more specific the electric currents).

I have a 3D bloc, with electric insulation everywhere.
electrical conductivity is 0.1+0.01i (yes it's a complex number).
permittivity is 1.
Two point sources, one acts as source +1 A, and one as sink -1A.


I changed the default solver to GMRES (so it can handle complex numbers).

My results (potential, current density,...) are now complex numbers.

My problem is when I integrate the current density, it gives me a real number. This happens only with the current desity. If I integrate potential or Electric field, I get complex results. How is this possible?

3 Replies Last Post 2011年8月31日 GMT-4 13:00
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 2011年8月31日 GMT-4 01:41
Hi

I'm not sure why, not obvious to give a quick reply,

but you could check the underlying equation in COMSOL in the Equation view (see preferences)

There might be an issue with a simple or a complex conjugate multiplication, somewhere.
Check also the doc and the use of the operator "realdot()" with complex variables

--
Good luck
Ivar
Hi I'm not sure why, not obvious to give a quick reply, but you could check the underlying equation in COMSOL in the Equation view (see preferences) There might be an issue with a simple or a complex conjugate multiplication, somewhere. Check also the doc and the use of the operator "realdot()" with complex variables -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月31日 GMT-4 12:26
Thanks for the reply,

I don't seem to find out why is that.

e.g.
Jx=ec.Jex+ec.Jix

Where in my case ec.Jex=0

Now ec.
Jix=ec.sigmaxx*ec.cucn1.input.Ex+ec.sigmaxy*ec.cucn1.input.Ey+ec.sigmaxz*ec.cucn1.input.Ez

Where ec.sigmaxx is a complex number
and ec.cunc1.Ex=-Vx which is a complex number.


Now if integrate ec.sigmaxx, I get a complex number (0.0102+0.001i)
integration of ec.cunc1.input.Ex=ec.Ex=-0.7723+0.0772i

bur integration of ec.sigmaxx*ec.Ex is a real number !!!


P.S.

Multiplication of ec.sigmaxx*ec.Ex = -0.080+(1.5e-5)i .

Can this be do to the number of decimical shown on comsol?
Thanks for the reply, I don't seem to find out why is that. e.g. Jx=ec.Jex+ec.Jix Where in my case ec.Jex=0 Now ec. Jix=ec.sigmaxx*ec.cucn1.input.Ex+ec.sigmaxy*ec.cucn1.input.Ey+ec.sigmaxz*ec.cucn1.input.Ez Where ec.sigmaxx is a complex number and ec.cunc1.Ex=-Vx which is a complex number. Now if integrate ec.sigmaxx, I get a complex number (0.0102+0.001i) integration of ec.cunc1.input.Ex=ec.Ex=-0.7723+0.0772i bur integration of ec.sigmaxx*ec.Ex is a real number !!! P.S. Multiplication of ec.sigmaxx*ec.Ex = -0.080+(1.5e-5)i . Can this be do to the number of decimical shown on comsol?

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 2011年8月31日 GMT-4 13:00
Hi
from my understanding COMSOL uses double precision, try to see the size of the defined variable "eps" smallest number to substract from "1" to differentiate the result from "1"

Now what about integration, I'm not sure it integrates correctly without that the user separates the real and complex parts specifically.
You need to look into the doc again (or try it out experimentally) I'm in the same situation, cannot remember, shuld though ;)

--
Good luck
Ivar
Hi from my understanding COMSOL uses double precision, try to see the size of the defined variable "eps" smallest number to substract from "1" to differentiate the result from "1" Now what about integration, I'm not sure it integrates correctly without that the user separates the real and complex parts specifically. You need to look into the doc again (or try it out experimentally) I'm in the same situation, cannot remember, shuld though ;) -- Good luck Ivar

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.