University of Florida/Egm4313/s12.team11.R4

From testwiki
Jump to navigation Jump to search

Template:Big3


Intermediate Engineering Analysis
Section 7566
Team 11
Due date: March 14, 2012.

R4.1

Problem Statement

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).

Given

As shown in p.7-21, the first equation is:

2C2+ac1+bc0=d0 (1) p.7-21

According to p.7-20, the general form of the series is:

j=0n2[cj+2(j+2)(j+1)+acj+1+bcj]xj+acnnxn1+b[cn1xn1+cnxn]=j=0ndjxj (2) p. 7-20

From (2) p.7-20, we can obtain n+1 equations for n+1 unknown coefficients c0,...,cn.

After referring to p.7-22, it can be determined that the matrix to be set up is of the following form:

A=[XXX0000XX00000X000000XXX0000XX00000X]

where the rows signify the coefficients c0,c1,c2,cn2,cn1,cn, and the columns signify d0,d1,d2,dn2,dn1,dn.

Solution

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 d0:

j=0: d0=2C2+ac1+bc0 (1)

Equation associated with d1:

j=1: d1=6c3+2ac2+bc1 (2)

Equation associated with d2:

j=2: d2=12c4+3ac3+bc2 (3)

Equation associated with dn2:

j=n-2: dn2=[cn(n)(n1)+acn1(n1)+bcn2] (n-2)

Equation associated with dn1:

j=n-1: dn1=acnn+bcn1 (n-1)

Equation associated with dn:

j=n: dn=bcn (n)

Using all of the above equations, (1), (2), (3), (n-2), (n-1), (n), we can then determine the A matrix to be:


                          A=[ba20000b2a00000b000000ba(n1)n(n1)0000ban00000b] 
                 

Solved by Gonzalo Perez

R4.2

Part 1

Solved by Jonathan Sheider

Problem Statement

Given: y'3y'+2y=sin(x)

With initial conditions: y(0)=1,y(0)=0

Using the Taylor series for sin(x), reproduce the graph in the lecture notes p.7-24.

Solution

The Taylor series expansion for sin(x) that is plotted with n = 13 is as follows:
y=xx33!+x55!x77!+x99!x1111!+x1313!x1515!+x1717!x1919!+x2121!x2323!+x2525!

Using MatLab, the following Taylor series expansion was plotted and coded:

File:R4.2.1code.jpg

The plot created with n = 13 (i.e. 13 terms) is as follows:

File:R4.2.1.jpg

Part 2

Solved by Jonathan Sheider

Problem Statement

Given: y'3y'+2y=r(x)

With initial conditions: y(0)=1,y(0)=0

Letting r(x) equal the truncated Taylor series of sin(x), i.e. r(x)=k=0n(1)kt2k+1(2k+1)!

Find the overall solution yn(x) for n=3,5,9 and plot these solutions on the interval from [0,4π]

Solution

First finding the homogenous solution to the ODE:

The characteristic equation:

λ23λ+2=0

(λ2)(λ1)=0

Therefore, λ=1,2

And the homogenous solution is:

yh=c1ex+c2e2x

Next the particular solution will be evaluated.

For n = 3:

The excitation is therefore: rx=xx33!+x55!x77!

Therefore the particular solution has a form:

yp=K7x7+K6x6+K5x5+K4x4+K3x3+K2x2+K1x+K0

Differentiating:

yp'=7K7x6+6K6x5+5K5x4+4K4x3+3K3x2+2K2x+1K1

yp'=42K7x5+30K6x4+20K5x3+12K4x2+6K3x+2K2

Plugging these values into the ODE and equating them to the excitation:

42K7x5+30K6x4+20K5x3+12K4x2+6K3x+2K2
3(7K7x6+6K6x5+5K5x4+4K4x3+3K3x2+2K2x+1K1)
+2(K7x7+K6x6+K5x5+K4x4+K3x3+K2x2+K1x+K0)=xx33!+x55!x77!

42K7x5+30K6x4+20K5x3+12K4x2+6K3x+2K2
21K7x618K6x515K5x412K4x39K3x26K2x3K1
+2K7x7+2K6x6+2K5x5+2K4x4+2K3x3+2K2x2+2K1x+2K0=xx33!+x55!x77!

