Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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|improve this question

2 Answers 2

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|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:

$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.

share|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

 
discard

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.