Error running example

13 views
Skip to first unread message

Andrew Slaughter

unread,
Jul 29, 2016, 1:52:59 PM7/29/16
to sympy
I am attempting to run the example: http://docs.sympy.org/latest/modules/vector/examples.html#third-product-rule-for-del-operator

Running the following, using sympy (1.0) installed with miniconda in Python 2.7, yields an error. Any help resolving this issue would be appreciated.

CODE:

from sympy.vector import CoordSysCartesian
C
= CoordSysCartesian('C')

from sympy import symbols
v1
, v2, v3 = symbols('v1 v2 v3 f', type="Function")
v
= v1(C.x, C.y, C.z)*C.i + v2(C.x, C.y, C.z)*C.j + v3(C.x, C.y, C.z)*C.z


ERROR:
Traceback (most recent call last):
 
File "LevelSetAdvectionSUPG.py", line 6, in <module>
    v
= v1(C.x, C.y, C.z)*C.i + v2(C.x, C.y, C.z)*C.j + v3(C.x, C.y, C.z)*C.z
 
File "/opt/moose/miniconda/lib/python2.7/site-packages/sympy/core/decorators.py", line 118, in binary_op_wrapper
   
return func(self, other)
 
File "/opt/moose/miniconda/lib/python2.7/site-packages/sympy/vector/basisdependent.py", line 19, in __add__
   
return self._add_func(self, other)
 
File "/opt/moose/miniconda/lib/python2.7/site-packages/sympy/vector/vector.py", line 399, in __new__
    obj
= BasisDependentAdd.__new__(cls, *args, **options)
 
File "/opt/moose/miniconda/lib/python2.7/site-packages/sympy/vector/basisdependent.py", line 196, in __new__
   
for x in arg.components:
AttributeError: 'Mul' object has no attribute 'components'



Reply all
Reply to author
Forward
0 new messages