rsolve - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Factorization and Solving Equations : rsolve

rsolve

recurrence equation solver

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

rsolve(eqns, fcns)

rsolve(eqns, fcns, 'genfunc'(z))

rsolve(eqns, fcns, 'makeproc')

rsolve(eqns, fcns, 'series')

Parameters

eqns

-

single equation or a set of equations

fcns

-

function name or set of function names

z

-

name, the generating function variable

Description

• 

The rsolve command attempts to solve the recurrence relation(s) specified in eqns for the functions in fcns, returning an expression for the general term of the function.

• 

The first argument must be a single recurrence relation or a set of recurrence relations and boundary conditions. Any expressions in eqns, which are not equations are understood to be equal to zero. Boundary conditions should be given in consecutive values of the indices, and for the case of multiple functions, all conditions should start at the same index.

• 

The second argument fcns indicates the functions that rsolve must solve for. A function may be represented by a name or an unevaluated function call whose argument is a name. If the function is represented by a name, the index variable for the solution is deduced from the recurrence equations. If the function is represented by an unevaluated function call, the argument name is used as the solution index. If the solution index differs from the index name in a recurrence equation, then the equation must be independent of the solution index.

• 

If fcns is a set, the solution is returned as a set of equations. The left-hand side of each equation is the function name. Otherwise, an expression for the solution is returned.

• 

The rsolve command can solve linear recurrences with constant coefficients, systems of linear recurrences with constant coefficients, divide and conquer recurrences with constant coefficients, many first order linear recurrences, and some nonlinear first order recurrences.

• 

If insufficient boundary conditions are given, rsolve uses symbolic function names as default values.

  

For linear recurrences with constant coefficients and systems of linear recurrences with constant coefficients, if no boundary conditions are given, symbolic function calls starting with index 0 are used.

  

Note: A solution of a recurrence can be completely different based on the starting point of the recurrence. If output is desired in terms of symbolic function calls starting at an index different from 0, use conditions of the form ui=ui,ui+1=ui+1,... for a recurrence starting at i.

  

For divide and conquer recurrences, a symbolic function call at index 1 is used.

• 

The ratio of the indices in divide and conquer recurrences must be an integer greater than 1 or a name. If the ratio is a name, it is understood to represent an integer greater than 1. It is assumed that the index variable is a non-negative power of the ratio.

• 

Boundary conditions for linear recurrences with constant coefficients and systems of linear recurrences with constant coefficients may be specified in one of three ways:

ta=c,

ta..b=c,

or  tk=a..b=fk,

  

- a and b are integers

  

- c is a constant with respect to the index variable for the sequence

  

- k is a name

  

- fk is an expression of k.

  

The boundary condition ta..b=c is equivalent to ta=ta+1=...=tb=c and the condition tk=a..b=fk is equivalent to ta=fa,ta+1=fa+1,...,tb=fb.

• 

The 'genfunc'z option is valid for linear recurrences with constant coefficients and systems of linear recurrences with constant coefficients. In this case, rsolve returns the generating functions of the sequences defined by eqns. The name z is used as the generating function variable.

• 

The makeproc option is valid for any single recurrence that can be uniquely isolated (solved) for the highest indexed function. In this case, rsolve returns a procedure body for evaluating the function defined by eqns.

• 

The series option leads to finding formal series solution using LinearFunctionalSystems[SeriesSolution]. The truncation order of the series is determined by the global variable Order.

• 

Setting infolevel['rsolve'] := 2 provides information about the choices rsolve makes to evaluate a recurrence.

• 

If rsolve is unable to compute a solution, it returns the unevaluated function invocation.  This unevaluated rsolve invocation may be understood by other functions;  for example, the asympt function is able to compute an asymptotic series expansion for the solution in some cases.

Examples

rsolvefn=3fn12fn2,fk

f1+2f01k+f1f02k

(1)

rsolvefn=3fn12fn2,f1..2=1,f

fn=2n31n

(2)

rsolvefn=3fn2+5n,fn

f1nln3ln210n+10nln3ln2

(3)

rsolvetbn=atn+n,tm

alnmlnbt1a+t1b+mlnbalnb1b+a

(4)

rsolveyn=nyn1,y0=1,y

Γn+1

(5)

rsolveynyn1+ynyn1=0,y0=a,y

aan+1

(6)

rsolveyn+1+fn=22n+n,fn+1yn=n2n+3,yk=1..5=2k1,f5=6,y,f

fn=n+1,yn=2n1

(7)

rsolveFn=Fn1+Fn2,F1..2=1,F,'genfunc'x

xx2+x1

(8)

rsolvesn=sn1+tn1,tn=sn+tn1,s0=0,t0=1,s,t,'genfunc'z

sz=zz23z+1,tz=z1z23z+1

(9)

rsolvesn=2sn1,s0=1,s,'makeproc'

procnif1<nargsthen&apos;procname&apos;argselseexpand2&Hat;nend ifend proc

(10)

An example of a recurrence having different solutions based on the starting point

rsolvenun&plus;1&plus;un&comma;un

&lcub;u0n&equals;0undefinedotherwise

(11)

rsolvenun&plus;1&plus;un&comma;u1&equals;u1&comma;un

1nu1&Gamma;n

(12)

An example of a series solution

sysy2xx2&plus;3y2xx&plus;2y2x2y1xx24y1xx&plus;y1x&plus;1x2&plus;y1x&plus;1x&comma;y2x&plus;2y1x&colon;

varsy1x&comma;y2x&colon;

rsolvesys&comma;vars&comma;&apos;series&apos;

y1x&equals;129163_c1736400_c4182480_c3&plus;13440_c2&plus;x98000_c4&plus;25040_c317323_c11560_c2&plus;xx17000_c41480_c3&plus;1703_c1&plus;240_c2&plus;xx1x21400_c4&plus;440_c3103_c1&plus;20_c2&plus;xx1x2x330_c3&plus;_c1&plus;10_c2&plus;xx1x2x3x412_c3&plus;_c2&plus;42_c4&plus;Ox6&comma;y2x&equals;3600_c1604800_c4151200_c3&plus;10800_c2&plus;x2520_c2&plus;151200_c4&plus;38880_c3960_c1&plus;xx14120_c315400_c4&plus;3383_c1&plus;240_c2&plus;xx1x21400_c4&plus;440_c3343_c1&plus;xx1x2x3_c1&plus;xx1x2x3x4_c2&plus;Ox6

(13)

See Also

asympt

dsolve

genfunc

LinearFunctionalSystems[SeriesSolution]

msolve

Order

solve

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam