I am new to Mathematica and now I could use some help.
Trying to plot any of these functions generates a $RecursionLimit
exception and I am wondering why.
G[y_] := 0.7 G[y - 1]
G[0] = 100;
J[y_] := 0.1*G[y - 1] + 0.6 J[y - 1]
H[y_] := 0.2*J[y] + 0.8*H[y - 1]
H[0] = 0
Plot[ G[x], {x, 0, 10}]
$RecursionLimit::reclim: Recursion depth of 1024 exceeded. >>
Evaluating any of G[2]
, H[4]
, J[3]
works fine.
Any ideas would be much appreciated :)
DiscretePlot[G[x], {x, 0, 10}]
. You are trying to plot for allx
(Reals) between 0 and 10. – belisarius May 5 at 14:56G
is a positive integer, which generally won't be the case in a Plot. You could use DiscretePlot as belisarius suggests or define the second part of the function asG[y_/;y<=0]=100
. – Sjoerd C. de Vries May 5 at 16:21