:

## Converting derived SI units to SI base units

Maple 2024

From a discussion about expanding unit expressions with compound units I concluded that expanding derived units such as Newton, Watt, Volt, Tesla,... to SI base units is difficult in Maple.

Unintentionally, I came across a rather simple solution for SI units.

`toSIbu := x -> x = Units:-Unit(simplify(x/Unit('kg'))*Unit('kg'));`

converts derived SI units to SI base units. It’s the inverse of what the units packages and simplify do (i.e. simplification to derived units).

What makes it maybe more interesting: It also works, again unintentionally, on other units than SI units. If, one day, you come along an erg or a hartree or or a kyne and you cannot guess the SI units convert/units needs, try

```toSIbu(Unit('pound'));
toSIbu(Unit('hp'));
toSIbu(Unit('electron'));
toSIbu(Unit('hartree'));
toSIbu(Unit('bohr'));
toSIbu(Unit('barye'));
toSIbu(Unit('kyne'));
toSIbu(Unit('erg'));
toSIbu(Unit(mile/gal(petroleum)));```

Maybe handy one day when you do not trust AI or the web.

 > toSIbu := x -> x = Units:-Unit(simplify(x/Unit('kg'))*Unit('kg')): toSIbu(Unit('N')); toSIbu(Unit('J')); toSIbu(Unit('W')); toSIbu(Unit('Pa')); toSIbu(Unit('C')); toSIbu(Unit('F')); toSIbu(Unit('S')); toSIbu(Unit('H')); toSIbu(Unit('T')); toSIbu(Unit('V')); toSIbu(Unit('Wb')); toSIbu(Unit('Omega')); toSIbu(Unit('lx')); toSIbu(Unit('lm')); toSIbu(Unit('degC')); toSIbu(Unit('rad')); toSIbu(Unit('sr'));
 (1)