Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I was wondering why won't mathematica give a result where the function is also Log10, instead it gives the ordinary Log. Is it because the Log fits the problem better than the Log10 or... ?

Clear[x, a, b, c, d]

Data = {{0, 0}, {1, 6.91}, {2, 9.2}, {3, 11.4}, {4, 13.4}, {24, 
    39}, {25, 40.5}};

aa = NonlinearModelFit[Data, {a + b*Log10[c*x + d], c > 0, d > 0}, {a, b, c, d}, x];

aa // Normal

Show[Plot[aa[x], {x, 0, 100}, PlotRange -> All], ListPlot[Data, PlotStyle -> Directive[Red, PointSize[0.02]]]]
share|improve this question
    
Just type Log10[x] on a line and execute. What do you see? –  Sjoerd C. de Vries Jun 6 at 8:13
1  
add comment

1 Answer 1

up vote 4 down vote accepted

The natural logarithm is the logarithm of mathematics. Hence, that's what Mathematica will use in results where a logarithm is present.

You can transform the expression if you really need to "see" things using common log, e.g. (many ways to do this, and see Rahul's comment on an equivalent result...):

Replace[Normal@aa, Log[val_] :> Defer[Log10[val^Log[10]]], Infinity]
share|improve this answer
1  
I feel Log[val_] :> Log[10] Defer[Log10[val]] is more what is desired: $-75.4281+47.393 \log _{10}(9.28813 x+41.0739)$ rather than $-75.4281+20.5825 \log _{10}\left((9.28813 x+41.0739)^{\log 10}\right)$. –  Rahul Narain Jun 6 at 8:12
1  
@RahulNarain: You're probably right, since they're equivalent I suppose it depends where one wants the Log[10] to appear... –  rasher Jun 6 at 8:22
1  
@RahulNarain: Um, I agree with you, had already updated my answer to point to your comment... –  rasher Jun 6 at 8:35
    
Thank you both for your contribution. The result is now displayed with a log10, which is what I originaly expected from Mathematica, but didn't get. –  user 3 50 Jun 6 at 14:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.