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]]]]

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]
| improve this answer | |
  • 1
    $\begingroup$ 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)$. $\endgroup$ – user484 Jun 6 '14 at 8:12
  • 1
    $\begingroup$ @RahulNarain: You're probably right, since they're equivalent I suppose it depends where one wants the Log[10] to appear... $\endgroup$ – ciao Jun 6 '14 at 8:22
  • 1
    $\begingroup$ @RahulNarain: Um, I agree with you, had already updated my answer to point to your comment... $\endgroup$ – ciao Jun 6 '14 at 8:35
  • $\begingroup$ 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. $\endgroup$ – user 3 50 Jun 6 '14 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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