User:Egm4313.s12.team1.essenwein

Eric Essenwein

Links
Team Page

Course Wiki

Statement
Consider the L2-ODE-CC (5) p7b-7 with the window function f(x) p.9-8 as excitation:
 * {| style="width:100%" border="0"

$$\displaystyle{y''-3y'+2y=r(x)}$$ $$r(x)=f(x)$$ (4.0) and the initial conditions
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$\displaystyle{y(0)=1, y'(0)=0}$$ (4.1) 1. Find $$ y_n(x) $$ such that:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$\displaystyle{y''_n +ay'_n + by_n=r_n(x)}$$ (4.2) with the same initial conditions (4.1). Plot $$ y_n(x)$$ for n=2,4,8, for x in [0,10]. 2.Use the matlab command ode45 to integrate the L2-ODE-CC, and plot the numerical solution to compare with the analytical solution. Level 1:n=0,1
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Part 1 Solution
First, we shift the excitation f(x) to the left by introducing a new independent variable, t. This allows the period to start at zero.
 * {| style="width:100%" border="0"

$$\displaystyle t=x-\frac{1}{4}$$ (4.3) The piecewise representation of the window function is now (in terms of t) as follows:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$\displaystyle f(t)=A$$ for $$\displaystyle t=\left[ 0,2 \right]$$ $$\displaystyle f(t)=0$$ for $$\displaystyle t=\left[ 2,4 \right]$$ (4.4) To find the Fourier transform, the period of oscillation is determined:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$\displaystyle p=2L=4$$ (4.5) And the frequency of oscillation:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$\displaystyle \omega =\frac{2\pi }{p}=\frac{\pi }{2}$$ (4.6) The general form of a Fourier transform is
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$\displaystyle f(t)={{a}_{0}}+\sum\limits_{1}^{n}{\left[ {{a}_{n}}\cos (n\omega t)+{{b}_{n}}\sin (n\omega t) \right]}$$ (4.7) The following equations are given values of the constants in (4.7), evaluated for the function in (4.4):
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$\displaystyle {{a}_{0}}=\frac{1}{2L}\int\limits_{0}^{2L}{f(t)dt}=\frac{1}{4}\int\limits_{0}^{2}{Adt}=\frac{A}{4}(2-0)=\frac{A}{2}$$ (4.8)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$\displaystyle {{a}_{n}}=\frac{1}{L}\int\limits_{0}^{2L}{f(t)\cos (n\omega t)dt} =\frac{1}{2}\int\limits_{0}^{2}{A\cos (\frac{n\pi }{2}t)dt} =\frac{A}{n\pi }(\sin n\pi -\sin 0)$$ (4.9)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$\displaystyle {{b}_{n}}=\frac{1}{L}\int\limits_{0}^{2L}{f(t)\sin (n\omega t)dt}=\frac{1}{2}\int\limits_{0}^{2}{A\sin (\frac{n\pi }{2}t)dt}=-\frac{A}{n\pi }(\cos n\pi -\cos 0)=\frac{A}{n\pi }(1-\cos n\pi )$$ (4.10) In their simplest forms:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$\displaystyle {{a}_{n}}=0$$ (4.11)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$\displaystyle {{b}_{n}}=\left\{ 0,\frac{A}{\pi },0,\frac{A}{2\pi },0,\frac{A}{3\pi },0,\frac{A}{4\pi },...,0,\frac{2A}{n\pi } \right\}$$ (4.12) Plugging in r(x)=f(t) in (4.0),
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$\displaystyle y''-3y'+2y=\frac{1}{2}+\frac{2}{n\pi }\sin (\frac{n\pi }{2}t)$$ (4.13) From the general form, a particular solution to (4.13) and its derivatives are as follows:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$\displaystyle {{y}_{n}}={{A}_{n}}\cos (\frac{n\pi }{2}t)+{{B}_{n}}\sin (\frac{n\pi }{2}t)$$ (4.14)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$\displaystyle {{y}_{n}}'=-{{A}_{n}}\frac{n\pi }{2}\sin (\frac{n\pi }{2}t)+{{B}_{n}}\frac{n\pi }{2}\cos (\frac{n\pi }{2}t)$$ (4.15)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$\displaystyle {{y}_{n}}''=-{{A}_{n}}\frac{4}\cos (\frac{n\pi }{2}t)-{{B}_{n}}\frac{4}\sin (\frac{n\pi }{2}t)$$ (4.16)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

By plugging in (4.14), (4.15), and (4.16) into (4.13), we find An and Bn in terms of another constant, Cn:


 * {| style="width:100%" border="0"

$$\displaystyle {{A}_{n}}=6n\pi {{C}_{n}}$$ (4.17)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$\displaystyle {{B}_{n}}=(8-{{n}^{2}}{{\pi }^{2}}){{C}_{n}}$$ (4.18)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$\displaystyle {{C}_{n}}={{\left[ \tfrac{1}{8}n\pi ({{(8-{{n}^{2}}{{\pi }^{2}})}^{2}}+{{(6n\pi )}^{2}}) \right]}^{-1}}$$ (4.19) After substituting t with (4.3), the solutions are shown for n=2,4,8.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle {{y}_{2}}={{y}_{1}}+{{y}_{2}}$$ (4.20)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$\displaystyle {{y}_{4}}={{y}_{1}}+{{y}_{2}}+{{y}_{3}}+{{y}_{4}}$$ (4.21)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$\displaystyle {{y}_{8}}={{y}_{1}}+{{y}_{2}}+{{y}_{3}}+{{y}_{4}}+{{y}_{5}}+{{y}_{6}}+{{y}_{7}}+{{y}_{8}}$$ (4.22)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Part 2 Solution
The excitation for n=0 and n=1 are the same, because $$a_1=b_1=0$$.

The homogeneous solution to (4.0) is
 * {| style="width:100%" border="0"

$$\displaystyle {{y}_{h}}={{C}_{1}}{{\operatorname{e}}^{2t}}+{{C}_{2}}{{\operatorname{e}}^{t}}$$ (4.23) For $$r(x)=a_0$$, the particular solution is
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle {{y}_{p}}={{C}_{3}}$$ (4.24) Evaluating, we find that
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$${{C}_{1}}=-\tfrac{3}{4}$$ $${{C}_{2}}=\tfrac{3}{2}$$ $${{C}_{3}}=\tfrac{1}{4}$$ (4.25) Thus, the complete solution $$y_0$$ is
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ {{y}_{0}}=\tfrac{1}{4}-\tfrac{3}{4}{{\operatorname{e}}^{2(x-\tfrac{1}{4})}}+\tfrac{3}{2}{{\operatorname{e}}^{x-\tfrac{1}{4}}}$$ (4.26) Integrating $$y_0$$ using MATLAB's ode45 command, the following plot is obtained for y:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Author
Solved and Typed By - Reviewed By -

Statement
Consider the following L2-ODE-CC; see p.6-6:
 * {| style="width:100%" border="0"

$$\displaystyle{y}''-4{y}'+13{y}=2e^{-2x}\cos(3x)$$ (6.0) Homogeneous solution:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle{y}_{h}(x)=e^{-2x}[A\cos3x+B\sin3x]$$ (6.1) Particular solution:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle{y}_{p}(x)=xe^{-2x}[M\cos3x+N\sin3x]$$ (6.2) Complete the solution for this problem.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Find the overall solution $$y(x)$$ that corresponds to the initial condition (3b) p.3-7
 * {| style="width:100%" border="0"

$$\displaystyle y(0)=1,y'(0)=0$$ (6.3)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Solution
Start by finding $$y_{p}'$$ and $$y_{p}''$$.
 * {| style="width:100%" border="0"

$$\displaystyle {y}_{p}'={{e}^{-2x}}[(-3Mx-2Nx+N)\sin 3x+(-2Mx+3Nx+M)\cos 3x]$$ (6.4)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle {y}_{p}''={{e}^{-2x}}[(12Mx-6M-5Nx-4N)\sin 3x+(-15Mx-12M-12Nx+6N)\cos 3x]$$ (6.5) Substitute $$y_p$$ and its derivatives into (6.0) to find $$M$$ and $$N$$.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle {y}_{p}''+4{y}_{p}'+13{y}_{p}={{e}^{-2x}}[(-6M)\sin 3x+(-10Mx-8M+6N)\cos 3x]$$ (6.6) Separating terms and setting equal to the excitation from (6.0):
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle -6M{{e}^{-2x}}\sin 3x+(-8M+6N){{e}^{-2x}}\cos 3x-10Mx{{e}^{-2x}}\cos 3x=2{{e}^{-2x}}\cos 3x$$
 * style="width:95%" |
 * style="width:95%" |

(6.7) From (6.7), we solve coefficients to get
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle -6M=0$$ $$\displaystyle -8M+6N=2$$ $$\displaystyle -10M=0$$ (6.8) Solving for $$M$$ and $$N$$:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle M=0$$ $$\displaystyle N=\frac{1}{3}$$ (6.9) Which gives us the particular solution:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle {y}_{p}=\frac{1}{3}x{{e}^{-2x}}\sin 3x$$ (6.10) For the general solution,
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle y={{y}_{h}}+{{y}_{p}}$$ (6.11)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle y=e^{-2x}[A\cos3x+B\sin3x]+\frac{1}{3}x{{e}^{-2x}}\sin 3x$$ (6.12)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle y=e^{-2x}[A\cos3x+(B+\frac{1}{3}x)\sin3x]$$ (6.13) To solve for $$A$$ and $$B$$, we use initial conditions from (6.3):
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle y(0)=e^{-2(0)}[A\cos3(0)+(B+\frac{1}{3}(0))\sin3(0)]=1$$ (6.14) Which simplifies to:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle A=1$$ (6.15) For the second initial condition from (6.3):
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle y'={{e}^{-2x}}[(-3A-2B+\frac{1}{3}+\frac{2}{3}x)\sin 3x+(3B+x-2)\cos 3x]$$ (6.16)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle y'(0)={{e}^{-2(0)}}[(-3A-2B+\frac{1}{3}+\frac{2}{3}(0))\sin 3(0)+(3B+(0)-2)\cos 3(0)]=0$$ (6.17)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle 3B-2=0$$ (6.18)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle B=\frac{2}{3}$$ (6.19) We can now write $$y$$ with all coefficients known.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle y={{e}^{-2x}}[(1)\cos 3x+(\frac{2}{3}+\frac{1}{3}x)\sin 3x]$$ (6.20) Final Equation
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="1"

$$\displaystyle y={{e}^{-2x}}[\cos 3x+(\frac{2}{3}+\frac{1}{3}x)\sin 3x]$$ (6.21)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }



Author
Solved and Typed By - Egm4313.s12.team1.essenwein (talk) 23:45, 19 March 2012 (UTC) Reviewed By -