# Problem with unit step function

• NewtonianAlch
In summary, the conversation discusses a problem involving a ramp function and finding the correct graph for a given equation. The solution involves finding the gradient and intercept, multiplying it by a rectangle function, and using a function defined as "r(t) = tu(t)" to simplify the equation. The conversation also discusses the role of unit steps in the solution and how they affect the graph.
NewtonianAlch

## Homework Statement

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

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

(t-4)*(2u(t-2)-2u(t-4)

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:
what does t*u(t) look like?

It's a slope starting at the origin, I guess it's the ramp function?

Yup. With slope +1. How can you change the slope?

NewtonianAlch said:

## Homework Statement

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

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

(t-4)*(2u(t-2)-2u(t-4)

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?
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:
$$(2-4)(2u(2-2)-2u(2-4))=(2-4)(2u(0)-2u(-2))=(-2)(2-0) = -4$$
and the other
$$(2-4)(u(2-2)-u(2-4))=(2-4)(u(0)-u(-2))=(-2)(1-0) = -2$$

$$(-t+4)(u(t-2)-u(t-4))$$
the test:
$$(-2+4)(u(2-2)-u(2-4))=(2)(u(0)-u(-2))=(2)(1-0)=2$$

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
$$r(t) = tu(t)$$
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:
$$2u(t-2)-(t-2)u(t-2)= \left (2-t+2 \right) u(t-2) = \left (4 - t \right) u(t-2)$$
t = 2.5
$$\left (4 - 2.5 \right) u(2.5-2)=\left (1.5 \right) u(.5)=(1.5)(1) = 1.5$$
t = 3
$$\left (4 - 3 \right) u(3-2)=\left (1 \right) u(1)=(1)(1) = 1$$
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
$$2u(t-2) - (t-2)u(t-2) + (t-4)u(t-4)$$
But if we are analyzing when t >= 4, all of the unit steps are "1" and simply go away:
$$2 - (t-2)+ (t-4)=2-t+2+t-4=0$$

Last edited by a moderator:
Sorry, I meant (4 - t), I did it correctly on paper, but misread it when typing it back up. Reading your post fully now!

Can you explain this bit a little more:

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.

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.

NewtonianAlch said:
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.

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.

## 1. What is the unit step function?

The unit step function, also known as the Heaviside step function, is a mathematical function that is defined as 1 for all positive input values and 0 for all negative input values. It is often used in engineering and physics to model discontinuous phenomena.

## 2. What is the problem with the unit step function?

The main problem with the unit step function is that it is not defined at the point where the input value is equal to 0. This is because the function jumps from 0 to 1 at that point, rather than having a smooth transition. This can cause issues when trying to use the function in certain calculations or applications.

## 3. How is the problem with the unit step function resolved?

The problem with the unit step function is typically resolved by using a different function, such as the sigmoid function, which has a smooth transition at the point where the input value is equal to 0. Alternatively, the unit step function can be approximated by using a small positive value instead of 0 for the input value.

## 4. What are some real-world applications of the unit step function?

The unit step function has many real-world applications, including in engineering for modeling the behavior of electrical circuits and in physics for describing the behavior of particles. It is also used in economics to model sudden changes in demand or supply, and in computer science for creating digital filters and signal processing algorithms.

## 5. Can the unit step function be generalized to higher dimensions?

Yes, the unit step function can be generalized to higher dimensions. In one dimension, the function jumps from 0 to 1 at a specific point. In higher dimensions, the function jumps from 0 to 1 along a specific surface or hypersurface. This is useful in applications such as image processing and computer graphics.

• Engineering and Comp Sci Homework Help
Replies
6
Views
1K
• Calculus and Beyond Homework Help
Replies
7
Views
469
• Engineering and Comp Sci Homework Help
Replies
1
Views
487
• Introductory Physics Homework Help
Replies
23
Views
302
• Engineering and Comp Sci Homework Help
Replies
3
Views
1K
• Engineering and Comp Sci Homework Help
Replies
3
Views
1K
• Engineering and Comp Sci Homework Help
Replies
23
Views
4K
• Engineering and Comp Sci Homework Help
Replies
16
Views
1K
• Engineering and Comp Sci Homework Help
Replies
13
Views
9K
• Engineering and Comp Sci Homework Help
Replies
1
Views
16K