Chem Differential Eq HW Solutions Fall 2011 196

# Chem Differential Eq HW Solutions Fall 2011 196 - A196...

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: A196 Appendix A Ordinary Diﬀerential Equations: Review of Concepts and Methods With the previous example in hand, we can solve Exercises 19-22 using Mathematica by repeating and modifying the commands. Here is an illustration with Exercise 19. We suppress some outcomes to save space. 19. y − y + 2y = ex , y(0) = 0, y (0) = 1. In[70]:= Clear y, seriessol, n, partsol n 10 seriessol Series y x , x, 0, n . y0 0, y ’ 0 leftside D seriessol, x, 2 D seriessol, x, 1 Series E ^ x, x, 0, n ; rightside equat LogicalExpand leftside rightside ; seriescoeff Solve equat ; ; partsol Normal seriessol . seriescoeff 1 Out[71]= x 2 seriessol; 10 Out[72]= 1 1 y 2 1 y 720 1 y 3 0 x3 6 y 7 0 x7 0 x6 5040 0 x2 6 1 1 y 4 0 x4 y5 24 120 y 8 0 x8 y 9 0 x9 40320 362880 0 x5 y 10 0 x10 3628800 Ox 11 The equation can be solved using analytical methods (undetermined coefficients). The exact solution is sol DSolve In[46]:= 1 14 sss x2 y ’’ x sol 7 Cos y’ x 2y x E ^ x, y 0 0, y ’ 0 1, 1, 2 7x 2 7 x2 Cos 7x 2 2 3 7 Sin 7x 2 Let's compare with the partial sum that we found earlier In[67]:= Plot sss, partsol , x, 2, 2 2 1.5 1 0.5 -2 Out[67]= 1 , y x ,x ; -1 Graphics We have a nice match on the interval [-2, 2] 1 2 7 x2 Sin 7x 2 2 ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online