I am trying to figure out how to use the step $u(t)$ and ramp $r(t)$ functions to create the function $f(t)$ below:
$f(x) = \begin{cases}0 & \text{for } t < 0 \\ t & \text{for }-1 \lt t \lt 1 \\ 2 & \text{for }t \gt 1 \end{cases}$
The step function $u(t)$ is defined to be 1 when $t \gt 0$ and $0$ otherwise.
The ramp function $r(t)$ is defined to $t$ for $t \gt 0$ and $0$ otherwise.
So here is my thought process:
$f(t)$ has a line with a slope of 1 from [-1,1]. This looks just like the r(t) function shifted to the left by one. Hence, r(t+1). However, the problem arises after $t = 1$. $r(t+1)$ continues on with a slope of 1 infinitely, but the graph below flattens out at $t=1$. Somehow, I need to cancel out the slope of 1 by adding with a slope of -1. The only way I can get a slope of -1 is by negating $r(t)$ and shifting it to the right by 1.
This yields $r(t+1) - r(t-1)$. This will cancel out the positive slope 1 for t > 1, but this creates a problem on left side because the slope of -1 continues on to negative infinity.
I feel like I'm over thinking this problem.
I would appreciate it if somebody could explain this problem in the simplest possible way.
Also, somebody told me there is an easy way to solve problems like this by looking at where the discontinuities are and where the slopes change. The discontinuities imply using an amplitude with u(t) and slopes imply using amplitude with $r(t)$.
Would appreciate all / any advise.
Thanks.