Homework Help: Laplace transform (solve an IVP)

1. Sep 21, 2008

wahoo2000

1. The problem statement, all variables and given/known data
Solve the IVP for t>0
$$y'(t)+\int^{t}_{0}y(\tau)d\tau =$$
=sin(t) for 0<t<=pi
=0 for t>pi
y(0)=-1

3. The attempt at a solution
The solution depends on how large t is and therefore the solution consist of two parts depending on the size of t..
Let's call them y1(t) (for 0<t<=pi) and y2(t) (for t>pi)

This is solved using Laplace transform.
for y2, after Laplacetransform, Y(s) is called just Y for convenience.
sY-y(0)+Y/s=0
$$Y=\frac{-1}{s+1/s}=....simplification.....=\frac{-s}{s^{2}+1}$$

Then using inverse lapcace transform
==> y2(t)=-cos(t)

then for y1:

$$Y=\frac{\frac{1}{s^{2}+1}-1}{s+\frac{1}{s}}=-\frac{1}{s+\frac{1}{s}}+\frac{1}{(s^{2}+1)(s+\frac{1}{s})}$$

First of all, is it correct so far?
And how do I continue the simplification from here to be able to use inverse lapace transform?
1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution

2. Sep 21, 2008

klondike

I would write the RHS (the excitation) as
$$x(t)=\sin(t)U(t)+\sin (t-\pi) U(t-\pi)$$

then
$$sY+1+Y/s=\dfrac{1}{s^{2}+1}(1+e^{- \pi s})$$
then
$$Y(s)=\dfrac{s}{(s^2+1)^2}(1+e^{-\pi s}) - \dfrac{s}{s^2+1}$$

then
$$y(t)=[0.5tsin(t)-cos(t)]U(t)+0.5(t-\pi)sin(t-\pi)U(t-\pi)$$

Hopefully I got my algebra right.

Last edited: Sep 21, 2008
3. Sep 22, 2008

wahoo2000

Hmm, I don't really understand.
I think that you rewrite the RHS in a smart way so that both cases 0<x<=pi and x>pi are "built in" in one expression, right?
Was my approach wrong (I guess so), but why?

What is U(x)? I have only solved more simple and straightforward IVPs with Laplace transform before. A few words about how you think would be very appreciated!

4. Sep 22, 2008

Defennder

He meant u(t). That is the Heaviside function or unit step function. So what this means is:
$$f(t)[u(t-a) - u(t-b)] = f(t) \ \mbox{when} \ t \in (a,b)$$
and $$0 \ \mbox{everywhere else}$$.

Your approach is fine as well, but it results in having to split the solution into two separate intervals to solve.

5. Sep 22, 2008

klondike

I don't remember how I did this in Calculus II (that was 14 years ago) but I do remember in the "Analysis of Elementary Linear circuits" class, and the following "Signals and Systems" class, we were taught to decompose the finite duration of excitation into sum of time shifted signals so that we can take the advantage of a very useful Laplace transform property

$$L {f(t-\alpha)u(t-\alpha)} =e^{-\alpha s}F(s)$$

which is usually easier to work with. and it's an important link between Laplace transform and z-transform.

To be honest, I don't see how your approach is wrong.

Yes, I mean "Unit Step" or "Heaviside step function" see http://en.wikipedia.org/wiki/Heaviside_step_function

and it's usually written in lower case as Defennder pointed out.

6. Sep 23, 2008

klondike

Hello wahoo2000,

I sorta, kinda know what is causing your problem, although I couldn't explain it in pure math context. Your ODE basically describes an inductor and a capacitor connected in serial driven by a voltage source which is a half sinusoid, the solution y(t) is the loop current for t>0

The physical meaning of y2(t) as the way you set it up (sY-y(0)+Y/s=0), is the system response due to the non-zero initial condition in absence of source. We EE call it Zero-Input-Response or ZIR. Note that 0<t<+infty.

y1 in this case, the physical meaning is that the circuit is driven by a STEADY sinusoid for t>0, with non-zero initial value taken into account. So even you find out y1 in this way, y1+y2 is not the solution given the source condition and initial condition. Further more y1 is divergent (something t times sin) due to lack of damping term in the ODE. We know that the solution should be oscillated (undamped) but not divergent because the source has finite duration and there is no negative resistence component.

Hope that helps. I hope someone can explain it in a more mathematical way.

