Wolfram Research

Function Repository Resource:

ButcherTrees

Source Notebook

Get a list of the trees for any Runge-Kutta method of a given order

Contributed by: Wolfram Research

ResourceFunction["ButcherTrees"][p]

gives a list, partitioned by order, of the trees for any Runge–Kutta method of order p.

Details and Options

The trees are represented in a functional form in terms of the elementrary symbol f (\[FormalF]).

Examples

Basic Examples

Give the trees that are needed for any third-order method:

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

Properties and Relations

Check the trees are all valid syntax, using ResourceFunction["ButcherTreeQ"]:

In[2]:=
ResourceFunction["ButcherTreeQ"] /@ ResourceFunction["ButcherTrees"][4]
Out[2]=

ResourceFunction["ButcherPlot"] can be used to plot Butcher trees:

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

Neat Examples

Plot and label the trees through order 5:

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

Resource History

Related Resources

License Information