Converting Piecewise function to Heaviside equation

In summary: Simon. i am confused on what to use as the definition of the heaviside function. i encountered the 3 definitions that sir Bruce mentioned but i don't know which one to follow. i'm sorryso, what is the definition of the heaviside function that i should follow sir? :smile:and by the way sir Simon, the question asks me to convert a particular piece wise function to a heaviside equation. but i got stuck when it comes to the u2(t). i don't know what to do with it. i am really sorry if i am asking too many questions. i am really confused with this topic. :smile:Hmmm... I see.
  • #1
alexjesse
3
0
Good day! I would just like to ask on how to convert a particular piece wise function to a heaviside equation.

For a function,

f(t) = t2 if t < 2
t - 1 if t >= 2

the heaviside equation would be,

H(t) = t + (t-1 -t)u2(t)
or
H(t) = t - u2(t)

but i can't comprehend on how to solve the following function,

g(t) = t if t < 2
0 if t = 2
t if t > 2

i tried solving it, and i my answer is

H(t) = t + (0-t)u2(t) + (t-0)u2(t)
or
H(t) = t

did i do it right? thanks :smile:
 
Physics news on Phys.org
  • #2
hi alex! welcome to physicsforums :)

for the first example, I don't think that is right. H(t) = t - u2(t) means that for t<2, you get H=t. But that's not right, since you want it to be t2 for this case.
 
  • #3
Hmm... intreguing notiation, what would happen is the peicewise boundary was at ##\small t=<\text{not an integer}>## like t=3.5 ... so you'd write ##u_{3.5}(t)## ? Why not ##u(t-3.5)## ?

in general, you have a boundary at t=b, you want f(t) to apply for t<b and g(t) to apply for t>b.

H=f(t) is fine right up until t=b, after that you want to remove f(t) and replace it with g(t).
Can you write the heaviside version of that down?

The trick is to be careful with the substitutions.
 
  • #4
alexjesse said:
Good day! I would just like to ask on how to convert a particular piece wise function to a heaviside equation.

For a function,

f(t) = t2 if t < 2
t - 1 if t >= 2

the heaviside equation would be,

H(t) = t + (t-1 -t)u2(t)
or
H(t) = t - u2(t)

but i can't comprehend on how to solve the following function,

g(t) = t if t < 2
0 if t = 2
t if t > 2

i tried solving it, and i my answer is

H(t) = t + (0-t)u2(t) + (t-0)u2(t)
or
H(t) = t

did i do it right? thanks :smile:

Exactly what definition of the Heaviside function are you employing? There are three common definitions of H(x); they all use H(x) = 0 if x < 0 and H(x) = 1 if x > 0. Where they differ is in their treatment of H(0): some use H(0) = 1, some use H(0) = 0 and some use H(0) = 1/2. How you deal with your problem (if you can at all) depends on how you treat H(0).
 
  • #5
Thank you so much for the response good sirs :smile:
BruceW said:
hi alex! welcome to physicsforums :)

for the first example, I don't think that is right. H(t) = t - u2(t) means that for t<2, you get H=t. But that's not right, since you want it to be t2 for this case.

Sorry for that sir Bruce. I missed to proofread that part..that's suppose to be H(t) = t2 - u2(t)

Simon Bridge said:
Hmm... intreguing notiation, what would happen is the peicewise boundary was at ##\small t=<\text{not an integer}>## like t=3.5 ... so you'd write ##u_{3.5}(t)## ? Why not ##u(t-3.5)## ?

in general, you have a boundary at t=b, you want f(t) to apply for t<b and g(t) to apply for t>b.

H=f(t) is fine right up until t=b, after that you want to remove f(t) and replace it with g(t).
Can you write the heaviside version of that down?

The trick is to be careful with the substitutions.

Sorry for that notation sir Simon. i was just following the notation uc(t) in preparation for an inverse Laplace transform:
L(uc(t)) = (e-cs)/s

Going back on the heaviside version on what you have given then is it
H = f(t) + (g(t)-f(t))u(t-b) ?

but what if you are given H = f(t) which is fine until t < b, then at t = b you want to remove f(t) and replace it with g(t), then at t> b you want to remove g(t) and replace it with k(t).

How do i then write this in heaviside then?

thank you very much for the help! :smile:
 
  • #6
alexjesse said:
Sorry for that sir Bruce. I missed to proofread that part..that's suppose to be H(t) = t2 - u2(t)
mm, it's still not right. if t>2, then it does not give the right answer. More proofreading required maybe :)
 
  • #7
alexjesse said:
Going back on the heaviside version on what you have given then is it
H = f(t) + (g(t)-f(t))u(t-b) ?
looks good to me.

alexjesse said:
but what if you are given H = f(t) which is fine until t < b, then at t = b you want to remove f(t) and replace it with g(t), then at t> b you want to remove g(t) and replace it with k(t).
are you actually asked to do this, or are you just wondering?
 
  • #8
alexjesse said:
Going back on the heaviside version on what you have given then is it
H = f(t) + (g(t)-f(t))u(t-b) ?

but what if you are given H = f(t) which is fine until t < b, then at t = b you want to remove f(t) and replace it with g(t), then at t> b you want to remove g(t) and replace it with k(t).

How do i then write this in heaviside then?
As already pointed out: depends on your definition of the Heaviside ;)
The trick is to make sure you are multiplying by zero at that point. (or by 1 ... the values elsewhere can be accommodated by adjusting f and g and k.)
Off the question I am guessing that u(t) is not zero at t=0... so you need to rearrange it to change that.

Look at: 2u(t)-1 perhaps, or u(-t), 1-u(t), for clues.
But it is difficult to guide you without the definition you are using.
 
Last edited:
  • #9
Simon Bridge said:
As already pointed out: depends on your definition of the Heaviside ;)
The trick is to make sure you are multiplying by zero at that point. (or by 1 ... the values elsewhere can be accommodated by adjusting f and g and k.)
I'm guessing this is not possible by just using Heaviside functions though... unless he uses different types of Heaviside functions, which could get confusing.

and by 'different types' I mean like, one is for x>a and another is for x>=a.
 
  • #10
I'm guessing this is not possible by just using Heaviside functions though.
Notice: if you can make an effective function h with behavior:

h(t)= 0:t=0, 1:t≠0
(Finding h is implied in the problem statement in post #1.)

then 1-h(t)=1:t=0, 0:t≠0

something like: fu(-t)+gu(t)+[k-(g+f)u(0))(1-h(t)] gives f:t<0, g:t>0, k:t=0.
the u(0) is needed to account for the different definitions.

Does that work? - need coffee.
Checking:

t<0: 1f + 0g + 0[k - (g + f)u(0)] = f
t>0: 0f + 1g + 0[k - (g + f)u(0)] = g
t=0: u(0)f +u(0)g + 1[k - (g + f)u(0)] = u(0)[(g + f) - (g + f)] + k = k
 
  • #11
Simon Bridge said:
Notice: if you can make an effective function h with behavior:

h(t)= 0:t=0, 1:t≠0
(Finding h is implied in the problem statement in post #1.)
can you really call that a Heaviside step function though? maybe that is OK, it just seems strange, since I've not seen that kind of Heaviside step function before.
 
  • #12
BruceW said:
can you really call that a Heaviside step function though?
No, of course not! Which is why I didn't. I said:
me said:
Notice: if you can make an effective function h with behavior:...

Please read the definitions step more carefully.

h(t) has to be constructed from heaviside step functions.
Since it is the answer to one of the problems in post #1 it is against the rules for me to show you how it's done.

I have to wait for OP to get back to us ... then I can maybe do the next hint.
Oh all right ... hint: it's easiest with the u(0)=1/2 definition.
If you cannot wait - pm me. (after all, I could be wrong :) )

Aside: another exercise is to see if you can use one to the step function types to make each of the other ones. If you can, then your observation that you need to be able to use more than one type is not an obstacle.
 
  • #13
@alexjesse: how did you get on?
 
  • #14
It's been more than 2 weeks since the thread was started - homework is usually due in 1-2 weeks so it's probably safe to let people off the hook. Presumably alexjesse intends to return to say what the actual answers were, so he can help other people ;) ??
##\renewcommand{\u}{\text{u}} \renewcommand{\h}{\text{h}}##

Using
##\u(t)=\left \{
\begin{array}{rl}
0 & :\; t<0;\\
\frac{1}{2} & :\; t=0;\\
1 & :\; t>0
\end{array}
\right .## means that: ##\; (2\u-1)^2 = \left \{
\begin{array}{rl}
1 & :\; t<0;\\
0 & :\; t=0;\\
1 & :\; t>0
\end{array}
\right .##

... looks promising. With that in mind:

Indexing the other two step-function definitions by the value they take at t=0, so we can tell them apart, gives:

##\u_0(t)=\left \{
\begin{array}{rl}
0 & :\; t\leq0;\\
1 & :\; t>0
\end{array}
\right .## and ##\; \u_1(t)=\left \{
\begin{array}{rl}
0 & :\; t<0;\\
1 & :\; t \geq 0
\end{array}
\right .##

Define h(t) from post #10 as follows:

##\h(t) = \left \{
\begin{array}{rl}
0 & :\; t<0;\\
1 & :\; t=0;\\
0 & :\; t>0
\end{array}
\right .##

I can express h(t) in terms of each of the step-function definitions as follows:

##\h(t)=1-\big(2\u(t)-1\big)^2=\u_1(-t)+\u_1(t)-1 = 1-\frac{1}{2}\big(u_0(-t)+u_0(t)\big)##

I haven't put these in their simplest form - this is so you can see the reasoning (and correct any mistakes I may have made)...

Using h(t) you can convert any of the definitions into any of the others.
i.e. converting ##\u_0## and ##\u_1## into ##\u##:

##\u=\u_1-\frac{1}{2}\h = \u_0+\frac{1}{2}\h##

From these observations, it should be possible to construct any piece-wise function from Heaviside step functions ... with the possible exception of stuff like Cantor's staircase.
 

1. What is a piecewise function?

A piecewise function is a mathematical function that is defined by different equations or rules for different intervals or parts of the domain. In other words, the function has different definitions depending on the input value.

2. How is a piecewise function different from a regular function?

A regular function has one definition for the entire domain, while a piecewise function has multiple definitions for different intervals of the domain. This allows for more flexibility in representing complex mathematical relationships.

3. What is a Heaviside equation?

A Heaviside equation, also known as the Heaviside step function, is a mathematical function that returns 0 for negative inputs and 1 for positive inputs. It is commonly used to represent a switch or threshold in a system.

4. Why would you need to convert a piecewise function to a Heaviside equation?

Converting a piecewise function to a Heaviside equation can help simplify the function and make it easier to work with. It can also make it easier to represent the function in a graph or in other mathematical operations.

5. How do you convert a piecewise function to a Heaviside equation?

To convert a piecewise function to a Heaviside equation, you need to identify the intervals or parts of the domain where the function has different definitions. Then, you can rewrite the function using the Heaviside function notation, with the different definitions for each interval. This process may require some algebraic manipulation and simplification.

Similar threads

  • Calculus and Beyond Homework Help
Replies
0
Views
158
  • Calculus and Beyond Homework Help
Replies
3
Views
568
  • Calculus and Beyond Homework Help
Replies
1
Views
702
  • Calculus and Beyond Homework Help
Replies
7
Views
272
  • Calculus and Beyond Homework Help
Replies
5
Views
216
  • Calculus and Beyond Homework Help
Replies
2
Views
150
  • Calculus and Beyond Homework Help
Replies
1
Views
81
  • Calculus and Beyond Homework Help
Replies
10
Views
2K
  • Calculus and Beyond Homework Help
Replies
7
Views
553
  • Calculus and Beyond Homework Help
Replies
2
Views
314
Back
Top