How to plot $ y(t)=-1000(\ r(t)-r(\ t-2\cdot 10^{-3})) $

42 Views Asked by At

Where $r(t)$ is the ramp function and i consider $t$ to be the independent variable (time). Wolfram gives me this result. However i'm confused why this is true. Could someone explain to me? Thanks in advance.

1

There are 1 best solutions below

0
On BEST ANSWER

Ok i have no idea what Wolfram gave me, i must have made a mistake or something. I did that in Matlab and this is the result. And it should be correct.

enter image description here

Why is it correct? Well i did it analytically by hand. Since $$ r(t-t_o)=(t-t_o)u(t-t_o) $$ where $u(t)$ is the heaviside unit step function, the function in question can be expanded to $$ y(t) = -1000tu(t)+1000(t-2\cdot 10^{-3})u(t-2\cdot 10^{-3})= -1000tu(t)+1000tu(t-2\cdot 10^{-3})-2u(t-2\cdot 10^{-3}) $$ i take various values of the function and:

  • $$ @ t=0.5\cdot10^{-3} : y=-0.5u(0.5\cdot 10^{-3}) +0.5u(-1.5\cdot 10^{-3})-2u(-1.5\cdot 10^{-3}) = -0.5 $$ since $u(-t_o)$ is zero.
  • $$ @ t=1.5\cdot10^{-3} : y=-1.5u(1.5\cdot 10^{-3}) +1.5u(-0.5\cdot 10^{-3})-2u(-0.5\cdot 10^{-3}) = -1.5 $$
  • $$ @ t=1.8\cdot10^{-3} : y=-1.8u(1.8\cdot 10^{-3}) +1.8u(-0.2\cdot 10^{-3})-2u(-0.2\cdot 10^{-3}) = -1.8 $$
  • $$ @ t=2\cdot10^{-3} : y=-2u(2\cdot 10^{-3}) +2u(0)-2u(0) = -2 $$
  • $$ @ t=3\cdot10^{-3} : y=-3u(3\cdot 10^{-3}) +3u(10^{-3})-2u(10^{-3}) = -3+3-2=-2 $$ and stays on forever at $-2$ afterwards.