Solved by Luca Imponenti
Find
, for
such that:
![{\displaystyle y_{n}''-3y_{n}'+2y_{n}=r_{n}(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/fe3ad9b6d6e3a615843c79cd8186b2c67c25f869)
for
in
with the initial conditions found.
Plot
for
for
in
.
The homogeneous case is shown below:
![{\displaystyle y''_{h}-3y'_{h}+2y_{h}=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b9b4a651ccd02299acfdaeb673d8a9ffd2806dc8)
This equation has the following roots:
Which gives yields the homogeneous solution
![{\displaystyle y_{h}=c_{1}e^{x}+c_{2}e^{2x}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d784436d8b5a0cddffb66c00fa82e27028f26a37)
Using the taylor series approximation from earlier with
we have
We know the particular solution,
, ve will have this form:
taking the derivatives of this solution
and
Plugging the above equations into the original ODE yields the following matrix equation:
![{\displaystyle {\begin{bmatrix}2&0&0&0&0\\-12&2&0&0&0\\12&-9&2&0&0\\0&6&-6&2&0\\0&0&2&-3&2\end{bmatrix}}*{\begin{bmatrix}a_{4}\\a_{3}\\a_{2}\\a_{1}\\a_{0}\end{bmatrix}}={\begin{bmatrix}-{\frac {1}{64ln(10)}}\\{\frac {1}{24ln(10)}}\\-{\frac {1}{8ln(10)}}\\{\frac {1}{2ln(10)}}\\log(2)\end{bmatrix}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/1ceccc22f98f92ec188f1dbe8238efd1147a7bea)
The unknown vector
can be easily solved by forward substitution,the following values were calculated in matlab:
So the particular solution
is
We can now find the general solution for n=4,
.
Solving using the initial conditions yields;
Using the taylor series approximation from earlier with
we have
In a similar fashion we construct a matrix equation for n=7:
![{\displaystyle {\begin{bmatrix}2&0&0&0&0&0&0&0\\-21&2&0&0&0&0&0&0\\42&-18&2&0&0&0&0&0\\0&30&-15&2&0&0&0&0\\0&0&20&-12&2&0&0&0\\0&0&0&12&-9&2&0&0\\0&0&0&0&6&-6&2&0\\0&0&0&0&0&2&-3&2\end{bmatrix}}*{\begin{bmatrix}a_{7}\\a_{6}\\a_{5}\\a_{4}\\a_{3}\\a_{2}\\a_{1}\\a_{0}\end{bmatrix}}={\begin{bmatrix}{\frac {1}{896ln(10)}}\\-{\frac {1}{384ln(10)}}\\{\frac {1}{160ln(10)}}\\-{\frac {1}{64ln(10)}}\\{\frac {1}{24ln(10)}}\\-{\frac {1}{8ln(10)}}\\{\frac {1}{2ln(10)}}\\log(2)\end{bmatrix}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/43afa0dcf3895cfe547f268f39c5272b030387b9)
Solving:
So the particular solution
is
We can now find the general solution for n=7,
.
Solving using our initial conditions yields
Using the taylor series approximation from earlier with
we have
Finally, we write out the matrix equation for n=11:
Solving the system in matlab:
So the particular solution
is
We can now find the general solution for n=11,
.
Solving using our initial conditions yields
shown in red
shown in blue
shown in green
Solved by Luca Imponenti
Use the matlab command ode45 to integrate numerically
with
and the initial conditions from Part 3 to obtain the numerical solution for y(x).
Plot y(x) in the same figure as above.
The numerical solution calculated using the matlab ode45 command is shown below:
ans =
0.2788
0.2854
0.2923
0.2997
0.3074
0.3229
0.3401
0.3592
0.3804
0.4040
0.4302
0.4595
0.4921
0.5285
0.5691
0.6145
0.6651
0.7218
0.7850
0.8557
0.9346
1.0228
1.1213
1.2313
1.3542
1.4914
1.6445
1.8155
2.0063
2.2193
2.4569
2.7219
3.0175
3.3471
3.7146
4.1243
4.5809
5.0898
5.6568
6.2885
6.9921
7.3442
7.7142
8.1032
8.5119
Plotting the aboved vector of y-values,along with the results from earlier yields the following graph:
where the answer calculated in matlab is shown in yellow.
Egm4313.s12.team11.imponenti (talk) 08:04, 14 March 2012 (UTC)