Post Reply 
Constants aren't so constant [SOLVED]
12-03-2016, 04:14 PM (This post was last modified: 02-02-2018 09:11 PM by JMB.)
Post: #1
Constants aren't so constant [SOLVED]
The physical constants that can be accessed in the Prime, fall mainly into two categories: constants with an exact value (like "c" - the speed oh light), and constants whose values depend on the current state of the art measurements (like "G" - the gravitation constant).

The internationally recommended values are recorded by CODATA (Committee on Data for Science and Technology). These constants can also be browsed at NIST (National Institute of Standards and Technology).

As long as I've seen, the values stored in the Prime agree exactly with the values given in 2010 by CODATA (for example, G=6.67384E-11).

Today these values are dated, because a new set of values was stablished in 2014 (for example, te current value for G is: 6.67408E-11).

Given the above, I propose to HP considering the update of these values in a future firmware release.
Find all posts by this user
Quote this message in a reply
12-05-2016, 03:26 PM (This post was last modified: 12-05-2016 03:27 PM by Tim Wessman.)
Post: #2
RE: Constants aren't so constant
(12-03-2016 04:14 PM)JMB Wrote:  Today these values are dated, because a new set of values was stablished in 2014 (for example, te current value for G is: 6.67408E-11).

I'd be happy to do so, but it is a pretty low priority item at this point. The thing that takes the longest is simply going through the table and finiding which did or didn't change. If you wanted to point those out, I'd be much more likely to be able to resolve sooner rather then later. Thanks!

Here's the actual code table:

Code:
  /// These values come from the NIST 2010 published values
  static struct { u32 StringId; wchar_t symbol[5]; HP_Real value; wchar_t unit[15]; } const constants[]={
    { SIDConstant_NA    ,L"NA"             ,HPREAL(+,602214129,23)      ,L"(1/mol)"      },
    { SIDConstant_k     ,L"k"              ,HPREAL(+,13806488,-23)      ,L"(J/K)"       },
    { SIDConstant_Vm    ,L"Vm"             ,HPREAL(+,22413968,1)        ,L"(l/mol)"      },
    { SIDConstant_R     ,L"R"              ,HPREAL(+,83144621,0)        ,L"(J/(mol*K))"    },
    { SIDConstant_StdT  ,L"StdT"           ,HPREAL(+,27315,2)           ,L"K"          },
    { SIDConstant_StdP  ,L"StdP"           ,HPREAL(+,101325,2)          ,L"kPa"        },

    { SIDConstant_Sigma ,L"\u03C3"         ,HPREAL(+,5670373,-8)        ,L"(W/(m^2*K^4))"    },
    { SIDConstant_c     ,L"c"              ,HPREAL(+,299792458,8)       ,L"(m/s)"        },
    { SIDConstant_e0    ,L"\u03B5\u2080"   ,HPREAL(+,885418781762,-12)  ,L"(F/m)"        },
    { SIDConstant_m0    ,L"\u03BC\u2080"   ,HPREAL(+,125663706144,-6)  ,L"(H/m)"        },
    { SIDConstant_g     ,L"g"              ,HPREAL(+,980665,0)          ,L"(m/(s^2))"       },
    { SIDConstant_G     ,L"G"              ,HPREAL(+,667384,-11)        ,L"(m^3/(s^2*kg))"   },

    { SIDConstant_h     ,L"h"              ,HPREAL(+,662606957,-34)     ,L"(J*s)"        },
    { SIDConstant_hBar  ,L"\u0127"           ,HPREAL(+,1054571726,-34)    ,L"(J*s)"        },
    { SIDConstant_q     ,L"q"              ,HPREAL(+,1602176565,-19)    ,L"C"          },
    { SIDConstant_me    ,L"me"             ,HPREAL(+,910938291,-31)     ,L"kg"         },
    { SIDConstant_qme   ,L"qme"            ,HPREAL(+,1758820088,11)     ,L"(C/kg)"       },
    { SIDConstant_mp    ,L"mp"             ,HPREAL(+,1672621777,-27)    ,L"kg"         },
    { SIDConstant_mpme  ,L"mpme"           ,HPREAL(+,183615267245,3)    ,NULL           },
    { SIDConstant_alpha ,L"\u03B1"         ,HPREAL(+,72973525698,-3)    ,NULL           },
    { SIDConstant_phi   ,L"\u03C6\u2080"   ,HPREAL(+,2067833758,-15)    ,L"Wb"         },
    { SIDConstant_F     ,L"F"              ,HPREAL(+,964853365,4)       ,L"(C/mol)"      },
    { SIDConstant_Rinf  ,L"R\u221E"        ,HPREAL(+,109737315685,7)   ,L"(1/m)"        },
    { SIDConstant_a0    ,L"a\u2080"        ,HPREAL(+,52917721092,-11)   ,L"m"         },
    { SIDConstant_mB    ,L"\u03BCB"        ,HPREAL(+,927400968,-24)     ,L"(J/T)"        },
    { SIDConstant_mN    ,L"\u03BCN"        ,HPREAL(+,505078353,-27)     ,L"(J/T)"        },
    { SIDConstant_l0    ,L"\u03BB\u2080"   ,HPREAL(+,123984192920,-6)   ,L"m"         },
    { SIDConstant_f0    ,L"f\u2080"        ,HPREAL(+,241798934961,14)   ,L"Hz"         },
    { SIDConstant_lc    ,L"\u03BBc"        ,HPREAL(+,24263102389,-12)   ,L"m"         } };

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
12-05-2016, 04:30 PM (This post was last modified: 12-05-2016 04:34 PM by sat1410.)
Post: #3
RE: Constants aren't so constant
I used the 2014 CODATA values in http://physics.nist.gov/cuu/Constants/Ta...lascii.txt
In cases where there were a different number of digits in the NIST vs. existing HP code, I used NIST values.

Also, one small error noted in the pdf manual on the HP support site (2nd edition, Sept 2016, DPN 813269-002):
Under the list on constants on page 499, in the chemistry section, the manual says "Boltmann, k" as one of the constants. Should be 'Boltzmann' (z is missing).

Hope these quick changes are useful.

Code:
  /// These values come from the NIST 2014 published values
  static struct { u32 StringId; wchar_t symbol[5]; HP_Real value; wchar_t unit[15]; } const constants[]={
    { SIDConstant_NA    ,L"NA"             ,HPREAL(+,6022140857,23)     ,L"(1/mol)"      },
    { SIDConstant_k     ,L"k"              ,HPREAL(+,138064852,-23)     ,L"(J/K)"       },
    { SIDConstant_Vm    ,L"Vm"             ,HPREAL(+,22413962,1)        ,L"(l/mol)"      },
    { SIDConstant_R     ,L"R"              ,HPREAL(+,83144598,0)        ,L"(J/(mol*K))"    },
    { SIDConstant_StdT  ,L"StdT"           ,HPREAL(+,27315,2)           ,L"K"          },
    { SIDConstant_StdP  ,L"StdP"           ,HPREAL(+,101325,2)          ,L"kPa"        },

    { SIDConstant_Sigma ,L"\u03C3"         ,HPREAL(+,5670367,-8)        ,L"(W/(m^2*K^4))"    },
    { SIDConstant_c     ,L"c"              ,HPREAL(+,299792458,8)       ,L"(m/s)"        },
    { SIDConstant_e0    ,L"\u03B5\u2080"   ,HPREAL(+,8854187817,-12)    ,L"(F/m)"        },
    { SIDConstant_m0    ,L"\u03BC\u2080"   ,HPREAL(+,12566370614,-6)    ,L"(H/m)"        },
    { SIDConstant_g     ,L"g"              ,HPREAL(+,980665,0)          ,L"(m/(s^2))"       },
    { SIDConstant_G     ,L"G"              ,HPREAL(+,667408,-11)        ,L"(m^3/(s^2*kg))"   },

    { SIDConstant_h     ,L"h"              ,HPREAL(+,6626070040,-34)    ,L"(J*s)"        },
    { SIDConstant_hBar  ,L"\u0127"         ,HPREAL(+,1054571800,-34)    ,L"(J*s)"        },
    { SIDConstant_q     ,L"q"              ,HPREAL(+,16021766208,-19)   ,L"C"          },
    { SIDConstant_me    ,L"me"             ,HPREAL(+,910938356,-31)     ,L"kg"         },
    { SIDConstant_qme   ,L"qme"            ,HPREAL(+,1758820024,11)     ,L"(C/kg)"       },
    { SIDConstant_mp    ,L"mp"             ,HPREAL(+,1672621898,-27)    ,L"kg"         },
    { SIDConstant_mpme  ,L"mpme"           ,HPREAL(+,183615267389,3)    ,NULL           },
    { SIDConstant_alpha ,L"\u03B1"         ,HPREAL(+,72973525664,-3)    ,NULL           },
    { SIDConstant_phi   ,L"\u03C6\u2080"   ,HPREAL(+,2067833831,-15)    ,L"Wb"         },
    { SIDConstant_F     ,L"F"              ,HPREAL(+,9648533289,4)      ,L"(C/mol)"      },
    { SIDConstant_Rinf  ,L"R\u221E"        ,HPREAL(+,10973731568508,7)  ,L"(1/m)"        },
    { SIDConstant_a0    ,L"a\u2080"        ,HPREAL(+,52917721067,-11)   ,L"m"         },
    { SIDConstant_mB    ,L"\u03BCB"        ,HPREAL(+,9274009994,-24)    ,L"(J/T)"        },
    { SIDConstant_mN    ,L"\u03BCN"        ,HPREAL(+,5050783699,-27)    ,L"(J/T)"        },
    { SIDConstant_l0    ,L"\u03BB\u2080"   ,HPREAL(+,12398419739,-6)    ,L"m"         },
    { SIDConstant_f0    ,L"f\u2080"        ,HPREAL(+,2417989262,14)     ,L"Hz"         },
    { SIDConstant_lc    ,L"\u03BBc"        ,HPREAL(+,24263102367,-12)   ,L"m"         } };