To solve this, we will use an upper triangular matrix, and solve using Matlab. The matrix is as follows:

[232000000266000000291200000021220000000215300000002184200000022100000002][K0K1K2K3K4K5K6K7]=[01013!015!017!]

The answer is calculated in Matlab:
File:R4.2.n3matrix.jpg

Therefore: yp=110080x7+1960x6+1320x5+1128x4+19192x3+51128x2+51128x+51256

The final solution is then found to be: yn=c1ex+c2e2x+110080x7+1960x6+1320x5+1128x4+19192x3+51128x2+51128x+51256

Evaluating at the initial conditions, we have:

yn(0)=c1+c2+51256=1

yn'(0)=c1+2c2+51128=0

Solving this system of equations, we find:

c1=2,c2=205256

Therefore the final solution is:

yn=2ex+205256e2x+110080x7+1960x6+1320x5+1128x4+19192x3+51128x2+51128x+51256

Plotting this equation in Matlab yields:

File:R4.2.1plot.jpg


For n = 5:

The excitation is therefore: rx=xx33!+x55!x77!+x99!x1111!

Therefore the particular solution has a form:

yp=K11x11+K10x10+K9x9+K8x8+K7x7+K6x6+K5x5+K4x4+K3x3+K2x2+K1x+K0

Differentiating:

yp'=11K11x10+10K10x9+9K9x8+8K8x7+7K7x6+6K6x5+5K5x4+4K4x3+3K3x2+2K2x+1K1

yp'=110K11x9+90K10x8+72K9x7+56K8x6+42K7x5+30K6x4+20K5x3+12K4x2+6K3x+2K2

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:
File:R4.2.n5matrix.jpg

Therefore: yp=179833600x11+14838400x10+1967680x9+1215040x8+759419x7+1715360x6
+175120x5+172048x4+3073072x3+8192048x2+8192048x+8194096

The final solution is then found to be: yn=c1ex+c2e2x+179833600x11+14838400x10+1967680x9+1215040x8+759419x7+1715360x6
+175120x5+172048x4+3073072x3+8192048x2+8192048x+8194096

Evaluating at the initial conditions, we have:

yn(0)=c1+c2+8194096=1

yn'(0)=c1+2c2+8192048=0

Solving this system of equations, we find:

c1=2,c2=32774096

Therefore the final solution is:

yn=2ex+32774096e2x+179833600x11+14838400x10+1967680x9+1215040x8+759419x7+1715360x6
+175120x5+172048x4+3073072x3+8192048x2+8192048x+8194096

Plotting this equation in Matlab yields:

File:R4.2.1plot.jpg



For n = 9:

The excitation is therefore: rx=xx33!+x55!x77!+x99!x1111!+x1313!x1515!+x1717!x1919!

Therefore the particular solution has a form:

yp=K19x19+K18x18+K17x17+K16x16+K15x15+K14x14+K13x13+K12x12+K11x11+K10x10
+K9x9+K8x8+K7x7+K6x6+K5x5+K4x4+K3x3+K2x2+K1x+K0

Differentiating:

yp'=19K19x18+18K18x17+17K17x16+16K16x15+15K15x14+14K14x13+13K13x12+12K12x11+11K11x10+10K10x9
+9K9x8+8K8x7+7K7x6+6K6x5+5K5x4+4K4x3+3K3x2+2K2x+1K1

yp'=342K19x17+306K18x16+272K17x15+240K16x14+210K15x13+182K14x12+156K13x11+132K12x10+110K11x9+90K10x8
+72K9x7+56K8x6+42K7x5+30K6x4+20K5x3+12K4x2+6K3x+2K2

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:
File:R4.2.n9matrix.jpg

Therefore: yp=12.433E17x19+18.536E15x18+19.485E14x17+11.112E14x16+12.202E12x15+11.094E11x14
+11.563E10x13+12.404E9x12+16.657E7x11+14.537E6x10+19.074E5x9+48.066E5x8+383.192E5x7
+73657010x6+21865401x5+21865401x4+344149157x3+11984061x2+14318177x+1454462

The final solution is then found to be: yn=c1ex+c2e2x+12.433E17x19+18.536E15x18+19.485E14x17+11.112E14x16+12.202E12x15+11.094E11x14
+11.563E10x13+12.404E9x12+16.657E7x11+14.537E6x10+19.074E5x9+48.066E5x8+383.192E5x7
+73657010x6+21865401x5+21865401x4+344149157x3+11984061x2+14318177x+1454462


Evaluating at the initial conditions, we have:

yn(0)=c1+c2+1454462=1

yn'(0)=c1+2c2+14318177=0

Solving this system of equations, we find:

c1=1.76,c2=0.7925

Therefore the final solution is:

yn=1.76ex+0.7925e2x+12.433E17x19+18.536E15x18+19.485E14x17+11.112E14x16+12.202E12x15+11.094E11x14
+11.563E10x13+12.404E9x12+16.657E7x11+14.537E6x10+19.074E5x9+48.066E5x8+383.192E5x7
+7365701x6+21865401x5+21865401x4+344149157x3+11984061x2+14318177x+1454462

Plotting this equation in Matlab yields:

File:R4.2.1plot.jpg

Note: On the interval from 0 to 4π, the resulting plots of the solutions, on such a large scale (note that the Y-axis is forced to be on the order of 1010!) 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)

Part 3

Solved by Daniel Suh

Problem Statement

Using the particular solution from Table 2.1 on Kreyszig, find the overall solution y(x), and plot it compared with yn(x) for n = 3,5,9

y3y+2y=r(x)
r(x)=sin(x)
Initial Conditions: y(0)=1, y(0)=0

Homogenous Solution

To find yh(x),
y3y+2y=r(x)
λ23λ+2=0
(λ2)(λ1)=0
λ1=2,λ2=1
yh(x)=c1e2x+c2ex

Particular Solution

To find yp(x),
Using Table 2.1, we find that for r(x)=sin(x),
yp=Kcos(ωx)+Msin(ωx)
y'p=Ksin(ωx)+Mcos(ωx)
y'p=Kcos(ωx)Msin(ωx)

Plugging it back into the equation,
(Kcos(x)Msin(x))3(Ksin(x)+Mcos(x))+2(Kcos(x)+Msin(x))=sin(x)
(3K+M)sin(x)+(K3M)cos(x)=sin(x)

Solving for coefficients,
(3K+M)=1
(K3M)=0
K=310
M=110
yp(x)=310cos(x)+110sin(x)

Overall Solution

y(x)=yh(x)+yp(x)
y(x)=c1e2x+c2ex+310cos(x)+110sin(x)

Solving with initial conditions,
y(x)=c1e2x+c2ex+310cos(x)+110sin(x)
y(x)=2c1e2x+c2ex310sin(x)+110cos(x)

1=c1+c2+310
0=2c1+c2+110
c1=45
c2=32

y(x)=45e2x+32ex+310cos(x)+110sin(x)

Plot

Plotting in matlab yields:
File: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)

R4.3

Part 1

Solved by Francisco Arrieta

Problem Statement
Develop log(x+1) in Taylor Series about x=0 to reproduce the figure on page 7-25
Given
f(x)=n=0f(n)(x^)n!(xx^)n
Solution

For n=4:

log(x+1)=xlog(10)x2log(102)+x3log(103)x4log(104)

For n=7:

log(x+1)=xlog(10)x2log(102)+x3log(103)x4log(104)+x5log(105)x6log(106)+x7log(107)

For n=11:

log(x+1)=xlog(10)x2log(102)+x3log(103)x4log(104)+x5log(105)x6log(106)+x7log(107)x8log(108)+x9log(109)x10log(1010)+x11log(1011)

For n=16:

log(x+1)=xlog(10)x2log(102)+x3log(103)x4log(104)+x5log(105)x6log(106)+x7log(107)x8log(108)+x9log(109)x10log(1010)+x11log(1011)
x12log(1012)+x13log(1013)x14log(1014)+x15log(1015)x16log(1016)

File:Log.jpg

Using MATLAB

--Egm4313.s12.team11.arrieta (talk) 00:44, 14 March 2012 (UTC)

Part 2

Solved by: --Egm4313.s12.team11.vargas.aa (talk) 01:28, 14 March 2012 (UTC)

Problem Statement

Given: y3y+2y=r(x)

where r(x)=log(1+x)

