Post Reply 
Question about units and formulas
07-24-2023, 02:17 AM
Post: #1
Question about units and formulas
Hello to everyone,

I have two questions. First question is it possible to define custom units in hp prime?

Second question is it possible to use units in equations and if yes what is the best way to do this?
I.e in a formula E=πR^2 should I assign the unit in the actual value I.e 2_m or to the R? I.e R_m?
I think that the first might be the right way but I wonder if the second is possible as well?

Thank you very much
Find all posts by this user
Quote this message in a reply
07-25-2023, 12:27 AM
Post: #2
RE: Question about units and formulas
(07-24-2023 02:17 AM)nickapos Wrote:  Hello to everyone,

I have two questions. First question is it possible to define custom units in hp prime?

No, not in the same way that you can in RPL.

For example, the HP48 allows you to create a variable called 'WEEK' and store 7_d in it. Then you can say '2_WEEK' to create a unit object '2_WEEK' on the stack. On the Prime you can store '7_d' into a variable called 'WEEK' but it's just a variable with a name that happens to have meaning - evaluating the expression '2 * WEEK' gives 14_d as the result and there's no simple way to go back.

Quote:Second question is it possible to use units in equations and if yes what is the best way to do this?
I.e in a formula E=πR^2 should I assign the unit in the actual value i.e 2_m or to the R? I.e R_m?
I think that the first might be the right way but I wonder if the second is possible as well?

Thank you very much

If you attach _m to both terms in a multiplication then your answer will be in square meters. So I suspect the answer in your example would be to attach the unit to the variable and leave the constant as a constant.
Find all posts by this user
Quote this message in a reply
07-25-2023, 08:30 PM
Post: #3
RE: Question about units and formulas
(07-25-2023 12:27 AM)BruceH Wrote:  
(07-24-2023 02:17 AM)nickapos Wrote:  Hello to everyone,

I have two questions. First question is it possible to define custom units in hp prime?

No, not in the same way that you can in RPL.

For example, the HP48 allows you to create a variable called 'WEEK' and store 7_d in it. Then you can say '2_WEEK' to create a unit object '2_WEEK' on the stack. On the Prime you can store '7_d' into a variable called 'WEEK' but it's just a variable with a name that happens to have meaning - evaluating the expression '2 * WEEK' gives 14_d as the result and there's no simple way to go back.

Quote:Second question is it possible to use units in equations and if yes what is the best way to do this?
I.e in a formula E=πR^2 should I assign the unit in the actual value i.e 2_m or to the R? I.e R_m?
I think that the first might be the right way but I wonder if the second is possible as well?

Thank you very much

If you attach _m to both terms in a multiplication then your answer will be in square meters. So I suspect the answer in your example would be to attach the unit to the variable and leave the constant as a constant.
Thank you very much Bruce for the reply. I need to experiment with units in equations to see what works and what does not work. I was hoping that maybe there is an internal way to define units, maybe in a program or something but unfortunately it seems I am not lucky.
Find all posts by this user
Quote this message in a reply
Post Reply 




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