Sie sind auf Seite 1von 3

Implementation of the Behavior of a Particle in a Double-Well Potential Using

the Fourth-Order Runge-Kutta Method


C. C. Esporlas
National Institute of Physics
University of the Philippines
ccesporlas@gmail.com

1. Introduction
Many physical systems are considered as
dynamic systems such as the spring-mass system,
population growth, radioactive decay, a falling object
and quantum mechanical systems like the potential
well. These dynamical systems are often described
using differential equations that describe its behavior
for a short period of time.
Differential equations arise when a continuously
changing quantity and their rates of change are
observed and known. To determine the behavior for
longer periods, it is necessary to integrate these
equations to get the exact solution or it may be
approximated using numerical methods that were
developed to determine solutions with a given
accuracy. Some of these methods are the Euler
Method, the MidPoint Method and the Runge-Kutta
Method.

quantization, zero-point energy and spatial nodes. We


shall consider only the first two behaviors. For the
standard particle in a box (no acting forces) we said
that its energy and velocity does not change. Now if we
add frictional force which opposes the motion of the
particle, the particle will eventually lose energy and its
velocity approaches 0 as time goes to infinity. But the
smallest energy that it can have is the zero point energy
where the probability of where the particle can be
found is greatest at the center of the box.

Figure 1 Double-Well Potential

2. Physics
Dynamical systems in the physical world are
dissipative where if not for some driving force the
motion will cease. This dissipation of motion can be
caused by many factors like friction.
One such dynamical system described by
differential equations is a particle moving in a onedimensional double-well potential with an additional
frictional force that is proportional with its velocity
with an equation of motion given by:
mx&& = x& + ax bx3
(1)
where , a and, b are positive constants. Also given
that /m=0.1, a/m=b/m=1, Equation1 becomes:
&&
x = 0.1x& + x x 3
(2)
Now what is the behavior of a particle inside a
two-well potential? First, let us consider the case for
a particle in a box a representation for a particle
inside a single infinite potential well. In a standard
particle in a box scenario, the particle experiences no
forces in it and thus loses no energy when it hits the
walls (infinite potential), it just reflects back always
at the same speed.
Now the quantum conditions of the particle in a
box gives out three major quantum behaviors: energy

Applying this knowledge about the particle in a


box to the particle in a double-well potential gives a
hint of how the particle will behave given the initial
conditions. In the double-well potential with friction,
there are two possible equilibrium states where the
particles may end up, at x(0) = 1 which is where the
particle eventually comes to rest. All initial conditions
of the particle except at x=dx/dt=0 eventually come to
rest either at x = +1 or at x = -1. These two points are
called attractors of the system. Now what we are
needed to do is to find the set of initial points that will
lead to a state where the particle ends up at x = -1. To
do this we need to get the solutions for the differential
equation in Equation2.
To get the solutions, the Fourth-Order RungeKutta Method is used. The Runge-Kutta Method allows
us to solve differential equations numerically by giving
approximations and it is more accurate and wellbehaved for a wide range of problems.
Considering a simple differential equation:
y ' = f ( x, y )
(3)

and we want to get an approximation of the solutions


to this equation over the interval [a,b]. We begin with
the formal integral of the differential equation.
dy
( t ) = f ( t , y ) y ( t ) = f ( t , y )dt.
dt
(4)
tn +1
yn +1 = yn + f ( t , y ) dt.
tn

Then we expand f( t tn , y yn ) in a Taylor


series about the midpoint of the integration interval:
df
f (t , y ) f ( tn +1/ 2 , yn +1/ 2 ) + ( t tn +1/ 2 ) ( tn +1/ 2 ) + ( h 2 )
ft
substituting this to Equation4 the integral of ( t
tn+1/2) vanishes and a higher order algorithm than
Eulers is obtained.
f ( t , y ) dt f ( tn +1/ 2 , yn +1/ 2 ).
(6)
yn +1 yn + hf ( tn +1/ 2 , yn +1/ 2 ) .

Next is, we set our time interval from which we


shall operate the RK4 method with a time step of 0.1.
Now we create a range of initial points and use this
to implement the RK4 method. To get the set of initial
points that will lead to the state where the particle ends
up at the left well (x = -1), we create a condition to
filter out the points that have a final state of x -1 and
v0 as t. We then plot these set of points.

4. Results
The set of initial points that will give the final state
where the point ends up at x = -1 and with v0 as
t is shown in Figure2. These set of points is called
the Basin of Attraction where the point x = -1 is the
attractor.

Now we need to express yn+1 in terms of the initial


conditions:
dy h 1
yn +1/ 2 yn +
= hf ( tn , yn )
(7)
dt 2 2
Continue this until we obtain the four equations of
the 4th-Order Runge-Kutta method.
1
yn +1 yn + ( k1 + 2k2 + 2k3 + k4 )
6
k1 = hf ( tn , yn )
k
h

k2 = hf tn + , yn + 1
2
2

k
h

k3 = hf tn + , yn + 2
2
2

k4 = hf ( tn + h, yn + k3 )

(7)

Evaluating the differential equation (Equation2)


using this method will give a set of solutions that are
a set of initial conditions that satisfy the differential
equation. This is what we will use to get the initial
points that will give the desired final state of the
particle in the double-well potential.

3. Algorithm
To get the desired set of initial conditions we
first implement the 4th-Order Runge-Kutta method
and the differential equation in two separate
functions. The differential equation in Equation2 is of
the second-order. We must change it into a set of
first-order differential equations in order to make the
4th-Order Runge-Kutta method applicable.
d1 =
d2 =

x[1]
-0.1*x[1] + x[0] - x[0]*x[0]*x[0]

Figure 2. Basin of Attractors for Attractor x = -1 for


a Particle Moving in a Double-Well Potential with
Friction

An attractor of a dynamical system is a subset in


the state space where initial conditions tend to orbit to
it as time increases. For this system there are two
attractors at x = 1. As we can see from Figure1 these
are the points where there is the maximum probability
of the points to be in when they are moving in a
double-potential well with friction.
For each attractor, the set of initial conditions
leading to the long-time behavior leading to the
attractor is called the basin of attraction.
As shown in the graph, the colored/black area
represents the basin of attraction for the attractor x = -1
while the colorless one is for the attractor x=1. If the
initial condition is at x=dx/dt=0, it will not go to either
attractor. This is called the stable manifold.
Also when the initial condition is at an unstable
equilibrium point like when x=0, it will stay there
forever. The boundary separating the two basins is
called the stable manifold of the unstable equilibrium
x=0.

References
[1] http://mathworld.wolfram.com/
[2] http://www.analyzemath.com/
[3] W. Kinzel and G. Reents. Physics by Computer.
Springer. 1998
[4] R. Landau, M. Paez, Computational Physics:
Problem Solving With Computers, Chapter 9, John
Wiley and Sons, Inc., 1997

thist = t[i]
dt = t[i+1] - thist
dt2 = dt/2.0
y0 = yout[i]
k1 = npy.asarray(derivs(y0, thist))
k2 = npy.asarray(derivs(y0 + dt2*k1, thist+dt2))
k3 = npy.asarray(derivs(y0 + dt2*k2, thist+dt2))
k4 = npy.asarray(derivs(y0 + dt*k3, thist+dt))
yout[i+1] = y0 + dt/6.0*(k1 + 2*k2 + 2*k3 + k4)
return yout
t=scipy.arange(0.0,100.0,0.05)

Appendix
Source Code:
import numpy as npy
import scipy, pylab
def derivs6(x,t):
d1 = x[1]
d2 = -0.1*x[1] + x[0] - x[0]*x[0]*x[0]
return (d1,d2)
def rk4(derivs, y0, t):
try: Ny = len(y0)
except TypeError:
yout = npy.zeros( (len(t),), npy.float_)
else:
yout = npy.zeros( (len(t), Ny), npy.float_)
yout[0] = y0
i=0
for i in npy.arange(len(t)-1):

for i in scipy.linspace(-2.5,2.5,30):
for j in scipy.linspace(-2.5,2.5,30):
yout = rk4(derivs6, [i,j], t)
x=yout[0:,0]
y=yout[0:,1]
l=len(x)
if (-1.5 < x[l-1] < -0.5):
if (-0.5 < y[l-1] < 0.5):
pylab.plot(x,y,'go')
pylab.title('Basin of Attraction for
Double-Well Potential as x(infinity)=-1')
pylab.xlabel('initial positions, x(0)')
pylab.ylabel('initial velocities, xdot(0)')
pylab.axis([-2,2,-2,2])
##
else:
##
pylab.plot(x,y,'ro')
##
pylab.axis([-2,2,-2,2])
pylab.show()

the

Das könnte Ihnen auch gefallen