Main Page | Report this Page
 
   
Science Forum Index  »  Math - Numerical Analysis Forum  »  Exact solution from numerical methods
Page 1 of 1    
Author Message
Hans Jakob Rivertz
Posted: Tue Feb 13, 2007 5:04 am
Guest
I made an exercise for my students, where they
should solve an ODE by using Runge Kutta and compare
it to the exact solution. To my surprise the Runge Kutta
method gave the exact answer. I have made some investigations
around this but does not find any references. Are there anyone
who know what is known about phenomenons like this.

Best regards
Hans Jakob Rivertz
Peter Spellucci
Posted: Tue Feb 13, 2007 5:04 am
Guest
In article <eqruu5$aur$1@orkan.itea.ntnu.no>,
Hans Jakob Rivertz <rivertz@math.ntnu.no> writes:
Quote:
I made an exercise for my students, where they
should solve an ODE by using Runge Kutta and compare
it to the exact solution. To my surprise the Runge Kutta
method gave the exact answer. I have made some investigations
around this but does not find any references. Are there anyone
who know what is known about phenomenons like this.

Best regards
Hans Jakob Rivertz

the truncation error of Runge Kutta methods of order p
is formed by some combination
of the (p+1)-th derivative of the true solution of the initial value
problem and some partial p-th order derivatives of the right hand side
f(x,y) of the ode y'=f(x,y) (with x and y as independent variables) multiplied
by stepsize h^p. Hence, if these derivatives and partial derivatives vanish,
then, up to roundoff, you get the true solution. this is especially true
if the ode reads y'=f(x), and f is polynomial of order p-1 .
for example the classical runge-kutta method of order 4 reduces to simpsons rule
in this case and integrates a cubic f(x) exactly.
hth
peter
Helmut Jarausch
Posted: Tue Feb 13, 2007 6:29 am
Guest
Hans Jakob Rivertz wrote:
Quote:
I made an exercise for my students, where they
should solve an ODE by using Runge Kutta and compare
it to the exact solution. To my surprise the Runge Kutta
method gave the exact answer. I have made some investigations
around this but does not find any references. Are there anyone
who know what is known about phenomenons like this.


If your Runge Kutta method is exact of oder p (p=4
for the old/classical RK method) then it is exact if
the solution happens to be a polynomial of degree
at most p .

--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
user923005
Posted: Tue Feb 13, 2007 4:36 pm
Guest
On Feb 13, 1:04 am, Hans Jakob Rivertz <rive...@math.ntnu.no> wrote:
Quote:
I made an exercise for my students, where they
should solve an ODE by using Runge Kutta and compare
it to the exact solution. To my surprise the Runge Kutta
method gave the exact answer. I have made some investigations
around this but does not find any references. Are there anyone
who know what is known about phenomenons like this.

You may find this paper interesting:
http://crd.lbl.gov/~dhbailey/dhbtalks/dhb-expmath-hpc.pdf

Numerical integration can be used to discover pure math results that
were hitherto unknown or only suspected.
Dave Dodson
Posted: Tue Feb 13, 2007 8:04 pm
Guest
On Feb 13, 3:04 am, Hans Jakob Rivertz <rive...@math.ntnu.no> wrote:
Quote:
I made an exercise for my students, where they
should solve an ODE by using Runge Kutta and compare
it to the exact solution. To my surprise the Runge Kutta
method gave the exact answer.

You should have tried the problem yourself before assigning it, huh?

Dave
Nasser Abbasi
Posted: Wed Feb 14, 2007 5:36 am
Guest
"Hans Jakob Rivertz" <rivertz@math.ntnu.no> wrote in message
news:eqruu5$aur$1@orkan.itea.ntnu.no...
Quote:
I made an exercise for my students, where they
should solve an ODE by using Runge Kutta and compare
it to the exact solution. To my surprise the Runge Kutta
method gave the exact answer. I have made some investigations
around this but does not find any references. Are there anyone
who know what is known about phenomenons like this.

Best regards
Hans Jakob Rivertz

Another example I suppose is Gauss quadrature for numerical integration.

If the function being integrated is a polynomial of degree 2n-1, then using
n points x_i with weights w_i yields an EXACT result when the points x_i are
the roots of orthogonal polynomials such as legendre polynomials.

Gauss numerical quadrature for numerical integration is used heavily in
finite element methods, since the 'shape' functions are normally selected to
be polynomials.

Nasser
Praveen C
Posted: Wed Feb 14, 2007 9:07 am
Guest
One more example.

If you solve the linear convection equation

u_t + c u_x = 0, c>0

with upwind method and forward euler time stepping

(u^(n+1)_i - u^(n)_i)/dt + c (u^(n)_i - u^(n)_i-1)/dx = 0

and if you choose unit CFL number

c*dt/dx = 1

you get exact solution whatever be the initial condition.

praveen

Nasser Abbasi wrote:
Quote:
"Hans Jakob Rivertz" <rivertz@math.ntnu.no> wrote in message
news:eqruu5$aur$1@orkan.itea.ntnu.no...
I made an exercise for my students, where they
should solve an ODE by using Runge Kutta and compare
it to the exact solution. To my surprise the Runge Kutta
method gave the exact answer. I have made some investigations
around this but does not find any references. Are there anyone
who know what is known about phenomenons like this.

Best regards
Hans Jakob Rivertz


--
http://pc.freeshell.org
Robert Israel
Posted: Wed Feb 14, 2007 8:25 pm
Guest
Helmut Jarausch <jarausch@igpm.rwth-aachen.de> writes:

Quote:
Hans Jakob Rivertz wrote:
I made an exercise for my students, where they
should solve an ODE by using Runge Kutta and compare
it to the exact solution. To my surprise the Runge Kutta
method gave the exact answer. I have made some investigations
around this but does not find any references. Are there anyone
who know what is known about phenomenons like this.


If your Runge Kutta method is exact of oder p (p=4
for the old/classical RK method) then it is exact if
the solution happens to be a polynomial of degree
at most p .

Sorry, that's not true. For example, consider the initial value problem
y' = y + 2 x - x^2, y(0) = 0, which has solution y = x^2.
But if you use classical RK4 with step size h, the result of the first
step is y_1 = h^2 - h^5/48, not h^2.

Perhaps you're thinking of the differential equation y' = f(x).

For a less trivial example, consider the initial value problem

y' = 2 x + a (y - x^2) + b (y - x^2)^2, y(0) = 0
which has solution y = x^2. Classical RK4 with step size h=1
is exact iff a and b satisfy the equation

(1/24)*b+(1/1024)*b^3+(1/4Cool*a^3+(1/3072)*b^4+(1/16384)*b^5
+(1/196608)*b^6+(1/6291456)*b^7+(1/24576)*b^3*a^4+(1/24576)*b^4*a^3
+(1/65536)*b^5*a^2+(1/393216)*a*b^6+(5/98304)*a*b^5+(1/8192)*b^4*a^2
-(1/6144)*b^3*a^3-(1/1536)*b^2*a^4+(1/4096)*a*b^4-(5/6144)*a^2*b^3
-(1/384)*a^3*b^2+(1/384)*a^4*b-(5/6144)*a*b^3-(5/768)*a^2*b^2
+(1/128)*b*a^3-(1/192)*a*b^2+(1/96)*b*a^2+(1/192)*b^2 = 0

describing a certain curve in the a,b plane. For example, with
a=1 there is one real solution for b, approximately −.3180400606.
--
Robert Israel israel@math.MyUniversitysInitials.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada
Guest
Posted: Wed Feb 14, 2007 8:51 pm
On Feb 14, 4:25 pm, Robert Israel
<isr...@math.MyUniversitysInitials.ca> wrote:
Quote:
Helmut Jarausch <jarau...@igpm.rwth-aachen.de> writes:
Hans Jakob Rivertz wrote:
I made an exercise for my students, where they
should solve an ODE by using Runge Kutta and compare
it to the exact solution. To my surprise the Runge Kutta
method gave the exact answer. I have made some investigations
around this but does not find any references. Are there anyone
who know what is known about phenomenons like this.

If your Runge Kutta method is exact of oder p (p=4
for the old/classical RK method) then it is exact if
the solution happens to be a polynomial of degree
at most p .

Sorry, that's not true. For example, consider the initial value problem
y' = y + 2 x - x^2, y(0) = 0, which has solution y = x^2.
But if you use classical RK4 with step size h, the result of the first
step is y_1 = h^2 - h^5/48, not h^2.

Perhaps you're thinking of the differential equation y' = f(x).

For a less trivial example, consider the initial value problem

y' = 2 x + a (y - x^2) + b (y - x^2)^2, y(0) = 0
which has solution y = x^2. Classical RK4 with step size h=1
is exact iff a and b satisfy the equation

(1/24)*b+(1/1024)*b^3+(1/4Cool*a^3+(1/3072)*b^4+(1/16384)*b^5
+(1/196608)*b^6+(1/6291456)*b^7+(1/24576)*b^3*a^4+(1/24576)*b^4*a^3
+(1/65536)*b^5*a^2+(1/393216)*a*b^6+(5/98304)*a*b^5+(1/8192)*b^4*a^2
-(1/6144)*b^3*a^3-(1/1536)*b^2*a^4+(1/4096)*a*b^4-(5/6144)*a^2*b^3
-(1/384)*a^3*b^2+(1/384)*a^4*b-(5/6144)*a*b^3-(5/768)*a^2*b^2
+(1/128)*b*a^3-(1/192)*a*b^2+(1/96)*b*a^2+(1/192)*b^2 = 0

describing a certain curve in the a,b plane. For example, with
a=1 there is one real solution for b, approximately −.3180400606.

Of course that should be -.3180400606. I was copying from Maple, and
I guess the - sign was in Unicode or something.

Another example: for the DE y' = a y, classical RK4 with step size h
gets the exact solutions y = exp(a t) iff
1 + ah + (ah)^2/2 + (ah)^3/6 + (ah)^4/24 = exp(ah).
This has no real solutions except ah = 0, but it does
have complex ones, e.g. approximately
ah = 6.9525624754216669489 + 9.8007293965122781170 i.
If you want to stick to real equations, consider this as
the system
x' = Re(a) x - Im(a) y
y' = Im(a) x + Re(a) y

Robert Israel isr...@math.MyUniversitysInitials.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada
widmar
Posted: Wed Feb 28, 2007 8:31 pm
Guest
israel@math.ubc.ca wrote:
Quote:

Another example: for the DE y' = a y, classical RK4 with step size h
gets the exact solutions y = exp(a t) iff
1 + ah + (ah)^2/2 + (ah)^3/6 + (ah)^4/24 = exp(ah).
This has no real solutions except ah = 0, but it does
have complex ones...

An interesting extension, except that it has no apparent practical
value!? One could however obtain the equality in a real domain by
simply choosing "ah" s.t. the remainder vanishes. It's fairly simple to
do for scalar cases, but can be quite a stretch for matrices. i.e.

http://www.maths.uq.edu.au/expokit/guide.html

In either case, a practical real solution exists - best of all, it's an
outside the box approach to an otherwise oxygen deprived art of
numerical integration.

---
sdx - modeling, simulation.
http://www.sdynamix.com
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Tue Dec 02, 2008 1:21 am