Initializations
> restart;
>
interface(showassumed=0);
assume(n,integer);
>
with(plots):
with(plottools):
Warning, the name changecoords has been redefined
>
The following Maple code defines the PX command which creates a periodic extension of a function. See lesson 2-4-1 for details of installation and behavior.
>
PX := proc(h, g)
local f, var, d;
if type(h, procedure) then RETURN(subs(
{'D' = rhs(g) - lhs(g), 'F' = h, 'L' = lhs(g)}, proc(
x::algebraic)
local y;
y := floor((x - L)/D); F(x - y*D)
end))
fi;
if type(g, equation) then var := lhs(g); d := rhs(g) fi;
f := unapply(h, var);
subs({'L' = lhs(d), 'D' = rhs(d) - lhs(d), 'F' = f}, proc(
x::algebraic)
local y;
y := floor((x - L)/D); F(x - y*D)
end)
end:
>