Function Repository Resource:

MultiwayEvolutionPlot

Source Notebook

Plot the evolution of a multiway system

Contributed by: Stephen Wolfram and Jonathan Gorard

ResourceFunction["MultiwayEvolutionPlot"][rules,init,n]

plots the first n steps in the evolution of the multiway system with the specified rules starting from initial conditions init.

Details and Options

ResourceFunction["MultiwayEvolutionPlot"] currently only works for string substitution rules of the form {"lhs"1"rhs"2,}.
Options for ResourceFunction["MultiwayEvolutionPlot"] include:
"EvolutionEventRendering""SingleArrow"how to render the events in the evolution
"VerticalSpacing"2vertical spacing between rows
"HorizontalSpacing"1.5horizontal spacing between elements
Possible settings for "EvolutionEventRendering" include:
"SingleArrow"a single arrow between connected states (as in A New Kind of Science)
"PositionalArrows"arrows indicating the center of each rewrite event
"PositionalPolygons"polygons indicating the extent of each rewrite event
ResourceFunction["MultiwayEvolutionPlot"] accepts both individual rules and lists of rules, and likewise for initial conditions.

Examples

Basic Examples (3) 

Plot a basic multiway evolution:

In[1]:=
ResourceFunction[
 "MultiwayEvolutionPlot"][{"A" -> "AA", "B" -> "AB"}, "ABA", 3]
Out[1]=

Plot a more complicated multiway evolution with arrows showing the rewrite events:

In[2]:=
ResourceFunction[
 "MultiwayEvolutionPlot"][{"A" -> "BBB", "BB" -> "A"}, "A", 5]
Out[2]=

Plot the same multiway evolution but with polygons highlighting the rewrite events:

In[3]:=
ResourceFunction[
 "MultiwayEvolutionPlot"][{"A" -> "BBB", "BB" -> "A"}, "A", 5, "EvolutionEventRendering" -> "PositionalPolygons"]
Out[4]=

Scope (2) 

MultiwayEvolutionPlot accepts both individual rules and lists of rules:

In[5]:=
ResourceFunction["MultiwayEvolutionPlot"]["A" -> "AA", "AAA", 3]
Out[5]=
In[6]:=
ResourceFunction[
 "MultiwayEvolutionPlot"][{"A" -> "AB", "B" -> "BA"}, "AAA", 2, "VerticalSpacing" -> 6]
Out[6]=

Likewise for initial conditions:

In[7]:=
ResourceFunction[
 "MultiwayEvolutionPlot"][{"A" -> "AB", "B" -> "BA"}, {"ABA", "AAB"}, 2, "VerticalSpacing" -> 6]
Out[7]=

Options (2) 

Default plot with single arrows between states:

In[8]:=
ResourceFunction[
 "MultiwayEvolutionPlot"][{"A" -> "AA", "B" -> "AB"}, "ABA", 3]
Out[8]=

Separate arrows indicating the center of the beginning and end of each rewrite event:

In[9]:=
ResourceFunction[
 "MultiwayEvolutionPlot"][{"A" -> "AA", "B" -> "AB"}, "ABA", 3, "EvolutionEventRendering" -> "PositionalArrows"]
Out[9]=

Polygons indicating the extent of the beginning and end of each rewrite event:

In[10]:=
ResourceFunction[
 "MultiwayEvolutionPlot"][{"A" -> "AA", "B" -> "AB"}, "ABA", 3, "EvolutionEventRendering" -> "PositionalPolygons"]
Out[10]=

Specify spacings in terms of element sizes:

In[11]:=
ResourceFunction[
 "MultiwayEvolutionPlot"][{"A" -> "AA", "B" -> "AB"}, "ABA", 3, "EvolutionEventRendering" -> "PositionalPolygons", "VerticalSpacing" -> 3, "HorizontalSpacing" -> 1]
Out[11]=

Version History

  • 3.0.0 – 10 April 2020
  • 2.0.0 – 19 March 2020
  • 1.0.0 – 10 March 2020

Source Metadata

Related Resources

License Information