2
$\begingroup$

I tried to execute this simple command

Plot[Cosh[t] - Sinh[t] + Sin[t], {t, 0, 40}]

and this is the result I got

enter image description here

As you can see, there is an unexpected visual between $t=30$ and $t=40$. But when I used the identity $e^{-t}=\cosh{t}-\sinh{t}$, everything went fine. This command

Plot[Exp[-t] + Sin[t], {t, 0, 40}]

gives

enter image description here

What's going on here? Can anyone reproduce this result? Is this a bug? I'm using MMA 12 64bit on Windows 10.

$\endgroup$
4
  • $\begingroup$ Try the MaxRecursion option for Plot. It is generally used to control adaptive sampling. $\endgroup$
    – Lotus
    Commented Feb 9, 2020 at 10:30
  • 4
    $\begingroup$ Both $\cosh x$ and $\sinh x$ functions are diverging at large positive $x$ as $e^x$. For these values are hard to achieve perfect cancellation between the two functions. $e^{-x}$ does not have this problem. Use WorkingPrecision -> 30 option of Plot to get the same result. $\endgroup$
    – yarchik
    Commented Feb 9, 2020 at 10:57
  • $\begingroup$ Plot[Cosh[t] - Sinh[t] + Sin[t], {t, 0, 40}, PlotPoints -> 4] this can partly solve it. $\endgroup$ Commented Feb 9, 2020 at 15:35
  • $\begingroup$ The same happens for me (v11 on Windows 10), WorkingPrecision -> 20 corrects it. $\endgroup$ Commented Feb 10, 2020 at 7:25

1 Answer 1

-1
$\begingroup$

I think there is a problem with your main file. I tried your command and the result is ok. My Mma version is 12.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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