Some Programs for Math 55

These are numerical methods for approximating solutions to first-order differential equations, originally written for my differential equations class, Spring 2015, at Pasadena City College.

Quick Start

Before using these, make sure you’ve read the Getting Started with Maxima page.

These programs can be modified to analyze any equation of the form dy/dx = f(x, y). This involves changing:

  • The function f
  • The initial conditions
  • The step size
  • The number of iterations

The function and initial conditions are at the top, as shown in the screenshots. (These are for the Taylor-series method, but it’s very similar for the Runge-Kutta method.)

Two lines of text in wxMaxima: "f(x,y):=x+y;" and "x[0]:0;y[0]:1;" The first line is labeled "function" and the second line is labeled "initial conditions".

The step size and iterations are in the middle. Look for a line starting with “h:”.

Two lines of text in wxMaxima: "h: float(1/3);" and "for n: 1 thru 3 do (". The number 3 is circled in the second line. The first line is labeled "interval size [float() recommended]" and the second line is labeled "number of iterations (circled)".

To have Maxima return decimal results, you should enter h as a decimal or use the float() function on an exact value.

Reply to this post via e-mail.
Philip Chung
Philip Chung
Software Developer