If you are dealing with gradient you might find this link of interest -

https://galgebra.readthedocs.io/en/latest/module-components.html#differential-operators

the galgebra package is built on top of sympy.

On 8/26/20 6:40 PM, Alexander Lindsay wrote:
This patch fixes the bad behavior:

diff --git a/sympy/vector/operators.py b/sympy/vector/operators.py
index 2f303ee690..994894f379 100644
--- a/sympy/vector/operators.py
+++ b/sympy/vector/operators.py
@@ -362,6 +362,4 @@ def _diff_conditional(expr, base_scalar, coeff_1, coeff_2):
     """
     from sympy.vector.functions import express
     new_expr = express(expr, base_scalar.system, variables=True)
-    if base_scalar in new_expr.atoms(BaseScalar):
-        return Derivative(coeff_1 * coeff_2 * new_expr, base_scalar)
-    return S.Zero
+    return Derivative(coeff_1 * coeff_2 * new_expr, base_scalar)

Should I submit a PR?

On Wed, Aug 26, 2020 at 3:30 PM Alexander Lindsay <[email protected] <mailto:[email protected]>> wrote:

    Execution of the below code:

    From sympy.vector import divergence, gradient, Vector, CoordSys3D
    R = CoordSys3D('R', transformation='cylindrical')
    divergence(R.i)

    generates a zero result. I believe the result should be 1/r, right?

--
You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CANFcJrFgKxs1S78dAWKRZeKKbxjHh_OsWWtT%2Btgz3EWW_3F6hw%40mail.gmail.com <https://groups.google.com/d/msgid/sympy/CANFcJrFgKxs1S78dAWKRZeKKbxjHh_OsWWtT%2Btgz3EWW_3F6hw%40mail.gmail.com?utm_medium=email&utm_source=footer>.


--
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/6394d18a-b4ba-76b1-9b4e-38a06f6c6646%40gmail.com.

Reply via email to