> readlib(laplace);f:=proc(x,k) local y,z;y:=2^k*x;y:=y-floor(y);z:=Heaviside(y-1/2);z end; proc(expr,t,s) ... end f := proc(x,k) local y,z; y := 2^k*x; y := y-floor(y); z := Heaviside(y-1/2); z end > # The point of the Laplace readin is to get the Heaviside function. # Maple is picky about Boolean evaluations in functions, and this lets # us write the condition that if y>1/2 then z=1 else z=0 in a form that # gets around this quirk. # Thanks to Doug Keenan for pointing out that the function was off by *3. -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- > g:=proc(x) sum(3^(-k-1)*evalf(f(x,k)),k=0..10)end; g := proc(x) sum(3^(-k-1)*evalf(f(x,k)),k = 0 .. 10) end -------------------------------------------------------------------------------- > plot(g(x),x=0..1); -------------------------------------------------------------------------------- >