Last edited: Sep 23, 2008
7. Sep 23, 2008

HallsofIvy

Engineers love "Laplace transforms". I don't. Here's how I would have done this problem.
$$y'+ \int y(\tau)d\tau= cos(t)$$ for $$0\le t\le \pi$$
$$y'+ \int y(\tau)d\tau= 0$$ for t> $$\pi$$
y(0)= -1.

Differentiate both sides of the equation to get rid of the integral:
y"+ y= -sin(t) for $0\le t\le \pi$
y"+ y= 0 for $t> \pi$

y"+ y= 0 has general solution y(t)= Ccos(t)+ Dsin(t) and we seek a specific solution to the entire equation of the form y= At cos(t). Then y'= Acos(t)- Atsin(t), y"= -2A sin(t)- Atcos(t). y"+ y= -2A sin(t)= -sin(t) so A= 1/2. y(t)= Ccos(t)+ Dsin(t)+ (1/2)t cos(t) satisfies the equation for t between 0 and $\pi$. When t= 0, y(0)= C= -1.
We also note that, from the original equation,
[tex]y'(0)+ \int_0^0 y(\tau)d\tau= y'(0)= cos(0)= 1[/itex]
From y(t)= Ccos(t)+ Dsin(t)+ (1/2)t cos(t), y'(t)= -C sin(t)+ Dcos(t)+ (1/2)cos(t)- (1/2)tsin(t) so y'(0)= D+ 1/2= 1 so D= 1/2
For $0\le t\le \pi$
y(t)= -cos(t)+ (1/2)sin(t)+ (1/2)tcos(t).
$y(\pi)= -cos(\pi)+ (1/2)sin(\pi)+ (1/2)\pi cos(\pi)= -1- (1/2)\pi$

y'(t)= sin(t)+ (1/2)cos(t)+ (1/2) cos(t)- (1/2)tsin(t)= sin(t)+ cos(t)- (1/2)t sin(t)
$\y'(\pi)= sin(\pi)+ cos(\pi)- (1/2)\pi sin(\pi)= -1-(1\2)\pi$
so now we solve the initial value problem
y"+ y= 0, $y(\pi)= -1- (1/2)\pi$, $y'(\pi)= -1-(1/2)\pi$
for $x> \pi$.
The general solution to y"+ y= 0 is, of course, y(t)= Ccos(t)+ Dsin(t).
$y(\pi)= C cos(\pi)+ Dsin(\pi)= -C= -1-(1/2)\pi$ or $C= 1+ (1/2)\pi$
y'(t)= -Csin(t)+ Dcos(t) so
$y'(\pi)= -D= -1-(1/2)\pi$ or D= $1+ (1/2)\pi$ also.

y(t)= -cos(t)- (1/2)sin(t)+ (1/2)tcos(t) for $0\le t\le\pi$
= (1+ (1/2)$\pi$)(cos(t)+ sin(t)) for $x> \pi$

8. Sep 23, 2008

klondike

Thanks for HallsofIvy's detailed work-out sample. It's excellent except that the excitation is sin instead of cos as the problem stated. It's always nice to learn how to solve same problem in different ways.

If Laplace isn't allowed, I would have solved the zero-input-response (homogeneous problem with non-zero iv) and zero-state-response by finding h(t), then y(t)=x(t)*h(t) where * denotes convolution. h(t) is the impulse response of the ODE (nonhomogeneous part set to Dirac Delta) . h(t) can be found by finding the step response first then take a time derivative.

Yes, we do love "Laplace transform" partially because almost all continuous-time Linear Time Invariant systems (i.e. linear feedback systems) are analyzed in s domain, and z domain for digital systems. For simple 2-order systems, one would simply draw the poles and zeros on the s-plane with pencil and paper and get an idea how the system would behave without solving the differential equation.

I didn’t realize the importance of Laplace Transform and Fourier Transform until I had to design commercial grade Phase-Lock-Loop, feedback amplifiers and filters at work. The most embarrassing thing is that I got an oscillator only when I was trying to build an amplifier. I actually had to review all the text I have learned and worked out many end chapter problems I skipped in school. Computer simulation was not as popular back then. Even with computer software available, it’s vital to know what is actually going on so that we don’t setup the model incorrectly and are able to tell if the simulated results make sense.

Sorry, I digress but I wanted to stress to EE students that Laplace transform is extremely important in practical electrical engineering. I wish I realized that earlier.