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.

Expression error

Please login with a confirmed email address before reporting spam

After running a simulation for a 3D structure with a magnetic field going in the z (vertical) direction, COMSOL returns the following error: Division by zero. - Function: / Failed to evaluate expression. - Expression: abs(try_catch(comp1.emw.Pin,1)/comp1.emw.Pmode_1) Failed to evaluate variable. - Variable: comp1.emw.tEmodex_1 - Defined as: sqrt(abs(try_catch(comp1.emw.Pin,1)/comp1.emw.Pmode_1))*comp1.emw.tE0modex_1 Failed to evaluate expression. - Expression: comp1.emw.tEdownx-comp1.emw.tEupx+comp1.emw.tEmodex_1

When I change the direction of the magnetic field to the y direction, the simulation runs. However, I need it in the z one and I cannot understand from the error message what it is that I have to change. Anyone can help?


1 Reply Last Post 2019年2月11日 GMT-5 09:54
Magnus Olsson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 2019年2月11日 GMT-5 09:54

Dear Giulio,

My guess is that something is inconsistent the way you set up the model but the information you supply is not sufficient. What feature do you use to excite the model, for example Port, Scattering Boundary Condition, Background Field (Scattered Field Formulation)? Can you share your model?

-------------------
Magnus
Dear Giulio, My guess is that something is inconsistent the way you set up the model but the information you supply is not sufficient. What feature do you use to excite the model, for example Port, Scattering Boundary Condition, Background Field (Scattered Field Formulation)? Can you share your model?

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.