9
$\begingroup$

Update June 25, 2023. Problem still there in V 13.3. Added screen shot at end.


I was trying code which worked all the time:

How to extend a function by period and display it

I find that in V 13.2 it now gives

Mathematica graphics

Why is that? has something changed in V 13.2 to explain this?

Below I will give the code in plain text, and then screen shot showing it works in V 13.1 but not in V 13.2. This is all done from clean kernel and on windows 10.

T = 2; (*period*) f[x_] := -((E^x + E^(-x))/2); fExtended[x_] := Piecewise[{{f[x], -T/2 < x < T/2}, {fExtended[x - T], x > T/2}, {fExtended[x + T], x < T/2}}]; Plot[fExtended[x], {x, -2*T, 2*T}, AxesOrigin -> {0, 0}, AxesOrigin -> {0, 0}] 

Mathematica graphics


Mathematica graphics


Mathematica graphics


enter image description here

$\endgroup$
14
  • 3
    $\begingroup$ Plot tries first to simplify f symbolically. Because of fExtended[x - T] this creates a recursion. If you restrict f to numerical values you can prevent the recursion: fExtended[x_?NumericQ] :=... Why this worked in 13.1 I do not know. $\endgroup$ Commented Jan 19, 2023 at 11:19
  • 2
    $\begingroup$ TerminatedEvaluation is new. Maybe in the old version the Plot has already generated recursion limit message but been suppressed. $\endgroup$ Commented Jan 19, 2023 at 14:03
  • 3
    $\begingroup$ Probably a bug. Will investigate. $\endgroup$ Commented Jan 19, 2023 at 17:38
  • 3
    $\begingroup$ Reported as a bug. $\endgroup$ Commented Jan 26, 2023 at 19:19
  • 1
    $\begingroup$ Thank you for reporting. I Just encountered a similar problem with DSolve. Reevaluated an old notebook that solves a bunch of differential equations (successfully with older versions) and had one of them fail with TerminatedEvaluation["RecursionLimit"]. Setting $RecursionLimit to a value 10 times its default does make Mathematica solve the equation. $\endgroup$ Commented Feb 3, 2023 at 12:02

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.