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 Nov 22, 2023, 9:46 a.m. EST
Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 11 months ago Nov 21, 2023, 1:55 p.m. EST
Updated: 11 months ago Nov 21, 2023, 1:55 p.m. EST

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: 11 months ago Nov 22, 2023, 9:22 a.m. EST

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: 11 months ago Nov 22, 2023, 9:46 a.m. EST
Updated: 11 months ago Nov 22, 2023, 9:45 a.m. EST

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.