HP Forums
units anomily - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: units anomily (/thread-6201.html)



units anomily - roadrunner - 05-04-2016 05:47 PM

Version 10077, emulator

In CAS:

5_(°F)▶_(Rankine)
returns "Some units could not be converted to MKSA Error: Bad Argument Value"

convert(5_(°F),1_(Rankine))
returns "Some units could not be converted to MKSA Error: Bad Argument Value"

While in home:

5_(°F)▶_(Rankine)
returns 464.67_(Rankine) OK

5_(°F)+5_(°F)
returns Error: Invalid input

CAS.(5_(°F)+5_(°F))
returns (10_(°F)) OK

It appears some unit operations are allowed only in CAS while other unit operations are allowed only in Home.


RE: units anomily - informach - 05-04-2016 07:30 PM

Hi!, roadrunner:

You can only CONVERT, for MKSA ... Meters, Kilograms, Seconds, Amperes.
Converts a complex unit, into the base components, of the MKSA system.
Example : MKSA(8.175_cm/s) returns .08175_m/s

Too, see ... http://en.hpprime.club/docs/reference/MKSA

For your example for added, in °F, (see image).



Kind Regards.
informach.


RE: units anomily - roadrunner - 05-04-2016 08:56 PM

Thanks for the reply informach,

I would have expected something as simple as units conversion to be easier than that on the Prime.

-road


RE: units anomily - compsystems - 05-05-2016 03:10 AM

Hi, the following code is compiled successfully, but not run in HOME MODE. why?

Code:

#cas
  test():=
  BEGIN
    return 5_°F+5_°F;
  END;
#end

CAS MODE VIEW
test() [ENTER] 10_°F

HOME MODE VIEW
test() [ENTER] program({},{},{RETURN 10_(°F)}) ??

-------

Because when you enter the function [VAR] [CAS] does not automatically add the parentheses?

test [ENTER] (NULL)->BEGIN RETURN(5_(°F)+5_(°F)); END;

default should automatically place the brackets, otherwise placed on the history the program source code =[

test()


RE: units anomily - cyrille de brébisson - 05-05-2016 05:51 AM

Hello


> I would have expected something as simple as units conversion to be easier than that on the Prime.

Unit conversion are anything BUT simple (unfortunately).

The problem of °C and °F set aside, the 'sto' shortcut as in 1_m▶_cm is quite simple and pretty much to the point with very few keystrokes (considering the possibility range of Prime).



Now, working with °C and °F, this is a whole other can of worms.
°C and °F are not technically units. This is because they are not 0 based. ie, 0°C does not denote the absolute 0 with negative units denoting anti-heat.
This is where the problem lies.
This means that 1°C is not (always) equal to 1°C.
If I say: the temperature is 1°C, I mean by that that the temperature is 247K
When I say the temperature change is 1°C, I mean that the temperature change is 1K
But, the calculator does not get the context. When you tell it to convert 1°C to °F or K, it does not know if the 1°C is the result of a previous subtraction or an 'absolute' temperature.

Bernard, in the the CAS has decided that no serious (real life) math/physics calculations will/should use °C and °F, and is basically banning them. It is a defendable position, which makes sense, and which also makes the software developer life much much easier.

In home, we recognized that some users would want to do some computation on °C and °F, so we did some extra work to allow, with restrictions, in order to reduce the occurrences of "vitum pillum" (pig latin for "javelot in foot", (sorry I forgot the declination), or, as we would say in modern english: shooting oneself in the foot).
But it still fall short of expectations, due to the problem mentioned above, the calculator can not know, when you use 1°C if this is 0 based, or 246°K based.

Cyrille


RE: units anomily - Thomas Radtke - 05-05-2016 01:32 PM

(05-04-2016 05:47 PM)roadrunner Wrote:  It appears some unit operations are allowed only in CAS while other unit operations are allowed only in Home.
Most has been said already by Cyrille. I'd like to add a tiny bit out of the real world: In e.g. refrigeration engineering, where I work, you are required to express differences in Kelvin. No idea how the Prime handles this, but you should be able to add 5K to 5°F.


RE: units anomily - informach - 05-05-2016 02:58 PM

Hi!, Thomas Radke:

Today, is impossible, in HP PRIME directly.
You must program for allow result.
In Wolfram Alpha, you have the conversion (see image).

You have a single formula, for create program ...
T(°F) = T(K) × 9/5 - 459.67
Kelvin to Fahrenheit
K = 5/9 * (F - 32) + 273.15

King Regards.
informach.


RE: units anomily - Fortin - 05-06-2016 02:32 AM

(05-05-2016 01:32 PM)Thomas Radtke Wrote:  
(05-04-2016 05:47 PM)roadrunner Wrote:  It appears some unit operations are allowed only in CAS while other unit operations are allowed only in Home.
Most has been said already by Cyrille. I'd like to add a tiny bit out of the real world: In e.g. refrigeration engineering, where I work, you are required to express differences in Kelvin. No idea how the Prime handles this, but you should be able to add 5K to 5°F.

I'm assuming you want a 5K change starting at a temp of 5°F with the final result expressed in °F. To do this, all temp units must first be converted to K so that they have a common zero reference.

(CONVERT(5_°F,0_K)+5_K)▶_°F


RE: units anomily - roadrunner - 05-06-2016 01:55 PM

(05-05-2016 05:51 AM)cyrille de brébisson Wrote:  Unit conversion are anything BUT simple (unfortunately)

Indeed, when I used the word “simple,” that was my naiveté speaking. About the rest: understandable and reasonable.

On a side note, my 48SX thinks 5_°F + 5_°F is 469.67_°F. At least the prime gets that right.

-road


RE: units anomily - informach - 05-06-2016 02:25 PM

Hi!, roadrunner:

In Hp48/49/50 series, the convertion's, are incompatible, the K to °F and viceversa.

And your example, to 5_°F+5_°F isn't ... 469.67_°F.
The correct result, is ... 10_°F

Kind Regards.
informach.


RE: units anomily - Claudio L. - 05-06-2016 10:06 PM

For the interested, there was a recent thread discussing these issues and possible solutions:

http://www.hpmuseum.org/forum/thread-4783.html


RE: units anomily - Joe Horn - 05-07-2016 05:14 PM

(05-06-2016 01:55 PM)roadrunner Wrote:  On a side note, my 48SX thinks 5_°F + 5_°F is 469.67_°F. At least the prime gets that right.

(05-06-2016 02:25 PM)informach Wrote:  In Hp48/49/50 series, the convertion's, are incompatible, the K to °F and viceversa.

And your example, to 5_°F+5_°F isn't ... 469.67_°F.
The correct result, is ... 10_°F

Please note that the logic of temperature arithmetic is different between the 48S/SX and 48G/GX. Roadrunner is correct that the 48SX says that 5_°F + 5_°F is 469.67_°F. The 48G/GX agrees with Informach, saying that 5_°F + 5_°F is 10_°.


RE: units anomily - Paul Berger (Canada) - 05-07-2016 06:33 PM

(05-06-2016 02:25 PM)informach Wrote:  Hi!, roadrunner:

In Hp48/49/50 series, the convertion's, are incompatible, the K to °F and viceversa.

And your example, to 5_°F+5_°F isn't ... 469.67_°F.
The correct result, is ... 10_°F

Kind Regards.
informach.

I can confirm that a 48SX does indeed return 469.67_°F, it would seem that it messes up the units but not in an entirely random manner because 5_°F is 464.67_°R so it would seem that for some reason it converts to °R to make the calculation but does not convert back, 469.67_°R = 10°F

It does a similar thing with °C but converts to Kelvin in that case, adding degrees Rankine or Kelvin work as expected.

Paul


RE: units anomily - roadrunner - 05-07-2016 07:41 PM

Paul,

Internally it converts 5_°F to 464.67_°R, then adds 464.67_°R + 464.67_°R to get 929.34_°R then converts 929.34_°R back to 469.67_°F.

Once I lost more than a couple points on a homework assignment because of that anomaly. Those were the good ol' days.

-road