skip to main content
10.1145/3147704.3147715acmotherconferencesArticle/Chapter ViewAbstractPublication PageseuroplopConference Proceedingsconference-collections
research-article

Physical Quantity: Towards a Pattern Language for Quantities and Units in Physical Calculations

Published: 12 July 2017 Publication History

Abstract

In this paper an approach is taken towards a pattern language for physical quantities in software applications. The central pattern, Physical Quantity, is described as well as some needed candidate patterns revolving around. The Physical Quantity design pattern is a specialized version of the Quantity analysis pattern, optimized for the SI unit system. It is intended for the physical and mathematical domains where calculations, arithmetic, conversion and simulations are the most used functionalities. Its emphasis is on type safety, dimensional analysis, performance, and convenient syntax. Supporting candidate patterns for handling tolerances, validation, conversion or matrix operations are shortly described. The target audiences are software engineers and practitioners working in the area of physical simulations and calculations.

References

[1]
BIPM. 2006. The International System of Units (SI) (8th ed.). 186 pages.
[2]
Frank Buschmann, Kevlin Henney, and Douglas Schmidt. 2007. Pattern-Oriented Software Architecture Volume 4: A Pattern Language for Distributed Computing. 639 pages.
[3]
C2. 2011. Canonical Form. (2011). http://wiki.c2.com/?CanonicalForm
[4]
Darren Dale. 2011. Quantities. (2011). http://pythonhosted.org/quantities/
[5]
Enthought. 2011. Scimath Documentation. (2011). http://scimath.readthedocs.io/en/latest/
[6]
Martin Fowler. 1996a. Analysis Patterns: Reusable Object Models. Addison-Wesley Professional. 384 pages.
[7]
Martin Fowler. 1996b. Money. (1996). https://www.martinfowler.com/eaaCatalog/money.html
[8]
Martin Fowler. 1997. Quantity. (1997).
[9]
Erich Gamma, Richard Helm, Ralph E. Johnson, and John Vlissides. 1995. Design Patterns - Elements of Reusable Object-Oriented Software (1 ed.). Addison-Wesley, Boston, USA. 395 pages.
[10]
James Geoffrey. 1987. The Tao Of Programming. (1987). http://canonical.org/
[11]
David Goldberg. 1991. What every computer scientist should know about floating-point arithmetic. Vol. 23. 5--48 pages.
[12]
Stefan Hausberger, Martin Rexeis, Raphael Luz, Christian Kreiner, Michael Krisper, Markus Quaritsch, Philipp Gretzl, and Helmut Eichlseder. 2016. VECTO tool development. (2016).
[13]
Nicholas J Higham. 2002. Accuracy and Stability of Numerical Algorithms. 1--663 pages.
[14]
ISO. 2009. ISO:80000-1:2009. (2009). https://www.iso.org/obp/ui/\#iso:std:iso:80000:-1:ed-1:v1:en
[15]
JScience. 2011. JScience. (2011). http://jscience.org/
[16]
William Kahan. 1996. IEEE Standard 754 for Binary Floating-Point Arithmetic. University of California, Berkeley May 1995 (1996), 1--30.
[17]
William Kahan. 2001. Why do we need a floating-point arithmetic standard? (2001).
[18]
Werner Keil. 2017. UOMSI. (2017). http://uom.si
[19]
Andrew Kennedy. 2008. Units of Measure in F#. (2008). https://blogs.msdn.microsoft.com/andrewkennedy/2008/08/29/units-of-measure-in-f-part-one-introducing-units/
[20]
Antonius Kies, Martin Rexeis, Gerard Silberholz, Raphael Luz, and Stefan Hausberger. 2013. Options to consider future advanced fuel- saving technologies in the CO2 test procedure for HDV. Technical Report. Forschungsgesellschaft für Verbrennungskraftmaschinen und Thermodynamik mbH. 108 pages.
[21]
Andreas Gullberg Larsen. 2017. Units.Net. (2017). https://github.com/anjdreas/UnitsNet
[22]
Chris MacLeod and Pierre Denis. 2013. Units in Python. (2013). https://pypi.python.org/pypi/Unum
[23]
Josh Mafu. 2013. NGenericDimensions™. (2013). http://ngenericdimensions.codeplex.com
[24]
Scott Meyers. 2004. The Most Important Design Guideline? In IEEE Software, Martin Fowler (Ed.). 14--16. http://www.aristeia.com/Papers/IEEE
[25]
Microsoft. 2012. FSPowerPack.Community. (2012). https://www.nuget.org/packages/FSPowerPack.Community
[26]
Microsoft. 2014. The Old F# "PowerPack". (2014). http://fsharppowerpack.codeplex.com/
[27]
Microsoft. 2016. Units of Measure (F#). (2016). https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/units-of-measure
[28]
Keith Nicewarner. 2013. The Units of Measure Library. (2013). http://tuoml.sourceforge.net
[29]
NIST. 2008. SP811 - Guide for the Use of the International System of Units (SI). Technical Report.
[30]
NIST. 2009. Derived Units, Outside the SI. (2009). http://physics.nist.gov/cuu/Units/outside.html
[31]
Gordon S. Novak. 1995. Conversion of units of measurement. IEEE Transactions on Software Engineering 21, 8 (1995), 651--661.
[32]
Steve Pemberton. 2015. F# Units of Measure - A Worked Example. (2015). http://stevenpemberton.net/blog/2015/03/11/FSharp-Units-Of-Measure/
[33]
Eric S. Raymond. 2004. The art of Unix programming. Addison-Wesley. 525 pages.
[34]
John F. Reiser and Donald E. Knuth. 1975. Evading the drift in floating-point addition. Inform. Process. Lett. 3, 3 (1975), 84--87.
[35]
Matthias C. Schabel. 2010. Boost.Units 1.1.0. (2010). http://www.boost.org/doc/libs/1_55_0/doc/html/boost_units.html
[36]
Gernot Schmoelzer, Christian Kreiner, Zsolt Kovacs, and Michael Thonhauser. 2006. Reflective, Model-Based Data Access with the Type-Safe Entity Container. In 30th Annual International Computer Software and Applications Conference (COMP-SAC'06), Vol. 2. 87--92.
[37]
Almas Shaikh, Chris Senior, Jean-Marie Dautelle, Karen Legrand, Leonardo Lima, Martin Desruisseaux, Mohamed Taman, Otavio Santana, Rajmahendra Hedge, and Werner Keil. 2016. JSR 363 Units of Measurement. (2016), 1--45.
[38]
Markus Voelter, Daniel Ratiu, Bernhard Schaetz, and Bernd Kolb. 2012. mbeddr: an Extensible C-based Programming Language and IDE for Embedded Systems. (2012). http://voelter.de/data/pub/wavefront-updatedSubmission2.pdf
[39]
James H. Wilkinson. 1994. Rounding Errors in Algebraic Processes (reprint ed.). Dover Publications. 161 pages. https://www.amazon.com/Rounding-Errors-Algebraic-Processes-Wilkinson/dp/0486679993
[40]
Scott Wlaschin. 2012. Units of measure - Type safety for numerics. (2012). https://fsharpforfunandprofit.com/posts/units-of-measure/
[41]
J.W. Yoder, F. Balaguer, and Ralph Johnson. 2000. From analysis to design of the observation pattern. (2000), 18. http://www.joeyoder.com/Research/metadata/Observation/ObservationModel.pdf

Cited By

View all
  • (2023)Managing Quantities and Units of Measurement in Code BasesUpdates on Software Usability10.5772/intechopen.108014Online publication date: 22-Feb-2023
  • (2023)Acknowledging Implementation Trade-Offs When Developing with Units of MeasurementModel-Driven Engineering and Software Development10.1007/978-3-031-38821-7_2(25-47)Online publication date: 4-Aug-2023
  • (2020)Unit of measurement libraries, their popularity and suitabilitySoftware: Practice and Experience10.1002/spe.292651:4(711-734)Online publication date: 11-Nov-2020

Index Terms

  1. Physical Quantity: Towards a Pattern Language for Quantities and Units in Physical Calculations

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Other conferences
      EuroPLoP '17: Proceedings of the 22nd European Conference on Pattern Languages of Programs
      July 2017
      566 pages
      ISBN:9781450348485
      DOI:10.1145/3147704
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      In-Cooperation

      • Hillside Europe: Hillside Europe

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 12 July 2017

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. calculations
      2. design patterns
      3. quantities
      4. si units
      5. simulations
      6. type safety
      7. unit system

      Qualifiers

      • Research-article
      • Research
      • Refereed limited

      Conference

      EuroPLoP '17

      Acceptance Rates

      EuroPLoP '17 Paper Acceptance Rate 34 of 53 submissions, 64%;
      Overall Acceptance Rate 216 of 354 submissions, 61%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)3
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 05 Mar 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2023)Managing Quantities and Units of Measurement in Code BasesUpdates on Software Usability10.5772/intechopen.108014Online publication date: 22-Feb-2023
      • (2023)Acknowledging Implementation Trade-Offs When Developing with Units of MeasurementModel-Driven Engineering and Software Development10.1007/978-3-031-38821-7_2(25-47)Online publication date: 4-Aug-2023
      • (2020)Unit of measurement libraries, their popularity and suitabilitySoftware: Practice and Experience10.1002/spe.292651:4(711-734)Online publication date: 11-Nov-2020

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Figures

      Tables

      Media

      Share

      Share

      Share this Publication link

      Share on social media