Wolfram Research

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" Automatic number of columns in an array of plots
"ButcherPlotNodeSize" 1 scaling factor for the nodes in the trees
"ButcherPlotRootSize" 1 scaling factor for highlighting roots
"ButcherPlotLabel" { } list of plot labels

Examples

Basic Examples

Generate and plot trees for any Runge–Kutta method of order 3:

In[1]:=
ResourceFunction["ButcherTrees"][3]
Out[1]=
In[2]:=
ResourceFunction["ButcherPlot"][%]
Out[2]=

Scope

Plot a Butcher tree:

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

Plot several trees:

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

Options

ButcherPlotColumns

Plot trees in a single column:

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

ButcherPlotNodeSize

Increase the size of nodes:

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

ButcherPlotRootSize

Highlight roots with larger circles:

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

ButcherPlotLabel

Label trees:

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

Resource History

Related Resources

License Information