Dear all,(adsbygoogle = window.adsbygoogle || []).push({});

Please help me to fix this problem:

f[m_, n_] :=

Module[{u1, u2, v1, v2, sumu1, sumu2, sumv1, sumv2}, u1 = 3 m + 2 n;

u2 = 2 m - 5 n; v1 = 4 m - 3 n; v2 = 6 m + 3 n;

sumu1 = Sum[u1[i, n], {i, 1, m, 2}];

sumu2 = Sum[u2[i, n], {i, 1, m, 2}];

sumv1 = Sum[v1[m, j], {j, 1, n, 2}];

sumv2 = Sum[v2[m, j], {j, 1, n, 2}] {sumu1, sumu2, sumv1, sumv2}];

Do[f[m, n]; Print[f[m, n]], {m, 1, 3, 2}, {n, 1, 3, 2}]

Definitions: the idea is that sumu1(1,1) = u1(1,1); sumu1(1,3) = u1(1,3); sumu1(3,1) = u1(1,1) + u1(3,1); sumu1(3,3) = u1(1,3) + u1(3,3)

and for sumu2(1,1) = u2(1,1); sumu2(1,3) = u2(1,3); sumu2(3,1) = u2(1,1) + u2(3,1); sumu2(3,3) = u2(1,3) + u2(3,3)

However for sumv1(1,1) = v1(1,1); sumv1(1,3) = v1(1,1) + v1(1,3); sumv1(3,1) = v1(3,1) ; sumv1(3,3) = v1(3,1) + v1(3,3)

and similarly for sumv2(1,1) = v2(1,1); sumv2(1,3) = v2(1,1) + v2(1,3); sumv2(3,1) = v2(3,1) ; sumv2(3,3) = v2(3,1) + v2(3,3)

The correct answers I should be getting from the Do-loop are:

f(1,1) = { 5, -3 , 1 , 9}

f(1,3) = { 9 , -13 , -4 , 24 }

f(3,1) = {15 , -2 , 11 , 19 }

f(3,3) = { 24 , -22 , -2 , 42 }

Thank you for any kind help.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Mathematica: need help please from the experts

Loading...

Similar Threads for Mathematica need help |
---|

Mathematica Storing Mathematica output |

Mathematica Mathematica to MATLAB |

Mathematica Cannot do the integral of the Hyper-geometric function? |

Mathematica Cannot Plot This Function in Mathematica |

Mathematica While Loop in Mathematica |

**Physics Forums | Science Articles, Homework Help, Discussion**