gfun[rectodiffeq] - convert a linear recurrence into a differential equation
Calling Sequence
rectodiffeq(eqns, u,n, f,z, <homogeneous=bool>, <operator=name>)
Parameters
eqns - a single equation or a set of equations
u,n - the name and index of the recurrence
f,z - the name and variable of the function
homogeneous - (optional) boolean requesting homogeneous output; the default is false
operator - (optional) name used verbatim as the differential operator
Description
- Let
fbe the generating function associated to the sequence (u(n)):f(z)=sum(u(n)*z^n,n=0..infinity). The procedure outputs a linear differential equation with polynomial coefficients verified byf. - The input syntax is the same as for rsolve: the first argument should be a single recurrence relation or a set containing one recurrence relation and boundary conditions. The recurrence relation should be linear in the variable
u, with polynomial coefficients inn. The terms of the sequence appearing in the relation should be of the formu(n+k), withkan integer. - The output is either a single differential equation, or a set containing a differential equation and initial conditions.
- With
operator=name, initial conditions are not computed. Homogeneous output is a polynomial in the supplied name and inhomogeneous output has the formL(name)=-q.
Examples
> with(gfun):
deq:=rectodiffeq({(5*n+10)*u(n)+a*u(n+1)-u(n+2),u(0)=0,u(1)=0},u(n),f(t));
\[\left(a t +10 t^{2}-1\right) f \! \left(t \right)+5 t^{3} \left(\frac{d}{d t}f \! \left(t \right)\right)\]
> diffeqtorec(deq,f(t),u(n));
\[\left(5 n +10\right) u \! \left(n \right)+a u \! \left(n +1\right)-u \! \left(n +2\right)\]
> deq:=rectodiffeq((n-10)*u(n+1)-u(n),u(n),y(z));
\[\left(-z -11\right) y \! \left(z \right)+z \left(\frac{d}{d z}y \! \left(z \right)\right)\]
> dsolve(deq,y(z));
\[y \! \left(z \right) = c_{1} {\mathrm e}^{z} z^{11}\]