Two-level Recurrence in Matlab

Hi All,
I want to solve a (system of) recurrence equation in Matlab's symbolic toolbox. Formally, I would like to have a formula for the value of a(n) if a(n) is defines, as follows:
a(n+1) = 0.5*b(n)+0.5*a(n)
b(n+1) = 0.2 + 0.8*b(n)
For one-level recurrence the task is easy and the solution by Matlab is
eq1 := rec(b(n+1) = 0.2 + 0.8*b(n),b(n),b(0)=b0)
rec(b(n + 1) - 0.8*b(n) - 0.2, b(n), {b(0) = b0})
solve(eq1)
{0.8^n*(1.0*b0 - 1.0) + 1.0}
That is, Matlab determined the close for solution for b(n). Do you have an idea how I can achieve the same for a(n)?
eq2 := rec(a(n+1) = 0.5*b(n) + 0.5*a(n),a(n),a(0)=a0)
rec(a(n + 1) - 0.5*a(n) - 0.5*b(n), a(n), {a(0) = a0})
But solving the system of equations
solve({eq1,eq2})
gives an error of Error: Recursive definition: the maximal depth for nested procedure calls is reached. Evaluating: numeric::rationalize@rec_rat
despite a closed form solution exists.
Any help is appreciated very much.
Thanks! Gerzson

Preguntada:

el 6 de Jun. de 2018

Editada:

el 7 de Jun. de 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by