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.

Finding magnitude of a vector for use in an analytic function

Please login with a confirmed email address before reporting spam

Hello,

I am hoping someone might be able to help me write an expression for the magnitude of an electric field. The electric potential is solved in the electrostatics module. I am using a 2D axisymmetric model. I hoope to implement this operator in an analytic function that depends on the magnitude of the electric field at that point.

So far I haven't been able to find any operator such as norm() or magnitude() or | | to represent the magnitude. I found an online solution for a simimlar problem in the tds module where the following was used to find the magnitude of mass flux of a certain species ineach direction. I coudn't convert this into a form that comsol would acccept for my problem.

sqrt(tds.mflux_cx^2+tds.mflux_cy^2+tds.mflux_cz^2)

Any help that anyone is able to provide would be much apreciated.

Thanks, Lee


1 Reply Last Post 13.05.2023, 19:22 GMT-4
Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 13.05.2023, 19:22 GMT-4
Updated: 2 years ago 13.05.2023, 19:25 GMT-4

es.normE is the norm (aka, magnitude) of the electric field in the electrostatics module. If you've run an electrostatics model, then that should be available. Have you tried that?

-------------------
Scientific Applications & Research Associates (SARA) Inc.
www.comsol.com/partners-consultants/certified-consultants/sara
*es.normE* is the norm (aka, magnitude) of the electric field in the electrostatics module. If you've run an electrostatics model, then that should be available. Have you tried that?

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.