

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A maple project for math 2280 students to learn how to use maple and maple programming to solve differential equations. The project involves implementing euler's method, improved euler's method, and runge-kutta method to calculate the values of famous numbers e, ln 2, and π out to three decimal places for euler's method and five decimal places for improved euler's method and nine decimal places for runge-kutta method. The document also includes instructions on how to open maple, create a new document in worksheet mode, and enter the given maple programs.
Typology: Study Guides, Projects, Research
1 / 3
This page cannot be seen from the preview
Don't miss anything!


This project will introduce us to Maple, and how we can use Maple and Maple programming to help us solve differential equations. The goal of this project is to introduce you to Maple programming, and to give you some experience of Maple programming by writing Maple programs that implement the various numerical methods we learned for solving first- order ODEs at the end of chapter 2.
We won’t be going in depth (at all) in this project or in this class on how to program in Maple. That’s a subject for another class, and frankly a sub- ject that your instructor would be unqualified to teach. We’re just going to learn the minimum you’ll need to know to start writing and hacking around with your own programs to do differential equations.
The first thing you’ll want to do is open up Maple on one of the com- puters in the math department. Then, you’ll want to open up a new doc- ument in worksheet mode. It’s very important that for programming we’re in worksheet mode. Next, you’ll want to go to the edit menu, and make sure you’re in text mode. So, if the edit menu says “switch to math mode F5”, then you’re good. If the edit menu says “switch to text mode F5”, then you’re going to want to click on that option to switch to text mode.
When this is done, enter in the following program:
EulersMethod := proc(x0,y0,h,n) local xk, yk, k; xk := x0; yk := y0; k := 0; while k < n do k := k+1; yk := yk + h*f(xk,yk); xk := xk + h; end do; [xk,yk]; end;
This program implements Euler’s Method for the function f. However, before you run it, you need to specify what this function f is. If we want to specify the function f (x, y) = y, then we’d do so by typing into Maple:
f := (x,y) -> y;
Do, this, and then run Euler’s method with a step size of .5 and a num- ber of steps 2, staring at the point x 0 = 0, and y 0 = 1. You would do this by entering:
EulersMethod(0,1,.5,2);
If you do this, you’ll get the final result we derived in class. If we want to instead do this for a step size of .1, and 10 steps we would enter:
EulersMethod(0,1,.1,10);
Again, we’d get the final answer we derived in class.
2 Maple Project
First, read through and do all the homework problems for sections 2.4, 2.5, and 2.6, so that you know something about Euler’s method, improved