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 ?
How to plot the the following function in Maple 12?
2 Answers
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
-
0Nice, 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 – 2012-10-10
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:
$f:=t->\text{piecewise}(t=0,a,t<0,\text{exp}(-b*t),0
; $\text{plot}(f(t),t=t_1..t_2);$
wherein $t_1$ and $t_2$ are some constats.
-
0@Jean-Sébastien: Oh! Thanks. I see you attempt to plot his function by employing **animate** command. Great one! :) – 2012-10-10