Tag Info

Hot answers tagged

4

I believe Block will work for you here: mem : averageFreeEnergyDensityCompiled["square", n_] := mem = Block[{Part}, Compile[{{j, _Real}, {d, _Real}, {a, _Real}, {h, _Real}, {dx, _Real}, {th, _Real, 2}, {ph, _Real, 2}}, Evaluate[(*apply boundary conditions*) s[i1_, i2_] := Which[i1 == n + 1 && i2 == n + 1, s[1, 1], i1 == ...


1

An interesting problem which at first sight looks innocent. But then ... My (bold) conjecture is that the maximum number lg of terms you can get of this recurrence if a[1] == 1 is lg = 11. First we solve the recurrence explicitly sol = RSolve[a[n + 1] == 7 a[n] + n && a[1] == 1, a[n], n]; a[n] /. First[sol] (* Out[317]= 1/252 (-7 + 43 7^n - 42 ...



Only top voted, non community-wiki answers of a minimum length are eligible