# Thread: D.E involving the heaviside step function

1. ## D.E involving the heaviside step function

Q: The differential equation y"+y=H(x)-H(x-a), where H is the heaviside step function, and a is a positive parameter, represents a simple harmonic oscillator subject to a constant force for a finite time. Solve the equation in three intervals of x and by applying appropriate matching conditions.

I've used x<0, 0<x<a and x>a as my three time intervals.
I managed to get:
y"+y=0 for x<0
y"+y=1 for 0<x<a
y"+y=0 for x>a.
Boundary conditions that I've come up with so far are y(0)=0 and y'(0)=1 and y'(a)=-1
The solutions so far that I've been able to get are:
y=0 for x<0
y=1-cosx for 0<x<a
but I'm stuck on the last time interval.
For all three intervals I used y=Asinx+Bcosx as my complementary function, and added a particular integral where neccessary, but the answers that I've been given tell me that for x>a, y=cos(x-a)-cosx. I dont see where this comes from, please enlighten me.

Edit: some1 mentioned using Laplace transforms for this but we havent covered that yet, so I'm thinking maybe there's another way to attack the question?

2. Originally Posted by free_to_fly
Q: The differential equation y"+y=H(x)-H(x-a), where H is the heaviside step function, and a is a positive parameter, represents a simple harmonic oscillator subject to a constant force for a finite time. Solve the equation in three intervals of x and by applying appropriate matching conditions.

I've used x<0, 0<x<a and x>a as my three time intervals.
I managed to get:
y"+y=0 for x<0
y"+y=1 for 0<x<a
y"+y=0 for x>a.
Boundary conditions that I've come up with so far are y(0)=0 and y'(0)=1 and y'(a)=-1
The solutions so far that I've been able to get are:
y=0 for x<0
y=1-cosx for 0<x<a
but I'm stuck on the last time interval.
For all three intervals I used y=Asinx+Bcosx as my complementary function, and added a particular integral where neccessary, but the answers that I've been given tell me that for x>a, y=cos(x-a)-cosx. I dont see where this comes from, please enlighten me.

Edit: some1 mentioned using Laplace transforms for this but we havent covered that yet, so I'm thinking maybe there's another way to attack the question?
Define three regions:

1. $x\le 0$
2. $0\le x \le a$
3. $a \le x$

Don't worry about the knots at x=0 abd x=0 being in two regions, we will meke the solution continuous there with solutions y_1(x),\ y_2(x) and y_3(x) in each of these.

Initial consitions $y_1(-1)=0,\ y'_1(-1)=0$ and continuity conditions at the knots:

$y_2(0)=y_1(0),\ y_2'(0)=y_1'(0)$
$
y_3(a)=y_2(a),\ y_3'(a)=y_2'(a)
$

Now solve the IVP problem for $y_1$ in region 1, use that to set the initial conditions for an IVP for $y_2$ in region 2 etc.

CB

3. Remembering that if we set...

$Y(s)= \mathcal{L}\{y(t)\}$ (1)

... is...

$\mathcal{L}\{y^{''} (t)\}= s^{2}\cdot Y(s) - s\cdot y(0) - y^{'} (0)$ (2)

... the DE in terms of Laplace Transform is written as...

$s^{2}\cdot Y(s) - s\cdot y(0) - y^{'} (0) + Y(s) = \frac{1-e^{-as}}{s}$ (3)

... and from (3) we obtain...

$Y(s) = \frac{1-e^{-as}}{s\cdot (1+s^{2})} + \frac{s\cdot y(0)}{1+s^{2}} + \frac{y^{'}(0)}{1+s^{2}}$ (4)

Now You can obtain $y(t)$ performing the inverse LT of (4)...

Kind regards

$\chi$ $\sigma$

4. Originally Posted by chisigma
Remembering that if we set...

$Y(s)= \mathcal{L}\{y(t)\}$ (1)

... is...

$\mathcal{L}\{y^{''} (t)\}= s^{2}\cdot Y(s) - s\cdot y(0) - y^{'} (0)$ (2)

... the DE in terms of Laplace Transform is written as...

$s^{2}\cdot Y(s) - s\cdot y(0) - y^{'} (0) + Y(s) = \frac{1-e^{-as}}{s}$ (3)

... and from (3) we obtain...

$Y(s) = \frac{1-e^{-as}}{s\cdot (1+s^{2})} + \frac{s\cdot y(0)}{1+s^{2}} + \frac{y^{'}(0)}{1+s^{2}}$ (4)

Now You can obtain $y(t)$ performing the inverse LT of (4)...

Kind regards

$\chi$ $\sigma$
Does not answer the question since "Solve the equation in three intervals of x and by applying appropriate matching conditions" implies solving the equation in the three intervals and matching valuse and derivatives at the knots.

CB

5. The general solution of a linear second order DE is of the type...

$y(t) = y_{free} (t) + y_{forced} (t)$ (1)

... where $y_{free} (t)$ is the general solution of the 'imcomplete' DE and $y_{forced} (t)$ is a particular solution of the 'complete' DE. In our case is...

$Y(s) = Y_{free} (s) + Y_{forced} (s)$

$Y_{free} (s) = \frac{y(0)\cdot s + y^{'} (0)}{1+s^{2}}$

$Y_{forced} (s) = \frac{1-e^{-as}}{s\cdot (1+s^{2})}$ (2)

Performing the inverse LT of the (2) we obtain...

$y_{free} (t) = y(0)\cdot \cos t + y^{'} (0)\cdot \sin t$

$y_{forced} (t) = (1-\cos t)\cdot H(t) - \{1-\cos (t-a)\}\cdot H(t-a)$ (3)

The main difference between $y_{free} (t)$ and $y_{forced} (t)$ is that the first is defined for $-\infty < t < + \infty$ and the second is $\ne 0$ only for $t>0$. Once You know $y(0)$ , $y^{'} (0)$ and $a$ the (3) supply to You the whole solution of the DE without great efforts and saving time... that's the main advantage of the use of LT ...

Kind regards

$\chi$ $\sigma$