This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 1 O O O O O O O O O O O O O O O O Euler's Method  The Maple Way restart:with(plots):with(DEtools): We begin again by entering the initial value problem. deq:=diff(y(x),x) = 5/sqrt(x+25); IC:=y(0)=0; deq := d d x y x = 5 x C 25 IC := y = 0 We solve the equation, change the righthand side to a function using unapply , and create the plot structure for our domain. Here we choose not to initialize the array structures. Y:=dsolve({deq,IC},y(x)); Y:=unapply(rhs(Y),x); p[1]:=plot(Y(x),x=0..700): Y := y x = 10 x C 25 K 50 Y := x / 10 x C 25 K 50 We use dsolve to implement Euler's method by setting the type to numeric, the method to classical [foreuler] (classical would be sufficient since foreuler, standing for forward Euler method, is the default), and providing a starting point for the independent variable and a stepsize. Y100:=dsolve({deq, IC}, y(x), type=numeric, method=classical[foreuler], start=0.0,stepsize=100); Y100 := proc x_classical ... end proc The output in this case is a procedure from which the data we want can be extracted. Suppose we simply wanted to find the data for when x = 200 . Y100(200); x = 200., y x = 144.721359549995782 We can do the following to create an ordered pair representing a single data point....
View
Full Document
 Spring '10
 Kidnan
 Numerical Analysis, Runge–Kutta methods, Numerical ordinary differential equations

Click to edit the document details