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.

Global constraint

Please login with a confirmed email address before reporting spam

Hi,
Would you please help me out? I’m working with COMSOL v4a. I want to define a global constraint for electric field norm (ec.norm) using point integration and Global equation under ge model with non-zero initial condition. But I have this error:

Attempt to evaluate negative power of zero.
- Function: ^
Failed to evaluate temporary symbolic derivative variable.
- Variable: mod1.ec.normE@VDN$mod1.Vy
- Defined as: (((-conj(mod1.ec.Ey))+(-conj(mod1.ec.Ey)))*((((realdot(mod1.ec.Ex,mod1.ec.Ex)+realdot(mod1.ec.Ey,mod1.ec.Ey))+realdot(mod1.ec.Ez,mod1.ec.Ez))^-0.5)*0.5))
Failed to evaluate expression.
- Expression: d(mod1.ec.normE,mod1.Vy)

Thanks,
Gita

1 Reply Last Post Jan 4, 2011, 4:03 a.m. EST
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 Jan 4, 2011, 4:03 a.m. EST
Hi

if you look at the formula:

((((realdot(mod1.ec.Ex,mod1.ec.Ex)+realdot(mod1.ec.Ey,mod1.ec.Ey))+realdot(mod1.ec.Ez,mod1.ec.Ez))^-0.5)*0.5)


realdot(mod1.ec.Ez,mod1.ec.Ez))^-0.5

then if Ex=Ey=Ez =0 this ^-0.5 gives a NaN hence the error

two ways out:
a) either you adapt Ex,Ey,Ez to avoid Ex=Ey=Ez=0, or
b) you cheat a little (might not work) and you add in the formula (under equations)

... realdot(mod1.ec.Ez,mod1.ec.Ez)+eps)^-0.5)...

But most probably you shouldavoid "nofield" by a better BC or initial value conditions

--
Good luck
Ivar
Hi if you look at the formula: ((((realdot(mod1.ec.Ex,mod1.ec.Ex)+realdot(mod1.ec.Ey,mod1.ec.Ey))+realdot(mod1.ec.Ez,mod1.ec.Ez))^-0.5)*0.5) realdot(mod1.ec.Ez,mod1.ec.Ez))^-0.5 then if Ex=Ey=Ez =0 this ^-0.5 gives a NaN hence the error two ways out: a) either you adapt Ex,Ey,Ez to avoid Ex=Ey=Ez=0, or b) you cheat a little (might not work) and you add in the formula (under equations) ... realdot(mod1.ec.Ez,mod1.ec.Ez)+eps)^-0.5)... But most probably you shouldavoid "nofield" by a better BC or initial value conditions -- 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.