Bug SS-1257
1 vote

Cannot perform operation with units in certain cases when using log10

Created by Demon on 1/27/2015 1:00 PM Last Updated by smath on 10/7/2017 1:40 AM
%
 (hrs)
Logged: 0   (hrs)

 Description

Hi,

For example, suppose I define two length variables:

d1:= 10 m       d1:= 2 m

If I define the following formula:

example(w,a):=log10(1+(w/a)^2)

and try:

example(d1,d2)=...

I obtain the error "Operation cannot be performed with units", despite the fact that the argument of the log10 is adimensional.

if you remove the "1" or substitute it with a "0", then it works. It also works if you use (w/a) instead of (w/a)^2

 

    smath (Saturday, October 7, 2017 1:40 AM) #

Issue is not actual anymore. 

Tested in 98.6484 - equation works well.

    smath (Tuesday, February 16, 2016 1:40 PM) #

This is because of symbolic optimization. Please see how log10 was simplified by the program:

test1(w,a)=-2*log10(a)+log10(a^2+w^2)

Quick fix is to set optimization for the function definition to none. I will address this issue later.