2

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]]]]
Kuba
  • 136,707
  • 13
  • 279
  • 740
user 3 50
  • 157
  • 9

1 Answers1

4

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]
ciao
  • 25,774
  • 2
  • 58
  • 139
  • 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)$. –  Jun 06 '14 at 08:12
  • 1
    @RahulNarain: You're probably right, since they're equivalent I suppose it depends where one wants the Log[10] to appear... – ciao Jun 06 '14 at 08:22
  • 1
    @RahulNarain: Um, I agree with you, had already updated my answer to point to your comment... – ciao Jun 06 '14 at 08: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 06 '14 at 14:15