Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to plot $\quad f(t) = \begin{cases} a, & \text{if $t=0$ } \\ e^{-b.t}, & \text{if $t>0$} \\ 0, & \text{if $t<0$} \end{cases} $ using maple 12 ?

share|cite|improve this question
up vote 2 down vote accepted

What you can do is animate the plot for one of the parameters, fixing the other one. The interesting parameter is of course $b$ since $a$ is just a single value at $x=0$. The following command animates the function for $b$ between $0$ and $5$ and gives a general idea of how the function behave when $b$ gains in magnitude.

f:=t->piecewise(t=0,a,t<0,exp(-b*t), t>0,0);

a:=1; #this can be anything you want

animate(plot,[f(x),x=-5..5,y=0..100],b=0..5,frames=100); #play with the values of b and the number of frames

share|cite|improve this answer
If a and b are not yet assigned values then another way to investigate the behaviour is with, say, plots:-interactiveparams(plot, [piecewise(t=0,a,t<0,exp(-b*t), t>0,0), t=-2..2,view=0..6,discont=true, thickness=2], a=0.0..2.0,b=-10.0..2.0); – acer Oct 10 '12 at 17:18
Nice, I didn't know about this one, feel free to add it to and answer of your own if you want, or I can edit mine to include it – Jean-Sébastien Oct 10 '12 at 17:34

It can't be done unless you give Maple the values $a$ and $b$. If we know these values then you can put them in the following command:



wherein $t_1$ and $t_2$ are some constats.

share|cite|improve this answer
It should be f:=t-> in your definition – Jean-Sébastien Oct 10 '12 at 13:45
@Jean-Sébastien: Oh! Thanks. I see you attempt to plot his function by employing animate command. Great one! :) – Babak S. Oct 10 '12 at 14:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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