# Using Fractal Growth Algorithm Of L System Commerce Essay

**Published:** **Last Edited:**

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

The study of plant development requires increasingly powerful modeling tools to help understand and simulate the growth and functioning of plants. In the last decade, the formalism of L-systems has emerged as a major paradigm for modeling plant development. Previous implementations of this formalism were made based on static languages, i.e., languages that require explicit definition of variable types before using them. These languages are often efficient but involve quite a lot of syntactic overhead, thus restricting the flexibility of use for modelers. In this work, we present an adaptation of Lindenmayer system (L-systems) to the Python language, a popular and powerful open-license dynamic language.

In the present notes we concentrate to create a software to model the tree using Fractal Growth Algorithm of L-system. The Algorithm and software is deeply discussed here.

## Introduction and literature Review

The learning of plant working and development has been complemented and supported by the development of a new family of models called functional-structural models, in the last two decades. These computational models use 3D illustrations of plant architecture to simulate diverse kinds of physical, physiological, or Eco-physiological processes in plants, and make it possible to assess the effects of these processes on plant functioning, development, and form.

Aristid Lindenmayer introduced formalism for simulating the growth of multicellular organisms and named as L-systems, in 1968 [36]. As a biologist, Lindenmayer worked with yeast and filamentous fungi and studied the development patterns of different types of algae, such as the blue/green bacteria Anabaena catenula. Initially the L-systems were devised to provide a formal description of the development of such simple multicellular organisms, and to illustrate the neighborhood relationships between plant cells. Later on, this system was extended to describe higher plants and complex branching structures.

This work was closely linked to abstract automata and formal languages and was attracted theoretical computer scientists [67]. The development of the mathematical theory of L-systems [70, 27, 66] was trailed by the application of the theory to the modeling of plants and trees [18, 17, 16, 31, 42, 56, 61].

In the present notes we concentrate to create software to model the tree using Fractal Growth Algorithm a type of L-system. The Algorithm software is deeply discussed here.

## The modular structure of plants

L-systems were initially presented to model the development of simple multicellular organisms

(for example, algae) in terms of division, growth and death of singular cells [36, 37]. The range

of L-system applications has consequently been prolonged to higher plants and compound branching structures, in particular inflorescences [18, 19], described as configurations of modules in space (Problem 2.1). In the context of L-systems, the term module indicates any discrete constructional unit that is repetitive as the plant grows, for example an internode, an apex, a flower, or a branch (c.f. [4, page 284]) (Problem 2.2). The goal of modeling at the modular level is to describe the development of a plant as a whole, and in particular the emergence of plant shape, as the integration of the development of individual units (Problem 2.3).

## Plant development as a rewriting process

An L-system or Lindenmayer system is a parallel rewriting system. It is variant of a formal grammar and well used to model the evolution processes of plant growth. It is also able to model the morphology of variety of organisms. An L-system involves alphabets of symbols that can be used to create strings. It is a collection of production rules which expands all symbols into some larger string of symbols. Initial string which is called "axiom" string, from which construction begins, is used for translating the generated strings into geometric structures. L-systems are also used to generate self-similar fractals such as iterated function systems. L-systems were introduced and developed in 1968 by the Hungarian theoretical biologist and botanist from the University of Utrecht, Aristid Lindenmayer (1925-1989).

The principle of growth at the modular level can be suitably captured by a parallel rewriting system that replaces individual parent, mother, or ancestor modules by configurations of child, daughter, or descendant modules. All modules belong to a finite alphabet of module types, therefore the behavior of an arbitrarily large configuration of modules can be specified using a limited set of productions or rewriting rules. In the simplest case, a production consists of a single module called the left hand side or predecessor, and a configuration of zero, one, or more modules is called the right hand side or successor. A production p with the left hand side corresponding a given mother module can be applied by removing this module from the rewritten structure and introducing the daughter modules stated by the production's successor. An occurrence map is required for this process ' that converts the predecessor into the mother module, and applying the same conversion to all the modules in the successor in order to produce the suitable child modules (Figure 1).

Figure

Two examples of production application are shown in Figure 2. In first case productions that substitute internodes split the branching structure into an upper part and lower part. The location of the upper part is adjusted to accommodate the insertion of the successor modules, keeping the size and the shape of both parts unchanged. In Other case the rewritten structures are denoted by graphs with sequences. The size and shape of the production successor does not always match the size and shape of the predecessor but the geometry of the predecessor and the implanting structure has to be adjusted to accommodate the successor. In our work we focus on the rewriting of branching structures corresponding to the first case.

Figure Productions may be applied parallel to all the modules being rewritten or sequentially in every steiop. Because development takes place in all all the parts simultaneously therefore Parallel rewriting is more suitable for the modeling of biological organism development. A derivation

Figure step corresponds to the advancement of time interval. a developmental sequence is defined as a series of structures obtained in successive derivation steps from a predefined initial structure. developmental sequence can also be viewed as the consequence of a discrete-time simulation of development. For example, Figure 3 shows the development of a stylized compound plant comprising two module types, the apices (denoted by thin lines) and the internodes (shown by thick lines).

An internode extends by a constant scaling factor. In spite of the ease of these rules, a complicated branching structure grows from a single apex over a number of derivation steps. The fractal geometry of this structure can be viewed as an emergent property of the rewriting rules.

## L-system structure

The recursive nature of the L-system rules leads to self-similarity and thus fractal-like forms are easy to define with an L-system. Plant models and natural-looking biological arrangements are easy to define, as by increasing the recursion level the form gradually grows and becomes more composite. Lindenmayer systems are also prevalent in the creation of artificial life.

L-systems are now commonly known as parametric L systems, defined as a tuple

where

V is a set of symbols(variables) comprising elements that can be replaced

Ï‰ (axiom, initiator or start) is a string of symbols from V that defines the initial state of the system

P is defines as the set of productions or production rules defining the way variables and can be replaced with the combinations of other variables.

The rules of the L-system grammar are iteratively applied that starts from the initial state. simultaneously as many rules as possible are applied per iteration; this is the distinguish between formal grammar generated by formal language and an L-system. If the production rules are to be applied one at a time, rather than an L-system , one should simply generates a language. Therefore L-systems are subsets of languages.

Context-free L-systems are represented by either a regular grammar or by a prefix grammar. if each production rule refers only to an individual symbol and not to its neighbours then An L-system is said to be context-free. it is termed a context-sensitive L-system If a rule depends not only on a particular symbol but also on its neighbours.

L-system is termed as deterministic If there is exactly one production for each symbol. a deterministic context-free L-system is popularly called a D0L-system. it is said to be stochastic L-system If there are several, and all are chosen with a certain probability during each iteration.

Using L-systems for creating graphical images requires that the symbols in the model denote the elements of a picture on the display screen.

## Examples of L-systems

## Example 1: Algae

This example is exactly similar to the example of Landmarks L-system example for the algae. Here we don't use any constants and other variables and rules are defines below.

variablesÂ : A B

start pointÂ : A

rules Â : (A â†’ AB), (B â†’ A)

which produces:

Iteration number = 0Â : A

Iteration number = 1Â : AB

Iteration number = 2Â : ABA

Iteration number = 3Â : ABAAB

Iteration number = 4Â : ABAABABA

Iteration number = 5Â : ABAABABAABAAB

Iteration number = 6Â : ABAABABAABAABABAABABA

Iteration number = 7Â : ABAABABAABAABABAABABAABAABABAABAAB

## Example 1: Algae, explained

If i denotes the iteration no then we can write it as

i=0: A start (initiator)

## / \

i=1: A B the initial single A will go to AB ( by rule A â†’ AB)

## /| \

i=2: A B A here the string A â†’ AB and B â†’ AB

## /| | |\

i=3: A B A A B the process is repeted

## /| | |\ |\ \

i=4: A B A A B A B A the process is repeted

this is like the Fibonacci sequence of numbers (skipping the first 1, due to our choice of initiator) we can write it as:

1 2 3 5 8 13 21 34 55 89 ...

For each string, if we calculate the n-th position from the left end of the string, the value is determined by a multiple of the golden mean that falls within the interval [n-1,n]. The ratio of A to B similarly converges to the golden mean.

## Example 2

here we define the variables and constants as

variablesÂ : 0, 1

## constants: [, ]

start Â : 0

rules Â : (1 â†’ 11), (0 â†’ 1[0]0)

The figure is built by recursively feeding the axiom through the production rules. Here in this example 1 will grow to 11 and 0 will grow to 1[0][0]

initiator:

0

1st Iteration:

1[0]0

2nd Iteration:

11[1[0]0]1[0]0

3rd Iteration:

1111[11[1[0]0]1[0]0]11[1[0]0]1[0]0

We can see that this string rapidly grows in size and complication. This string can be drawn on an imag using turtle graphics, in which each symbol is allotted a graphical setup for the turtle to be performed. We discuss it an other example to draw the these, the turtle can be defined in the the following manners:

if 0: draw a line ending in a leaf

if 1: draw a line

if ]: pop position and angle, turn right 45 degrees

