Hello,
Maybe this can help you.
kill(all)$
load(solve_rec)$
eqf:f(n)=(2*f(n-1)+g(n-1))/3$
eqg:g(n)=(f(n-1)+g(n-1))/2$
rhs(first(solve(eqf,g(n-1))));
ratsubst(n+1,n,%);
g(n):=''(%);
ev(eqg);
ratsubst(n-1,n,%);
first(solve(%,f(n)));
solf:solve_rec(%,f(n),f(0)=x);
kill(g);
rhs(first(solve(eqg,f(n-1))));
ratsubst(n+1,n,%);
f(n):=''(%);
ev(eqf);
ratsubst(n-1,n,%);
first(solve(%,g(n)));
solg:solve_rec(%,g(n),g(0)=y);
kill(f);
solf:ratsubst(%k[1],%k[2],solf);
f(n):=''(rhs(solf));
g(n):=''(rhs(solg));
[ev(eqf),ev(eqg)];
solk:first(solve(%,[%k[1],%k[2]]));
kill(f,g);
%k[1]:rhs(solk[1]);
%k[2]:rhs(solk[2]);
solf:ratsimp(ev(solf));
solg:ratsimp(ev(solg));
partfrac(solf,6^n);
partfrac(solg,6^n);
Laurent.
> -----Message d'origine-----
> De : maxima-bounces at math.utexas.edu
> [mailto:maxima-bounces at math.utexas.edu] De la part de Angel Popov
> Envoy? : vendredi 22 septembre 2006 19:13
> ? : maxima at math.utexas.edu
> Objet : Re: [Maxima] Limit of a recursive function
>
>
> Thanks, that did it
> But I am stuck again
>
> I have two recursive functions:
> f(n)=(2*f(n-1)+g(n-1))/3;
> g(n)=(f(n-1)+g(n-1))/2;
> where f(0)=x and g(0)=y
> and I need to find f(inf)
>
> It's obvious that f(inf)=(3*x+2*y)/5 , but I can't get Maxima to
> calculate it:
>
> load(solve_rec)$
> f(n)=(2*f(n-1)+g(n-1))/3;
> fn: solve_rec(%, f(n), f(0)=y);
> g(n)=(f(n-1)+g(n-1))/2;
> gn: solve_rec(%, g(n), g(0)=x);
>
> and I get stuck at:
> solve( [fn,gn], [f(n),g(n)] );
>
> Andrej Vodopivec wrote:
> > Find the explicit form for f(n) and then compute the limit:
> >
> > (%i1) load(solve_rec)$
> > (%i2) f(n) = (f(n-1)+x)/2;
> > (%o2) f(n)=(x+f(n-1))/2
> > (%i3) solve_rec(%, f(n), f(0)=y);
> > (%o3) f(n)=y/2^n-x/2^n+x
> > (%i4) limit(rhs(%), n, inf), assume_pos=true;
> > (%o4) x
> >
> > Andrej
> >
> > On 9/22/06, Angel Popov <geleto at geleto.com> wrote:
> >> ... forgot to specify:
> >> f(0) = y
> >>
> >> Angel Popov wrote:
> >> > I need to find the limit of a recursive function at infinity For
> >> > instance: f(n):= (f(n-1)+x)/2
> >> > limit( f(n),n,inf )
> >> > Is there a way to do this in maxima?
> >> >
> >> > Thanks
> >> > _______________________________________________
> >> > Maxima mailing list
> >> > Maxima at math.utexas.edu
> >> > http://www.math.utexas.edu/mailman/listinfo/maxima
> >> >
> >> >
> >> > __________ NOD32 1.1768 (20060922) Information __________
> >> >
> >> > This message was checked by NOD32 antivirus system.
> >> > http://www.eset.com
> >> >
> >> >
> >> >
> >> > __________ NOD32 1.1768 (20060922) Information __________
> >> >
> >> > This message was checked by NOD32 antivirus system.
> >> > http://www.eset.com
> >> >
> >> >
> >> >
> >> >
> >> _______________________________________________
> >> Maxima mailing list
> >> Maxima at math.utexas.edu
> >> http://www.math.utexas.edu/mailman/listinfo/maxima
> >>
> >
> >
> >
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>