Report 4
Intermediate Engineering Analysis
Section 7566
Team 11
Due date: March 14, 2012.
Obtain equations (2), (3), (n-2), (n-1), (n), and set up the matrix A as in (1) p.7-21
for the general case, with the matrix coefficients for rows 1, 2, 3, (n-2), (n-1), n, filled in,
as obtained from equations (1), (2), (3), (n-2), (n-1), (n).
As shown in p.7-21, the first equation is:
(1) p.7-21
According to p.7-20, the general form of the series is:
(2) p. 7-20
From (2) p.7-20, we can obtain n+1 equations for n+1 unknown coefficients
.
After referring to p.7-22, it can be determined that the matrix to be set up is of the following form:
where the rows signify the coefficients
,
and the columns signify
.
Building the coefficient matrix as shown in p.7-22 of the class notes, we can begin to solve for the coefficients
as follows:
Equation associated with
:
j=0:
(1)
Equation associated with
:
j=1:
(2)
Equation associated with
:
j=2:
(3)
Equation associated with
:
j=n-2:
(n-2)
Equation associated with
:
j=n-1:
(n-1)
Equation associated with
:
j=n:
(n)
Using all of the above equations, (1), (2), (3), (n-2), (n-1), (n), we can then determine the A matrix to be:
Solved by Gonzalo Perez
Solved by Jonathan Sheider
Given: ![{\displaystyle y^{''}-3y^{'}+2y=sin(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b45a40922a3a18ab5ff97814702b1fa6d30e5c7e)
With initial conditions: ![{\displaystyle y(0)=1,y'(0)=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d358729028ad1e6ffc817e7b90208281056b9220)
Using the Taylor series for sin(x), reproduce the graph in the lecture notes p.7-24.
The Taylor series expansion for sin(x) that is plotted with n = 13 is as follows:
![{\displaystyle y=x-{\frac {x^{3}}{3!}}+{\frac {x^{5}}{5!}}-{\frac {x^{7}}{7!}}+{\frac {x^{9}}{9!}}-{\frac {x^{11}}{11!}}+{\frac {x^{13}}{13!}}-{\frac {x^{15}}{15!}}+{\frac {x^{17}}{17!}}-{\frac {x^{19}}{19!}}+{\frac {x^{21}}{21!}}-{\frac {x^{23}}{23!}}+{\frac {x^{25}}{25!}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f7607a21f48e84a371229866e6f1b2fd84ddb4f1)
Using MatLab, the following Taylor series expansion was plotted and coded:
The plot created with n = 13 (i.e. 13 terms) is as follows:
Solved by Jonathan Sheider
Given: ![{\displaystyle y^{''}-3y^{'}+2y=r(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8f6a764b773443ef039e5d8ba165834235f747a1)
With initial conditions: ![{\displaystyle y(0)=1,y'(0)=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d358729028ad1e6ffc817e7b90208281056b9220)
Letting
equal the truncated Taylor series of
, i.e. ![{\displaystyle r(x)=\sum _{k=0}^{n}{\frac {(-1)^{k}t^{2k+1}}{(2k+1)!}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/32b8cf4b8406c31b754633feebc4ba18ec04df26)
Find the overall solution
for
and plot these solutions on the interval from
First finding the homogenous solution to the ODE:
The characteristic equation:
![{\displaystyle \lambda ^{2}-3\lambda +2=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/acda7e2f9dc09ae2212b455504353bd189576ce3)
![{\displaystyle (\lambda -2)(\lambda -1)=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/af5d3775e3da754de856d4bda6f0a85f8b327555)
Therefore, ![{\displaystyle \lambda =1,2\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/665b8a8e6b8fcd57dc28291fa259644ff6ba659a)
And the homogenous solution is:
![{\displaystyle y_{h}=c_{1}e^{x}+c_{2}e^{2x}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d784436d8b5a0cddffb66c00fa82e27028f26a37)
Next the particular solution will be evaluated.
For n = 3:
The excitation is therefore: ![{\displaystyle r_{x}=x-{\frac {x^{3}}{3!}}+{\frac {x^{5}}{5!}}-{\frac {x^{7}}{7!}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ed4b79095b91d2f9e6d5060a31bef58a3a17456b)
Therefore the particular solution has a form:
![{\displaystyle y_{p}=K_{7}x^{7}+K_{6}x^{6}+K_{5}x^{5}+K_{4}x^{4}+K_{3}x^{3}+K_{2}x^{2}+K_{1}x+K_{0}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e4567fceb8e200942e698eca20c2d168397483bd)
Differentiating:
![{\displaystyle y_{p}^{'}=7K_{7}x^{6}+6K_{6}x^{5}+5K_{5}x^{4}+4K_{4}x^{3}+3K_{3}x^{2}+2K_{2}x+1K_{1}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ffad9f5351bda75bf1ab8e98205bbf73c46713a3)
![{\displaystyle y_{p}^{''}=42K_{7}x^{5}+30K_{6}x^{4}+20K_{5}x^{3}+12K_{4}x^{2}+6K_{3}x+2K_{2}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e02e9cbe10e65ed2aff0be530e3f684a90d74681)
Plugging these values into the ODE and equating them to the excitation:
![{\displaystyle -3(7K_{7}x^{6}+6K_{6}x^{5}+5K_{5}x^{4}+4K_{4}x^{3}+3K_{3}x^{2}+2K_{2}x+1K_{1})\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/fb2c13d6793979f2eddac8f033d44a15d963e4ad)
![{\displaystyle +2(K_{7}x^{7}+K_{6}x^{6}+K_{5}x^{5}+K_{4}x^{4}+K_{3}x^{3}+K_{2}x^{2}+K_{1}x+K_{0})=x-{\frac {x^{3}}{3!}}+{\frac {x^{5}}{5!}}-{\frac {x^{7}}{7!}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/87a00abd4f99f94fd7a4135b8af73951c99d2127)
![{\displaystyle -21K_{7}x^{6}-18K_{6}x^{5}-15K_{5}x^{4}-12K_{4}x^{3}-9K_{3}x^{2}-6K_{2}x-3K_{1}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/1d6807699a4362b7be170710314054af90edcc25)
![{\displaystyle +2K_{7}x^{7}+2K_{6}x^{6}+2K_{5}x^{5}+2K_{4}x^{4}+2K_{3}x^{3}+2K_{2}x^{2}+2K_{1}x+2K_{0}=x-{\frac {x^{3}}{3!}}+{\frac {x^{5}}{5!}}-{\frac {x^{7}}{7!}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/728d06cc452acf6038b8a273f4b9f1b7036c0b06)
To solve this, we will use an upper triangular matrix, and solve using Matlab. The matrix is as follows:
The answer is calculated in Matlab:
![](//upload.wikimedia.org/wikiversity/en/f/f5/R4.2.n3matrix.jpg)
Therefore: ![{\displaystyle y_{p}={\frac {-1}{10080}}x^{7}+{\frac {-1}{960}}x^{6}+{\frac {-1}{320}}x^{5}+{\frac {-1}{128}}x^{4}+{\frac {-19}{192}}x^{3}+{\frac {-51}{128}}x^{2}+{\frac {-51}{128}}x+{\frac {-51}{256}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/6520fcd144efe3ddf899c5dd31a40cd4e2d753b9)
The final solution is then found to be:
Evaluating at the initial conditions, we have:
![{\displaystyle y_{n}(0)=c_{1}+c_{2}+{\frac {-51}{256}}=1\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f417f015136fac24cc3ec7a00c1eb8552eb8cae1)
![{\displaystyle y_{n}^{'}(0)=c_{1}+2c_{2}+{\frac {-51}{128}}=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/44cbaee6bc8f44e62f2784e12cd1f48b5ecd19b9)
Solving this system of equations, we find:
Therefore the final solution is:
Plotting this equation in Matlab yields:
![](//upload.wikimedia.org/wikiversity/en/7/72/R4.2.1plot.jpg)
For n = 5:
The excitation is therefore: ![{\displaystyle r_{x}=x-{\frac {x^{3}}{3!}}+{\frac {x^{5}}{5!}}-{\frac {x^{7}}{7!}}+{\frac {x^{9}}{9!}}-{\frac {x^{11}}{11!}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/dd265d5ef43a48d9ea0a645d36e28611e3203323)
Therefore the particular solution has a form:
![{\displaystyle y_{p}=K_{11}x^{11}+K_{10}x^{10}+K_{9}x^{9}+K_{8}x^{8}+K_{7}x^{7}+K_{6}x^{6}+K_{5}x^{5}+K_{4}x^{4}+K_{3}x^{3}+K_{2}x^{2}+K_{1}x+K_{0}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/91ae1763a38a4c7815a868ab0bc110ee48346542)
Differentiating:
![{\displaystyle y_{p}^{'}=11K_{11}x^{10}+10K_{10}x^{9}+9K_{9}x^{8}+8K_{8}x^{7}+7K_{7}x^{6}+6K_{6}x^{5}+5K_{5}x^{4}+4K_{4}x^{3}+3K_{3}x^{2}+2K_{2}x+1K_{1}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e532f91f6cf5280f92873b54a8f8b4887842b16b)
![{\displaystyle y_{p}^{''}=110K_{11}x^{9}+90K_{10}x^{8}+72K_{9}x^{7}+56K_{8}x^{6}+42K_{7}x^{5}+30K_{6}x^{4}+20K_{5}x^{3}+12K_{4}x^{2}+6K_{3}x+2K_{2}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b30883e99ee1465727e5ce141e0f722b03d2d7cd)
Plugging these values into the ODE and equating them to the excitation, and then solving them by using a upper triangular matrix as before (just as in the n=3 example) in Matlab:
![](//upload.wikimedia.org/wikiversity/en/5/5e/R4.2.n5matrix.jpg)
Therefore:
![{\displaystyle +{\frac {-17}{5120}}x^{5}+{\frac {-17}{2048}}x^{4}+{\frac {-307}{3072}}x^{3}+{\frac {-819}{2048}}x^{2}+{\frac {-819}{2048}}x+{\frac {-819}{4096}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/209f51d0cc01a53f488347b8a071a41958ded9a3)
The final solution is then found to be: ![{\displaystyle y_{n}=c_{1}e^{x}+c_{2}e^{2x}+{\frac {-1}{79833600}}x^{11}+{\frac {-1}{4838400}}x^{10}+{\frac {-1}{967680}}x^{9}+{\frac {-1}{215040}}x^{8}+{\frac {-7}{59419}}x^{7}+{\frac {-17}{15360}}x^{6}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ba5fc365827dddc481e9244f1c008a8130463467)
Evaluating at the initial conditions, we have:
![{\displaystyle y_{n}(0)=c_{1}+c_{2}+{\frac {-819}{4096}}=1\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ee6fd119a8705f5eb918ed23411f55607716e686)
![{\displaystyle y_{n}^{'}(0)=c_{1}+2c_{2}+{\frac {-819}{2048}}=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e7ce6fe358b00db62bf185020cc40575d671056f)
Solving this system of equations, we find:
Therefore the final solution is:
![{\displaystyle y_{n}=2e^{x}+{\frac {-3277}{4096}}e^{2x}+{\frac {-1}{79833600}}x^{11}+{\frac {-1}{4838400}}x^{10}+{\frac {-1}{967680}}x^{9}+{\frac {-1}{215040}}x^{8}+{\frac {-7}{59419}}x^{7}+{\frac {-17}{15360}}x^{6}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/82b5ffa75f4c3d87f4ffe196f65040697e0a1ca6)
![{\displaystyle +{\frac {-17}{5120}}x^{5}+{\frac {-17}{2048}}x^{4}+{\frac {-307}{3072}}x^{3}+{\frac {-819}{2048}}x^{2}+{\frac {-819}{2048}}x+{\frac {-819}{4096}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/209f51d0cc01a53f488347b8a071a41958ded9a3)
Plotting this equation in Matlab yields:
![](//upload.wikimedia.org/wikiversity/en/7/72/R4.2.1plot.jpg)
For n = 9:
The excitation is therefore: ![{\displaystyle r_{x}=x-{\frac {x^{3}}{3!}}+{\frac {x^{5}}{5!}}-{\frac {x^{7}}{7!}}+{\frac {x^{9}}{9!}}-{\frac {x^{11}}{11!}}+{\frac {x^{13}}{13!}}-{\frac {x^{15}}{15!}}+{\frac {x^{17}}{17!}}-{\frac {x^{19}}{19!}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/78fbb7facd72e07d5fb5b4422afca30b6af3dfec)
Therefore the particular solution has a form:
![{\displaystyle +K_{9}x^{9}+K_{8}x^{8}+K_{7}x^{7}+K_{6}x^{6}+K_{5}x^{5}+K_{4}x^{4}+K_{3}x^{3}+K_{2}x^{2}+K_{1}x+K_{0}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/89bb45db5479217bb261fcf9a3927aaa24272771)
Differentiating:
![{\displaystyle y_{p}^{'}=19K_{19}x^{18}+18K_{18}x^{17}+17K_{17}x^{16}+16K_{16}x^{15}+15K_{15}x^{14}+14K_{14}x^{13}+13K_{13}x^{12}+12K_{12}x^{11}+11K_{11}x^{10}+10K_{10}x^{9}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/9d0715ddb56700bc599df688209b79c87bf8b19d)
![{\displaystyle +9K_{9}x^{8}+8K_{8}x^{7}+7K_{7}x^{6}+6K_{6}x^{5}+5K_{5}x^{4}+4K_{4}x^{3}+3K_{3}x^{2}+2K_{2}x+1K_{1}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/16378432e60199c8ad1d11f256f5ef369016e132)
![{\displaystyle +72K_{9}x^{7}+56K_{8}x^{6}+42K_{7}x^{5}+30K_{6}x^{4}+20K_{5}x^{3}+12K_{4}x^{2}+6K_{3}x+2K_{2}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a4bd6125ce14d07ade447e23334e0c7da6b09940)
Plugging these values into the ODE and equating them to the excitation, and then solving them by using an upper triangular matrix as before (just as in the n=3 example) in Matlab:
![](//upload.wikimedia.org/wikiversity/en/7/76/R4.2.n9matrix.jpg)
Therefore:
![{\displaystyle +{\frac {-1}{1.563E10}}x^{13}+{\frac {-1}{2.404E9}}x^{12}+{\frac {-1}{6.657E7}}x^{11}+{\frac {-1}{4.537E6}}x^{10}+{\frac {-1}{9.074E5}}x^{9}+{\frac {-4}{8.066E5}}x^{8}+{\frac {-38}{3.192E5}}x^{7}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/5499d7a0f3abf0b3b561a28c8bce812c839633c3)
![{\displaystyle +{\frac {-73}{657010}}x^{6}+{\frac {-218}{65401}}x^{5}+{\frac {-218}{65401}}x^{4}+{\frac {-3441}{49157}}x^{3}+{\frac {-1198}{4061}}x^{2}+{\frac {-1431}{8177}}x+{\frac {145}{4462}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/9b8b8bf728f9e07d5db2c2d1f32ba771c3e81438)
The final solution is then found to be:
![{\displaystyle +{\frac {-1}{1.563E10}}x^{13}+{\frac {-1}{2.404E9}}x^{12}+{\frac {-1}{6.657E7}}x^{11}+{\frac {-1}{4.537E6}}x^{10}+{\frac {-1}{9.074E5}}x^{9}+{\frac {-4}{8.066E5}}x^{8}+{\frac {-38}{3.192E5}}x^{7}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/5499d7a0f3abf0b3b561a28c8bce812c839633c3)
![{\displaystyle +{\frac {-73}{657010}}x^{6}+{\frac {-218}{65401}}x^{5}+{\frac {-218}{65401}}x^{4}+{\frac {-3441}{49157}}x^{3}+{\frac {-1198}{4061}}x^{2}+{\frac {-1431}{8177}}x+{\frac {145}{4462}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/9b8b8bf728f9e07d5db2c2d1f32ba771c3e81438)
Evaluating at the initial conditions, we have:
![{\displaystyle y_{n}(0)=c_{1}+c_{2}+{\frac {145}{4462}}=1\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e4adad4007b5aedd0fbd251ff497b6000dc6178b)
![{\displaystyle y_{n}^{'}(0)=c_{1}+2c_{2}+{\frac {-1431}{8177}}=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/2c39e34cb6b60d26a89df07e322d1dcabbb52356)
Solving this system of equations, we find:
Therefore the final solution is:
![{\displaystyle +{\frac {-1}{1.563E10}}x^{13}+{\frac {-1}{2.404E9}}x^{12}+{\frac {-1}{6.657E7}}x^{11}+{\frac {-1}{4.537E6}}x^{10}+{\frac {-1}{9.074E5}}x^{9}+{\frac {-4}{8.066E5}}x^{8}+{\frac {-38}{3.192E5}}x^{7}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/5499d7a0f3abf0b3b561a28c8bce812c839633c3)
Plotting this equation in Matlab yields:
![](//upload.wikimedia.org/wikiversity/en/7/72/R4.2.1plot.jpg)
Note: On the interval from
to
, the resulting plots of the solutions, on such a large scale (note that the Y-axis is forced to be on the order of
!) each plot looks almost exactly identical. It is not until you are able to zoom in a lot do you see the very slight change in the curve of each plot on this interval.
--Egm4313.s12.team11.sheider (talk) 01:09, 14 March 2012 (UTC)
Solved by Daniel Suh
Using the particular solution from Table 2.1 on Kreyszig, find the overall solution
, and plot it compared with
for n = 3,5,9
![{\displaystyle y''-3y'+2y=r(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/01a25cd23b4aa2ccd2e7e13e69b98c297b3c0462)
![{\displaystyle r(x)=sin(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/57cb50290b6ae6e271b08e2be10569b556f2faf9)
Initial Conditions:
, ![{\displaystyle y'(0)=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/6e2c7cc83a57d75b1c0eec87fb9833db40b60c62)
To find
,
![{\displaystyle y''-3y'+2y=r(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/01a25cd23b4aa2ccd2e7e13e69b98c297b3c0462)
![{\displaystyle \lambda ^{2}-3\lambda +2=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/acda7e2f9dc09ae2212b455504353bd189576ce3)
![{\displaystyle (\lambda -2)(\lambda -1)=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/af5d3775e3da754de856d4bda6f0a85f8b327555)
![{\displaystyle \lambda _{1}=2,\lambda _{2}=1\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/41db091fd07606cbf8df7e00d477e089843d63b9)
![{\displaystyle y_{h}(x)=c_{1}e^{2x}+c_{2}e^{x}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/2e5661ddd3ae95fc21155eb174d757e17e49574f)
To find
,
Using Table 2.1, we find that for
,
![{\displaystyle y_{p}=Kcos(\omega x)+Msin(\omega x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c48471c1556e6cd1ef6fa92ff6e2da54f919b1cc)
![{\displaystyle y'_{p}=-Ksin(\omega x)+Mcos(\omega x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/50578257d53dac7d5a0022aad4ffb7bafcaee0b2)
![{\displaystyle y''_{p}=-Kcos(\omega x)-Msin(\omega x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/754c78a58c53aa770f91d586c3e56129b88b5bad)
Plugging it back into the equation,
![{\displaystyle (-Kcos(x)-Msin(x))-3(-Ksin(x)+Mcos(x))+2(Kcos(x)+Msin(x))=sin(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/2c64ee86e6533211ddf159bad525a26d2c1f5a0f)
![{\displaystyle (3K+M)sin(x)+(K-3M)cos(x)=sin(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a09ce991d51e8df2bf9d493b3e570bf35a476381)
Solving for coefficients,
![{\displaystyle (3K+M)=1\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/100b9e5e8639aefeb40de75af52240dad8487c0a)
![{\displaystyle (K-3M)=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c7c222224572457f05ecdb92a138aefec607f867)
![{\displaystyle K={\frac {3}{10}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0945cab742ba12cc3620b1f6828455036f20cf11)
![{\displaystyle M={\frac {1}{10}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b3b43ce881a69c38bf14373d344d1849b6c0028b)
![{\displaystyle y_{p}(x)={\frac {3}{10}}cos(x)+{\frac {1}{10}}sin(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d880cd3fdd5555041bcdc4cbe56bee3bc91cf3cc)
![{\displaystyle y(x)=y_{h}(x)+y_{p}(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b5b27862316c71cea6d463ff89e366f0987a799d)
![{\displaystyle y(x)=c_{1}e^{2x}+c_{2}e^{x}+{\frac {3}{10}}cos(x)+{\frac {1}{10}}sin(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7c6ed04146fc5434c8e0cf8ecf908b56efd37afb)
Solving with initial conditions,
![{\displaystyle y(x)=c_{1}e^{2x}+c_{2}e^{x}+{\frac {3}{10}}cos(x)+{\frac {1}{10}}sin(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7c6ed04146fc5434c8e0cf8ecf908b56efd37afb)
![{\displaystyle y'(x)=2c_{1}e^{2x}+c_{2}e^{x}-{\frac {3}{10}}sin(x)+{\frac {1}{10}}cos(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d5c502fc96a1e2a5b73c86561af085b06da08425)
![{\displaystyle 1=c_{1}+c_{2}+{\frac {3}{10}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/50789202c8a55aa81defcd7ec1556e059d2e1110)
![{\displaystyle 0=2c_{1}+c_{2}+{\frac {1}{10}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/2ef1ce3c54720b15100943cc34fcd4ddd0bdc470)
![{\displaystyle c_{1}={\frac {-4}{5}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/445e495148861d147f8929764990acbbf75b5ecb)
![{\displaystyle c_{2}={\frac {3}{2}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/06317edd7fdc4ea60abd798b4a9787f540187165)
![{\displaystyle y(x)={\frac {-4}{5}}e^{2x}+{\frac {3}{2}}e^{x}+{\frac {3}{10}}cos(x)+{\frac {1}{10}}sin(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/6a84b1b75a0b707cba73d8cdb69aa7b0afc64a79)
![{\displaystyle \!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/78a9e37f799bdd8621f4e34e75db19fe08d108bb)
Plotting in matlab yields:
![](//upload.wikimedia.org/wikiversity/en/d/de/4.2bPlot.png)
As shown on the graph, the two plots are exactly the same.
Created by [Daniel Suh] 20:43, 13 March 2012 (UTC)
Solved by Francisco Arrieta
- Develop
in Taylor Series about
to reproduce the figure on page 7-25
![{\displaystyle f(x)=\sum _{n=0}^{\infty }{\frac {f^{(n)}({\hat {x}})}{n!}}(x-{\hat {x}})^{n}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c24740835e835668b3002caa04e0f2011a78c3f8)
For n=4:
![{\displaystyle \log(x+1)={\frac {x}{\log(10)}}-{\frac {x^{2}}{\log(10^{2})}}+{\frac {x^{3}}{\log(10^{3})}}-{\frac {x^{4}}{\log(10^{4})}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/53ba615a800f5d225f6c84dd4e113e9b5bdb4ea1)
For n=7:
![{\displaystyle \log(x+1)={\frac {x}{\log(10)}}-{\frac {x^{2}}{\log(10^{2})}}+{\frac {x^{3}}{\log(10^{3})}}-{\frac {x^{4}}{\log(10^{4})}}+{\frac {x^{5}}{\log(10^{5})}}-{\frac {x^{6}}{\log(10^{6})}}+{\frac {x^{7}}{\log(10^{7})}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/aab575ee7415dd43929223129052174467b854b1)
For n=11:
![{\displaystyle \log(x+1)={\frac {x}{\log(10)}}-{\frac {x^{2}}{\log(10^{2})}}+{\frac {x^{3}}{\log(10^{3})}}-{\frac {x^{4}}{\log(10^{4})}}+{\frac {x^{5}}{\log(10^{5})}}-{\frac {x^{6}}{\log(10^{6})}}+{\frac {x^{7}}{\log(10^{7})}}-{\frac {x^{8}}{\log(10^{8})}}+{\frac {x^{9}}{\log(10^{9})}}-{\frac {x^{10}}{\log(10^{10})}}+{\frac {x^{11}}{\log(10^{11})}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8178f31973dfb9c87d7a025b606a383d91e5ff2d)
For n=16:
![{\displaystyle -{\frac {x^{12}}{\log(10^{12})}}+{\frac {x^{13}}{\log(10^{13})}}-{\frac {x^{14}}{\log(10^{14})}}+{\frac {x^{15}}{\log(10^{15})}}-{\frac {x^{16}}{\log(10^{16})}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/6b959ac8761a5f6dfa0eb2f491b321e3ef701458)
Using MATLAB
--Egm4313.s12.team11.arrieta (talk) 00:44, 14 March 2012 (UTC)
Solved by: --Egm4313.s12.team11.vargas.aa (talk) 01:28, 14 March 2012 (UTC)
Given:
![{\displaystyle y''-3y'+2y=r(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/01a25cd23b4aa2ccd2e7e13e69b98c297b3c0462)
where ![{\displaystyle r(x)=\log(1+x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ad9349835503f60351e194f5fd32928c82452aae)
With initial conditions: ![{\displaystyle y(-{\frac {3}{4}})=1,y'(-{\frac {3}{4}})=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c36e28286d992c531ca68f8ff03a2caaa09a63db)
Find the overall solution
for
and plot these solutions on the interval from
First we find the homogeneous solution to the ODE:
The characteristic equation is:
![{\displaystyle (\lambda -2)(\lambda -1)=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/af5d3775e3da754de856d4bda6f0a85f8b327555)
Then,
![{\displaystyle \lambda =1,2\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/665b8a8e6b8fcd57dc28291fa259644ff6ba659a)
Therefore the homogeneous solution is:
![{\displaystyle y_{h}=C_{1}e^{(}2x)+c_{2}e^{x}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0903940be1db8899b50568a3a9924c71b73d2481)
Now to find the particulate solution
For n=4
![{\displaystyle r(x)=\sum _{0}^{n}-{\frac {(-1)^{n}x^{n}}{n\ln(10)}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/1995083561ffc8842cfab6eef6aba7e3e9281a5c)
![{\displaystyle r(x)={\frac {x}{\ln(10)}}-{\frac {x^{2}}{2\ln(10)}}+{\frac {x^{3}}{3\ln(10)}}-{\frac {x^{4}}{4\ln(10)}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7bdf452f7b56fad218572d2e7f0760dabbabbece)
We can then use a matrix to organize the known coefficients:
Then, using MATLAB and the backlash operator we can solve for these unknowns:
![](//upload.wikimedia.org/wikiversity/en/3/3d/4_3n4.PNG)
Therefore
![{\displaystyle y_{p4}=4.0444+3.7458x+1.5743x^{2}+0.3981x^{3}+0.0543x^{4}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a89d48a5e2943c12c7ff84b38b557bd611bab7de)
Superposing the homogeneous and particulate solution we get
![{\displaystyle y_{n}=4.0444+3.7458x+1.5743x^{2}+0.3981x^{3}+0.0543x^{4}+C_{1}e^{2x}+C_{2}e^{x}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/9f28bf5ba855dac54eb8f80cd3039ab09cbb742d)
Differentiating:
Evaluating at the initial conditions:
![{\displaystyle y(-0.75)=0.9698261719+0.231301601C_{!}+0.4723665527C_{2}=1\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/5e32e527292d31e950f9235e32fed6d2ed806f67)
![{\displaystyle y'(-0.75)=1.9645125+0.4462603203C_{1}+0.4723665527C_{2}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/13c8b8c57d716e1b520ddeb0096e10898e497a0b)
We obtain:
![{\displaystyle C_{1}=-4.46\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/aedbb96c22531f7d5bfad39b43a6e3d57b694c20)
![{\displaystyle C_{2}=0.055\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f1b952e8e3f092bf1a8f336333a1f79661218cec)
Finally we have:
![{\displaystyle y_{n}=4.0444+3.7458x+1.5743x^{2}+0.3981x^{3}+0.0543x^{4}-4.46e^{2x}+0.055e^{x}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8dbfda5a566057849a420cc69b0500d5109c61bc)
For n=7
![{\displaystyle r(x)=\sum _{0}^{n}-{\frac {(-1)^{n}x^{n}}{n\ln(10)}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/1995083561ffc8842cfab6eef6aba7e3e9281a5c)
![{\displaystyle r(x)={\frac {x}{\ln(10)}}-{\frac {x^{2}}{2\ln(10)}}+{\frac {x^{3}}{3\ln(10)}}-{\frac {x^{4}}{4\ln(10)}}+{\frac {x^{5}}{5\ln(10)}}-{\frac {x^{6}}{6\ln(10)}}+{\frac {x^{7}}{7\ln(10)}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/774b6448372b67eb6693c68f962062e1f27ba82e)
We can then use a matrix to organize the known coefficients:
Then, using MATLAB and the backlash operator we can solve for these unknowns:
![](//upload.wikimedia.org/wikiversity/en/8/88/4_3n7.PNG)
Therefore
![{\displaystyle y_{p7}=377.4833+375.3933x+185.6066x^{2}+60.5479x^{3}+14.4946x^{4}+2.6492x^{5}+0.3619x^{6}+0.0310x^{7}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0db9b140684a1139aa91da23c7819c56ce9cf06a)
Superposing the homogeneous and particulate solution we get
![{\displaystyle y_{n}=377.4833+375.3933x+185.6066x^{2}+60.5479x^{3}+14.4946x^{4}+2.6492x^{5}+0.3619x^{6}+0.0310x^{7}+C_{1}e^{2x}+c_{2}e^{x}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c7c6a2cb5d4a0fe0f16542800ee2c54820878f8c)
Differentiating:
Evaluating at the initial conditions:
![{\displaystyle y(-0.75)=178.816+0.2231301601C_{!}+0.4723665527C_{2}=1\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8bd60f405c19cb1867ad39fea28fcae0340f7277)
![{\displaystyle y'(-0.75)=178.413+0.4462603203C_{1}+0.4723665527C_{2}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a809fa359950e34c98c6ffd76ed67fbe95979e91)
We obtain:
![{\displaystyle C_{1}=-2.6757\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/83757e6fc287a997666578f9a5f5e82e2827ae64)
![{\displaystyle C_{2}=-375.173\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8a44af748b654cb29dbd44c423dbfd08a02acb5d)
Finally
![{\displaystyle y_{n}=377.4833+375.3933x+185.6066x^{2}+60.5479x^{3}+14.4946x^{4}+2.6492x^{5}+0.3619x^{6}+0.0310x^{7}+-2.6757e^{2x}-375.173e^{x}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/5257dfd573f2e9d368a2b276c6a1af5e9fd3a4e9)
For n=11
![{\displaystyle r(x)=\sum _{0}^{n}-{\frac {(-1)^{n}x^{n}}{n\ln(10)}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/1995083561ffc8842cfab6eef6aba7e3e9281a5c)
![{\displaystyle r(x)={\frac {x}{\ln(10)}}-{\frac {x^{2}}{2\ln(10)}}+{\frac {x^{3}}{3\ln(10)}}-{\frac {x^{4}}{4\ln(10)}}+{\frac {x^{5}}{5\ln(10)}}-{\frac {x^{6}}{6\ln(10)}}+{\frac {x^{7}}{7\ln(10)}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/774b6448372b67eb6693c68f962062e1f27ba82e)
We can then use a matrix to organize the known coefficients:
Then, using MATLAB and the backlash operator we can solve for these unknowns:
![](//upload.wikimedia.org/wikiversity/en/2/21/4_3n11.png)
Therefore
![{\displaystyle y_{p11}=1753158.594+1752673.419x+875851.535x^{2}+291627.134x^{3}+72745.1129x^{4}+14484.362x^{5}+2392.510x^{6}+335.632x^{7}+40.417x^{8}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ec8ba268d7198cab32108791a23c66dee9dc5cbb)
![{\displaystyle +4.1499x^{9}+0.3474x^{(}10)+0.0197x^{(}11)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/92463a4196e019b60b2df7e3785d3b4bc7b8cb01)
Superposing the homogeneous and particulate solution we get
![{\displaystyle y_{n}=1753158.594+1752673.419x+875851.535x^{2}+291627.134x^{3}+72745.1129x^{4}+14484.362x^{5}+2392.510x^{6}+335.632x^{7}+40.417x^{8}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f86722e35ebd573cf3c5f3d4b230f0284c5c986e)
![{\displaystyle +4.1499x^{9}+0.3474x^{(}10)+0.0197x^{(}11)+C_{1}e^{2x}+C_{2}e^{(}x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/93d03a30bbf5f2cb2b24deee6a0e43bbc66774ff)
Differentiating:
![{\displaystyle +1.7517x10^{6}x+1.75267x10^{6}+2C_{1}e^{2x}+C_{2}e^{x}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a46d216922a46764f3fa5294eb3ec056f41e4bc6)
Evaluating at the initial conditions:
![{\displaystyle y(-0.75)=828254+0.2231301601C_{!}+0.4723665527C_{2}=1\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/10a35fb9b8815d776be1dda670f731032d4db46a)
![{\displaystyle y'(-0.75)=828145+0.4462603203C_{1}+0.4723665527C_{2}=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c2511d8a7f7027a9a1bf34d33ec1ad391197277f)
We obtain:
![{\displaystyle C_{1}=-484.022\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d67cf176b9204692655649db5499ce3ebc5d58fc)
![{\displaystyle C_{2}=-1753750\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c3a77d32b8ebe63a3a5a5c547bf00547165ef6ae)
Finally
![{\displaystyle y_{n}=1753158.594+1752673.419x+875851.535x^{2}+291627.134x^{3}+72745.1129x^{4}+14484.362x^{5}+2392.510x^{6}+335.632x^{7}+40.417x^{8}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f86722e35ebd573cf3c5f3d4b230f0284c5c986e)
![{\displaystyle +4.1499x^{9}+0.3474x^{(}10)+0.0197x^{(}11)-484.022e^{2x}-1753750e^{x}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/33da837d3ac3e0d70f9d034e893045c45d4e4b3e)
Plot for part 2 and part 3. Please note that because of the broad scale, it is almost impossible to distinguish between the graphs for n=4,7,11 nad the ODE45 operator. Only when zoomed in is there any noticeable difference
Find n sufficiently high so that
do not differ from the numerical solution by more than
at ![{\displaystyle x_{1}=0.9}](https://wikimedia.org/api/rest_v1/media/math/render/svg/271c0b04a8e24b4b77e5f80eb409c2fa5368f76d)
Using a program in MATLAB that iteratively added terms onto the taylor series of
, terms were added until the error between the exact answer and the series was less than
.
![](//upload.wikimedia.org/wikiversity/en/4/46/Taylor_series_441a.jpg)
It was found after trial and error that
for the error to be of a magnitude of
. This error found was
9.7422e-005
Similarly, for
.
![](//upload.wikimedia.org/wikiversity/en/9/9f/Taylor_series441b.jpg)
It was found after trial and error that
for the error to be of a magnitude of
. This error found was
9.3967e-005
Develop
in Taylor series about
for
and plot these truncated series vs. the exact function.
What is now the domain of convergence by observation?
A MATLAB program was created, which calculated the Taylor series of each n value, along with the exact function, then plotted these together to show the comparison of all the series.
Below is the Taylor series for
expanded at
.
![{\displaystyle {\frac {x-1}{2\,\ln \!\left(10\right)}}-{\frac {{\left(x-1\right)}^{2}}{8\,\ln \!\left(10\right)}}+{\frac {{\left(x-1\right)}^{3}}{24\,\ln \!\left(10\right)}}-{\frac {{\left(x-1\right)}^{4}}{64\,\ln \!\left(10\right)}}+{\frac {{\left(x-1\right)}^{5}}{160\,\ln \!\left(10\right)}}-{\frac {{\left(x-1\right)}^{6}}{384\,\ln \!\left(10\right)}}+{\frac {\ln \!\left(2\right)}{\ln \!\left(10\right)}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f1f09acf23a87fd80c112ecd1156dbb8db421b57)
![](//upload.wikimedia.org/wikiversity/en/d/d5/Taylor_series_442_code.jpg)
![](//upload.wikimedia.org/wikiversity/en/7/74/Taylor_series_442_graph.jpg)
It can be seen by observation that the domain of convergence has shifted to the right one unit.
--egm4313.s12.team11.gooding (talk) 03:48, 14 March 2012 (UTC)
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)