0

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 ?

Litun
  • 670

2 Answers2

2

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

Jean-Sébastien
  • 4,623
  • 1
  • 17
  • 39
  • 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
1

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<t,0)$;

$\text{plot}(f(t),t=t_1..t_2);$

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

Mikasa
  • 67,374