Skip to content
Advertisement

Tag: complex-numbers

Sympy calculation on tan function

I have a problem when simplifying a symbolic expression in sympy when having a trigonometric function and a complex exponent, namely I just assumed a different definition of tan function, and I have a weird thing going on. So I do: Symbolic variable sym.simplify(test2) is equal to -tan(a) and normaly test1 variable should be equal to 0, however when I

Solving linear equation of complex matrices

I have a linear equation of a form ax=b where b is a complex matrix, and a is a real matrix. I’m expecting solution x to be a complex vector. When trying the numpy.linalg.solve(a,b) function, I’m getting this warning: ComplexWarning: Casting complex values to real discards the imaginary part How do I solve this equation to preserve the complex numbers?

Advertisement