4 ms·
Interesting project. I use command line Qalculate [1] for this (has a very similar feature set to Frink AFAICT) and Pint [2] for scripting. I feel like unit-awa
by synapsomorphy 2y ago
Interesting project. I use command line Qalculate [1] for this (has a very similar feature set to Frink AFAICT) and Pint [2] for scripting. I feel like unit-aware calculators are hugely underused by physical engineers, it's the same idea and benefit as type safety but they're virtually unheard of, everyone just uses excel. Having guaranteed dimensional correctness is so great for the early design stage, it makes it a lot easier to explore the problem space.
[1] https://qalculate.github.io/ https://qalculate.github.io/
[2] https://pint.readthedocs.io/en/stable/ https://pint.readthedocs.io/en/stable/
- timewizard 2y agoI use the gem 'ruby-units' with "irb" on the command line. It's an exceptionally useful library.
- stevage 2y agoIs this still true if you're using metric? Just curious, as the Frink examples were all imperial. And examples like `10 feet 12 feet 8 feet -> gallons` are much less compelling in metric (eg, 3 metres x 4 metres x 2 metres in cubic metres is, uh, 24 cubic metres...)
- genter 2y agoThere's lots of metric units that aren't obvious when multiplied. For example, watts = ohms * amps^2 (very important if you want to calculate how much heat a mosfet is going to dissipate.)
- synapsomorphy 2y agoDunno about Frink but both qalc and pint allow any units and mixing and matching, in qalc you can do something like `1in^2 * 1m to gal` or `1 ly / fortnight to mph` and get as complex as you want. I use metric except when converting to vendor units for component speccing.
- ericyd 2y agoIMO dimensional analysis is still useful even if unit conversions are more compatible.
- Y_Y 2y agoI agree with this sentiment, and in fact have always thought of it as analogous to type-checking (which must programmers benefit from to some extent). If you use something with a sufficiently flexible type system you can combine these benefits, for example Haskell will let you mix physical units into the type system and have them statically checked: https://wiki.haskell.org/Physical_units https://wiki.haskell.org/Physical_units
- schiffern 2y ago>Just curious, as the Frink examples were all imperial. No worries. Internally Frink immediately converts everything into SI, actually. Fortunately Frink converts with zero loss of precision, because the language supports exact rational numbers. The unit definitions are all given in exact rationals, since they are (legally) defined as exact multipliers. For readability Frink introduces the "ee" ('exact exponent') notation, so for instance the standard acceleration due to gravity can be given as: 9.80665ee0 m/s^2 or (equivalently) in simplest form, as: 196133/20000 m s^-2 Frink treats these two quantities as exactly equivalent.
- ginko 2y agoTalking about Frink alternatives.. Back when I was using Windows I really liked SpeQ[1]. The cool thing about that one was that you could define values and functions and modify any part and it would immediately recalculate everything. Unfortunately it seems to be abandoned (last release was from 2010). [1] https://speqmath.com/ https://speqmath.com/