-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add the eV derived units #20
Comments
First, it occurred to me that I should add some pre-defined constants like below. Would that be useful, or do you think people would prefer to define their own constants? (perhaps without the units, I imagine it could be a hassle to be forced to use units sometimes, maybe I should add a toggle to just ignore them-- though I don't know how that could work for constants that people use in different units sometimes)
This way, Could you give me a few examples on what you'd expect to happen? If you tried to do But if you are multiplying, I don't know how you could tell how the user wants to treat 1 eV. If you just want to convert the final result, then you could simply add But if you had an expression where you need the conversion to happen as soon as you enter the value, I don't know how I could figure out which units to use. A simple example of this is with degrees Celsius. I considered adding it, but I thought it would be too ambiguous. If the user says "0 degrees Celsius to Kelvin" then it is obvious. But if you are treating the temperature as a difference, i.e. "q = m * c * delta T", then putting "0 degrees Celsius" in for "delta T" would need to convert to 0 K, not 273.15 K. If the ambiguity is too difficult to manage, what would you think of simply creating new units like "1 eVkg" or "1 eVm" (m for mass), or "1 eVK" or "1 eVT" etc. This might look confusing in plaintext, but if you use the GUI popup I could simply show the unit as "1 eV (mass)", or perhaps "1 eV (1.78266192e-36 kg)". This is similar to how I have "pounds (force)" ( Another possibility: another user suggested adding the ability to define custom units. Then users could use whatever convention makes sense to them. I could easily implement this. |
This might be a bit tricky.
These units are commonly used in high-energy physics and particle physics. Also, they are often all referred to as "eV", when you set c = 1.
The next three are super common in physics:
1 eV = 1.602176634×10^-19 J
1 eV/c² = 1 eV = 1.78266192×10^-36 kg
1 eV/k_B = 1 eV = 11604.51812 K
A few less common ones can be seen at https://en.wikipedia.org/wiki/Electronvolt#Relation_to_other_physical_properties_and_units.
The tricky thing about this is that if we want to be able to parse expressions with "eV", we will need to figure out if the user is talking about mass, temperature, or energy.
The text was updated successfully, but these errors were encountered: