# Thread: Looking for a math genius

1. ## Looking for a math genius

Hey folks.

I'm attempting to use Revit's Log function in a formula, and I'm not getting results that agree with Excel. We've tried two ways, and I admit to not being a math genius, and never really liking Logs in the first place. We've tried the two versions below:

= (16.649*(log(<parameter name>)/(log(exp(1))))-15.222)

and

= (16.649 * log(<parameter name>) - 15.222)

In both cases when using a parameter value of 30 Revit returns a value around 10.4 or something, in Excel we get a value of about 41.4 which we know to be accurate. I think I'm misunderstanding something about how Revit processes logs? Can anyone help?

Thanks much,
-Robert

2. ## Re: Looking for a math genius

Is it something to do with the assumed base value of the LOG function? I.e. is one of them assuming the LOG function uses base 10, while the other is a Natural LOG using a base 2.71828182845904. Usually, Natural LOGs have a separate function called "LN", that is the same as LOG base 2.71828182845904. However, I don't see LN as a valid function in Revit formulas.

3. ## Re: Looking for a math genius

The natural logarithm (logarithm base e, the mathematical constant of ~2.71828 ) is what gives the 41.4 result. I guess that is what Excel is using, although I would think Excel would recognize the difference between a "log" command (log base 10) and a "ln" command (natural log).

You can convert to a different log base. Do this with the following: (log (parameter)) / (log (needed base)).

So log base 10 of a number can be achieved by dividing the natural log of your parameter by the natural log of 10. Or vice versa, dividing log base 10 of your parameter by log base 10 of "e" (2.7182 will approximately give you the natural log of the number.

Now I wouldn't call myself a genius, although I took some Calculus classes, but I did have to look up all of this. http://en.wikipedia.org/wiki/Logarithm#Change_of_base

Now I should note that I could not get a result of 10.4 using either log base 10 or the natural logarithmic function. So what Revit is calculating, I'm not really sure.

4. ## Re: Looking for a math genius

Well you obviously remember your calculus better then I do. The really strange thing is, in Revit if use the formula suggusted (which I had already) I get the same 10.4 result if I have log(exp(1)) or log(10) as the piece after the divide symbol.

Very strange....

5. ## Re: Looking for a math genius

Doing a little algebra it appears that a log base 9.1163... would be required to get the result of around 10.4.... that you described. That is the weirdest thing I've ever heard of.

I'm going by the 2nd formula in your original post.

6. ## Re: Looking for a math genius

Originally Posted by patricks
Doing a little algebra it appears that a log base 9.1163... would be required to get the result of around 10.4.... that you described. That is the weirdest thing I've ever heard of.

I'm going by the 2nd formula in your original post.
This is why I feel like I'm doing something wrong.

If you plug either of my original formulas into the family editor, what do you get for a result if you put in "35" for the parameter value?

7. ## Re: Looking for a math genius

Originally Posted by robert.manna
This is why I feel like I'm doing something wrong.

If you plug either of my original formulas into the family editor, what do you get for a result if you put in "35" for the parameter value?
35 gives me 10.4. I was using 30 from your original post which was giving me 9.371.

So the logarithmic function in Revit is log base 10.

What you used in Excel is the natural logarithm. To get that in Revit I think you'll have to divide (log (parameter) / log (2.71828 ).

8. ## Re: Looking for a math genius

But the, instead of "2.718", should I not be able to use "exp(1)" which according to the Revit syntax guide , should be e raised to the first power, which should be e, without having to worry about decimal accuracy in e? But, possibly raising e to the first just doesn't work, and I'll stick with your suggustion.

-R

9. ## Re: Looking for a math genius

umm... wow. Revit does "e" COMPLETELY wrong. e^1 should be 2.71828.... but instead it's 10 in Revit.

Looks to me like Revit is treating e like the inverse of the common logarithmic base 10 function.

10. ## Re: Looking for a math genius

Most definitely not a math genius...grocery store math is more my speed... I'm curious though, any chance Project and Parameter Units are affecting this somehow?

Page 1 of 3 123 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•