In [1]:
using Flows
In [2]:
@t_vars t
@x_vars u
@funs F
Out[2]:
In [3]:
ex = E(F,t,u)
Out[3]:
In [4]:
ex = t_derivative(ex, t)
Out[4]:
In [5]:
ex = t_derivative(ex, t)
Out[5]:
In [6]:
ex = t_derivative(ex, t)
Out[6]:
In [7]:
ex = t_derivative(ex,t )
Out[7]:
The last expression is not fully expanded, it is a linear combination consisting of 3 terms:
In [8]:
length(ex.terms)
Out[8]:
If we expand it, we obtain a linear combination of 4 terms, corresponding to the 4 elementary differentials (Butcher trees) of order 4:
In [9]:
ex = expand(ex)
Out[9]:
In [10]:
length(ex.terms)
Out[10]:
In [11]:
ex = expand(t_derivative(ex, t))
Out[11]:
In [12]:
length(ex.terms)
Out[12]:
In [13]:
ex = expand(t_derivative(ex, t))
Out[13]:
In [14]:
length(ex.terms)
Out[14]:
In [15]:
ex = expand(t_derivative(ex, t))
print(ex) # Here the LaTeX output of Jupyter gives up...
In [16]:
length(ex.terms)
Out[16]:
We generate a table of the number of elementary differentials (Butcher trees) up to order 12.
This table is to be compared with https://oeis.org/A000081 or Table 2.1 in
E. Hairer, S.P. Norsett, G. Wanner, Solving Ordinary Differential Equations I, 2nd ed, Springer, 1993.
In [ ]:
ex = E(F,t,u)
ex = expand(t_derivative(ex, t))
println("order\t#terms")
println("---------------")
println(1,"\t",1)
ex = expand(t_derivative(ex, t))
println(2,"\t",1)
for k=3:20
ex = expand(t_derivative(ex, t))
println(k,"\t", length(ex.terms))
end
In [ ]:
In [ ]: