On 07/16/2014 04:59 PM, Robert Boyles wrote:
I am wondering if there is a way to set the precision for sympy objects.

I have two sympy objects (a and q) that when I execute q*a*inv(q), the result is of the form:

ans = 1.0*n_o + x1*e_1 + x2*e_2 + x3*e_3 + x4*n_i + x5*e_1^e_2^n_i

where x5 is on the order of 1E-9.

My problem is that I then want to calculate MV.norm(a), which throws a ValueError that the result is not a scalar, due to the last term. The precision I need to assume something is zero is much less, say 0.001. If that term was assumed to be zero the operation would work as with my other cases. Is there a way to set this at the start of the program and carry throughout all operations?

Thanks,
-Robert

--
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 post to this group, send email to [email protected] <mailto:[email protected]>.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/1b07ca41-0491-402c-a3c0-491ddf8d710d%40googlegroups.com <https://groups.google.com/d/msgid/sympy/1b07ca41-0491-402c-a3c0-491ddf8d710d%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
Please send me your program so I can look at it

    [email protected]

When I wrote the galgebra modules I was not thinking about numerics.
Also in general I would suggest using my new fork of sympy

https://github.com/brombo/sympy

with detailed documentation in sympy/doc/src/modules/galgebra/pdf/GA.pdf

However, if your use of geometric algebra is mainly numerical and not symbolic you should look at

http://glucat.sourceforge.net/

It is a C++ template class for general Clifford algebras. The is a python wrapper that comes with the package. On linux compiling and using the package is relatively simple, on windows you would need to use the cygwin unix environment (If I had a windows machine I would install virtual box and run ubuntu under windows and would do the same if the machine was running OSX).

Meanwhile if I could see the code you are trying to run I would try to implement what you need in my new sympy fork.




--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/53C6EE9E.8060608%40verizon.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to