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.

Arrow volume expression

Please login with a confirmed email address before reporting spam

In the result temw.Hx and the coordinate x are both vectors. I want to use d(temw.Hx, x) as the expression for the arrow, so I want to take the modulus of the coordinate x and change the expression to d(temw.Hx, abs(x)). But the system reminds that x and y in d(x, y) must be variables。


3 Replies Last Post 22.11.2023, 09:46 GMT-5
Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 21.11.2023, 13:55 GMT-5
Updated: 1 year ago 21.11.2023, 13:55 GMT-5

The quantities temw.Hx and x are both scalars. However, they are components of vectors and , respectively. The expression should give you the derivative of with respect to . For x>=0, this should be the same as the derivative with respect to abs(x). For x<0, this would simply flip the sign of the derivative. So if I were you, and if I truly needed the derivative with respect to |x|, then I would construct the derivative of temw.Hx with respect to x and (again, only if I had a good physics-based reason to do so) mutiply it by -1 for all cases where x<0. For example, just might do the job.

-------------------
Scientific Applications & Research Associates (SARA) Inc.
www.comsol.com/partners-consultants/certified-consultants/sara
The quantities temw.Hx and x are both scalars. However, they are *components* of vectors (temw.Hx, temw.Hy,temw.Hz) and (x,y,z), respectively. The expression d(temw.Hx, x) should give you the derivative of temw.Hx with respect to x. For x>=0, this should be the same as the derivative with respect to abs(x). For x

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 22.11.2023, 09:22 GMT-5

when I do d(temw.Hz,y) - d(temw.Hy,z), d(temw.Hx,z) - d(temw.Hz,x), d(temw.Hy,x) - d(temw.Hx,y) for the x y and z components, nothing is showing up on the arrows.Do you know the reason for this?

when I do d(temw.Hz,y) - d(temw.Hy,z), d(temw.Hx,z) - d(temw.Hz,x), d(temw.Hy,x) - d(temw.Hx,y) for the x y and z components, nothing is showing up on the arrows.Do you know the reason for this?

Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 22.11.2023, 09:46 GMT-5
Updated: 1 year ago 22.11.2023, 09:45 GMT-5

I suggest you post your .mph file to the forum.

-------------------
Scientific Applications & Research Associates (SARA) Inc.
www.comsol.com/partners-consultants/certified-consultants/sara
I suggest you post your .mph file to the forum.

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.