Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respecting complex units #106

Open
fbruetting opened this issue Dec 20, 2016 · 2 comments
Open

Respecting complex units #106

fbruetting opened this issue Dec 20, 2016 · 2 comments

Comments

@fbruetting
Copy link

fbruetting commented Dec 20, 2016

• Would be great if complex power could be named by VA, while real power stays W and imaginary power gets Var.
• As far as I understand Julia, complex numbers aren't separated in real and imaginary parts, but this would be really useful for e.g. axis labeling, if the real or imaginary part of a complex number is zero or the Type Real is used somehow. At least W should be substituted by VA if SIUnits.jl is used in conjunction with Type Complex.

Depends on: #54 / #76 / #104.

@fbruetting fbruetting changed the title Respecting complex numbers Respecting complex units Dec 20, 2016
@tomasaschan
Copy link
Collaborator

As far as I understand Julia, complex numbers aren't separated in real and imaginary parts

That's incorrect (see the source code). However, Julia's complex numbers are typed as Complex{T<:Real} and since unitful quantities don't subtype Real they can't be used independently for the built-in variables.

Instead, we usually do SIQuantity{Complex{T}, ...}, in which case we don't separate units over the real and imaginary parts.

@fbruetting
Copy link
Author

Not sure if I understand your answer correct, but am I right, that at least a switch from Wto VA is possible when complex numbers are used in conjunction with SIUnits?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants