1
$\begingroup$

Suppose i have list of function like below:

F = Table[Sum[(i + 4) x^m + i*y^n + (j + 3) x^(m + 4)*y^(n - 2), {m, 40}, {n,40}], {i, 40}, {j, 40}]

and i want to take derivative like below

Laplacian[F, {x, y}]

Is there any way to take derivative as fast as possible(My main functions and derivatives are so complex than what we mention here)

$\endgroup$
1
  • $\begingroup$ Can you post your "main function"? This would enable a much better effort to help. $\endgroup$
    – MikeY
    Commented Jun 29, 2017 at 19:17

1 Answer 1

1
$\begingroup$

In the example you give, the problem is linear and so you can move the Laplacian into the problem and compute it once. If this holds for your more complicated problem, this can help.

term = (i + 4) x^m + i*y^n + (j + 3) x^(m + 4)*y^(n - 2);

lapterm = Laplacian[term, {x, y}];

lt = Laplacian[
    Table[Sum[term, {m, 20}, {n, 20}], {i, 20}, {j, 20}], {x, 
     y}]; // Timing

(*   3.588  *)

tl = Table[
    Sum[lapterm, {m, 20}, {n, 20}], {i, 20}, {j, 20}]; // Timing

(*    1.912    *)

lt == tl

(*    True    *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.