if [: push position and angle, turn left 45 degrees

the above example can be shon in the graphical image shown in figure

## Example 3: Cantor dust

variablesÂ : X Y

constantsÂ : none

start Â : X {initiator}

rules Â : (X â†’ XYX), (Y â†’ YYY)

Let X mean "draw forward" and Y mean "move forward".

This produces the famous Cantor's fractal set on a real straight line R.

## Example 4: Koch curve

A variant of the Koch curve which uses only right angles.

variablesÂ : X

## constantsÂ : + âˆ’

start Â : X

rules Â : (X â†’ X+Xâˆ’Xâˆ’X+X)

Here, X means "draw forward", + means "turn left 90Â°", and âˆ’ means "turn right 90Â°" (see turtle graphics).

i = 0:

X

Koch Square - 0 iterations

i = 1:

X+Xâˆ’Xâˆ’X+X

Koch Square - 1 iterations

i = 2:

X+Xâˆ’Xâˆ’X+X + X+Xâˆ’Xâˆ’X+X âˆ’ X+Xâˆ’Xâˆ’X+X âˆ’ X+Xâˆ’Xâˆ’X+X + X+Xâˆ’Xâˆ’X+X

Koch Square - 2 iterations

i = 3:

X+Xâˆ’Xâˆ’X+X+X+Xâˆ’Xâˆ’X+Xâˆ’X+Xâˆ’Xâˆ’X+Xâˆ’X+Xâˆ’Xâˆ’X+X+X+Xâˆ’Xâˆ’X+X +

X+Xâˆ’Xâˆ’X+X+X+Xâˆ’Xâˆ’X+Xâˆ’X+Xâˆ’Xâˆ’X+Xâˆ’X+Xâˆ’Xâˆ’X+X+X+Xâˆ’Xâˆ’X+X âˆ’

X+Xâˆ’Xâˆ’X+X+X+Xâˆ’Xâˆ’X+Xâˆ’X+Xâˆ’Xâˆ’X+Xâˆ’X+Xâˆ’Xâˆ’X+X+X+Xâˆ’Xâˆ’X+X âˆ’

X+Xâˆ’Xâˆ’X+X+X+Xâˆ’Xâˆ’X+Xâˆ’X+Xâˆ’Xâˆ’X+Xâˆ’X+Xâˆ’Xâˆ’X+X+X+Xâˆ’Xâˆ’X+X +

X+Xâˆ’Xâˆ’X+X+X+Xâˆ’Xâˆ’X+Xâˆ’X+Xâˆ’Xâˆ’X+Xâˆ’X+Xâˆ’Xâˆ’X+X+X+Xâˆ’Xâˆ’X+X

Koch Square - 3 iterations

## Example 5: Sierpinski triangle

The Sierpinski triangle drawn using an L-system.

variablesÂ : X Y

## constantsÂ : + âˆ’

start Â : X

rules Â : (X â†’ Yâˆ’Xâˆ’Y), (Y â†’ X+Y+X)

angle Â : 60Â°

Here, X and Y both mean "draw forward", + means "turn left by angle", and âˆ’ means "turn right by angle" (see turtle graphics). The angle changes sign at each iteration so that the base of the triangular shapes are always in the bottom (otherwise the bases would alternate between top and bottom).

Serpinski Lsystem.svg

Evolution for i = 2, i = 4, i = 6, i = 8

There is another way to draw the Sierpinski triangle using an L-system.

variablesÂ : A B

## constantsÂ : + âˆ’

start Â : Aâˆ’Bâˆ’B

rules Â : (A â†’ Aâˆ’B+A+Bâˆ’A), (B â†’ BB)

angle Â : 120Â°

Here, A and B both mean "draw forward", + means "turn left by angle", and âˆ’ means "turn right by angle".

## Example 6: Dragon curve

The dragon curve drawn using an L-system.

variablesÂ : A B

constantsÂ : C + âˆ’

start Â : CA

rules Â : (A â†’ A+BC), (B â†’ CA-B)

angle Â : 90Â°

Here, C means "draw forward", - means "turn left 90Â°", and + means "turn right 90Â°". A and Y do not correspond to any drawing action and are only used to control the evolution of the curve.

Dragon curve L-system.svg

Dragon curve for i = 10

## Implementation of Fractal Algorithm for Creation of Tree

variablesÂ : X F

## constantsÂ : + âˆ’ [ ]

start Â : X

rules Â : (X â†’ F-[[X]+X]+F[+FX]-X), (F â†’ FF)

angle Â : 25Â°

Here, F means "draw forward", - means "turn left 25Â°", and + means "turn right 25Â°". X does not correspond to any drawing action and is used to control the evolution of the curve. [ corresponds to saving the current values for position and angle, which are restored when the corresponding ] is executed.

Fractal-plant.svg

Fractal plant for i = 6

## Variations

A number of elaborations on this basic L-system technique have been developed which can be used in conjunction with each other. Among these are stochastic, context sensitive, and parametric grammars.