Re: Re: Recursion
- To: mathgroup at smc.vnet.net
- Subject: [mg62326] Re: [mg62315] Re: Recursion
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sun, 20 Nov 2005 04:50:30 -0500 (EST)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
It blows up because you did not restrict the definition to Integers. It starts recursing with the symbolic terms in the definition. Use x[t_Integer] = Piecewise[{{2, t ? 0}, {a x[t - 1](1 - x[t - 1]), 5 > t > 0}}]; Bob Hanlon > > From: "Chris Chiasson" <chris.chiasson at gmail.com> To: mathgroup at smc.vnet.net > Date: 2005/11/19 Sat PM 11:18:51 EST > Subject: [mg62326] [mg62315] Re: Recursion > > Fujio Takata, > > Perhaps the following code will work for you: > > x[Condition[t_,t\[LessEqual]0]]=2 > x[Condition[t_,t>0]]=a x[t-1](1-x[t-1]) > Block[{a=2},Plot[x[t],{t,0,9}]] > > > On another note, can anyone explain why the following code blows up? > > x[t_]=Piecewise[{{2,t<=0},{a x[t-1](1-x[t-1]),5>t>0}}] > > Regards, > -- > http://chrischiasson.com/contact/chris_chiasson > >