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.

Problem with complex numbers

Please login with a confirmed email address before reporting spam

Hi!
I am using for heating one subdomain a complicate function of temperature. COMSOL says that in my heating function apperas complex numbers, but i think that my heating function avoid this... This is how I define my heating function:
J.*(((E1*(1-T./Tc).^n0).*(J./(J1*(1-T./Tc).^n0)-1).^n).*(T<Tc)+(J.*(Al.*T+Ac)).*(T>=Tc))

in theory when T>Tc the first part is complex but I avoided it with the (T<Tc) statement... is this correct?
Maybe is a too complicate function to give it to COMSOL?
Thanks for your helping

2 Replies Last Post Nov 14, 2009, 4:08 a.m. EST

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 12, 2009, 12:08 a.m. EST
...for T>Tc the first part is complex if "n0" is even...however...pay attention to the use of parameters...i mean, for comsol "i" is the complex unit but if i well remember also "j" is considered as the complex unit, so try to use another letter instead of "J" in your expression
...for T>Tc the first part is complex if "n0" is even...however...pay attention to the use of parameters...i mean, for comsol "i" is the complex unit but if i well remember also "j" is considered as the complex unit, so try to use another letter instead of "J" in your expression

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 Nov 14, 2009, 4:08 a.m. EST
Hi

In general the appearance of complex numbner is not a "problem", often they are linked to dissipation elements, but could also come from the way one needs solving the equations.

Applications not needing complex number are generally easier to handle, that is also why the use of complex number "feature" is generally turned "off" in the solvers parameters. When complex numbers appear, and the application mode does not expect them and has not already changed this default setting, then I agree the user must either turn them on, or reformulate his equation system. But in both cases it's better to exactly understand what you are demanding and how COMSOL issolving the case.

Now, I agree this is the theory and easy to say, I must admit that in your case I hanv't found an obvious clue, apart perhaps that COMSOL cannot always understand the boolean tests as "real case" selection of possible "complex" solutions. Therefre, I would suggest to try the empiicl way, turn on complex values and check carefully the reasults, the latter is anyhow mandatory especially when you start studies in new domains or new cases

Good luck
Ivar
Hi In general the appearance of complex numbner is not a "problem", often they are linked to dissipation elements, but could also come from the way one needs solving the equations. Applications not needing complex number are generally easier to handle, that is also why the use of complex number "feature" is generally turned "off" in the solvers parameters. When complex numbers appear, and the application mode does not expect them and has not already changed this default setting, then I agree the user must either turn them on, or reformulate his equation system. But in both cases it's better to exactly understand what you are demanding and how COMSOL issolving the case. Now, I agree this is the theory and easy to say, I must admit that in your case I hanv't found an obvious clue, apart perhaps that COMSOL cannot always understand the boolean tests as "real case" selection of possible "complex" solutions. Therefre, I would suggest to try the empiicl way, turn on complex values and check carefully the reasults, the latter is anyhow mandatory especially when you start studies in new domains or new cases 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.