I need to define a recursion defined by the following equation
$y(n) = f_1 y(n-1) + u(n)$
In which $f_1$ is a symbolic constant. I know the values of the sequence u and I know the initial value of y.
Now if I tried to type this in Mathematica (see below) I get an error because I don't have a lower limit for my index. How do I make Mathematica understand that Im starting my sequences from 0?
yhat[n_] := -f1 yhat[n - 1] - f2 yhat[n - 2] + u[n] yhat[0] = 0; yhat[5] During evaluation of In[3]:= $RecursionLimit::reclim: Recursion depth of 1024 exceeded. >> > During evaluation of In[3]:= $RecursionLimit::reclim: Recursion depth of 1024 exceeded. >> During evaluation of In[3]:= $RecursionLimit::reclim: Recursion depth of 1024 exceeded. >> >During evaluation of In[3]:= $RecursionLimit::reclim: Recursion depth of 1024 exceeded. >> During evaluation of In[3]:= General::stop: Further output of $RecursionLimit::reclim will be suppressed during this calculation. >>
Out[3]