Post Reply 
PLUS42 - Usage of UNITS functions in solver
09-21-2022, 01:38 PM
Post: #1
PLUS42 - Usage of UNITS functions in solver
I am using Plus42 v.1.0.10 Decimal under Windows 10.

I am trying to use the Equation Solver to implement the following equation:

Code:
TEST:TimeH=L(K1:EXP(UBASE(U*A*(INV(W*C)-INV(w*c)))))*0+L(K2:(M*(G(K1)*w*c-W*C)/(W*w*c*(G(K1)-1))))*0+G(K2)*LN((UBASE(t1)-UBASE(T1))/(UBASE(t1)-UBASE(T2)))

All variables shall be with units.
The use of UBASE in K1 definition is necessary to reduce all UOM to their base definition, and the semplification of UOMs will reduce to a pure number.
The use of UBASE in LN argument has the same purpose of the above, plus the purpose of converting the temperatures to Kelvin degrees.
When solving, i get a "NONEXISTENT" error, just like UBASE is interpreted as a variable (see attached screenshot)

Such arrangement works properly on 48g/50g (of course keeping K1 and K2 definition outside the main equation and using MES)
Code:
{ 'K2=M*((K1*w*c-W*C)/(W*w*c*(K1-1.)))' 'K1=EXP(UBASE(U*A*(1./(W*C)-1./(w*c))))' 'Theat=K2*LN((UBASE(t1)-UBASE(T1))/(UBASE(t1)-UBASE(T2)))' }

What am i doing wrong?

Thanks in advance


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
09-21-2022, 04:54 PM
Post: #2
RE: PLUS42 - Usage of UNITS functions in solver
UBASE isn't defined as a built-in function in the equation language. (There is a complete list of built-in functions here, under the sub-heading Functions.)

I guess I should add it, but in the meantime, you can work around this problem by creating a function UBASE yourself, and implementing it using a program:

UBASE(X):XEQ(UB:X)

00 { 8-Byte Prgm }
01▸LBL "UB"
02 UBASE
03 END
Visit this user's website Find all posts by this user
Quote this message in a reply
09-21-2022, 06:23 PM
Post: #3
RE: PLUS42 - Usage of UNITS functions in solver
Should any other unit-related functions, apart from UBASE, be made available in the equation language as well?
Visit this user's website Find all posts by this user
Quote this message in a reply
09-21-2022, 07:16 PM (This post was last modified: 09-21-2022 07:20 PM by Marco Polo.)
Post: #4
RE: PLUS42 - Usage of UNITS functions in solver
(09-21-2022 06:23 PM)Thomas Okken Wrote:  Should any other unit-related functions, apart from UBASE, be made available in the equation language as well?
Yes, UVAL will be useful too.
Thank you for the quick answer and your effort.

By the way, any new about a multiple equation solver like MES?
Find all posts by this user
Quote this message in a reply
09-21-2022, 09:46 PM
Post: #5
RE: PLUS42 - Usage of UNITS functions in solver
(09-21-2022 07:16 PM)Marco Polo Wrote:  By the way, any new about a multiple equation solver like MES?

I haven't really thought about it... it's not high on the list.
I would like to do it eventually, but for now, I don't even have an algorithm.
Visit this user's website Find all posts by this user
Quote this message in a reply
10-03-2022, 01:17 PM
Post: #6
RE: PLUS42 - Usage of UNITS functions in solver
(09-21-2022 07:16 PM)Marco Polo Wrote:  
(09-21-2022 06:23 PM)Thomas Okken Wrote:  Should any other unit-related functions, apart from UBASE, be made available in the equation language as well?
Yes, UVAL will be useful too.
Thank you for the quick answer and your effort.

By the way, any new about a multiple equation solver like MES?
Just downloaded v. 1.0.11 for Windows 64bit.
UBASE and UVAL in EQN Solver works as expected.

Thank you!
Find all posts by this user
Quote this message in a reply
Post Reply 




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