small program in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg40869] small program in Mathematica
- From: Rebeca Choy <rchoy at ula.ve>
- Date: Tue, 22 Apr 2003 06:48:32 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hi everybody,
I'm trying to do a small program in Mathematica with control functions,
but I have a problem with the if function.
The code is this:
If[
errort â?¤ 10.^(-6),
v = w - ((0.3)*(errot_deriv));
d2D = Table[
Sqrt[(w[[i, 1]] - w[[k, 1]])^2 + (w[[i, 2]] - w[[k, 2]])^2], {i,
26}, {k, 26}];
errort = (1/Sum[If[i < j, d3D[[i, j]], 0], {i, 26}, {j, 26}])*(Sum[
If[i < j, (((d3D[[i, j]] - d2D[[i, j]])^2)/(d3D[[i, j]])), 0],
{i,
26}, {j, 26}]);
errot_deriv = (-2/Sum[If[i < j, d3D[[i, j]], 0], {i, 26}, {j,
26}])*(Sum[
If[j â? p, ((d3D[[p, j]] - d2D[[p, j]])/(d2D[[p, j]]*
d3D[[p, j]]))*(w[[p, k]] - w[[j, k]]), 0], {p,
26}, {j,
26}, {k, 2}]);
m = m + 1;
Print[m];
Print[v]
]
Everything is previously declared, but it doesn't give any answers. The
program is supposed to check if a certain error is under a value and if
it isn't it should re-calculate a matrix else it should print it.
Is it good? or what else can i do?
Thanks,
Rebeca Choy