This preview shows pages 1–2. Sign up to view the full content.
01/21/08
NEEP 602  Engineering Problem Solving II
Exercise 1
A large fraction of the problems we’ll examine this semester will be differential equations, so
we’ll begin there for illustration and, in the process, remind ourselves of some of the features of
Matlab.
In discussing ordinary differential equations (ODEs), we can divide these into two broad
categories that depend on how boundary conditions are prescribed.
First we note that the number
of boundary conditions depends on the order of the equation: a first order ODE requires only one
boundary condition, a second order ODE requires two, and so forth.
If the conditions are all
prescribed at the same point, the information about the solution has to be originated at that point
and marched or propagated to different parts of the solution domain.
This results in one kind of
solution approach.
If the conditions are prescribed at different points (say, at the beginning and
end of an interval), then information about the solution in the rest of the domain has to span the
whole interval with the boundary condition information incorporated into the solution.
This latter
condition results in a second kind of approach.
We’ll refer to problems having the first kind of
boundary condition information as Initial Value Problems (IVPs) and the second as Boundary
Value Problems (BVPs).
We’ll begin our treatment of differential equations by considering the
simplest (first order) IVPs.
Matlab provides several utilities (among them,
ode45
) for solving IVPs, but what goes on inside
the utility is hidden from us, so we’ll spend some time today talking about how we would
advance the solution ourselves, and in the process introduce some terms that will be helpful in
characterizing computational approaches to problemsolving.
Numerical Solution of First Order IVP:
)
,
(
'
y
x
f
y
=
To provide some motivation for the
RungeKutta
method embedded in, for instance, Matlab’s
ode45
utility, we begin with simpler ways of advancing the solution and work towards more
accurate ones.
For reference, consider the first order IVP:
1
)
0
(
;
=
+
=
y
y
x
dx
dy
Since you’ve all taken Math 319 (or some other course on the solution of ODEs), you’ll know
that this first order, linear, nonhomogeneous ODE has a solution given by:
1
2
)
(
−
−
=
x
e
x
y
x
As we’ll do often over the course of this semester, we’ll use the analytical solution to compare the
accuracy of various numerical methods.
Instead of beginning with a numerical solution of the differential equation itself, let’s begin with
a Taylor series expansion of the function in the neighborhood of
x
= 0.
We know that a general
expression for the Taylor series in the neighborhood of a point
x
=
x
o
, is:
...
)
(
!
3
)
(
'
'
'
)
(
!
2
)
(
'
'
)
)(
(
'
)
(
)
(
3
2
+
−
+
−
+
−
+
=
o
o
o
o
o
o
o
x
x
x
y
x
x
x
y
x
x
x
y
x
y
x
y
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
 Spring '08
 Witt

Click to edit the document details