withpdetools sol pdsolve wave uxt sol

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

View Full Document Right Arrow Icon
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. > 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. > dsolve( {eq(t), ini}, {theta(t)} ); θ(t) = 20 + 80 e(−1/10 t) > q := rhs(%); q := 20 + 80 e(−1/10 t) Thus, you can compare the series solution with the actual solution. > plot( [p, q], t=0..30 ); 100 80 60 40 20 0 –20 5 10 15 t 20 25 30 Instead of finding the Taylor series by hand, you can use the series option of the dsolve command. 7.2 Ordinary Differential Equations > 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 differential 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. > de := (x^7+x^3-3)*diff(y(x),x,x) + x^4*diff(y(x),x) > + (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 find a closed form solution to de. > 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, find a series approximation. > 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 Differential Equations You cannot solve many differential equations analytically. In such cases, plotting the differential equation is advantageous. > ode1 := > 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 > 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. > dsolve({ode1, ic1}, {y(t)} ); The dsolve command returned nothing, indicating that it could not find a solution. Try Laplace methods. > dsolve( {ode1, ic1}, {y(t)}, method=laplace ); Again, dsolve did not find a solution. Since dsolve was not successful, try the DEplot command found in the DEtools package. > with(DEtools): DEplot is a general ODE plotter which you can use with the following syntax. 7.2 Ordinary Differential Equations • 261 DEplot( ode, dep-var, range, [ini-conds ] ) • ode is the differential 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