With initial conditions: y(34)=1,y(34)=0

Find the overall solution yn(x) for n=4,7,11 and plot these solutions on the interval from [34,3]

Solution

First we find the homogeneous solution to the ODE:
The characteristic equation is:
λ23λ+2=0
(λ2)(λ1)=0
Then, λ=1,2
Therefore the homogeneous solution is:
yh=C1e(2x)+c2ex

Now to find the particulate solution
For n=4

r(x)=0n(1)nxnnln(10)

r(x)=xln(10)x22ln(10)+x33ln(10)x44ln(10)

We can then use a matrix to organize the known coefficients:

[232000266000291200021200002][K0K1K2K3K4]=[01ln(10)12ln(10)13ln(10)14ln(10)]

Then, using MATLAB and the backlash operator we can solve for these unknowns:
File:4 3n4.PNG
Therefore
yp4=4.0444+3.7458x+1.5743x2+0.3981x3+0.0543x4

Superposing the homogeneous and particulate solution we get
yn=4.0444+3.7458x+1.5743x2+0.3981x3+0.0543x4+C1e2x+C2ex

Differentiating:
y'n=3.7458+3.1486x+1.1943x2+0.2172x3+2C1e2x+C2ex Evaluating at the initial conditions:
y(0.75)=0.9698261719+0.231301601C!+0.4723665527C2=1
y(0.75)=1.9645125+0.4462603203C1+0.4723665527C2

We obtain:
C1=4.46
C2=0.055

Finally we have:
yn=4.0444+3.7458x+1.5743x2+0.3981x3+0.0543x44.46e2x+0.055ex

For n=7

r(x)=0n(1)nxnnln(10)

r(x)=xln(10)x22ln(10)+x33ln(10)x44ln(10)+x55ln(10)x66ln(10)+x77ln(10)

We can then use a matrix to organize the known coefficients:

[232000000266000000291200000021220000000215300000002184200000022100000002][K0K1K2K3K4K5K6K7][01ln(10)12ln(10)13ln(10)14ln(10)15ln(10)16ln(10)17ln(10)]

Then, using MATLAB and the backlash operator we can solve for these unknowns:
File:4 3n7.PNG
Therefore
yp7=377.4833+375.3933x+185.6066x2+60.5479x3+14.4946x4+2.6492x5+0.3619x6+0.0310x7

Superposing the homogeneous and particulate solution we get
yn=377.4833+375.3933x+185.6066x2+60.5479x3+14.4946x4+2.6492x5+0.3619x6+0.0310x7+C1e2x+c2ex

Differentiating:
y'n=375.3933+371.213x+181.644x2+57.9784x3+13.46x4+2.1714x5+0.214x6+2C1e2x+C2ex Evaluating at the initial conditions:
y(0.75)=178.816+0.2231301601C!+0.4723665527C2=1
y(0.75)=178.413+0.4462603203C1+0.4723665527C2

We obtain:
C1=2.6757
C2=375.173

Finally
yn=377.4833+375.3933x+185.6066x2+60.5479x3+14.4946x4+2.6492x5+0.3619x6+0.0310x7+2.6757e2x375.173ex

For n=11 r(x)=0n(1)nxnnln(10)

r(x)=xln(10)x22ln(10)+x33ln(10)x44ln(10)+x55ln(10)x66ln(10)+x77ln(10)

We can then use a matrix to organize the known coefficients:
File:N11.PNG [K0K1K2K3K4K5K6K7K8K9K10K11]=[01ln(10)12ln(10)13ln(10)14ln(10)15ln(10)16ln(10)17ln(10)18ln(10)19ln(10)110ln(10)111ln(10)]

Then, using MATLAB and the backlash operator we can solve for these unknowns:
File:4 3n11.png
Therefore
yp11=1753158.594+1752673.419x+875851.535x2+291627.134x3+72745.1129x4+14484.362x5+2392.510x6+335.632x7+40.417x8
+4.1499x9+0.3474x(10)+0.0197x(11)

Superposing the homogeneous and particulate solution we get
yn=1753158.594+1752673.419x+875851.535x2+291627.134x3+72745.1129x4+14484.362x5+2392.510x6+335.632x7+40.417x8
+4.1499x9+0.3474x(10)+0.0197x(11)+C1e2x+C2e(x)

