LearningGuide

# withpdetools sol pdsolve wave uxt sol

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: olynom); 258 • Chapter 7: Solving Calculus Problems p := 100 − 8 t + 22 13 14 1 t− t+ t− t5 5 75 3000 150000 You can now plot the response. &gt; plot(p, t=0..30); 100 80 60 40 20 0 –20 5 10 15 t 20 25 30 This particular example has the following analytic solution. &gt; dsolve( {eq(t), ini}, {theta(t)} ); θ(t) = 20 + 80 e(−1/10 t) &gt; q := rhs(%); q := 20 + 80 e(−1/10 t) Thus, you can compare the series solution with the actual solution. &gt; plot( [p, q], t=0..30 ); 100 80 60 40 20 0 –20 5 10 15 t 20 25 30 Instead of ﬁnding the Taylor series by hand, you can use the series option of the dsolve command. 7.2 Ordinary Diﬀerential Equations &gt; dsolve( {eq(t), ini}, {theta(t)}, ’series’ ); • 259 θ(t) = 100 − 8 t + 22 13 14 1 t− t+ t− t5 + O(t6 ) 5 75 3000 150000 When You Cannot Find a Closed Form Solution In some instances, you cannot express the solution to a linear ODE in closed form. In such cases, dsolve may return solutions containing the data structure DESol. DESol is a place holder representing the solution of a diﬀerential equation without explicitly computing it. Thus, DESol is similar to RootOf, which represents the roots of an expression. This allows you to manipulate the resulting expression symbolically prior to attempting another approach. &gt; de := (x^7+x^3-3)*diff(y(x),x,x) + x^4*diff(y(x),x) &gt; + (23*x-17)*y(x); de := d2 d (x7 + x3 − 3) ( dx2 y(x)) + x4 ( dx y(x)) + (23 x − 17) y(x) The dsolve command cannot ﬁnd a closed form solution to de. &gt; dsolve( de, y(x) ); y(x) = DESol d ( dx2 _Y(x)) + 2 d x4 ( dx _Y(x)) (23 x − 17) _Y(x) , + x7 + x3 − 3 x7 + x3 − 3 {_Y(x)} You can now try another method on the DESol itself. For example, ﬁnd a series approximation. &gt; series(rhs(%), x); 260 • Chapter 7: Solving Calculus Problems _Y(0) + D(_Y )(0) x − (− 17 _Y(0) x2 + 6 23 17 D(_Y )(0) + _Y(0)) x3 + 18 18 289 23 ( _Y(0) + D(_Y )(0)) x4 + 216 36 289 833 ( D(_Y )(0) − _Y(0)) x5 + O(x6 ) 1080 540 The diff and int commands can also operate on DESol. Plotting Ordinary Diﬀerential Equations You cannot solve many diﬀerential equations analytically. In such cases, plotting the diﬀerential equation is advantageous. &gt; ode1 := &gt; diff(y(t), t\$2) + sin(t)^2*diff(y(t),t) + y(t) = cos(t)^2; ode1 := ( d2 d y(t)) + sin(t)2 ( y(t)) + y(t) = cos(t)2 dt2 dt &gt; ic1 := y(0) = 1, D(y)(0) = 0; ic1 := y(0) = 1, D(y )(0) = 0 First, attempt to solve this ODE analytically by using dsolve. &gt; dsolve({ode1, ic1}, {y(t)} ); The dsolve command returned nothing, indicating that it could not ﬁnd a solution. Try Laplace methods. &gt; dsolve( {ode1, ic1}, {y(t)}, method=laplace ); Again, dsolve did not ﬁnd a solution. Since dsolve was not successful, try the DEplot command found in the DEtools package. &gt; with(DEtools): DEplot is a general ODE plotter which you can use with the following syntax. 7.2 Ordinary Diﬀerential Equations • 261 DEplot( ode, dep-var, range, [ini-conds ] ) • ode is the diﬀerential equation to plot • dep-var...
View Full Document

## This note was uploaded on 08/27/2012 for the course MATH 1100 taught by Professor Nil during the Spring '12 term at National University of Singapore.

Ask a homework question - tutors are online