Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Problem with unit step function

  1. Mar 29, 2012 #1
    1. The problem statement, all variables and given/known data

    I'm having trouble with part b and part d, where there is some kind of ramp function involved
    http://img845.imageshack.us/img845/7507/76500775.jpg [Broken]

    3. The attempt at a solution

    For part b, I calculated the gradient of that ramp, and the intercept which gives y = -x + 4, which would mean it's the function (t - 4)

    The other parts of the function are 2u(t-2) and -2u(t-4) ; which are the rise and fall respectively. So I multiplied (t-4) by these two and it's not the same graph:


    The solutions give (t-4)*(u(t-2)-u(t-4) - which now gives the correct graph. However, I don't understand why since it rises to 2u and drops by 2u, how did the constant two disappear?

    Also the equation here is simplified to 2u(t − 2) − r(t − 2) + r(t − 4) - which I do not understand as to where an r came from.

    Similarly for part d, I calculate the gradient and intercept, which gives y = -x for the slope, which gives the function (-t), and this shold be multiplied through like (-t)(u(t-1) - 2u(t-2)) I would have thought, but once again in the solution that 2 has disappeared from 2u(t-2)

    Can someone explain?
    Last edited by a moderator: May 5, 2017
  2. jcsd
  3. Mar 29, 2012 #2
    what does t*u(t) look like?
  4. Mar 29, 2012 #3
    It's a slope starting at the origin, I guess it's the ramp function?
  5. Mar 29, 2012 #4
    Yup. With slope +1. How can you change the slope?
  6. Mar 29, 2012 #5
    Why does the function become t - 4 if you just said it is -t +4? We can just evaluate your two equations and see they are wrong. Consider t = 2 where you should compute 2:
    [tex](2-4)(2u(2-2)-2u(2-4))=(2-4)(2u(0)-2u(-2))=(-2)(2-0) = -4[/tex]
    and the other
    [tex](2-4)(u(2-2)-u(2-4))=(2-4)(u(0)-u(-2))=(-2)(1-0) = -2[/tex]

    The answer should be
    the test:

    The reason the two isn't there is you find the linear line as if you had the entire function and no start or end. You did this, finding v = -t + 4. You then multiply it by a rectangle to make it nonzero only between 2 and 4. You do this by multiplying (u(t-2) - u(t-4)). the first unit step will trigger to 1 at t = 2 and stay there forever after. The second will become 1 at t = 4 and stay there forever after. So the quantity is 1 between 2 and 4. It then is 1 - 1 = 0 after 4 forever. And before t = 2, both were zero, so you had 0+0 = 0.

    edit: and the simplification uses a function defined as
    [tex]r(t) = tu(t)[/tex]
    So in the answer, everything is 0 before t = 2. The unit step itself and the two unit steps in the ramp functions both will be negative, making them equal zero. When you get to t = 2, the unit step returns a 1 and is then multiplied by two. So at that moment, you have v = 2. The first ramp also starts at that moment, but it equals zero still. It is (t - 2)u(t-2), so (2-2)u(2-2) = 0*1 = 0. The ramp then subtracts more and more as you go toward 4 (with slope -1). Just do the math to see it:
    [tex]2u(t-2)-(t-2)u(t-2)= \left (2-t+2 \right) u(t-2) = \left (4 - t \right) u(t-2)[/tex]
    t = 2.5
    [tex]\left (4 - 2.5 \right) u(2.5-2)=\left (1.5 \right) u(.5)=(1.5)(1) = 1.5[/tex]
    t = 3
    [tex]\left (4 - 3 \right) u(3-2)=\left (1 \right) u(1)=(1)(1) = 1[/tex]
    until at t = 4, it equals zero.

    But if you leave the above unchecked, it will just continue to become more negative linearly. So the second ramp function provides a positive increase at the same rate to counteract it, and it starts exactly at t = 4 where you need it. We have
    [tex]2u(t-2) - (t-2)u(t-2) + (t-4)u(t-4)[/tex]
    But if we are analyzing when t >= 4, all of the unit steps are "1" and simply go away:
    [tex]2 - (t-2)+ (t-4)=2-t+2+t-4=0[/tex]
    Last edited by a moderator: May 5, 2017
  7. Mar 29, 2012 #6
    Sorry, I meant (4 - t), I did it correctly on paper, but misread it when typing it back up. Reading your post fully now!
  8. Mar 29, 2012 #7
    Can you explain this bit a little more:

    So if it's triggering to 1 at t = 2, why is it reaching 2V at t = 2? What you said makes sense now mathematically, but I do not understand how it's triggering to 1, yet graphically going to 2V, because 2V means it should be 2u(t - x)

    Thanks a lot for the detailed explanation by the way, this really made clear things not pointed out in the lecture.
  9. Mar 29, 2012 #8
    It's because the unitstep is being multiplied by 2 since you multiply it by (-t+4) = (-2+4) = (2). So that function you determined is what changes the height.

    Think about the function you want and the unitsteps separately.The function you determined, when graphed, already has the correct height for the domain you need. You simply need to multiply that function g(t) by another function rectangle(t) that is zero everywhere you want zero and 1 everywhere you want to have g(t). I recommend you graph -t + 4 and u(t-2) - u(t-4) on 2 different graphs with the same scale next to each other. Then, conceptually multiply the two graphs together.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook