Question: "I am facing error in loops"

Hello;

I am facing "Error, too many levels of recursion" in loops. kindly guide me. Thanks

 

1D1P.mw


 

restart; printlevel := 3

restart; with(LinearAlgebra); with(linalg); with(CodeGeneration); with(plots); Digits := 30; `ε` := 0.1e-1; k := .5; m := 1; c := 1; q := 1

L[time] := 1:

.200000000000000000000000000000

 

.200000000000000000000000000000

 

.200000000000000000000000000000

(1)

``

ICff := 1.0*exp(-p^2/(2.0))*(1.0+epsilon*cos(1.0*k*x))/sqrt(2.0*Pi):

for i from 0 while i <= N[x] do for j from 0 while j <= N[p] do f[0, i, j] := eval(ICff, [x = i*`&Delta;x`, p = j*`&Delta;p`]) end do end do:

for n from 0 while n <= T do for j from 0 while j <= N[p] do f[n, 0, j] := 0; f[n, N[x], j] := 0 end do end do:

for n from 0 while n <= T do for i from 0 while i <= N[x] do f[n, i, 0] := 0; f[n, i, N[p]] := 0 end do end do:

``

for n1 from 0 while n1 <= T-1 do for i1 while i1 <= N[x] do for j1 while j1 <= N[p] do f[n1+1, i1, j1] := f[n1, i1, j1]-`&Delta;t`*j1*`&Delta;p`*(f[n1+1, i1+1, j1]-f[n1+1, i1-1, j1]+f[n1, i1+1, j1]-f[n1, i1-1, j1])/((4*`&Delta;x`)*(1.0)) end do end do end do

Error, too many levels of recursion

 


 

Please Wait...