© 2001 by CRC Press LLC
MATHEMATICA APPLICATIONS
For solving the membrane problem, Mathematica can be applied as follows:
In[1]: = Ns = 11; DX = 0.5; c = Table[0,{Ns},{Ns}];
R = Table[–5*DX^2/100,{Ns}];
Print[“R = “,R]
Out[1] = R = {–0.0125, –0.0125, –0.0125, –0.0125, –0.0125, –0.0125,
–0.0125, –0.0125, –0.0125, –0.0125, –0.0125}
In[2]: = (Do[Do[x = 3 + i*DX; If[i = = j, c[[i,j]] = –2;,
If[i = = j–1, c[[i,j]] = 1DX/2/x;,
If[i = = j + 1, c[[i,j]] = 1 + DX/2/x;, Continue]]],
{i,Ns}], {j,Ns}]); Print[“Matrix c = “,c]
Out[2] = Matrix c = {{–2, 0.928571, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1.0625,–2, 0.9375, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 1.05556, –2, 0.944444, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 1.05, –2, 0.95, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1.04545, –2, 0.954545, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1.04167, –2, 0.958333, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1.03846, –2, 0.961538, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1.03571, –2, 0.964286, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 1.03333, –2, 0.966667, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 1.03125, –2, 0.96875},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 1.02941, –2}}
In[3]: = V = Inverse[c].R
Out[3] = {0.0533741, 0.101498, 0.142705, 0.175525, 0.198641, 0.210864,
0.211107, 0.198368, 0.171723, 0.13031, 0.0733212}
These results are in agreement with those obtained by the MATLAB application.
The loaded beam problem also can be treated in a similar manner as follows:
In[1]: = c = Table[0,{9},{9}]; c[[1,1]] = –2; c[[1,2]] = 1; c[[9,9]] = –2;
c[[9,8]] = 1;
In[2]: = (Do[Do[If[i = = j,c[[i,j]] = 6;, If[(j = = i–1)||(j = = i + 1), c[[i,j]] = –4;,
If[(j = = i + 2)||(j = = i–2), c[[i,j]] = 1;, Continue]]],
{i,2,8}],{j,9}]); Print[“Matrix c = “,c]
Out[2] = Matrix c = {{–2, 1, 0, 0, 0, 0, 0, 0, 0}, {–4, 6, –4, 1, 0, 0, 0, 0, 0},
{1, –4, 6, –4, 1, 0, 0, 0, 0}, {0, 1, –4, 6, –4, 1, 0, 0, 0},
{0, 0, 1, –4, 6, –4, 1, 0, 0}, {0, 0, 0, 1, –4, 6, –4, 1, 0},