A new advance on dimensional-aware scalar, vector and matrix operations in C+

Eduard George Stan1,2, Dan Andrei Ciubotaru1, Michele Renda1

  • 1IFIN-HH, Particle Physics Department, Măgurele, 077125, Romania.

Scientific Reports
|October 4, 2023
PubMed
Summary

This study introduces Univec, a C++ library for dimensional-aware computations in scientific and engineering applications. Univec ensures unit consistency for scalars, vectors, and matrices, enhancing calculation accuracy.

Related Concept Videos

Scalar and Vectors01:22

Scalar and Vectors

In mechanics, commonly used terms like force, speed, velocity, and work can be classified as either scalar or vector quantities. A scalar is a physical quantity that can be described by its magnitude alone and does not require any directional components. Examples of scalar quantities are mass, area, and length.
Scalar quantities with the same physical units can be added or subtracted according to the usual algebra rules for numbers. For example, a class ending 10 min earlier than 50 min lasts...
1.3K
Scalar and Vector Triple Products01:06

Scalar and Vector Triple Products

Two vectors can be multiplied using a scalar product or a vector product. The resultant of a scalar product is scalar, while with vector products, the resultant is a vector. These rules of the scalar or vector product between two vectors can be applied to multiple vectors to obtain meaningful combinations. The scalar triple product is the dot product of a vector with the cross product of two vectors.
The scalar triple product is the dot product of a vector with the cross product of two vectors....
2.5K
Dimensional Analysis02:19

Dimensional Analysis

The concept of dimension is important because every mathematical equation linking physical quantities must be dimensionally consistent, implying that mathematical equations must meet the following two rules. The first rule is that, in an equation, the expressions on each side of the equal sign must have the same dimensions. This is fairly intuitive since we can only add or subtract quantities of the same type (dimension). The second rule states that, in an equation, the arguments of any of the...
15.2K
Vector Operations01:20

Vector Operations

Vectors are physical quantities that have both magnitude and direction. The vector operations include addition, subtraction, and scalar multiplication.
A vector multiplied by a scalar value is called scalar multiplication. The result obtained is a new vector with a different magnitude. If the scalar is positive, the direction of the vector remains the same, but if it is negative, the direction of the vector is reversed. For example, the product of the mass and velocity yields the momentum.
1.3K
Scalar Product (Dot Product)01:11

Scalar Product (Dot Product)

The scalar multiplication of two vectors is known as the scalar or dot product. As the name indicates, the scalar product of two vectors results in a number, that is, a scalar quantity. Scalar products are used to define work and energy relations. For example, the work that a force (a vector) performs on an object while causing its displacement (a vector) is defined as a scalar product of the force vector with the displacement vector.
The scalar product of two vectors is obtained by multiplying...
8.4K
Cartesian Vector Notation01:28

Cartesian Vector Notation

Cartesian vector notation is a valuable tool in mechanical engineering for representing vectors in three-dimensional space, performing vector operations such as determining the gradient, divergence, and curl, and expressing physical quantities such as the displacement, velocity, acceleration, and force. By using Cartesian vector notation, engineers can more easily analyze and solve problems in various areas of mechanical engineering, including dynamics, kinematics, and fluid mechanics. This...
783