Too many values to unpack error.

4 months ago by
Hi all.
For my code I have to do some symbolic computation and for that reason I need:
import sympy as sym
from sympy import symbols
from sympy import atan2

x, y, z, t = sym.symbols('x[0], x[1], x[2], atan2(x[1],x[0])')​
but when I debug my code as soon as I reach this line I get this error: "too many values to unpack".
The error goes away when I use "atan(x[1]/x[0])". But I really need to work with "atan2". Please help!
Community: FEniCS Project

1 Answer

4 months ago by
Take t as a separate one.

t = sym.symbols('atan2(x[1], x[0])')
Thanks for your reply. I did so and I don't get any error now. However, when I want to switch it back to UFL I get this error:
"In instant.recompile: The module did not compile with command 'make VERBOSE=1'"
written 4 months ago by Nima  
That's not the actual error message but the consequence of the error. At least post the actual error message please. Even better would be to show us what you are doing, that is, what you mean by "switch it back to UFL".
written 4 months ago by klunkean  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »