the chemical basis of morphogenesis by reaction diffusion system

54
THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM by W.A.B. Janith( SC/2007/6624 ) Group members S.H. Madarasinghe( SC/2007/6678 ) D.M.S. Thushani( SC/2007/6705 ) Supervisor: Mr. L. W. Somathilake Demostrater: Mr. Anjana Prabhath MMA 3b23 report submitted to the faculty of science University Of Ruhuna in partial fulfillment of the requirements for the degree of Bachelor of Science Department of Mathematics University Of Ruhuna October 2010

Upload: buddhika-janith

Post on 28-Apr-2015

35 views

Category:

Documents


0 download

DESCRIPTION

Recent progress in development biology has identified various micro mechanisms so we used mathematical methods is Gray-Scott model and Turing model for make animal various skin patterns just like zebra skin, tiger skin patterns.

TRANSCRIPT

Page 1: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

THE CHEMICAL BASIS OF MORPHOGENESIS BYREACTION DIFFUSION SYSTEM

byW.A.B. Janith( SC/2007/6624 )

Group membersS.H. Madarasinghe( SC/2007/6678 )D.M.S. Thushani( SC/2007/6705 )

Supervisor: Mr. L. W. SomathilakeDemostrater: Mr. Anjana Prabhath

MMA 3b23 report submitted to the faculty of scienceUniversity Of Ruhuna

in partial fulfillment of the requirements for the degree of

Bachelor of Science

Department of Mathematics

University Of Ruhuna

October 2010

Page 2: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

Copyright c© 2010 W.A.B. Janith

All Rights Reserved

Page 3: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

ABSTRACT

THE CHEMICAL BASIS OF MORPHOGENESIS BY

REACTION DIFFUSION SYSTEM

W.A.B. Janith

Department of Mathematics

Bachelor of Science

How do animals make their various skin patterns? Although this question may

seem easy, in fact it is very difficult to answer. The problem is that most ani-

mals have no related structures under the skin; therefore, the skin cells must

form the patterns without the support of a pre pattern. Recent progress in

developmental biology has identified various micro mechanisms that function

in setting the positional information needed for the correct formation of body

structure. None of these can explain how skin pattern is formed, however, be-

cause all such molecular mechanisms depend on the existing structure of the

birth. Although little is known about the underlying micro mechanism, many

theoretical studies suggest that the skin patterns of animals form through a

reaction-diffusion system-just like ’wave’ of chemical reactions that can gen-

erate periodic patterns in the field. This idea had remained unaccepted for

a long time, but recent findings on the skin patterns of zebra and tiger have

proved that such waves do exist in the animal body. In this project review,

we explain briefly the principles of the reaction-diffusion mechanism after that

simulate pattern using java applet and summarize the recent progress made

in this area.

Page 4: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

ACKNOWLEDGMENTS

Our heartiest thanks to Mr. L. W. Somathilake who gave us a lot of

advices which gave us a brilliant guidance for us to make our project success-

ful and at the same time we would like to offer our heartiest thanks to Dr.

J.R.Wedagedera who nourished us with Java Programming knowledge and the

well devoted Mr. Anjana and all demonstrators who helped us a lot in this

project. It is the resources of the library gave us additional knowledge and

lots of information to make our attempt more successful and fruitful. We hope

our project will be a very successful attempt, thanks to all personalities who

helped us.

Page 5: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

Contents

Table of Contents v

List of Figures vi

1 Introduction 11.1 Principle and properties of the reaction-diffusion model . . . . . . . . 11.2 About Our programming language . . . . . . . . . . . . . . . . . . . 5

2 Mathematical back ground 72.1 Reaction-Diffusion Equations . . . . . . . . . . . . . . . . . . . . . . 72.2 Gray-Scott model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.3 Euler forward method . . . . . . . . . . . . . . . . . . . . . . . . . . 142.4 Finite difference method . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.4.1 Difference methods . . . . . . . . . . . . . . . . . . . . . . . . 152.4.2 Parabolic Partial Differential Equations Two Space Dimensions 17

2.5 Periodic Boundary Conditions . . . . . . . . . . . . . . . . . . . . . 21

3 Method Of Solution 233.1 Problem formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.2 Numerical scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

4 Program 274.1 Program Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.2 Program OUTPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5 Conclusion 45

6 Discussion 46

Bibliography 48

v

Page 6: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

List of Figures

1.1 Schematic drawing of a reaction-diffusion system . . . . . . . . . . . . 31.2 Java Logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.1 Introduction reaction-diffusion . . . . . . . . . . . . . . . . . . . . . . 72.2 Continuous stirred tank reactor . . . . . . . . . . . . . . . . . . . . . 102.3 Calculate area by left rectangular rule . . . . . . . . . . . . . . . . . . 142.4 The region R and nodes . . . . . . . . . . . . . . . . . . . . . . . . . 162.5 Application of the implicit method on the level n+1 . . . . . . . . . . 192.6 Representation of nodal points in Example . . . . . . . . . . . . . . . 21

4.1 Cheetah Skin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444.2 zebra fish Skin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

vi

Page 7: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

Chapter 1

Introduction

1.1 Principle and properties of the reaction-diffusion

model

This chapter briefly explains, without recourse to mathematics, how

the reaction-diffusion system can form a periodic structure. Sir Alan Tur-

ing presented a idea that a combination of reaction and diffusion can

generate spatial patterns (Alan Mathison Turing worked from 1952 until

his death in 1954 on mathematical biology, specifically morphogenesis.

He published one paper on the subject called The Chemical Basis of Mor-

phogenesis in 1952,). In the paper, he studied the behavior of a complex

system in which two substances interact with each other and diffuse at

different diffusion rates, which is known as the reaction-diffusion system.

Turing proved mathematically that such system is able to form some char-

acteristic spatio-temporal patterns in the field. One of the most significant

deviations is s formation of a stable periodic pattern. He stated that the

spatial pattern generated by the system might provide positional infor-

1

Page 8: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

1.1 Principle and properties of the reaction-diffusion model 2

mation for a developing embryo.

In spite of the importance of the idea in the developmental biology, his

model was not accepted by most experimental biologists. But,At finally

most of those who took over and developed the Turing’s idea were applied

mathematicians and physicists. They proposed various types of model

that developed Turing’s original equation to fit real, naturally occurring

phenomena. Although the equations for each model differ, they all share

the basic requirement of the original model; that is, ’waves’ are made

from the interactions of two putative chemical substances which we refer

to here as the ’activator’ and the ’inhibitor’. Suppose that the activa-

tor enhances the synthesis of itself and another substance-the inhibitor.

In turn, the inhibitor inhibits the synthesis of the activator. The auto-

catalytic property of the activator and the feedback circuit of the inhibitor

make the system oscillate when the catalytic constants are set properly.

Like normal molecules, both substances are expected to diffuse into neigh-

boring cells according to the concentration gradient. The ratio of the dif-

fusion constants of the two substances plays a main role in determining

the behavior of the system.

The most important and interesting phenomenon in this system occurs

when the diffusion of the inhibitor is much faster than that of the acti-

