Hello, Robert, interesting question!
I propose solution with s.c. memoization for recursion (accumulating all results).
What about RecurrenceTable
I ran into some problems and will answer later.
Clear[k1, k2, k3, s, maxj, maxn, data, recFun];
(*This is numerical coeffs*)
k1 = 0.15 (11 Exp[1]/3);
k2 = 11./3;
k3 = 13./1056;
s = 12;
(*Dimensions of data*)
maxj = 3; maxn = 80;
(*Prepare array with initial values and some non-numerical value as \
default*)
data = SparseArray[Table[{1, n} -> k1 ((n + 8) Exp[-n/8] - 8),
{n, maxn}], {maxj, maxn}, _];
(*Define recursive function*)
recFun[j_, n_] := Which[
(*If n<1 immediately return 0*)
n < 1, 0,
(*If data always defined, return it*)
NumericQ@data[[j, n]], data[[j, n]],
(*In other cases calculate value, set it to data and return*)
True, (data[[j, n]] = recFun[j, n - 1] +
k2 Log[1 + k3 (recFun[j - 1, n - s - 1] - recFun[j, n - s - 1])])
];
Run function for maxj,maxn
; it takes fraction of second:
recFun[maxj, maxn]
Now all needed values are stored in data
, and you can do whatever you want to with them,
eg
ListLinePlot[data]
![enter image description here](https://community.wolfram.com//c/portal/getImageAttachment?filename=2634111.png&userId=2005873)