Math 466 Numerical Analysis
Math 466 Numerical Analysis
Math 466 Numerical Analysis
the di erential equation exactly. Plot the computed solutions and the true solution on a
single graph.
2. Let f (x; y) = y(2 y). Run the program with a = 0; b = 4; k = 8, for the three initial
y values ya = :1; 1; 3, and let m = 28 . Plot the results on a single graph.
3. Let f (x; y) = x2 + y2 . Let a = 0; b = 1; ya = 1, and let m = 2 , where k = 2; : : : ; 8.
Plot the solutions and explain the results.
k
u0 = F(x; u)
where u and F are n-vectors. Take the suggestion of Johnson & Riess, p396, and write a
subroutine func(x; u; y), which puts the value of F(x; u) in y. The program should take
as inputs the following arguments:
integer n 10, where n is the dimension of the system
initial x value
nal x value
initial values u1; u2; : : : ; u
positive integer m, where the number of subdivisions is m
The step-size is then h = (b a)=m. There is also a parameter VALMAX, which may
be taken to be 1.e6.
The program should place the values u(x ) = (u1(x ); u2 (x ); : : : ; u (x )), calculated
at the intermediate points x , in an external le or print an error message if some calculated
value of ku(x )k or ky(x )k exceeds VALMAX.
n
X 0 = 10X + 10Y
Y 0 = XZ + rX Y
Z 0 = XY 8Z=3
with initial conditions X (0) = 0; Y (0) = 1; Z (0) = 0. Solve this system on 0 t 30,
using the method of your choice with a stepsize of :01, with r assuming the values 5; 20; 28.
In each case make the following plots: (t; Y ); (X; Y ); (Y; Z ).
s0 = cd
c0 = ds
d0 = sc=3
with initial conditions s(0) = 0; c(0) = d(0) = 1. This is the system satis ed by the
angular momentum of a rigid body with moments of inertia (1; 2; 3) (an asymmetric top).
The solution is periodic in t. Find the period P by nding the rst P > 0 for which
s(P ) = 0; c(P ) = d(P ) = 1. This period is also given by an integral
4
Z1
dx
(1 x2)(1 x2 =3)
Use a Gaussian quadrature routine to compute this integral. There is yet another way to
compute P (also due to Gauss) using the arithmetic- p
geometric mean. Let a0 = 1; b0 =
p
2=3. For n 0, let a +1 = (a + b )=2; b +1 = a b . The sequences fa g; fb g
converge very rapidly to a common limit L. Gauss showed that P = 2 =L.
Project # 5 (Extra Credit, due June 1)
n
n n
yy
opt
xx