Maple Project 1: Solving Diff. Equations with Numerical Methods, Study Guides, Projects, Research of Mathematics

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

Pre 2010

Uploaded on 08/31/2009

koofers-user-6tq
koofers-user-6tq 🇺🇸

9 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Math 2280 - Maple Project 1
Dylan Zwick
Spring 2009
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.
1 Maple Programming
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:
1
pf3

Partial preview of the text

Download Maple Project 1: Solving Diff. Equations with Numerical Methods and more Study Guides, Projects, Research Mathematics in PDF only on Docsity!

Math 2280 - Maple Project 1

Dylan Zwick

Spring 2009

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.

1 Maple Programming

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