Find all posts by this user
Quote this message in a reply
12-05-2016, 04:54 PM
Post: #4
RE: Constants aren't so constant
Definitely, I can do a text compare and cross check much easier. Much appreciated!

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
12-05-2016, 05:21 PM
Post: #5
RE: Constants aren't so constant
I agree with the new values listed by sat1410.

Thanks to everyone.
Find all posts by this user
Quote this message in a reply
12-05-2016, 06:09 PM
Post: #6
RE: Constants aren't so constant
I would also suggest adding NIST_Year or something, to identify in one place which version of all the variables you have - to be accessible from a user program along with the other variables, so that a program can add "as at 2016" or whatever to the small print..

Everyone is bound to have their own additions they would like to sneak in, but I usually end up defining my own, if only whilst compatability testing.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
01-14-2018, 12:48 PM (This post was last modified: 01-14-2018 12:49 PM by JMB.)
Post: #7
RE: Constants aren't so constant
The last FW beta v3 (13217) still has the old values. Is there any possibility to see the new values for the constants in the final version?
Find all posts by this user
Quote this message in a reply
01-15-2018, 04:12 AM
Post: #8
RE: Constants aren't so constant
A Murphy's law corollary states that "Constants aren't, and variables won't." Such is the dichotomy between nature and frustrated programmers....
Find all posts by this user
Quote this message in a reply
01-15-2018, 03:46 PM
Post: #9
RE: Constants aren't so constant
(01-15-2018 04:12 AM)JimP Wrote:  A Murphy's law corollary states that "Constants aren't, and variables won't." Such is the dichotomy between nature and frustrated programmers....

Nice.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
01-15-2018, 04:43 PM
Post: #10
RE: Constants aren't so constant
(12-03-2016 04:14 PM)JMB Wrote:  The physical constants that can be accessed in the Prime, fall mainly into two categories: constants with an exact value (like "c" - the speed oh light), and constants whose values depend on the current state of the art measurements (like "G" - the gravitation constant).

But even constant speed of light isn't as constant since it depends on the medium it travels.
In water (I suppose 20° celsius) it's 225 e6 m/s, in glass it's 160 e6 m/s.

HP: 20S 25C 32S 33E 33s 35s 41CV 42S 39GS 48SX 71B
Casio: FX702P
Swissmicros: DM15L
Need Forth71B
Find all posts by this user
Quote this message in a reply
01-16-2018, 05:12 PM
Post: #11
RE: Constants aren't so constant
Just note that Rinf will be "109737315685" since we are limited to 12 digits of precision here. Anyway...

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
01-16-2018, 07:01 PM
Post: #12
RE: Constants aren't so constant
Understood Tim, thanks.
Find all posts by this user
Quote this message in a reply
02-02-2018, 09:12 PM
Post: #13
RE: Constants aren't so constant [SOLVED]
Corrected in firmware 13333.

Thanks to the HP Prime Team!
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)