- #1
Dustinsfl
- 2,281
- 5
Can anyone tell me what is the problem with this Mathematica code?
Even though Mathematica will get stuck running this code(above), the code below has no problems. What is the deal?
Code:
Nmax = 10;
Mmax = 10;
A = 4/Pi^2*Integrate[x*Sin[n*x]*Sin[m*y], {x, 0, Pi}, {y, 0, Pi}];
B = 4/Pi^2*Integrate[Sin[n*x]*Sin[m*y], {x, 0, Pi}, {y, 0, Pi}];
u[x_, y_, t_] =
Sum[Sin[n*x]*
Sin[m*y] (A*Cos[(n^2 + m^2)*t] +
B/(n^2 + m^2)*Sin[(n^2 + m^2)*t]), {n, 1, Nmax}, {m, 1, Max}];
Code:
Nmax = 20;
Mmax = 20;
\[Lambda] = Table[n^2 + m^2, {n, 1, Nmax}, {m, 1, Mmax}];
u[x_, y_, t_] =
4/Pi^2*Sum[
Sin[n*Pi/2]*Sin[m*Pi/2]/\[Lambda][[n, m]]*Sin[n*x]*Sin[m*y]*
Sin[t*\[Lambda][[n, m]]], {n, 1, Nmax}, {m, 1, Mmax}];