Tag Info

Hot answers tagged

5

To illustrate whats going on, your function is 0 at x=0, rises to a max and becomes essentially zero very quickly. With[{a = .9}, Plot[x Exp[-(a^2+.001^2) x^2], {x, 0, 3}]] Now look at the values NIntegrate computes: res = Reap[With[{a = .9}, NIntegrate[y = x Exp[-(a^2 + 0.001^2) x^2], {x, 0, 8000}, EvaluationMonitor :> Sow[{x, ...


1

First, a fixed version of your code: ClearAll[eOF0, eOF1, eOF2, eOF3] eOF0[int_, dt_, nas_, nts_] := Module[{d = ConstantArray[2, {nas + 1, nts}]}, For[j = nts, j > 1, j--, d = ReplacePart[d, {1, j - 1} -> (1 - int*dt)*d[[1, j]]]]; Grid[d]] eOF0[0.01, 0.1, 4, 4] and a few alternatives eOF1[int_, dt_, nas_, nts_] := Module[{d = ...



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