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.

2D Arrow Surface Plot -- Arrow Length Logarithmic

Please login with a confirmed email address before reporting spam

Hello,

I am plotting a 2D Surface with an arrow surface. I need to scale my arrows logarithmically, but I am unsure whether this scaling is a natural logarithm or a base 10 logarithm. Which is it? The COMSOL Multiphysics User Guide states:

"Logarithmic, so that the length of the arrows is proportional to the logarithm of the
magnitude of the quantity they represent. This makes arrows representing small
values relatively larger. The value in the Range quotient field (default: 100)
determines the ratio between the smallest and largest values in the range of values
for the logarithmic arrow length."

If this is a natural logarithm, is there any way that I can scale my arrows with a base 10 logarithm? I will have some negative values in my vectors, so taking a log10 before plotting is not an option.

Thanks,
Lauren

3 Replies Last Post 10 mai 2013, 10:06 UTC−4
Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 mai 2013, 02:15 UTC−4

If this is a natural logarithm, is there any way that I can scale my arrows with a base 10 logarithm? I will have some negative values in my vectors, so taking a log10 before plotting is not an option.


It's the vector's length that is used to compute the scaling, not the individual components, so negative values in the components don't pose a problem.


[QUOTE] If this is a natural logarithm, is there any way that I can scale my arrows with a base 10 logarithm? I will have some negative values in my vectors, so taking a log10 before plotting is not an option. [/QUOTE] It's the vector's length that is used to compute the scaling, not the individual components, so negative values in the components don't pose a problem.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 mai 2013, 09:53 UTC−4
I guess what I was trying to say is that I cannot manually enter a different equation (like "log10(my vector)") in the x and y components for my vectors (because there are negative values in my vectors) and then leave the arrow length setting as "proportional." I know that the arrow length setting "logarithmic" only scales the magnitude.

But I would still like to know if the arrow length setting "logarithmic" is a base e or a base 10 log.

Thanks.
I guess what I was trying to say is that I cannot manually enter a different equation (like "log10(my vector)") in the x and y components for my vectors (because there are negative values in my vectors) and then leave the arrow length setting as "proportional." I know that the arrow length setting "logarithmic" only scales the magnitude. But I would still like to know if the arrow length setting "logarithmic" is a base e or a base 10 log. Thanks.

Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 mai 2013, 10:06 UTC−4

I guess what I was trying to say is that I cannot manually enter a different equation (like "log10(my vector)") in the x and y components for my vectors (because there are negative values in my vectors) and then leave the arrow length setting as "proportional."


Applying transformations such as log10() to the components of the vector would change its direction, so this approach doesn't work. If you want the control the length scaling yourself, you have to define the vector components in a way that takes its length into account. Suppose that the components are {A, B, C}. Then you can use {A/sqrt(A*A+B*B+C*C), B/sqrt(A*A+B*B+C*C), C/sqrt(A*A+B*B+C*C)} to scale the vector's length to 1. Using more complicated expressions, you can create any transform.


But I would still like to know if the arrow length setting "logarithmic" is a base e or a base 10 log.


The base is e.


[QUOTE] I guess what I was trying to say is that I cannot manually enter a different equation (like "log10(my vector)") in the x and y components for my vectors (because there are negative values in my vectors) and then leave the arrow length setting as "proportional." [/QUOTE] Applying transformations such as log10() to the components of the vector would change its direction, so this approach doesn't work. If you want the control the length scaling yourself, you have to define the vector components in a way that takes its length into account. Suppose that the components are {A, B, C}. Then you can use {A/sqrt(A*A+B*B+C*C), B/sqrt(A*A+B*B+C*C), C/sqrt(A*A+B*B+C*C)} to scale the vector's length to 1. Using more complicated expressions, you can create any transform. [QUOTE] But I would still like to know if the arrow length setting "logarithmic" is a base e or a base 10 log. [/QUOTE] The base is e.

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.