kill(all)$

maxima : use packages (ezunits,lrats),version 1.0
peter.vlasschaert@gmail.com,20/08/2021

load(lrats)$

load (ezunits)$

  [a, c, d] : [1 ` m, 2 ` m, 3 ` m];
  p1:dimensionally(solve([A = a * b, b = c * d], [A, b]));
  p1a:flatten(p1);

p1a:ev(p1a,nouns);

→ need special values 

declare_index_properties(A,[postsubscript,postsuperscript,presubscript,presuperscript])$
p1b:A[a,b,c,d];

→ subst,ratsubst : 'doesn't work'

p1c:lratsubst(p1a,p1b);

use :lratsubst , 'load(lrats)'

p1d:s1=a+c+d;

definition :force = kg*m/s^2
mass             = mm = 10kg
acceleration = aa    = 9.81m/s^2

gravitation
========

p2:F = mm*aa;

p2a:aa  =10`kg;
p2b:mm=9.81`m/s^2;

p2c:[p2a,p2b];

p2d:subst(p2c,p2);

→ how find :unit & value

p2d1:args(rhs(p2d));

or 

p2d2:[qty(rhs(p2d)),units(rhs(p2d))];

→ dimension : force

p3:dimensions(p2d1[2]);

→ fundamental_units

p4: fundamental_units(p3);

→ dimensions_as_list 

p4a: dimensions_as_list (p4);
p4b:fundamental_units();

rem :

fundamental_units();

fundamental_dimensions();

→ declare_units 

declare_units(gg,foot/s^2);

fundamental_units(gg);

gg;

→ force

1 ` N ``kg*m/s^2;

fundamental_units(%);

physical constant
=============

load (physical_constants)$
propvars (physical_constant);

rem : very important , 'electrochemistry'
n =number
ΔE =voltage difference

pa:%F;

pb:constvalue(pa);

pc:get(pa,'description);

→  equilibrium 

pd:ΔG[°]=-n*pa*ΔE;

pd1:ev(pd,constvalue);

rem :known_unit_conversions;
========================

→  conversion : inch to cm 

ppa:1 `inch``cm;

ppb:%,float;

→conversion :cm to inch

qqa:2.54`cm``inch;

→ operation : +/-

float((100 ` m - 300 ` ft) ``m);;

→temperature conversion: Fharenheit →Celsius;

qqb:212`degF``degC;                                       f;

qqb1:qqb;

example: with declare
=================

declare_unit_conversion (kWh = kW*hour, 
                               MWh = 1000*kWh)$

rra: 1 ` kW*s `` kWh;;

→  MWh = 1000*kWh =>rra*MWh/1000 

rrb: 1 ` kW*s `` MWh;

rem : 1 hour =3600 seconds

rrc:1`hour``s;