How to plot the the following function in Maple 12?

782 Views Asked by At

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 ?

2

There are 2 best solutions below

2
On BEST ANSWER

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

2
On

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.