Differentiating:
y'n=0.2167x10+3.474x9+37.3491x8+323.336x7+2349.42x6+14355.1x5+72421.8x4+290980.x3+874881.x2 +1.7517x106x+1.75267x106+2C1e2x+C2ex
Evaluating at the initial conditions:
y(0.75)=828254+0.2231301601C!+0.4723665527C2=1
y(0.75)=828145+0.4462603203C1+0.4723665527C2=0

We obtain:
C1=484.022
C2=1753750

Finally
yn=1753158.594+1752673.419x+875851.535x2+291627.134x3+72745.1129x4+14484.362x5+2392.510x6+335.632x7+40.417x8
+4.1499x9+0.3474x(10)+0.0197x(11)484.022e2x1753750ex

Part 3

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
File:4711.jpg

R4.4

Part 1

Problem Statement

Find n sufficiently high so that yn(x1),y'n(x1) do not differ from the numerical solution by more than 105 at x1=0.9

Solution

Using a program in MATLAB that iteratively added terms onto the taylor series of log(1+x), terms were added until the error between the exact answer and the series was less than 105.

File:Taylor series 441a.jpg

It was found after trial and error that n=39 for the error to be of a magnitude of 105. This error found was 9.7422e-005

Similarly, for y'n(x1).

File:Taylor series441b.jpg

It was found after trial and error that n=74 for the error to be of a magnitude of 105. This error found was 9.3967e-005

Part 2

Problem Statement

Develop log(1+x) in Taylor series about x^=1 for n=4,7,11 and plot these truncated series vs. the exact function.
What is now the domain of convergence by observation?

Solution

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 n=7 expanded at x^=1.
x12ln(10)(x1)28ln(10)+(x1)324ln(10)(x1)464ln(10)+(x1)5160ln(10)(x1)6384ln(10)+ln(2)ln(10)

File:Taylor series 442 code.jpg
File: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)

Part 3=

Solved by Luca Imponenti

Find yn(x) , for n=4,7,11 such that:

yn3yn+2yn=rn(x)

for x in [0.9,3] with the initial conditions found.

Plot yn(x) for n=4,7,11 for x in [0.9,3].

Homogeneous Solution

The homogeneous case is shown below:

y'h3y'h+2yh=0

This equation has the following roots:

λ1=1,λ2=2

Which gives yields the homogeneous solution

yh=c1ex+c2e2x

General Solution, n=4

Using the taylor series approximation from earlier with n=4 we have

r4(x)=log(2)+(x1)2ln(10)(x1)28ln(10)+(x1)324ln(10)(x1)464ln(10)

We know the particular solution, yp4(x), ve will have this form:

yp4(x)=a4(x1)4+a3(x1)3+a2(x1)2+a1(x1)+a0

taking the derivatives of this solution

y'p4(x)=ddxyp4(x)=4a4(x1)3+3a3(x1)2+2a2(x1)+a1

and

y'p4(x)=ddxy'p4(x)=12a4(x1)3+6a3(x1)2+2a2

Plugging the above equations into the original ODE yields the following matrix equation:

[200001220001292000662000232]*[a4a3a2a1a0]=[164ln(10)124ln(10)18ln(10)12ln(10)log(2)]

The unknown vector a can be easily solved by forward substitution,the following values were calculated in matlab:

a4=.0034,a3=.0113,a2=.0577,a1=.1624,a0=.1624

So the particular solution yp4 is

yp4=0.16240.1624*(x1).0577*(x1)2.0113*(x1)3.0034*(x1)4

We can now find the general solution for n=4, y4(x).

y4(x)=yh(x)+yp4(x)

y4(x)=c1ex+c2e2x+0.16240.1624*(x1) .0577*(x1)2.0113*(x1)3.0034*(x1)4

Solving using the initial conditions yields;

        y4(x)=.0595ex.0076e2x+0.16240.1624*(x1)
          .0577*(x1)2.0113*(x1)3.0034*(x1)4

General Solution, n=7

Using the taylor series approximation from earlier with n=7 we have

r7(x)=log(2)+(x1)2ln(10)(x1)28ln(10)+(x1)324ln(10)(x1)464ln(10)+(x1)5160ln(10)(x1)6384ln(10)+(x1)7896ln(10)

In a similar fashion we construct a matrix equation for n=7:

[200000002120000004218200000030152000000201220000001292000000662000000232]*[a7a6a5a4a3a2a1a0]=[1896ln(10)1384ln(10)1160ln(10)164ln(10)124ln(10)18ln(10)12ln(10)log(2)]

Solving:

a7=.0002,a6=.0020,a5=.0141,a4=.0725,a3=.3034,a2=.9029,a1=1.9072,a0=2.1084

So the particular solution yp7 is

yp7=2.1084+1.9072*(x1)+.9029*(x1)2+.3034*(x1)3+.0725*(x1)4+.0141*(x1)5+.0020*(x1)6+.0002*(x1)7

We can now find the general solution for n=7, y7(x).

y7(x)=yh(x)+yp7(x)

y7(x)=c1ex+c2e2x+2.1084+1.9072*(x1)+.9029*(x1)2+

.3034*(x1)3+.0725*(x1)4+.0141*(x1)5+.0020*(x1)6+.0002*(x1)7

Solving using our initial conditions yields

    y7(x)=.7271ex+.0233e2x+2.1084+1.9072*(x1)+   
 .9029*(x1)2+.3034*(x1)3+.0725*(x1)4+.0141*(x1)5+
               .0020*(x1)6+.0002*(x1)7

General Solution, n=11

Using the taylor series approximation from earlier with n=11 we have

r11(x)=log(2)+(x1)2ln(10)(x1)28ln(10)+(x1)324ln(10)(x1)464ln(10)+(x1)5160ln(10)(x1)6384ln(10)+

(x1)7896ln(10)(x1)82048ln(10)+(x1)94608ln(10)(x1)1010240ln(10)+(x1)1122528ln(10)

Finally, we write out the matrix equation for n=11:

File:R4.4.JPG

A*[a11a10a9a8a7a6a5a4a3a2a1a0]=[122528ln(10)110240ln(10)14608ln(10)12048ln(10)1896ln(10)1384ln(10)1160ln(10)164ln(10)124ln(10)18ln(10)12ln(10)log(2)]

Solving the system in matlab:

a11=0,a10=.0002,a9=.0019,a8=.0181,a7=.15,a6=1.0675,a5=6.4597,

a4=32.4318,a3=130.0033,a2=390.3968,a1=781.289,a0=781.6873

So the particular solution yp11 is

yp11=781.6873+781.289*(x1)+390.3968*(x1)2+130.0033*(x1)3+32.4318*(x1)4+

6.4597*(x1)5+1.0675*(x1)6+.15*(x1)7+.0181*(x1)8+.0019*(x1)9+.0002*(x1)10

We can now find the general solution for n=11, y11(x).

y11(x)=yh(x)+yp11(x)

y11(x)=c1ex+c2e2x+781.6873+781.289*(x1)

+390.3968*(x1)2+130.0033*(x1)3+32.4318*(x1)4

6.4597*(x1)5+1.0675*(x1)6+.15*(x1)7+.0181*(x1)8+.0019*(x1)9+.0002*(x1)10

Solving using our initial conditions yields

    y11(x)=287.5907ex+.05e2x+781.6873+781.289*(x1)
     
      +390.3968*(x1)2+130.0033*(x1)3+32.4318*(x1)4
      
               6.4597*(x1)5+1.0675*(x1)6+ 
   
    .15*(x1)7+.0181*(x1)8+.0019*(x1)9+.0002*(x1)10

Plot

y4 shown in red

y7 shown in blue

y11 shown in green

File:Plotr4.JPG

Part 4

Solved by Luca Imponenti

Use the matlab command ode45 to integrate numerically y3y+2y=r(x) with r(x)=log(1+x)

and the initial conditions from Part 3 to obtain the numerical solution for y(x).

Plot y(x) in the same figure as above.

Matlab Solution

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

Plot

Plotting the aboved vector of y-values,along with the results from earlier yields the following graph:

File:Plotr4ode45.JPG

where the answer calculated in matlab is shown in yellow.

Egm4313.s12.team11.imponenti (talk) 08:04, 14 March 2012 (UTC)

Template:CourseCat