Unitful.jl icon indicating copy to clipboard operation
Unitful.jl copied to clipboard

Stefan–Boltzmann constant has unexpected units

Open mrke opened this issue 2 years ago • 3 comments

change c to c0 https://github.com/PainterQubits/Unitful.jl/blob/e2aa6f8bb66ddf37adc0d33c7a40958dfcaaadaa/src/pkgdefaults.jl#L480

mrke avatar Mar 04 '23 23:03 mrke

I wouldn’t say the value is wrong, the quantity is just accidentally given in "unusual units". You can convert it to SI units and get the correct value:

julia> u"σ"
5.09627837461878e9 J K^-4 s^-3 c^-2

julia> uconvert(u"W/(m^2*K^4)", u"σ")
5.6703744191844294e-8 W K^-4 m^-2

julia> upreferred(u"σ")
5.6703744191844294e-8 kg K^-4 s^-3

Nevertheless, I think this happened accidentally (and is certainly unexpected), so it should be changed by replacing c by c0 as you suggested.

I think we can do this in a feature release (I don’t consider it a breaking change, but since the value isn’t wrong, I wouldn’t call it a bugfix either).

sostock avatar Mar 06 '23 10:03 sostock

Thanks Sebastian – I didn’t fully understand that c is a unit equal to c0.

I’m loving putting units on things in Julia.

From: Sebastian Stock @.> Sent: Monday, March 6, 2023 9:46 PM To: PainterQubits/Unitful.jl @.> Cc: Michael Kearney @.>; Author @.> Subject: Re: [PainterQubits/Unitful.jl] wrong value due to speed of light (Issue #624)

I wouldn’t say the value is wrong, the quantity is just accidentally given in "unusual units". You can convert it to SI units and get the correct value:

julia> u"σ"

5.09627837461878e9 J K^-4 s^-3 c^-2

julia> uconvert(u"W/(m^2*K^4)", u"σ")

5.6703744191844294e-8 W K^-4 m^-2

julia> upreferred(u"σ")

5.6703744191844294e-8 kg K^-4 s^-3

Nevertheless, I think this happened accidentally (and is certainly unexpected), so it should be changed by replacing c by c0 as you suggested.

I think we can do this in a feature release (I don’t consider it a breaking change, but since the value isn’t wrong, I wouldn’t call it a bugfix either).

— Reply to this email directly, view it on GitHubhttps://github.com/PainterQubits/Unitful.jl/issues/624#issuecomment-1455897050, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB7IUPHGLOYS3Q3HYBNZJSTW2W55VANCNFSM6AAAAAAVP2G2JE. You are receiving this because you authored the thread.Message ID: @.@.>>

mrke avatar Mar 06 '23 10:03 mrke

I am reopening this so that we don’t forget to change it (I think it should be changed).

sostock avatar Mar 21 '23 10:03 sostock