vator. For example, imagine a one-dimensional (1D) cell array in which

the above interactions function (Fig. 1b-g). In the central region, as an

initial condition, the concentration of the activator is set relatively higher

than in other regions (Fig. 1a). Due to the self-catalytic nature of the

activator, the concentration of activator increases at the center, as well

as the concentration of the inhibitor (Fig. 1c). The concentration curve

Page 9: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

1.1 Principle and properties of the reaction-diffusion model 3

Figure 1.1 (a) Schematic drawing of a reaction-diffusion system(activator-inhibitor type). The white and black arrows represent activa-tion and inhibition, respectively. (bd): Wave formation from almost randominitial conditions (for details, see text). (eg) Doubling of the waves in thegrowing field (for details, see text). (h) Different patterns generated byan identical RD equation. One of the parameter values in the equation ischanged for each pattern.

becomes steeper for the activator and shallower for the inhibitor, accord-

ing to the ratios of their diffusion constants. In the side regions, then,

the activator concentration decreases because of the high concentration

of inhibitor diffusing from the central region. Eventually, the small initial

concentration difference between the central and side regions are gradually

amplified (Fig. 1d). When the concentration of activator reaches a peak,

the balance of reaction and diffusion stabilizes the slopes of the concentra-

tion. The concentration wave created by this mechanism has an intrinsic

Page 10: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

1.1 Principle and properties of the reaction-diffusion model 4

wavelength that is determined by the constants of reaction and diffusion.

Suppose that the 1D field enlarges (i.e. grows) gradually. This process

does not immediately change the number of peaks but changes the gradi-

ent of the slope (Fig. 1e,f ). As the field grows, the concentration of the

inhibitor increases, particularly at the centre, because this region is far-

thest from the low concentration regions. When the field reaches a critical

length, the feedback effect of the inhibitor exceeds the auto-catalysis of

the activator, and the widened peak divides into two peaks of the original

width (Fig. 1g). The shapes of the waves are determined by the values

of the parameters that represent the constants of reaction and diffusion.

The two-dimensional (2D) patterns of the reaction and diffusion wave are

more sensitive to the parameter values. Figure 1h shows the stable 2D

pattern of an reaction and diffusion system calculated with different pa-

rameters. One of the merits of the reaction and diffusion model is that

it can explain each of the clearly different patterns that are often seen in

animal skin. The most important properties of this system are:

(i) that the pattern forms autonomously without any other positional in-

formation

(ii) that the pattern is stable once formed

(iii) That it regenerates when it is artificially disturbed.

Turing and many other theoretical researchers thought that these prop-

erties appropriately explain the marvelous robustness of animal develop-

ment. In Turing’s, as well as many other models, ’diffusion’ is used as a

means of propagating a condition that occurs in a cell.

Page 11: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

1.2 About Our programming language 5

1.2 About Our programming language

Figure 1.2

For in our project we used java programming language as Java is a high-level lan-

guage , third generation programming language, like C, Fortran, Smalltalk, Perl, and

many others. We can use Java to write computer applications that crunch numbers,

process words, play games, store data or do any of the thousands of other things

computer software can do. Compared to other programming languages, Java is most

similar to C. However although Java shares much of C’s syntax, it is not C. C , will

certainly help Us to learn Java more quickly. Unlike C++ Java is not a superset of

C. A Java compiler won’t compile C code, and most large C programs need to be

changed substantially before they can become Java programs.

Java is a platform for application development. A platform is a loosely defined

computer industry buzzword that typically means some combination of hardware and

system software that will mostly run all the same software. For instance PowerMacs

running Mac OS 9.2 would be one platform. DEC Alphas running Windows NT

would be another.

object oriented programming is the catch phrase of computer programming in the

1990’s. Although object oriented programming has been around in one form or an-

other since the Simula language was invented in the 1960’s, it’s really begun to take

Page 12: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

1.2 About Our programming language 6

hold in modern GUI environments like Windows, Motif and the Mac. In object-

oriented programs data is represented by objects. Objects have two sections, fields

(instance variables) and methods. Fields tell what an object is. Methods tell what

an object does. These fields and methods are closely tied to the object’s real world

characteristics and behavior. When a program is run messages are passed back and

forth between objects. When an object receives a message it responds accordingly as

defined by its methods.

Object oriented programming is alleged to have a number of advantages including:

” Simpler, easier to read programs ” More efficient reuse of code ” Faster time to

market ” More robust, error-free code

Java is Platform Independent, Java was designed to not only be cross-platform in

source form like C, but also in compiled binary form. Since this is frankly impossible

across processor architectures Java is compiled to an intermediate form called byte-

code. A Java program never really executes natively on the host machine. Rather a

special native program called the Java interpreter reads the byte code and executes

the corresponding native machine instructions. Thus to port Java programs to a new

platform all that is needed is to port the interpreter and some of the library routines.

Even the compiler is written in Java. The byte codes are precisely defined, and remain

the same on all platforms.

Page 13: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

Chapter 2

Mathematical back ground

2.1 Reaction-Diffusion Equations

Figure 2.1

A system of reaction-diffusion equations is a system of equations of

the form

∂x

∂t= D4 u + f(u,5u, x, t)

Over a region D ⊆ Rn , where u (x,t) is a vector representing the states

(in our model morphogenesis concentrations) of a group of substances at

time t and position X ⊆ Rn A is a matrix of diffusion coefficients, which

in a two species system is typically of the form D=

u 0

0 v

, and 4u

7

Page 14: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.1 Reaction-Diffusion Equations 8

is the Laplacian differential operator acting on u with respect to x ∈ D

It is the second order spatial rate of change of u. In the most general

case, the inputs in the reaction function f are u,5u the gradient of u with

respect to x, x and t. These partial differential equations are subject to

boundary conditions over Ω ⊆ D and initial conditions. In these equa-

tions the term containing the Laplacian operator is the diffusion term.

Without the function f, (see Fig. 2.1) is the heat equation, one of the first

equations encountered in any partial differential equation course. The

heat equation models the diffusion of heat from regions of higher tem-

perature, or heat concentration, to regions of lower temperature, which

is very similar to chemical diffusion. The function f is called the reac-

tion function because it represents the interactions between particles that

act to increase or decrease the quantities of each species,and may depend

on the concentration of particles themselves (u), the gradient of the con-

centrations with respect to space(5u),and the location of the reaction in

space and time, (x and t). The use of chemical terms is meant merely as

an analogy, as reaction-diffusion equations have found broad application

in areas other than chemistry, such as neurological signal transmission,

Belousov-Zhabotinsky chemical waves, geochemical systems, combustion

theory, and other complex systems.

This study is primarily concerned with functions f that depend only

on the concentrations of the reactants. This idealization is a good approx-

imation for many chemical reactions held at constant temperature, as is

often true for biological reactions. The general system now reduces to

∂x

∂t= D4 u + f(u)

Page 15: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.1 Reaction-Diffusion Equations 9

This system is augmented by initial conditions, u(x, 0) = h(x) ,and bound-

ary conditions. We will be dealing with two morphogens, that is, the

vector u will be given by:

u(x, t) =

u(x, t)

v(x, t)

J.D.Murray gives a good overview of several reaction-diffusion equations

used to model morphogenesis. The three primary reactions he mentions

are Schnakenbergs reaction, Gierer and Meinhardts activator/inhibitor

model, and Thomas experimental model. Schnakenbergs model has not

found much biological application. It is given in nondimensionalized form

by

ut = γ(b− v2u) + d4 u,

vt = γ(a− v + uv2) +4v

following model which is known as an activator/inhibitor system.

ut = γ(a− bv +u2

v) +4u

vt = γ(u2 − v) + d4 v

The nondimensionalized parameters are the same as above. For this equa-

tion we will call u the activator, since it acts to increase the population of

both chemicals, and v will be the inhibitor, since it decreases the rate of

change over time for each morphogen. For patterns to occur, Gierer and

Meinhardt showed that d À 1, in other words, that the inhibitor must dif-

fuse significantly faster than the activator. As an illustration, consider a

predator/prey system. Think of the prey as the activators and the preda-

tors as the inhibitors. The predators, cheetahs for instance, diffuse faster

Page 16: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.2 Gray-Scott model 10

than the prey, antelope. Where the antelope gather together they create

an environment where more of their kind can thrive, but the fast moving

cheetahs inhibit their numbers (through digestion) when they stray from

the herd. Also contact between antelope and cheetahs (again through

digestion) activates the production of cheetahs. For the right parame-

ters, activator/inhibitor reaction-diffusion systems form dappled patterns

where activators clump together that can be thought of as analogous to

herds of prey species.

2.2 Gray-Scott model

Figure 2.2 Continuous stirred tank reactor

For the study of a chemical reaction we are going to look at a continu-

ous stirred tank reactor. The reactor contains two chemicals: U and V. In

the tank reactor we have a continuous inlet stream which, in our case, only

contains the chemical U and the product P is continuously drained. The

reactor is well mixed so that there is a uniform concentration of the chem-

icals U and V throughout the reactor. We study the following chemical

Page 17: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.2 Gray-Scott model 11

reaction:

U + 2V −→ 3V

This is an autocatalytic reaction in which V is called the catalyst or the

activator and U the inhibitor of the reaction. Since we want the catalyst

V to have a finite lifetime,we use a second chemical reaction which is of

the form

V −→ P

P is an inert product. It is assumed for simplicity that the reverse reactions

do not occur (this is a useful simplification when a constant supply of

reactants prevents the attainment of equilibrium). Because V appears on

both sides of the first reaction, it acts as a catalyst for its own production.

The overall behavior of the system is described by the following for-

mula, two equations which describe three sources of increase and decrease

for each of the two chemicals:

∂U

∂t= Du 52 U − UV 2 + F (1− U)

∂V

∂t= Dv 52 V + UV 2 − (F + K)V

These equations were posed by P.Gray and S.K. Scott in 1983, that’s why

it’s called the Gray-Scott model. In this model, the two partial differential

equations are the mass-balance equations for U and V. In the model DU

and DV are the diffusivities, which represent the rate of speed by which U

and V diffuse. For the sake of simplicity we can consider Du, Dv, F and

k to be constants. In computer simulations there are also quantization

constants for time and space (4t and 4x) that are used to break ∂t and

52 into discrete intervals.

Page 18: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.2 Gray-Scott model 12

The first equation tells how quickly the quantity u increases. There are

three terms. The first term, Du52u is the diffusion term. It specifies that

u will increase in proportion to the Laplacian (a sort of multidimensional

second derivative giving the amount of local variation in the gradient) of U.

When the quantity of U is higher in neighboring areas, u will increase. 52u

will be negative when the surrounding regions have lower concentrations

of U, and in such cases the diffusion term is negative and u decreases.

If we made an equation for u with only the first term, we would have

∂U∂t

= Du 52 U , which is a diffusion-only system equivalent to the heat

equation.

The second term is −uv2. This is the reaction rate. The first reaction

shown above requires one U and two V, such a reaction takes place at

a rate proportional to the concentration of U times the square of the

concentration of V. Also, it converts U into V: the increase in v is equal

to the decrease in u (as shown by the positive uv2 in the second equation).

There is no constant on the reaction terms, but the relative strength of

the other terms can be adjusted through the constants Du, Dv, F and k,

and the choice of the arbitrary time unit implicit in ∂t.

The third term, F(1-u), is the replenishment term. Since the reaction

uses up U and generates V, all of the chemical U will eventually get used

up unless there is a way to replenish it. The replenishment term says that

u will be increased at a rate proportional to the difference between its

current level and 1. As a result, even if the other two terms had no effect,

1 would be the maximum value for u. The constant F is the feed rate and

represents the rate of replenishment. In the systems this equation is mod-

eling, the area where the reaction occurs is physically adjacent to a large

Page 19: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.2 Gray-Scott model 13

supply of U and separated by something that limits its flow, such as a

semi-permeable membrane; replenishment takes place via diffusion across

the membrane, at a rate proportional to the concentration difference 4[U ]

across the membrane. The value 1 represents the concentration of U in

this supply area, and F corresponds to the permeability of the membrane.

The only significant difference in the v equation is in its third term. The

third term in the v equation is the dimishment term. Without the di-

minishment term, the concentration of V could increase without limit.

In practice, V could be allowed to accumulate for a long time without

interfering with further production of more V, but it naturally diffuses

out of the system through the same (or a similar) process as that which

introduces the new supply of U. The diminishment term is proportional

to the concentration of V that is currently present, and also to the sum

of two constants F and k. F, as above, represents the permeability of

the membrane to U, and k represents the difference between this rate

and that for V. Notice that there is nothing in the equations that states

whether the system exists in a two-dimensional space (like a Petri dish)

or in three dimensions, or even some other number of dimensions. In fact,

any number of dimensions is possible, and the resulting behavior is fairly

similar. The only significant difference is that in higher dimensions, there

are more directions for diffusion to happen in and the first term of the

equation becomes relatively stronger. It is for this reason that phenomena

depending on diffusion for their action (such as gradient-sustained stable

”spots”) occur at higher k values in the 2-D system as compared to the

1-D system, and at yet higher values for the 3-D system

Page 20: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.3 Euler forward method 14

2.3 Euler forward method

In mathematics and computational science, the Euler method, named

after Leonhard Euler, is a first-order numerical procedure for solving or-

dinary differential equations (ODEs) with a given initial value. It is the

most basic kind of explicit method for numerical integration of ordinary

differential equations.

A method for solving ordinary differential equations using the Euler

formula

From Calculus we know that calculating an integral is equivalent to com-

puting the area under the curve given by a(s) = f(s, y(s)) over the interval

[tk, tk + h] by the (left) rectangular rule

Figure 2.3 Calculate area by left rectangular rule

∫ tk+1

tk

f(s, y(s))ds = hf(tk, y(tk)),

which after substitution and replacing exact values with approximate ones

Page 21: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.4 Finite difference method 15

(yk ≈ y(tk), yk+1 ≈ y(tk+1)) results in

yk+1 = yk + hf(tk, yk) k = 0, ..., N − 1.

Naturally, y0 is given by the initial condition at t0 in problem . The

formula yk+1 = yk +hf(tk, yk) is called Forward Euler Method or Explicit

Euler Method. Note that the method increments a solution through an

interval while using derivative information from only the beginning of the

interval.

2.4 Finite difference method

2.4.1 Difference methods

We assume throughout our discussion that our mathematical problem

is well posed, that is ,if its solution exists then it is unique and depends

continuously on the given data.

In the finite difference method, we superimpose on the region R of

interest a network or a mash by lines, as follows:

(1) one-dimensional case:

xm = a + mh, m = 0, 1, 2, .....

where h is the mash size in the x-direction.

(2)two-dimensional case:

xl = a + lh1, l = 0, 1, 2, ......

ym = b + mh2, m = 0, 1, 2, ......

Page 22: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.4 Finite difference method 16

where h1, h2 are the mash sizes in x and y directions respectively. If we

are considering an initial value problem, then we also have the lines

tn = nk, n = 0, 1, 2, .....

where k is the step length in the t-direction. The points of intersection of

the network are called nodes. The network and nodes for boundary value

problem are shown in (see Fig. 2.4) The partial derivatives in the differ-

R

Y

X

0h

k

Figure 2.4 The region R and nodes

ential equation are replaced by suitable difference quotients, converting

the differential equation to a difference equation at each nodal point. We

may call this procedure as the discretization of the differential equation.

The given data is used to modify the difference equation at the nodes near

or on the boundary. The solution of this system of equations gives the

numerical solution of the given initial/boundary value problem.

Page 23: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.4 Finite difference method 17

2.4.2 Parabolic Partial Differential Equations Two Space Di-

mensions

Parabolic partial differential equations arise in various branches of sci-

ence and engineering,such as fluid dynamics,heat flow, diffusion, elastic

vibration etc. We assume that a steady state solution does not exist, and

one of the independent variables t has the role of time. We also assume

that unique solution exists, the solution being uniquely determined by the

differential equations together with the initial and boundary conditions.

Two Space Dimensions

we can readily extend the one dimensional difference schemes to higher

space dimension especially when the region is rectangular. The tow di-

mensional heat flow equation in the unit square R = [0 ≤ x, y ≤ 1]× [0, T ]

is given by

∂u

∂t=

∂2u

∂x2+

∂2u

∂y2

subject to the initial condition

u(x, y, 0) = f(x, y)

and the boundary conditions

u(0, y, t) = g1(y, t) u(1, y, t) = g2(y, t)

u(x, 0, t) = h1(x, t) u(x, 1, t) = h2(x, t) t > 0

We place a uniform mesh of spacing h on the square region 0 ≤ x, y ≤ 1

with Mh=1. Let k be the step size in the time direction such that t-

nk,n=0,1,.....N where Nk=T. The nodal points are defined by

xl = lh, l = 0, 1, 2, ..., M

Page 24: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.4 Finite difference method 18

ym = mh, m = 0, 1, 2, ..M

tn = nk, n = 0, 1, 2, ..., N

The solution value u(x, y, t) at the nodal point (l,m,n) is denoted by Unl,m

.Then may be written as

un+1l,m = un

l,m + λ(δ2x + δ2

y)[θun+1l,m + (1− θ)un

l,m]

where unl,m is an approximate value of Un

l,m .For example, the value θ = 0

gives the difference scheme

un+1l,m = un

l,m + λ(δ2x + δ2

y)unl,m

which has order off accuracy (k + h2).

Using the Von Neumann method of stability analysis, We substitute

unl,m = Aξneiθ1lheiθ2mh

in the explicit difference scheme un+1l,m = un

l,m + λ(δ2x + δ2

y)unl,m.The

propagating factor is given by

ξ = 1− 4λ(sin2 φ1 + sin2 φ2)

where φ1 = θ1h/2 and φ2 = θ2h/2.

For stability, we require that |ξ| ≤ 1 and hence

−1 ≤ 1− 4λ(sin2 φ1 + sin2 φ2) ≤ 1

since 0 ≤ sin2 φ1, sin2 φ2 ≤ 1 the stability condition is obtained as

0 < λ ≤ 1/4

Again for θ = 1/2,we write the difference scheme above

un+1l,m = un

l,m + λ(δ2x + δ2

y)[θun+1l,m + (1− θ)un

l,m equation as

un+1l,m = un

l,m +λ

2(δ2

x + δ2y)(u

n+1l,m + un

l,m)

Page 25: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.4 Finite difference method 19

which is of order k2 + h2 .using the Von Neumann method,we obtain

the propagating factor as

ξ =1− 2λ(sin2 φ1 + sin2 φ2)

1 + 2λ(sin2 φ1 + sin2 φ2)

where φ1 = θ1h/2 and φ2 = θ2h/2. Since 0 ≤ sin2 φ1, sin2 φ2 ≤ 1 and

λ > 0,the condition |ξ| ≤ 1 is always satisfied. Hence the method above

eqn un+1l,m = un

l,m + λ2(δ2

x + δ2y)(u

n+1l,m + un

l,m) is unconditionally stable.

M

1 2 m-1

m

m+1

2M-2

M-1

y

h

h

A:(j-1)(M-1)+m

B:(j-1)(M-1)+m+1

C:j(M-1)+m

D:(j-1)(M-1)+m-1

E:(J-2)(m-1)+m

j A B

C

D

E

Figure 2.5 Application of the implicit method on the level n+1

On each time level, a system of linear algebraic equations is to be

solved.The coefficient matrix of this system is a band matrix whose total

band with is 2M-1 as shown in 2.5 We number the unknowns in the

interior stating from left to right in the x-direction and from bottom to

top in the y-direction. When we apply above eqn un+1l,m = un

l,m + λ2(δ2

x +

δ2y)(u

n+1l,m + un

l,m) at A, the five point A,B,C,D,E (and hence the unknowns

at these nodes ) enter the scheme. The points E and C are M-1 unite

Page 26: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.4 Finite difference method 20

away from A while B and D are one unit away from A. Hence the total

band width of this system of equations is 2M-1. If h is small, then the

band width is very large and the solution of this system of equations takes

a lot of computer time . To avoid this difficulty we use the Alternating

Direction implicit methods. we can get idea about this differential method

by a example. now we try to find the solution of the two dimension

equation

∂u

∂t=

∂2u

∂x2+

∂2u

∂y2

subject to the initial condition

u(x, y, 0) = sin πx sin πy, 0 ≤ x, y ≤ 1

and the boundary conditions

u = 0, ontheboundaries, t ≥ 1

using the explicit method

un+1l,m = un

l,m + λ(unl−1,m + un

l+1,m + unl,m−1 + un

l,m+1 − 4unl,m)

with h = 1/3 and λ = 1/8. Integrate upto two time levels. Compare the

results with the exact solution

u(x, y, t) = e−π2t sin πx sin πy

The nodal points are given in Figure 2.6 For λ = 1/8,we have

un+1l,m =

1

2un

l,m +1

8(un

l−1,m + unl+1,m + un

l,m−1 + unl,m+1)

the initial and boundary conditions become

u0l,m = sin(πl/3)sin(πm/3), l, m = 0, 1, 2, 3

Page 27: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.5 Periodic Boundary Conditions 21

u0

0,0U

0

3,0

u2

0,0

u2

3,0

u2

3,3

u2

0,3

u0

3,3

Zeroth level

First level

Second level

Figure 2.6 Representation of nodal points in Example

unl,0 = un

0,m = un3,m = un

l,3 = 0, l,m = 0, 1, 2, 3, andn = 0, 1, 2, ...

We get for n=0

u1l,m =

1

2u0

l,m +1

8(u0

l−1,m + u0l+1,m + u0

l,m−1 + u0l,m+1)

so now we can calculate every unl,m for l,m = 0, 1, 2, ...

2.5 Periodic Boundary Conditions

In mathematical models and computer simulations, periodic bound-

ary conditions (PBC) are a set of boundary conditions that are often

used to simulate a large system by modeling a small part that is far from

its edge. Periodic boundary conditions resemble the topologies of some

video games; a unit cell or simulation box of geometry suitable for perfect

three-dimensional tiling is defined, and when an object passes through

Page 28: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

2.5 Periodic Boundary Conditions 22

one face of the unit cell, it reappears on the opposite face with the same

velocity. The simulation is of an infinite perfect tiling of the system. In

topological terms, the space can be thought of as being mapped onto a

four-dimensional torus. The tiled copies of the unit cell are called im-

ages, of which there are infinitely many. During the simulation, only

the properties of the unit cell need be recorded and propagated. The

minimum-image convention is a common form of PBC particle bookkeep-

ing in which each individual particle in the simulation interacts with the

closest image of the remaining particles in the system. An example occurs

in molecular dynamics, where PBC are usually applied to simulate bulk

gasses, liquids, crystals or mixtures. A common application uses PBCs to

simulate solvated macromolecules in a bath of explicit solvent.

Practical implementation:

To implement periodic boundary conditions in practice, at least two steps

are needed. he first is to make an object which leaves the simulation cell

on one side enter back on the other. This is we used operation,

If (periodicx) then

if (x < 0) x=x+width

if (x >= width) x=x-width

endif

Page 29: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

Chapter 3

Method Of Solution

According to Gray-Scott model there two equation as follows

∂U

∂t= Du 52 U − UV 2 + F (1− U)

∂V

∂t= Dv 52 V + UV 2 − (F + K)V

where U,V are input reactants and P is product of this reaction.

U + 2V −→ 3V

V −→ P

3.1 Problem formulation

we will assume that Ω ≡ (0, L)× (0, L) is an open square representing the

square reactor where the chemical reaction takes place, ∂Ω is its boundary

and is its outer normal. Then initial-boundary value problem for the

Gray-Scott model then we solve is a system of two partial differential

equations with initial condition and periodic boundary conditions there

23

Page 30: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

3.2 Numerical scheme 24

initial condition are

U(x, y, 0) =

0.5 if 13≤ x < 2

3, 5

7≤ x < 6

7and 1

3≤ y < 2

3, 3

5≤ y < 4

5

1 elsewhere,

V (x, y, 0) =

0.25 if 13≤ x < 2

3, 5

7≤ x < 6

7and 1

3≤ y < 2

3, 3

5≤ y < 4

5

0 elsewhere,

this model boundary condition is periodic boundary conditions

u(0, y, t) = u(1, y, t) u(x, 0, t) = u(x, 1, t)

v(0, y, t) = v(1, y, t) v(x, 0, t) = v(x, 1, t)

3.2 Numerical scheme

In this two-dimensional numerical experiments the following choices

for the model parameters are made: Du = 2e−5 Dv = 1e−5 and f =

0.02 k = 0.059 but through the program can be changed k and f

value. we can get range on the domain [0, 1] [0, 1] where L =1 in above

defined. We choose the same time step, and tolerances as in 1D on a

spatial mesh of 100 100 mesh points with Dirichlet boundary conditions

and diffusion coefficients

∇u = (∂

∂xi +

∂yj)u =

∂u

∂xi +

∂u

∂yj

∇2u = ∇(∇u) = (∂

∂xi +

∂yj)(

∂u

∂xi +

∂u

∂yj)

=∂2u

∂x2+

∂2u

∂y2

In practice, we represent the concentration functions as two-dimensional

arrays of discrete samples. To evaluate U and V we approximate the space

Page 31: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

3.2 Numerical scheme 25

derivative ∇2U by a finite difference. The second finite difference in the

x direction is

∂2u

∂x2≈ ui+1,j + ui−1,j − 2ui,j

h2

The second finite difference in the y direction is

∂2v

∂y2≈ ui,j+1 + ui,j−1 − 2ui,j

h2

where the i and j are array subscripts, and h is the distance between

adjacent samples.therefore we can get h value as h = LN

= 1100

= 0.01

where L is domain length, N is mash size. Taking the corresponding

second difference in the y direction, and summing, gives

52Ui,j ≈ ui+1,j + ui−1,j + ui,j+1 + ui,j−1 − 4ui,j

h2

where ui,j represent an approximation to u(xi, yj). so above equation can

be used in our Gray-Scott model equation as follows

d

dtUi,j(t) = Du∇2Ui,j − Ui,jV

2i,j + F (1− Ui,j)

d

dtUi,j(t) = Du[

1

h2(ui−1,j+ui+1,j+ui,j−1+ui,j+1−4ui,j)]−ui,jv

2i,j+F (1−ui,j)

as well as consider v concentration

d

dtVi,j(t) = Dv∇2Vi,j + Ui,jV

2i,j − (F + k)Vi,j

d

dtVi,j(t) = Dv[

1

h2(vi−1,j +vi+1,j +vi,j−1+vi,j+1−4vi,j)]+ui,jv

2i,j−(F +k)vi,j

using corresponding initial and boundary conditions.The discretization in

time is done my mean of the method of lines.To solve resulting systems

of ordinary differential equations Euler method was used. This is Euler

forward method with adaptive time stepping. For details on the second

numerical scheme we use based of finite difference method.

Page 32: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

3.2 Numerical scheme 26

using Euler forward method

D+un =(un+1 − un − un)

4t

un+1 − un

4t= f(un)

un+1 = un +4tf(un)

This Euler methods are only first order accurate.

un+1i,j − un

i,j

4t= Du[

1

h2(un

i−1,j+uni+1,j+un

i,j−1+uni,j+1−4un

i,j)]−uni,jv

n2i,j+F (1−un

i,j)

un+1i,j = un

i,j+4tDu[1

h2(un

i−1,j+uni+1,j+un

i,j−1+uni,j+1−4un

i,j)]−uni,jv

n2i,j+F (1−un

i,j)

vn+1i,j − vn

i,j

4t= Dv[

1

h2(vn

i−1,j+vni+1,j+vn

i,j−1+vni,j+1−4vn

i,j)]+uni,jv

n2i,j−(F+k)vn

i,j)

vn+1i,j = vn

i,j+4tDv[1

h2(vn

i−1,j+vni+1,j+vn

i,j−1+vni,j+1−4vn

i,j)]+uni,jv

n2i,j−(F+k)vn

i,j)

then we can calculate each value of the u00,0, u

00,1.....similarely we can find

u10,0, u

10,1, ....so on. which mean arbitrary Un

i,j can be found

In next chapter we will demonstrate founded solution how to represent in

program using Applet

Page 33: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

Chapter 4

Program

This Gray Scott.java file is initialized Array of U and V using Gray-Scott method

and finite difference method and this class is handle(base) Our program in mainly.

4.1 Program Code

package ptternformation;

/**

*

* @author W.A.B. Janith

*/

final class GrayScott

double[][] u;

double[][] v;

private double[][] tmpU;

private double[][] tmpV;

double uMax;

27

Page 34: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 28

static final double DU = 2e-5;

static final double DV = 1e-5;

public double k = 0.059;

public double f = 0.02;

public double h = 0.01;

private double duDivh2;

private double dvDivh2;

int width, height;

public GrayScott(int width, int height, double f, double k, double h)

this.width = width;

this.height = height;

this.f = f;

this.k = k;

this.h = h;

double v0 = f/(2*(f+k)) + Math.sqrt(f/(2*(f+k))*f/(2*(f+k)) - f*(f+k));

double u0 = f/(v0*v0+f);

duDivh2 = DU/(h*h);

dvDivh2 = DV/(h*h);

u = new double[width][height];

v = new double[width][height];

tmpU = new double[width][height];

tmpV = new double[width][height];

uMax = 0;

initialState();

public void initialState()

uMax = 0.5;

double v0 = f/(2*(f+k)) + Math.sqrt(f/(2*(f+k))*f/(2*(f+k)) - f*(f+k));

double u0 = f/(v0*v0+f);

Page 35: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 29

for (int x = 0; x<width; x++)

for (int y = 0; y<height; y++)

tmpU[x][y] = 1;

tmpV[x][y] = 0;

for (int x = 0; x<(width/3); x++)

for (int y = 0; y<height/3; y++)

tmpU[1*width/3 + x][1*height/3 + y] = 0.5;

tmpV[1*width/3 + x][1*height/3 + y] = 0.25;

for (int x = 0; x<(width/7); x++)

for (int y = 0; y<height/5; y++)

tmpU[5*width/7 + x][3*height/5 + y] = 0.5;

tmpV[5*width/7 + x][3*height/5 + y] = 0.25;

public void setF(double f)

this.f = f;

public void setK(double k)

this.k = k;

public void timeStep(double dt)

Page 36: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 30

double newMax = 0;

double uv2;

/*centre*/

for (int x = 1; x<width-1; x++)

for (int y = 1; y<height-1; y++)

uv2 = tmpU[x][y]*tmpV[x][y]*tmpV[x][y];

u[x][y] = tmpU[x][y] + dt*(duDivh2*(tmpU[x+1][y] + tmpU[x-1][y] +

tmpU[x][y+1] + tmpU[x][y-1] - 4*tmpU[x][y]) - uv2 + f*(1-tmpU[x][y]));

if (u[x][y]<0) u[x][y] = 0;

v[x][y] = tmpV[x][y] + dt*(dvDivh2*(tmpV[x+1][y] + tmpV[x-1][y] +

tmpV[x][y+1] + tmpV[x][y-1] - 4*tmpV[x][y]) + uv2 - k*tmpV[x][y]);

if (v[x][y]<0) v[x][y] = 0;

/*edges*/

int x, y;

for (x = 0; x<width; x++)

y = 0;

uv2 = tmpU[x][y]*tmpV[x][y]*tmpV[x][y];

u[x][y] = tmpU[x][y] + dt*(duDivh2*(tmpU[pBC(x+1,width)][y] +

tmpU[pBC(x-1,width)][y] + tmpU[x][pBC(y+1, height)] + tmpU[x][pBC(y-1,

height)] - 4*tmpU[x][y]) - uv2 + f*(1-tmpU[x][y]));

if (u[x][y]<0) u[x][y] = 0;

v[x][y] = tmpV[x][y] + dt*(dvDivh2*(tmpV[pBC(x+1,width)][y] +

tmpV[pBC(x-1,width)][y] + tmpV[x][pBC(y+1, height)] + tmpV[x][pBC(y-1,

height)] - 4*tmpV[x][y]) + uv2 - k*tmpV[x][y]);

if (v[x][y]<0) v[x][y] = 0;

y = height - 1;

uv2 = tmpU[x][y]*tmpV[x][y]*tmpV[x][y];

u[x][y] = tmpU[x][y] + dt*(duDivh2*(tmpU[pBC(x+1,width)][y] +

tmpU[pBC(x-1,width)][y] + tmpU[x][pBC(y+1, height)] +

Page 37: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 31

tmpU[x][pBC(y-1, height)] - 4*tmpU[x][y]) - uv2 + f*(1-tmpU[x][y]));

if (u[x][y]<0) u[x][y] = 0;

v[x][y] = tmpV[x][y] + dt*(dvDivh2*(tmpV[pBC(x+1,width)][y] +

tmpV[pBC(x-1,width)][y] + tmpV[x][pBC(y+1, height)] +

tmpV[x][pBC(y-1, height)] - 4*tmpV[x][y]) + uv2 - k*tmpV[x][y]);

if (v[x][y]<0) v[x][y] = 0;

for (y = 0; y<height; y++)

x = 0;

uv2 = tmpU[x][y]*tmpV[x][y]*tmpV[x][y];

u[x][y] = tmpU[x][y] + dt*(duDivh2*(tmpU[pBC(x+1,width)][y] +

tmpU[pBC(x-1,width)][y] + tmpU[x][pBC(y+1, height)] +

tmpU[x][pBC(y-1, height)] - 4*tmpU[x][y]) - uv2 + f*(1-tmpU[x][y]));

if (u[x][y]<0) u[x][y] = 0;

v[x][y] = tmpV[x][y] + dt*(dvDivh2*(tmpV[pBC(x+1,width)][y] +

tmpV[pBC(x-1,width)][y] + tmpV[x][pBC(y+1, height)] +

tmpV[x][pBC(y-1, height)] - 4*tmpV[x][y]) + uv2 - k*tmpV[x][y]);

if (v[x][y]<0) v[x][y] = 0;

x = width - 1;

uv2 = tmpU[x][y]*tmpV[x][y]*tmpV[x][y];

u[x][y] = tmpU[x][y] + dt*(duDivh2*(tmpU[pBC(x+1,width)][y] +

tmpU[pBC(x-1,width)][y] + tmpU[x][pBC(y+1, height)] +

tmpU[x][pBC(y-1, height)] - 4*tmpU[x][y]) - uv2 + f*(1-tmpU[x][y]));

if (u[x][y]<0) u[x][y] = 0;

v[x][y] = tmpV[x][y] + dt*(dvDivh2*(tmpV[pBC(x+1,width)][y] +

tmpV[pBC(x-1,width)][y] + tmpV[x][pBC(y+1, height)] +

tmpV[x][pBC(y-1, height)] - 4*tmpV[x][y]) + uv2 - k*tmpV[x][y]);

if (v[x][y]<0) v[x][y] = 0;

for (x = 0; x<width; x++)

Page 38: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 32

for (y = 0; y<height; y++)

tmpU[x][y] = u[x][y];

tmpV[x][y] = v[x][y];

private int pBC(int x, int max) /*periodic boundary conditions*/

int xp = x;

while (xp<0) xp += max;

while (xp>=max) xp -= max;

return xp;

Page 39: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 33

This is RDCanvas.java file is just like a canvas so we can paint on canvas just like

change color

/*

* To change this template, choose Tools | Templates

* and open the template in the editor.

*/

package ptternformation;

import java.awt.*;

/**

*

* @author W.A.B. Janith

*/

final class RDCanvas extends Canvas implements Runnable

public Thread runner = null;

int w, h;

Dimension preferredSize;

Image DB_Image;

Graphics DB_Graphics;

GrayScott grayScott;

int nColors = 85;

Color[] color = new Color[3*nColors];

double[][] u;

ReactionDiffusion controller;

double umax;

public RDCanvas(ReactionDiffusion controller, int w, int h)

this.w = w;

this.h = h;

this.controller = controller;

preferredSize = new Dimension(w + 3, h + 3);

Page 40: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 34

u = new double[w][h];

for (int i = 0; i<nColors; i++)

color[i] = new Color((int)(255*((double)i/nColors)), 0, 0);

for (int i = 0; i<nColors; i++)

color[i+nColors] = new Color(255, (int)(255*((double)i/nColors)), 0);

for (int i = 0; i<nColors; i++)

color[i+2*nColors] = new Color((int)(255*(1.0-(double)i/nColors)), 255,0);

grayScott = new GrayScott(w, h, controller.F0, controller.K0, 0.01);

@Override

public Dimension getPreferredSize()

return preferredSize;

@Override

public void paint(Graphics g)

update(g);

@Override

public void update(Graphics g)

int cn;

double uMax = 0;

if (DB_Graphics == null)

DB_Image = createImage(w+3, h+3);

Page 41: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 35

DB_Graphics = DB_Image.getGraphics();

for (int x = 0; x<w; x++)

for (int y = 0; y<h; y++)

cn = (int)((3*nColors-1.0)*u[x][y]/0.4);

if (cn>(3*nColors-1)) cn = 3*nColors - 1;

if (cn<0) cn = 0;

DB_Graphics.setColor(color[cn]);

DB_Graphics.drawLine(x+1,y+1,x+1,y+1);

/*draw border*/

DB_Graphics.setColor(Color.black);

DB_Graphics.drawLine(0,0,preferredSize.width-1,0);

DB_Graphics.drawLine(0,0,0,preferredSize.height-1);

DB_Graphics.drawLine(0,preferredSize.height-2,preferredSize.width-2,preferredSize.height-2);

DB_Graphics.drawLine(preferredSize.width-2,0,preferredSize.width-2,preferredSize.height-2);

DB_Graphics.drawLine(0,preferredSize.height-1,preferredSize.width-1,preferredSize.height-1);

DB_Graphics.drawLine(preferredSize.width-1,0,preferredSize.width-1,preferredSize.height-1);

g.drawImage(DB_Image, 0, 0, this);

@Override

public void run()

Thread myThread = Thread.currentThread();

while (runner == myThread)

for (int i = 0; i<10; i++) /* 10 timesteps / frame */

grayScott.timeStep(1);

Page 42: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 36

umax = 0;

for (int x = 0; x<w; x++)

for (int y = 0; y<h; y++)

u[x][y] = grayScott.v[x][y];

if (u[x][y]>umax) umax = u[x][y];

repaint();

try

Thread.sleep(50);

catch (InterruptedException e)

Page 43: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 37

/*

* To change this template, choose Tools | Templates

* and open the template in the editor.

*/

package ptternformation;

import java.applet.Applet;

import java.awt.*;

import java.awt.event.*;

/**

*

* @author W.A.B. Janith

*/

/*------------------------------->class ReactionDiffusion<-----------------------------------------------

<APPLET CODE="ReactionDiffusion.class" WIDTH=200 HEIGHT=250>

<PARAM NAME=xmax VALUE=100>

<PARAM NAME=ymax VALUE=100>

</APPLET>

*/

public final class ReactionDiffusion extends Applet implements ActionListener, AdjustmentListener

Thread runner = null;

int w; /*APPLET WIDTH*/

int h; /*APPLET HEIGHT*/

int xmax, ymax; /*canvas size*/

int tpf = 10; /*timesteps per frame*/

double dt;

Page 44: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 38

Graphics DB_Graphics;

Image DB_Image;

GrayScott grayScott;

int nColors = 85;

Color[] color = new Color[3 * nColors];

double[][] u;

double umax;

private RDCanvas canvas;

Scrollbar kSlider, fSlider;

Button restartButton;

Label fLabel, kLabel;

final double K0 = 0.079;

final double F0 = 0.02;

@Override

public void init()

w = getSize().width; /*applet width*/

h = getSize().height; /*applet height*/

u = new double[w][h];

String p;

/*canvas width*/

p = getParameter("xmax");

if (p == null)

p = "100";

xmax = Integer.valueOf(p).intValue();

if (xmax < 10)

xmax = 10;

Page 45: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 39

/*canvas height*/

p = getParameter("ymax");

if (p == null)

p = "100";

ymax = Integer.valueOf(p).intValue();

if (ymax < 10)

ymax = 10;

/*create components*/

restartButton = new Button("Restart");

restartButton.addActionListener(this);

canvas = new RDCanvas(this, xmax, ymax);

int pos = (int) (K0 * 100.0 / 0.15);

kSlider = new Scrollbar(Scrollbar.HORIZONTAL, pos, 1, 0, 200);

kSlider.addAdjustmentListener(this);

kLabel = new Label("k = ");

kLabel.setText("k = " + String.valueOf(K0));

pos = (int) (F0 * 100.0 / 0.15);

fSlider = new Scrollbar(Scrollbar.HORIZONTAL, pos, 1, 0, 200);

fSlider.addAdjustmentListener(this);

fLabel = new Label("f = ");

fLabel.setText("f = " + String.valueOf(F0));

GridBagLayout gridbag = new GridBagLayout();

GridBagConstraints c = new GridBagConstraints();

Page 46: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 40

setLayout(gridbag);

/*add components*/

gridbag.setConstraints(getCanvas(), c);

add(getCanvas());

c.gridy = 1;

gridbag.setConstraints(fLabel, c);

add(fLabel);

c.gridy = 2;

c.fill = GridBagConstraints.HORIZONTAL;

gridbag.setConstraints(fSlider, c);

add(fSlider);

c.gridy = 3;

c.fill = GridBagConstraints.NONE;

gridbag.setConstraints(kLabel, c);

add(kLabel);

c.gridy = 4;

c.fill = GridBagConstraints.HORIZONTAL;

gridbag.setConstraints(kSlider, c);

add(kSlider);

c.gridy = 5;

c.fill = GridBagConstraints.NONE;

gridbag.setConstraints(restartButton, c);

add(restartButton);

Page 47: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 41

@Override

public void start()

if (canvas.runner == null)

canvas.runner = new Thread(canvas, "CanvasRunner");

canvas.runner.start();

@Override

public void stop()

canvas.runner = null;

@Override

public void paint(Graphics g)

/*draw border*/

g.setColor(Color.green);

g.drawLine(0, 0, getWidth() - 1, 0);

g.drawLine(0, 0, 0, getHeight() - 1);

g.drawLine(getWidth() - 1, getHeight() - 1, 0, getHeight() - 1);

g.drawLine(getWidth() - 1, getHeight() - 2, 0, getHeight() - 2);

g.drawLine(getWidth() - 1, getHeight() - 1, getWidth() - 1, 0);

g.drawLine(getWidth() - 2, getHeight() - 1, getWidth() - 2, 0);

@Override

public void actionPerformed(ActionEvent e)

if (getCanvas().runner != null)

canvas.runner = null;

getCanvas().grayScott.initialState();

canvas.runner = new Thread(getCanvas(), "CanvasRunner");

Page 48: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 42

getCanvas().runner.start();

else

getCanvas().grayScott.initialState();

@Override

public void adjustmentValueChanged(AdjustmentEvent e)

if (e.getAdjustable() == fSlider)

getCanvas().grayScott.setF(fSlider.getValue() * 0.15 / 100.0);

fLabel.setText("f = " + String.valueOf(getCanvas().grayScott.f));

else

getCanvas().grayScott.setK(kSlider.getValue() * 0.15 / 100.0);

kLabel.setText("k = " + String.valueOf(getCanvas().grayScott.k));

/**

* @return the canvas

*/

public RDCanvas getCanvas()

return canvas;

Page 49: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.1 Program Code 43

This is main class so we must run first this java file(class)

/*

* To change this template, choose Tools | Templates

* and open the template in the editor.

*/

package ptternformation;

import java.awt.Color;

import javax.swing.JFrame;

/**

*

* @author W.A.B. Janith

*/

public class main

public static void main(String arg[])

ReactionDiffusion theApplet = new ReactionDiffusion();

theApplet.init(); // Needed if overridden in applet

theApplet.start(); // Needed if overridden in applet

//... Create a window (JFrame) and make applet the content pane.

JFrame window = new JFrame("Sample Applet and Application");

window.setBackground(Color.ORANGE);

window.setContentPane(theApplet);

window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

window.pack(); // Arrange the components.

//System.out.println(theApplet.getSize());

window.setVisible(true);

Page 50: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

4.2 Program OUTPUT 44

4.2 Program OUTPUT

Figure 4.1 1For f=0.02,k=0.079

Figure 4.2 2or f=0.024,k=0.0765

Page 51: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

Chapter 5

Conclusion

In this study we considered the large-time behavior of solutions U(x, y , t) and V

(x, y, t) of the Gray-Scott model on a two-dimensional domain (0, L) × (0, L). We

focused on the parameters Du, Dv and on the small L of the domain. We did look

at the final profiles of the model for two different values of F and K by doing some

numerical simulations. We tried to build the program which we saw in our project

results. It appears different patterns that for some values of F and k for small L, we

able to built a nice patterns of our numerical results using the Gray-Scott model.

45

Page 52: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

Chapter 6

Discussion

In this dissertation we have investigated pattern formation in reaction-

diffusion systems. We used a simple and well known model to explore

different pattern behaviors in two dimensions. This pattern generation

model is using in very important role because every biological pattern

was made by in reaction such as reaction diffusions .as a example zebra’s

skin , tiger’s skin and our finger print also made in pattern by reaction

diffusions . we developed a programs generate many varies pattern For a

variety of systems, reaction-diffusion equations with more than two com-

ponents have been proposed, e.g. as models for the Belousov-Zhabotinsky

reaction, for blood clotting or planar gas discharge systems. So we can

implement our program in multi dimensional region.

In recent times, reaction-diffusion systems have attracted much interest

as a prototype model for pattern formation. The above-mentioned pat-

terns (fronts, spirals, targets, hexagons, stripes and dissipative solutions)

can be found in various types of reaction-diffusion systems in spite of large

discrepancies e.g. in the local reaction terms. It has also been argued that

46

Page 53: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

47

reaction-diffusion processes are an essential basis for processes connected

to morphogenesis in biology and may even be related to animal coats and

skin pigmentation. The chemical basis of morphogenesis Another reason

for the interest in reaction-diffusion systems is that although they rep-

resent nonlinear partial differential equation, there are often possibilities

for an analytical treatment. There are many experiments in the world be

investigated. Well-controllable experiments in chemical reaction-diffusion

systems have up to now been realized in three ways. First, gel reactors

or filled capillary tubes may be used. Second, temperature pulses on cat-

alytic surfaces have been investigated. Third, the propagation of running

nerve pulses is modeled using reaction-diffusion systems. Aside from these

generic examples, it has turned out that under appropriate circumstances

electric transport systems like plasmas or semiconductors can be described

in a reaction-diffusion approach. For these systems various experiments

on pattern formation have been carried out.

Page 54: THE CHEMICAL BASIS OF MORPHOGENESIS BY REACTION DIFFUSION SYSTEM

Bibliography

[1] M.K.Jain,S.R.K.Iyengar,R.K.Jain, Computational Methods for Partial Differen-

tial Equations, 3rd ed. (Wiley, new Delhi:India, 1993),

[2] Randall J. LeVeque, “Finite Difference Methods for Differential Equations,”

DRAFT VERSION for use in the course A Math 585-586 University of Wash-

ington Version of September, 2005.

[3] PATTERN FORMATION IN REACTION-DIFFUSION MODELS FAR FROM

THE TURING REGIME by THEODORE KOLOKOLNIKOV August 2004

[4] Pattern formation in the Gray-Scott model Jeff S. McGough and Kyle Riley

Department of Mathematics and Computer Science, South Dakota School of

Mines and Technology 501 E. St. Joseph St. Rapid City, SD 57701 USA

[5] Numerical Solutio of the 2D Gray-scott model ,Jan Mach,Faculty of Nuclear sci-

ences and PhysicalPhysical Engineering,Czech Teachnical University in Prague.

[6] Sole) PATTERN FORMATION IN NOISY SELF-REPLICATING SPOTS An-

dreea Munteanu1,and Ricard V. Sole, 1ICREA-Complex Systems Lab, Universi-

tat Pompeu Fabra (GRIB), Dr Aiguader 80, 08003 Barcelona, Spain 2Santa Fe

Institute, 1399 Hyde Park Road, Santa Fe NM 87501, USA

[7] http://www.wikipedia.org/

48