A Lindenmayer system, or L-system, is a parallel rewriting system and a type of formal grammar.
June 23, 2017—Alessio Sarti
History and Origins
L-systems were introduced and developed in 1968 by Aristid Lindenmayer to capture the behavior of cell divisions in multicellular organisms, where many divisions may occur at the same time. Lindenmayer used them to model the growth patterns of algae and plants, but they can also be used for modeling fractals.
Derivation
An L-system is defined by an alphabet of symbols that can be used to make strings, a collection of production rules that expand each symbol into some larger string of symbols, an initial “axiom” string from which to begin construction and a mechanism for translating the generated strings into geometric structures.
The first step is to create the alphabet:
In[1]:=
alphabet={"A","B"}
Out[1]=
{A,B}
Then we define the substitution rules:
In[2]:=
rules={"A""AB","B""A"}
Out[2]=
{AAB,BA}
Define the initial axiom:
In[3]:=
axiom="A"
Out[3]=
A
The first generation of the system is, by definition, the axiom:
In[4]:=
LSystem[0,axiom_,rules_]:=axiom
The following generations can be computed recursively: