Function Repository Resource:

ButcherPlot

Source Notebook

Plot order condition trees for Runge-Kutta method

Contributed by: Wolfram Research

ResourceFunction["ButcherPlot"][tree]

gives a plot of the Butcher tree tree.

ResourceFunction["ButcherPlot"][{tree1,tree2,}]

gives an array of plots of the treei.

Details and Options

Rooted trees in ResourceFunction["ButcherPlot"][] correspond to the elementary differentials appearing in the Taylor expansion of the system of differential equations, and branching of a sub-tree corresponds to exponentiation in the differential equation.
In Butcher plots, roots are denoted by circles and the number of vertices in a tree correspond to the order of the tree.
The following options can be given:
"ButcherPlotColumns"Automaticnumber of columns in an array of plots
"ButcherPlotNodeSize"1scaling factor for the nodes in the trees
"ButcherPlotRootSize"1scaling factor for highlighting roots
"ButcherPlotLabel"{}list of plot labels

Examples

Basic Examples (2) 

Use the resource function ButcherTrees to generate trees for any Runge-Kutta method of order 3:

In[1]:=
ResourceFunction["ButcherTrees"][3]
Out[1]=

Plot the trees:

In[2]:=
ResourceFunction["ButcherPlot"][%]
Out[2]=

Scope (2) 

Plot a Butcher tree:

In[3]:=
ResourceFunction["ButcherPlot"][\[FormalF][\[FormalF]^2]]
Out[3]=

Generate several trees with the resource function ButcherTrees and use ButcherPlot to plot them:

In[4]:=
ResourceFunction["ButcherPlot"][ResourceFunction["ButcherTrees"][4]]
Out[4]=

Options (4) 

ButcherPlotColumns (1) 

Plot trees in a single column:

In[5]:=
ResourceFunction["ButcherPlot"][ResourceFunction["ButcherTrees"][3], "ButcherPlotColumns" -> 1]
Out[5]=

ButcherPlotNodeSize (1) 

Increase the size of nodes:

In[6]:=
ResourceFunction["ButcherPlot"][ResourceFunction["ButcherTrees"][3], "ButcherPlotNodeSize" -> 3]
Out[6]=

ButcherPlotNodeSize (1) 

Highlight roots with larger circles:

In[7]:=
ResourceFunction["ButcherPlot"][ResourceFunction["ButcherTrees"][3], "ButcherPlotRootSize" -> 3]
Out[7]=

ButcherPlotLabel (1) 

Label trees:

In[8]:=
(ResourceFunction["ButcherPlot"][#, "ButcherPlotLabel" -> #] &)[
 Flatten[ResourceFunction["ButcherTrees"][4]]]
Out[8]=

Version History

  • 1.0.0 – 04 November 2019

Related Resources

License Information