Repeat Maple Piecewise Plot

时间:2017-10-12 10:05:34

标签: plot maple piecewise

I have:

h(t):=piecewise(0<=t<2,2-t,2<=t<=3,2t-4)

Then I use:

plot(h(t),t=0..6,y=-1..3,scaling=constrained)

My intention was to create a period of 2 by making a larger interval. This didn't solved my problem.

How would I be able to create two periods in the plot?

1 个答案:

答案 0 :(得分:0)

希望我已经理解了目标。

restart;

h:=t->piecewise(0<=t and t<2,2-t,2<=t and t<=3,2*t-4):

H:=proc(t,p::realcons)
     local P,T;
     if not t::realcons then
       return 'procname'(args);
     end if;
     P:=evalf(p);
     T:=frem(t-P/2,P)+P/2;
     h(T);
end proc:

plot(H(t,3), t=0..6, y=-1..3);

enter image description here

plot(H(t,3), t=-12..12, y=-1..3);

enter image description here