CMatty

8 Reputation

2 Badges

18 years, 185 days

MaplePrimes Activity


These are questions asked by CMatty

Hi, I am having problems with a slow procedure for doing a large number of recursive calculations. Here is the code: g_exp := proc(u,t,lambda,beta) global k, g, f, d, i, t1, sum2, j: g := array(0..u+t): f := array(0..u+t): g[0] := evalf(exp(-1*lambda)): f[0] := evalf(1-exp(-beta*(0.5))): for k from 1 to (u+t) do f[k] := evalf((1-exp(-beta*(k+0.5)))-(1-exp(-beta*(k-0.5)))): g[k] := evalf((lambda/k)*sum(i*f[i]*g[k-i],i=1..k)): end do: d := array(0..u+t-1,1..t); d[0,1] = evalf(g[0] + g[1]); for i from 1 to (u+t-1) do
Page 1 of 1