MATH201/content/Solving IVP's using Laplace...

102 lines
4.8 KiB
Markdown
Raw Normal View History

2023-10-18 18:18:24 -06:00
2023-11-01 14:25:42 -06:00
#start of lec 17
<i>Lecture starts with a 25 minute long midterm review.</i>
2023-11-06 07:43:30 -07:00
He spends most of the time giving us a summary of all the equations (separable, linear, homogenous, exact, ...) The review is available on the eclass page.
2023-11-01 14:25:42 -06:00
So, why did we learn all this stuff about Laplace transforms? We will now see how its useful:
# Solving IVP's with Laplace
## Example:
#ex #LT #second_order_nonhomogenous #IVP
Solve the following IVP using Laplace transforms:
2023-10-18 18:18:24 -06:00
$$y''+y=t^2+2 \qquad y(0)=1 \qquad y'(0)=-1$$
2023-11-01 14:25:42 -06:00
LHS=RHS, so the Laplace transforms of each side must also be equal.
We take the Laplace transform of both sides:
2023-10-18 18:18:24 -06:00
$\mathcal{L}\{y''+y\}=\mathcal{L}\{t^2+2\}$
applying linearity:
$\mathcal{L}\{y''\}+\mathcal{L}\{y\}=\mathcal{L}\{t^2\}+\mathcal{L}\{2\}$
using properties:
2023-11-01 14:25:42 -06:00
$s^2Y(s)-sy(0)-y'(0)+Y(s)=\frac{2!}{s^3}+\frac{2}{s}$
2023-10-18 18:18:24 -06:00
$s^2Y(s)-s+1+Y(s)=\frac{2!}{s^3}+\frac{2}{s}$
2023-11-01 14:25:42 -06:00
Now we need to isolate $Y(s)$.
So we add $s-1$ to both sides and factor out $Y(s)$:
2023-10-18 18:18:24 -06:00
$Y(s)(s^2+1)=\frac{2(s^2+1)}{s^3}+s-1$
2023-11-01 14:25:42 -06:00
Divide both sides by $(s^2+1)$ :
2023-10-18 18:18:24 -06:00
$Y(s)=\frac{2}{s^3}+\frac{s}{s^2+1}-\frac{1}{s^2+1}$
2023-11-01 14:25:42 -06:00
Now we take the inverse LT of both sides to obtain $y(t)$
2023-10-18 18:18:24 -06:00
$$y(t)=t^2+\cos(t)-\sin(t)$$
2023-11-01 14:25:42 -06:00
Done. That was pretty fast!
2023-10-18 18:18:24 -06:00
second example:
#ex #LT #second_order_nonhomogenous
2023-11-01 14:25:42 -06:00
Solve the following IVP using Laplace transforms:
2023-10-18 18:18:24 -06:00
$$y''-y=(t-2)e^{t-2} \qquad y(2)=0 \qquad y'(2)=0$$
2023-11-01 14:25:42 -06:00
We are provided $y(2)$ but usually we need it in the form $y(0)$ What do we do?
We make a substitution: $x=t-2$
$\frac{d^2y}{dx^2}-y=xe^x$ <- notice the y here is not the same as the y above, lousy notation. This graph is shifted 2 units to the left.
2023-10-18 18:18:24 -06:00
where $y(0)=0 \qquad \frac{dy}{dx}(0)=0$
2023-11-01 14:25:42 -06:00
Hit it with the LT!
$\frac{1}{s^2}$ is LT of $x$. Using the shifting property, $\frac{1}{(s-\alpha)^2}$ is the LT of $xe^{\alpha x}$
2023-11-04 16:36:36 -06:00
$s^2Y(s)-s\underbrace{ y(0) }_{ =0 }-\underbrace{ y'(0) }_{ =0 }-Y(s) =\frac{1}{(s-1)^2}$
2023-11-01 14:25:42 -06:00
Isolate $Y(s)$ :
$(s^2-1)Y(s)=\frac{1}{(s-1)^2}$
$Y(s)=\frac{1}{(s-1)^2(s^2-1)}$
$Y(s)=\frac{1}{(s-1)^2(s-1)(s+1)}$
Partial fraction time:
2023-10-18 18:18:24 -06:00
$Y(s)=\frac{1}{(s-1)^3(s+1)}=\frac{A}{s-1}+\frac{B}{(s-1)^2}+\frac{C}{(s-1)^3}+\frac{D}{s+1}$
$\frac{{A(s-1)^2(s+1)+B(s-1)(s+1)+C(s+1)+D(s-1)^3}}{(s-1)^3(s+1)}$
2023-11-01 14:25:42 -06:00
$\begin{matrix}A+D=0 \\A-2A+B-3D=0 \\ A-2A+B-B+C+3D=0 \\ A-B+C-D=1\end{matrix}$
2023-11-06 07:43:30 -07:00
We can express this linear system as a matrix:
2023-11-04 16:36:36 -06:00
$\begin{bmatrix}1 & 0 & 0 & 1 & 0 \\-1 & 1 & 0 & -3 & 0 \\-1 & 0 & 1 & 3 & 0 \\ 1 & -1 & 1 & -1 & 1\end{bmatrix}$
2023-11-06 07:43:30 -07:00
Solving this matrix is a PITA. you could use row reduction or Cramer's rule.
However, I happen to know that adding all four gives an equation for $C$ alone. We are lucky, this is not always the case.
$0+0+2C+0=1 \qquad \implies C=\frac{1}{2}$
Add equations 1 and 3:
$C+4D=0 \qquad\qquad\ \ \ \implies D=\frac{-1}{8}$
equation 3:
$-A+C+3D=0 \qquad \implies A=\frac{1}{2}-\frac{3}{8}=\frac{1}{8}$
equation 2:
$-A+B-3D=0 \qquad \implies B=\frac{1}{8}-\frac{3}{8}=-\frac{1}{4}$
2023-11-04 16:36:36 -06:00
2023-11-06 07:43:30 -07:00
Plug into expression then take inv LT to obtain y(x):
$y(x)=\frac{1}{8}e^x-\frac{1}{4}xe^x+\frac{1}{4}x^2e^x-\frac{1}{8}e^{-x}$
substitute back $x=t-2$
$$y(t)=\frac{1}{8}e^{t-2}-\frac{1}{4}(t-2)e^{t-2}+\frac{1}{4}(t-2)^2e^{t-2}-\frac{1}{8}e^{-(t-2)}$$
2023-10-18 18:18:24 -06:00
all done!
#end of lec 17 #start of lec 18
2023-11-06 07:43:30 -07:00
#ex #LT #IVP
Solve the following equation using LT:
2023-10-18 18:18:24 -06:00
$$y''+ty'-2y=2 \qquad y(0)=y'(0)=0$$
hit it with the LT!
$\mathcal{L}\{y''\}+\mathcal{L}\{ty'\}-2\mathcal{L}\{y\}=\frac{2}{s}$
2023-11-06 07:43:30 -07:00
$s^2Y(s)-s\cancelto{ 0 }{ y(0) }-\cancelto{ 0 }{ y'(0) }-\frac{d}{ds}\mathcal{L}\{y'\}-2Y(s)=\frac{2}{s}$
$s^2Y-\frac{d}{ds}(sY(s)-\cancelto{ 0 }{ y(0) })-2Y=\frac{2}{s}$
2023-10-18 18:18:24 -06:00
apply product rule:
2023-11-06 07:43:30 -07:00
$s^2Y-3Y-s\frac{dY}{ds}=\frac{2}{s}$
2023-10-18 18:18:24 -06:00
^ Boooo! another differential equation! :(
$\frac{dY}{ds}$ lies in the s "phase space"
2023-11-06 07:43:30 -07:00
$-s\frac{dY}{ds}+s\left( s-\frac{3}{s} \right)Y=\frac{2}{s}$
2023-10-18 18:18:24 -06:00
This is a linear equation!
2023-11-06 07:43:30 -07:00
divide both sides by $-s$ to get it in standard form
$\frac{dY}{ds}-\left( s-\frac{3}{s} \right)Y=-\frac{2}{s^2}$
2023-10-18 18:18:24 -06:00
compute integrating factor:
$\mu(s)=e^{-\int (s-3/s) \, ds}=e^{-s^2/2}e^{\ln{s^3}}=s^3e^{-s^2/2}$
2023-11-06 07:43:30 -07:00
> ^interesting, why no abs() when integrating $\frac{1}{s}$ ?
2023-10-18 18:18:24 -06:00
2023-11-06 07:43:30 -07:00
recall, $(\mu Y)'=\mu(s)Q(s)$ according to linear equation solving technique.
However, you could also continue from here using the formula $Y(s)=\frac{1}{\mu(s)}\int \mu(s) Q(s) \, ds$
$\frac{d}{ds}(s^3e^{-s^2/2}Y)= \underbrace{ -2se^{-s^2/2} }_{ \mu(s)Q(s) }$
integrate both sides:
2023-10-18 18:18:24 -06:00
$s^3e^{-s^2/2}Y=-2\int se^{-s^2/2} \, ds$
2023-11-06 07:43:30 -07:00
use u sub:
$u=\frac{s^2}{2} \qquad du=sds$
$=-2\int e^{-u} \, du$
$s^3e^{-s^2/2}Y=2e^{-s^2/2}+C$
$Y(s)=\frac{2}{s^3}+C \frac{e^{s^2/2}}{s^3}$
Is this even a legitimate thing to take an inverse of?
The lim of the expression approaches inf as s approaches inf due to the exponential.
So what do we do? Well we have that $C$ term. We have to set $C=0$
2023-10-18 18:18:24 -06:00
then:
$Y(s)=\frac{2}{s^3}$
$$y(t)=t^2$$
2023-11-06 07:43:30 -07:00
We just solved a new equation that hasn't fit into our previous equation types using LT. How cool is that!