sysml-validate 0.11.0 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/LICENSE +27 -27
  2. package/README.md +200 -200
  3. package/out/main.js +596 -141
  4. package/out/main.js.map +4 -4
  5. package/package.json +57 -57
  6. package/resources/sysml.dimension-table.json +1 -1
  7. package/resources/sysml.library/Domain Libraries/Analysis/.meta.json +9 -9
  8. package/resources/sysml.library/Domain Libraries/Analysis/.project.json +26 -26
  9. package/resources/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml +33 -33
  10. package/resources/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml +118 -118
  11. package/resources/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml +143 -143
  12. package/resources/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml +170 -170
  13. package/resources/sysml.library/Domain Libraries/Cause and Effect/.meta.json +7 -7
  14. package/resources/sysml.library/Domain Libraries/Cause and Effect/.project.json +22 -22
  15. package/resources/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml +82 -82
  16. package/resources/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml +81 -81
  17. package/resources/sysml.library/Domain Libraries/Geometry/.meta.json +7 -7
  18. package/resources/sysml.library/Domain Libraries/Geometry/.project.json +26 -26
  19. package/resources/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml +898 -898
  20. package/resources/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml +167 -167
  21. package/resources/sysml.library/Domain Libraries/Metadata/.meta.json +9 -9
  22. package/resources/sysml.library/Domain Libraries/Metadata/.project.json +18 -18
  23. package/resources/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml +77 -77
  24. package/resources/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml +142 -142
  25. package/resources/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml +38 -38
  26. package/resources/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml +99 -99
  27. package/resources/sysml.library/Domain Libraries/Quantities and Units/.meta.json +28 -28
  28. package/resources/sysml.library/Domain Libraries/Quantities and Units/.project.json +22 -22
  29. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml +42 -42
  30. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml +439 -439
  31. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml +2726 -2726
  32. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml +206 -206
  33. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml +1991 -1991
  34. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml +1353 -1353
  35. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml +1223 -1223
  36. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml +2333 -2333
  37. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml +958 -958
  38. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml +1537 -1537
  39. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml +1564 -1564
  40. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml +1169 -1169
  41. package/resources/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml +1256 -1256
  42. package/resources/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml +30 -30
  43. package/resources/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml +526 -526
  44. package/resources/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml +107 -107
  45. package/resources/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml +70 -70
  46. package/resources/sysml.library/Domain Libraries/Quantities and Units/SI.sysml +378 -378
  47. package/resources/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml +48 -48
  48. package/resources/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml +49 -49
  49. package/resources/sysml.library/Domain Libraries/Quantities and Units/Time.sysml +274 -274
  50. package/resources/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml +260 -260
  51. package/resources/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml +62 -62
  52. package/resources/sysml.library/Domain Libraries/Requirement Derivation/.meta.json +7 -7
  53. package/resources/sysml.library/Domain Libraries/Requirement Derivation/.project.json +18 -18
  54. package/resources/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml +62 -62
  55. package/resources/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml +38 -38
  56. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/.meta.json +8 -8
  57. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +10 -10
  58. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/Collections.kerml +176 -176
  59. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/ScalarValues.kerml +23 -23
  60. package/resources/sysml.library/Kernel Libraries/Kernel Data Type Library/VectorValues.kerml +63 -63
  61. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/.meta.json +22 -22
  62. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +14 -14
  63. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/BaseFunctions.kerml +79 -79
  64. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/BooleanFunctions.kerml +22 -22
  65. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/CollectionFunctions.kerml +68 -68
  66. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ComplexFunctions.kerml +47 -47
  67. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ControlFunctions.kerml +116 -116
  68. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/DataFunctions.kerml +42 -42
  69. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/IntegerFunctions.kerml +43 -43
  70. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/NaturalFunctions.kerml +27 -27
  71. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/NumericalFunctions.kerml +42 -42
  72. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/OccurrenceFunctions.kerml +153 -153
  73. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/RationalFunctions.kerml +49 -49
  74. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/RealFunctions.kerml +56 -56
  75. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/ScalarFunctions.kerml +32 -32
  76. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/SequenceFunctions.kerml +110 -110
  77. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/StringFunctions.kerml +25 -25
  78. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/TrigFunctions.kerml +34 -34
  79. package/resources/sysml.library/Kernel Libraries/Kernel Function Library/VectorFunctions.kerml +272 -272
  80. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/.meta.json +21 -21
  81. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +14 -14
  82. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Base.kerml +94 -94
  83. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Clocks.kerml +155 -155
  84. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/ControlPerformances.kerml +134 -134
  85. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/FeatureReferencingPerformances.kerml +189 -189
  86. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/KerML.kerml +483 -483
  87. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Links.kerml +66 -66
  88. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Metaobjects.kerml +57 -57
  89. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Objects.kerml +212 -212
  90. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Observation.kerml +160 -160
  91. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Occurrences.kerml +992 -992
  92. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Performances.kerml +292 -292
  93. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/SpatialFrames.kerml +196 -196
  94. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/StatePerformances.kerml +144 -144
  95. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Transfers.kerml +280 -280
  96. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/TransitionPerformances.kerml +65 -65
  97. package/resources/sysml.library/Kernel Libraries/Kernel Semantic Library/Triggers.kerml +187 -187
  98. package/resources/sysml.library/LICENSE +276 -276
  99. package/resources/sysml.library/NOTICE.md +20 -20
  100. package/resources/sysml.library/Systems Library/Actions.sysml +556 -556
  101. package/resources/sysml.library/Systems Library/Allocations.sysml +28 -28
  102. package/resources/sysml.library/Systems Library/AnalysisCases.sysml +37 -37
  103. package/resources/sysml.library/Systems Library/Attributes.sysml +24 -24
  104. package/resources/sysml.library/Systems Library/Calculations.sysml +36 -36
  105. package/resources/sysml.library/Systems Library/Cases.sysml +70 -70
  106. package/resources/sysml.library/Systems Library/Connections.sysml +59 -59
  107. package/resources/sysml.library/Systems Library/Constraints.sysml +43 -43
  108. package/resources/sysml.library/Systems Library/Flows.sysml +125 -125
  109. package/resources/sysml.library/Systems Library/Interfaces.sysml +88 -88
  110. package/resources/sysml.library/Systems Library/Items.sysml +152 -152
  111. package/resources/sysml.library/Systems Library/Metadata.sysml +31 -31
  112. package/resources/sysml.library/Systems Library/Parts.sysml +80 -80
  113. package/resources/sysml.library/Systems Library/Ports.sysml +53 -53
  114. package/resources/sysml.library/Systems Library/Requirements.sysml +193 -193
  115. package/resources/sysml.library/Systems Library/StandardViewDefinitions.sysml +123 -123
  116. package/resources/sysml.library/Systems Library/States.sysml +102 -102
  117. package/resources/sysml.library/Systems Library/SysML.sysml +539 -539
  118. package/resources/sysml.library/Systems Library/UseCases.sysml +56 -56
  119. package/resources/sysml.library/Systems Library/VerificationCases.sysml +102 -102
  120. package/resources/sysml.library/Systems Library/Views.sysml +163 -163
  121. package/resources/sysml.library.index.json +1 -1
@@ -1,526 +1,526 @@
1
- standard library package MeasurementReferences {
2
- doc
3
- /*
4
- * This package defines the representations for measurement references.
5
- */
6
-
7
- private import Collections::Array;
8
- private import Collections::List;
9
- private import ScalarValues::*;
10
- private import VectorValues::ThreeVectorValue;
11
-
12
- private import SequenceFunctions::size;
13
- private import SequenceFunctions::equals;
14
- private import ControlFunctions::forAll;
15
- private import Quantities::QuantityDimension;
16
- private import Quantities::VectorQuantityValue;
17
- private import Quantities::scalarQuantities;
18
- private import Quantities::ScalarQuantityValue;
19
- private import Quantities::SystemOfQuantities;
20
- private import ISQSpaceTime::angularMeasure;
21
-
22
- attribute def TensorMeasurementReference :> Array {
23
- doc
24
- /*
25
- * TensorMeasurementReference is the most general AttributeDefinition to represent measurement references.
26
- *
27
- * The concept "measurement reference" is defined in [VIM] "quantity" NOTE 2 as "A reference can be a measurement unit,
28
- * a measurement procedure, a reference material, or a combination of such.", see https://jcgm.bipm.org/vim/en/1.1.html .
29
- * In addition [VIM] "quantity" NOTE 5 states that "A quantity as defined here is a scalar. However, a vector or a tensor,
30
- * the components of which are quantities, is also considered to be a quantity". However, the rest of [VIM] does not explicitly
31
- * define how tensor and vector quantities can be or should be supported.
32
- *
33
- * In this package, in line with TensorQuantityValue in package Quantities, the most general kind of measurement reference
34
- * is TensorMeasurementReference that represents a measurement reference for any order of tensor quantity. Since the order can
35
- * also be one or zero, this includes vector and scalar quantities. The specializations VectorMeasurementReference and
36
- * ScalarMeasurementReference are defined to specifically represent measurement references for vector and scalar quantities.
37
- *
38
- * TensorMeasurementReference specializes Array, which provides its multi-dimensional structure. The order of a tensor is equivalent
39
- * to the rank of an Array.
40
- *
41
- * Attribute isBound specifies whether the vector space product is bound (isBound is true) or free (isBound is false).
42
- *
43
- * Attribute mRefs specifies the scalar measurement references for all dimensions of a tensor quantity.
44
- *
45
- * The short name of a TensorMeasurementReference is the unique symbol by which the measurement reference is known.
46
- * The name of a TensorMeasurementReference is spelled-out human readable name of the measurement reference.
47
- *
48
- * For example, typical measurement references for (scalar) quantity speed are declared with the following humanId and name:
49
- * <'m/s'> and 'metre per second',
50
- * <'km/h'> and 'kilometre per hour',
51
- * <'mi/h'> and 'mile per hour'.
52
- *
53
- * A measurement reference can have zero or more definitionalQuantityValues that allow to specify
54
- * quantity values that carry a particular meaning or relevance for the measurement reference.
55
- */
56
-
57
- attribute isBound: Boolean[1] default false;
58
- attribute order :>> rank;
59
- attribute mRefs: ScalarMeasurementReference[1..*] nonunique :>> elements;
60
- attribute definitionalQuantityValues: DefinitionalQuantityValue[0..*];
61
- }
62
-
63
- attribute def VectorMeasurementReference :> TensorMeasurementReference {
64
- doc
65
- /*
66
- * A VectorMeasurementReference is a specialization of TensorMeasurementReference for vector quantities that are
67
- * typed by a VectorQuantityValue. Its order is one. Implicitly, it defines a vector space of dimension `n` = dimensions[1].
68
- * The magnitudes of the `n` basis unit vectors that span the vector space are defined by the mRefs which each are
69
- * a ScalarMeasurementReference, typically a MeasurementUnit or an IntervalScale.
70
- *
71
- * Attribute isOrthogonal declares whether the basis vectors of the vector space are orthogonal, i.e., whether all
72
- * inner products of any pair of basis vectors are equal to zero.
73
- *
74
- * A pair of a specialization of VectorQuantityValue and a specialization of VectorMeasurementReference can also be used to
75
- * define a vector space for state vectors as used in state-space representation models.
76
- */
77
-
78
- attribute :>> dimensions: Positive[0..1];
79
- attribute isOrthogonal: Boolean[1] default true;
80
- }
81
-
82
- abstract attribute def ScalarMeasurementReference :> VectorMeasurementReference {
83
- doc
84
- /*
85
- * A ScalarMeasurementReference is a specialization of VectorMeasurementReference for scalar quantities
86
- * that are typed by a ScalarQuantityValue and for components of tensor or vector quantities.
87
- * Its order is zero. A ScalarMeasurementReference is also a generalization of MeasurementUnit and MeasurementScale.
88
- * It establishes how to interpret the numerical value (num) of a ScalarQuantityValue or a component of
89
- * a tensor or vector quantity value, and establishes its actual quantity dimension.
90
- *
91
- * Attribute mRefs is bound to self for a ScalarMeasurementReference, for consistency with tensor and vector measurement references,
92
- * as the dimension or component of a scalar quantity is itself.
93
- */
94
-
95
- attribute :>> dimensions = ();
96
- attribute :>> isOrthogonal = true;
97
- attribute :>> mRefs = self;
98
- attribute quantityDimension: QuantityDimension[1];
99
- }
100
-
101
- attribute def CoordinateFrame :> VectorMeasurementReference {
102
- doc
103
- /*
104
- * CoordinateFrame is a VectorMeasurementReference with the specific purpose to quantify (i.e., coordinatize) a vector space,
105
- * and locate and orient it with respect to another CoordinateFrame.
106
- *
107
- * Optional attribute transformation enables specification of the location and orientation of this CoordinateFrame as dependent
108
- * and nested with respect to another (reference) coordinate frame. Typically the other CoordinateFrame is the frame of
109
- * the next higher element (Object, Item or Part) in a composite structure.
110
- */
111
-
112
- attribute transformation: CoordinateTransformation[0..1] {
113
- attribute :>> target = that;
114
- }
115
- }
116
-
117
- attribute def '3dCoordinateFrame' :> CoordinateFrame {
118
- doc
119
- /*
120
- * Most general 3-dimensional coordinate frame
121
- */
122
- attribute :>> dimensions = 3;
123
- }
124
- alias ThreeDCoordinateFrame for '3dCoordinateFrame';
125
-
126
- abstract attribute def CoordinateTransformation {
127
- doc
128
- /*
129
- * CoordinateTransformation is the most general representation of the transformation of a target VectorMeasurementReference
130
- * with respect to a source VectorMeasurementReference.
131
- */
132
- attribute source: VectorMeasurementReference[1];
133
- attribute target: VectorMeasurementReference[1];
134
- assert constraint validSourceTargetDimensions { source.dimensions == target.dimensions }
135
- }
136
-
137
- attribute def CoordinateFramePlacement :> CoordinateTransformation {
138
- doc
139
- /*
140
- * CoordinateFramePlacement is a CoordinateTransformation by placement of the target frame in the source frame.
141
- *
142
- * Attribute origin specifies the location of the origin of the target frame as a vector in the source frame.
143
- *
144
- * Attribute basisDirections specifies the orientation of the target frame by specifying the directions of
145
- * the respective basis vectors of the target frame via direction vectors in the source frame. An empty sequence of
146
- * basisDirections signifies no change of orientation of the target coordinate frame.
147
- */
148
-
149
- attribute origin : VectorQuantityValue[1];
150
- attribute basisDirections : VectorQuantityValue[0..*] ordered nonunique;
151
- assert constraint validOriginDimensions { origin.dimensions == source.dimensions }
152
- assert constraint { size(basisDirections) == 0 or size(basisDirections) == source.dimensions#(1)}
153
- assert constraint validateBasisDirections { basisDirections->forAll { in basisDirection : VectorQuantityValue;
154
- basisDirection.dimensions->equals(source.dimensions) }
155
- }
156
- }
157
-
158
- abstract attribute def TranslationOrRotation {
159
- doc
160
- /*
161
- * TranslationOrRotation is an abstract union of Translation and Rotation
162
- */
163
- }
164
-
165
- attribute def Translation :> TranslationOrRotation {
166
- doc
167
- /*
168
- * Representation of a translation with respect to a coordinate frame
169
- *
170
- * Attribute translationVector specifies the displacement vector that constitutes the translation.
171
- */
172
-
173
- attribute translationVector : VectorQuantityValue[1];
174
- }
175
-
176
- attribute def Rotation :> TranslationOrRotation {
177
- doc
178
- /*
179
- * Representation of a rotation about an axis over an angle
180
- *
181
- * Attribute axisDirection specifies the direction of the rotation axis.
182
- * Attribute angle specifies the angle of rotation, where a positive value implies right-handed rotation.
183
- * Attribute isIntrinsic asserts whether the intermediate coordinate frame moves with the rotation or not,
184
- * i.e. whether an instrinsic or extrinsic rotation is specified.
185
- *
186
- * See https://en.wikipedia.org/wiki/Davenport_chained_rotations for details.
187
- */
188
-
189
- attribute axisDirection : VectorQuantityValue[1];
190
- attribute angle :>> angularMeasure;
191
- attribute isIntrinsic : Boolean[1] default true;
192
- }
193
-
194
- attribute def TranslationRotationSequence :> CoordinateTransformation, List {
195
- doc
196
- /*
197
- * Coordinate frame transformation specified by a sequence of translations and/or rotations
198
- *
199
- * Note: This is a coordinate transformation that is convenient for interpretation by humans.
200
- * In particular a sequence of rotations about the principal axes of a coordinate frame is much more easy understandable
201
- * than a rotation about an arbitrary axis.
202
- * Any sequence can be reduced to a single combination of a translation and a rotation about a particular axis, but in general
203
- * the original sequence cannot be retrieved as there are infinitely many sequences representing the reduced transformation.
204
- */
205
-
206
- attribute :>> elements : TranslationOrRotation[1..*] ordered nonunique;
207
- }
208
-
209
- attribute def AffineTransformationMatrix3d :> CoordinateTransformation, Array {
210
- doc
211
- /*
212
- * AffineTransformationMatrix3d is a three dimensional CoordinateTransformation specified via an affine transformation matrix
213
- *
214
- * The interpretation of the matrix is as follows:
215
- * - the upper left 3x3 matrix represents the rotation matrix
216
- * - the uper right 3x1 column vector represents the translation vector
217
- * - the bottom row must be the row vector (0, 0, 0, 1).
218
- *
219
- * I.e. the matrix has the following form:
220
- * ( R, R, R, T,
221
- * R, R, R, T,
222
- * R, R, R, T,
223
- * 0, 0, 0, 1 )
224
- * where the cells marked R form the rotation matrix and the cells marked T form the translation vector.
225
- *
226
- * Note: See https://en.wikipedia.org/wiki/Transformation_matrix, under affine transformations for a general explanation.
227
- */
228
-
229
- attribute rotationMatrix : Array {
230
- attribute :>> elements : Real[9] ordered nonunique;
231
- attribute :>> dimensions = (3, 3);
232
- }
233
- attribute translationVector : ThreeVectorValue[1] { :>> elements : Real[3]; }
234
- attribute :>> dimensions = (4, 4);
235
- attribute :>> elements : Real[16] ordered nonunique = (
236
- rotationMatrix.elements#(1), rotationMatrix.elements#(2), rotationMatrix.elements#(3), translationVector#(1),
237
- rotationMatrix.elements#(4), rotationMatrix.elements#(5), rotationMatrix.elements#(6), translationVector#(2),
238
- rotationMatrix.elements#(7), rotationMatrix.elements#(8), rotationMatrix.elements#(9), translationVector#(3),
239
- 0, 0, 0, 1);
240
- assert constraint validSourceDimensions { source.dimensions == 3 }
241
- }
242
-
243
- attribute def NullTransformation :> AffineTransformationMatrix3d {
244
- doc
245
- /*
246
- * NullTransformation is a three dimensional CoordinateTransformation that places the target CoordinateFrame at the
247
- * same position and orientation as the source CoordinateFrame.
248
- */
249
- attribute :>> rotationMatrix {
250
- attribute :>> elements = (1, 0, 0, 0, 1, 0, 0, 0, 1);
251
- }
252
- attribute :>> translationVector {
253
- attribute :>> elements = (0, 0, 0);
254
- }
255
- }
256
-
257
- attribute nullTransformation : NullTransformation [1];
258
-
259
- abstract attribute def MeasurementUnit :> ScalarMeasurementReference {
260
- doc
261
- /*
262
- * Representation of a measurement unit.
263
- *
264
- * Note: MeasurementUnit directly specializes ScalarMeasurementReference in order to allow for efficient and intuitive definition of a ratio scale.
265
- *
266
- * A MeasurementUnit can be used in two ways:
267
- * 1. Directly as the mRef in a ScalarQuantityValue, which implies that the effective measurement reference is a ratio scale defined by the unit.
268
- * 2. As the unit of a MeasurementScale.
269
- *
270
- * A MeasurementUnit specifies one or more UnitPowerFactors.
271
- */
272
-
273
- attribute :>> isBound = false;
274
- attribute unitPowerFactors: UnitPowerFactor[0..*] ordered;
275
- attribute unitConversion: UnitConversion[0..1];
276
- assert constraint hasValidUnitPowerFactors : VerifyUnitPowerFactors {
277
- in unitPowerFactors = MeasurementUnit::unitPowerFactors;
278
- in quantityDimension = MeasurementUnit::quantityDimension;
279
- }
280
- }
281
-
282
-
283
- abstract attribute def SimpleUnit :> MeasurementUnit {
284
- doc
285
- /*
286
- * Representation of a measurement unit that does not depend on any other measurement unit.
287
- */
288
-
289
- private attribute simpleUnitSelf: SimpleUnit = self;
290
- attribute :>> unitPowerFactors: UnitPowerFactor[1] {
291
- attribute unit :>> UnitPowerFactor::unit = simpleUnitSelf;
292
- attribute exponent :>> UnitPowerFactor::exponent = 1;
293
- }
294
- }
295
-
296
-
297
- abstract attribute def DerivedUnit :> MeasurementUnit {
298
- doc
299
- /*
300
- * Representation of a derived measurement unit that depends on one or more powers of other measurement units.
301
- *
302
- * VIM defines "derived unit" as "measurement unit for a derived quantity", see https://jcgm.bipm.org/vim/en/1.11.html .
303
- */
304
- }
305
-
306
-
307
- attribute def UnitPowerFactor {
308
- doc
309
- /*
310
- * Representation of a measurement unit power factor, which is a tuple
311
- * of a referenced measurement unit and an exponent.
312
- */
313
-
314
- attribute unit: MeasurementUnit;
315
- attribute exponent: Real;
316
- }
317
-
318
- abstract attribute def UnitConversion {
319
- doc
320
- /*
321
- * Representation of the linear conversion relationship between one measurement unit and another measurement unit, that acts as a reference.
322
- *
323
- * Attribute isExact asserts whether the conversionFactor is exact or not. By default it is set true.
324
- */
325
-
326
- attribute referenceUnit: MeasurementUnit;
327
- attribute conversionFactor: Real;
328
- attribute isExact: Boolean default true;
329
- }
330
-
331
- attribute def ConversionByConvention :> UnitConversion {
332
- doc
333
- /*
334
- * Representation of a UnitConversion that is defined according to some convention.
335
- */
336
- }
337
-
338
- attribute def ConversionByPrefix :> UnitConversion {
339
- doc
340
- /*
341
- * Representation of a UnitConversion that is defined through reference to a named unit prefix,
342
- * that in turn represents a decimal or binary multiple or sub-multiple, as defined in ISO/IEC 80000-1.
343
- *
344
- * Note: The actual value of the conversion factor is derived from the definition of the unit prefix.
345
- *
346
- * Examples: kilometre for conversion factor 1000 with reference unit metre, nanofarad for 1E-9 farad.
347
- */
348
-
349
- attribute prefix: UnitPrefix[1];
350
- attribute conversionFactor redefines UnitConversion::conversionFactor = prefix.conversionFactor;
351
- }
352
-
353
- attribute def UnitPrefix {
354
- doc
355
- /*
356
- * Representation of a multiple or sub-multiple measurement unit prefix as defined in ISO/IEC 80000-1.
357
- */
358
-
359
- attribute longName: String;
360
- attribute symbol: String;
361
- attribute conversionFactor: Real;
362
- }
363
-
364
-
365
- abstract attribute def MeasurementScale :> ScalarMeasurementReference {
366
- doc
367
- /*
368
- * Representation of a non-ratio measurement scale as opposed to a ratio measurement scale defined by a MeasurementUnit.
369
- *
370
- * Note: A ratio scale is implied by direct use of a MeasurementUnit as the mRef in a ScalarQuantityValue.
371
- */
372
-
373
- attribute unit: MeasurementUnit;
374
- attribute quantityValueMapping: QuantityValueMapping[0..1];
375
- }
376
-
377
- attribute def OrdinalScale :> MeasurementScale {
378
- doc
379
- /*
380
- * Representation of an ordinal measurement scale.
381
- */
382
- }
383
-
384
- attribute def IntervalScale :> MeasurementScale, CoordinateFrame {
385
- doc
386
- /*
387
- * Representation of an interval measurement scale.
388
- *
389
- * An IntervalScale is also a CoordinateFrame
390
- * The offset of one interval measurement scale w.r.t. another interval or ratio scale is defined through a quantityValueMapping, see MeasurementReference.
391
- */
392
-
393
- attribute :>> isBound = true;
394
- }
395
-
396
- attribute def CyclicRatioScale :> MeasurementScale {
397
- doc
398
- /*
399
- * Representation of a ratio measurement scale with a periodic cycle.
400
- *
401
- * Note: The magnitude of the periodic cycle is defined by the modulus of the scale.
402
- * Example: Planar angle with modulus 360 degrees, therefore on such a cyclic ratio scale,
403
- * an angle of 450 degrees is equivalent to an angle of 90 degrees, and -60 degrees is equivalent to 300 degrees.
404
- */
405
-
406
- attribute modulus: Number;
407
- }
408
-
409
- attribute def LogarithmicScale :> MeasurementScale {
410
- doc
411
- /*
412
- * Representation of a logarithmic measurement scale
413
- *
414
- * The magnitude v of a ratio quantity value expressed on a logarithmic scale
415
- * for a magnitude x of a quantity value expressed on a ratio scale is computed as follows:
416
- * v = f * log_base( (x / x_ref )^a )
417
- * where:
418
- * f is a multiplication factor,
419
- * log_base is the log function for the given logarithm base,
420
- * x is the actual quantity,
421
- * x_ref is a reference quantity,
422
- * a is an exponent.
423
- */
424
-
425
- attribute logarithmBase: Number;
426
- attribute factor: Number;
427
- attribute exponent: Number;
428
- attribute referenceQuantity: ScalarQuantityValue[0..1];
429
- }
430
-
431
- attribute def QuantityValueMapping {
432
- doc
433
- /*
434
- * Representation of the mapping of equivalent quantity values expressed on two different MeasurementReferences
435
- *
436
- * A QuantityValueMapping specifies a mapping from a given mappedQuantityValue owned by the MeasurementReference
437
- * that owns the QuantityValueMapping to a referenceQuantityValue owned by another MeasurementReference.
438
- *
439
- * Example: The mapping between the temperature value of 0.01 degree Celsius on the celsius temperature scale
440
- * to the equivalent temperature value of 273.16 K on the kelvin temperature scale,
441
- * would specify a mappedQuantityValue referencing the
442
- * the DefinitionalQuantityValue (0.01, "absolute thermodynamic temperature of the triple point of water")
443
- * of the celsius interval scale, and a referenceQuantityValue referencing the
444
- * DefinitionalQuantityValue (273.16, "absolute thermodynamic temperature of the triple point of water")
445
- * of the kelvin ratio scale.
446
- */
447
-
448
- attribute mappedQuantityValue: DefinitionalQuantityValue;
449
- attribute referenceQuantityValue: DefinitionalQuantityValue;
450
- }
451
-
452
- attribute def DefinitionalQuantityValue {
453
- doc
454
- /*
455
- * Representation of a particular quantity value that is used in the definition of a TensorMeasurementReference
456
- *
457
- * Typically such a particular value is defined by convention. It can be used to define a selected reference value,
458
- * such as the meaning of zero on a measurement scale or the origin of a top-level coordinate frame.
459
- *
460
- * Example: The 'kelvin' MeasurementReference for thermodynamic temperature could have a
461
- * DefinitionalQuantityValue {
462
- * :>> num = 273.16;
463
- * :>> definition = "thermodynamic temperature of the triple point of Vienna Standard Mean Ocean Water in kelvin";
464
- * }
465
- * that is value of the definition of the scale.
466
- */
467
-
468
- attribute num: Number[1..*];
469
- attribute definition: String;
470
- }
471
-
472
- attribute def DimensionOneUnit :> DerivedUnit {
473
- doc
474
- /*
475
- * Explicit definition of "unit of dimension one", also known as "dimensionless unit".
476
- */
477
-
478
- attribute :>> unitPowerFactors = ();
479
- }
480
- attribute def DimensionOneValue :> ScalarQuantityValue {
481
- doc
482
- /*
483
- * A ScalarQuantityValue with a DimensionOneUnit.
484
- */
485
- attribute :>> num: Real;
486
- attribute :>> mRef: DimensionOneUnit;
487
- }
488
- attribute dimensionOneQuantities : DimensionOneValue[*] nonunique :> scalarQuantities;
489
-
490
- attribute one : DimensionOneUnit[1] = new DimensionOneUnit();
491
-
492
- attribute def CountValue :> DimensionOneValue {
493
- doc
494
- /*
495
- * Explicit definition of a generic "count" quantity as a DimensionOneValue.
496
- */
497
- }
498
- attribute countQuantities : CountValue[*] nonunique :> dimensionOneQuantities;
499
-
500
- attribute def SystemOfUnits {
501
- doc
502
- /*
503
- * A SystemOfUnits represents the essentials of [VIM] concept "system of units" (https://jcgm.bipm.org/vim/en/1.13.html), defined as a
504
- * "set of base units and derived units, together with their multiples and submultiples, defined in accordance with given rules,
505
- * for a given system of quantities".
506
- * The base units are a particular selection of measurement units for each of the base quantities of a system of quantities,
507
- * that form the basis on top of which all other (derived) units are defined.
508
- *
509
- * Attribute systemOfQuantities speficies the associated SystemOfQuantities.
510
- */
511
-
512
- attribute longName: String[1];
513
- attribute systemOfQuantities : SystemOfQuantities[1];
514
- attribute baseUnits: SimpleUnit[1..*] ordered;
515
- }
516
-
517
- constraint def VerifyUnitPowerFactors {
518
- doc
519
- /*
520
- * Constraint definition to verify that the given unit power factors comply with the required quantity dimension
521
- */
522
-
523
- in unitPowerFactors: UnitPowerFactor[*] ordered;
524
- in quantityDimension: QuantityDimension[1];
525
- }
526
- }
1
+ standard library package MeasurementReferences {
2
+ doc
3
+ /*
4
+ * This package defines the representations for measurement references.
5
+ */
6
+
7
+ private import Collections::Array;
8
+ private import Collections::List;
9
+ private import ScalarValues::*;
10
+ private import VectorValues::ThreeVectorValue;
11
+
12
+ private import SequenceFunctions::size;
13
+ private import SequenceFunctions::equals;
14
+ private import ControlFunctions::forAll;
15
+ private import Quantities::QuantityDimension;
16
+ private import Quantities::VectorQuantityValue;
17
+ private import Quantities::scalarQuantities;
18
+ private import Quantities::ScalarQuantityValue;
19
+ private import Quantities::SystemOfQuantities;
20
+ private import ISQSpaceTime::angularMeasure;
21
+
22
+ attribute def TensorMeasurementReference :> Array {
23
+ doc
24
+ /*
25
+ * TensorMeasurementReference is the most general AttributeDefinition to represent measurement references.
26
+ *
27
+ * The concept "measurement reference" is defined in [VIM] "quantity" NOTE 2 as "A reference can be a measurement unit,
28
+ * a measurement procedure, a reference material, or a combination of such.", see https://jcgm.bipm.org/vim/en/1.1.html .
29
+ * In addition [VIM] "quantity" NOTE 5 states that "A quantity as defined here is a scalar. However, a vector or a tensor,
30
+ * the components of which are quantities, is also considered to be a quantity". However, the rest of [VIM] does not explicitly
31
+ * define how tensor and vector quantities can be or should be supported.
32
+ *
33
+ * In this package, in line with TensorQuantityValue in package Quantities, the most general kind of measurement reference
34
+ * is TensorMeasurementReference that represents a measurement reference for any order of tensor quantity. Since the order can
35
+ * also be one or zero, this includes vector and scalar quantities. The specializations VectorMeasurementReference and
36
+ * ScalarMeasurementReference are defined to specifically represent measurement references for vector and scalar quantities.
37
+ *
38
+ * TensorMeasurementReference specializes Array, which provides its multi-dimensional structure. The order of a tensor is equivalent
39
+ * to the rank of an Array.
40
+ *
41
+ * Attribute isBound specifies whether the vector space product is bound (isBound is true) or free (isBound is false).
42
+ *
43
+ * Attribute mRefs specifies the scalar measurement references for all dimensions of a tensor quantity.
44
+ *
45
+ * The short name of a TensorMeasurementReference is the unique symbol by which the measurement reference is known.
46
+ * The name of a TensorMeasurementReference is spelled-out human readable name of the measurement reference.
47
+ *
48
+ * For example, typical measurement references for (scalar) quantity speed are declared with the following humanId and name:
49
+ * <'m/s'> and 'metre per second',
50
+ * <'km/h'> and 'kilometre per hour',
51
+ * <'mi/h'> and 'mile per hour'.
52
+ *
53
+ * A measurement reference can have zero or more definitionalQuantityValues that allow to specify
54
+ * quantity values that carry a particular meaning or relevance for the measurement reference.
55
+ */
56
+
57
+ attribute isBound: Boolean[1] default false;
58
+ attribute order :>> rank;
59
+ attribute mRefs: ScalarMeasurementReference[1..*] nonunique :>> elements;
60
+ attribute definitionalQuantityValues: DefinitionalQuantityValue[0..*];
61
+ }
62
+
63
+ attribute def VectorMeasurementReference :> TensorMeasurementReference {
64
+ doc
65
+ /*
66
+ * A VectorMeasurementReference is a specialization of TensorMeasurementReference for vector quantities that are
67
+ * typed by a VectorQuantityValue. Its order is one. Implicitly, it defines a vector space of dimension `n` = dimensions[1].
68
+ * The magnitudes of the `n` basis unit vectors that span the vector space are defined by the mRefs which each are
69
+ * a ScalarMeasurementReference, typically a MeasurementUnit or an IntervalScale.
70
+ *
71
+ * Attribute isOrthogonal declares whether the basis vectors of the vector space are orthogonal, i.e., whether all
72
+ * inner products of any pair of basis vectors are equal to zero.
73
+ *
74
+ * A pair of a specialization of VectorQuantityValue and a specialization of VectorMeasurementReference can also be used to
75
+ * define a vector space for state vectors as used in state-space representation models.
76
+ */
77
+
78
+ attribute :>> dimensions: Positive[0..1];
79
+ attribute isOrthogonal: Boolean[1] default true;
80
+ }
81
+
82
+ abstract attribute def ScalarMeasurementReference :> VectorMeasurementReference {
83
+ doc
84
+ /*
85
+ * A ScalarMeasurementReference is a specialization of VectorMeasurementReference for scalar quantities
86
+ * that are typed by a ScalarQuantityValue and for components of tensor or vector quantities.
87
+ * Its order is zero. A ScalarMeasurementReference is also a generalization of MeasurementUnit and MeasurementScale.
88
+ * It establishes how to interpret the numerical value (num) of a ScalarQuantityValue or a component of
89
+ * a tensor or vector quantity value, and establishes its actual quantity dimension.
90
+ *
91
+ * Attribute mRefs is bound to self for a ScalarMeasurementReference, for consistency with tensor and vector measurement references,
92
+ * as the dimension or component of a scalar quantity is itself.
93
+ */
94
+
95
+ attribute :>> dimensions = ();
96
+ attribute :>> isOrthogonal = true;
97
+ attribute :>> mRefs = self;
98
+ attribute quantityDimension: QuantityDimension[1];
99
+ }
100
+
101
+ attribute def CoordinateFrame :> VectorMeasurementReference {
102
+ doc
103
+ /*
104
+ * CoordinateFrame is a VectorMeasurementReference with the specific purpose to quantify (i.e., coordinatize) a vector space,
105
+ * and locate and orient it with respect to another CoordinateFrame.
106
+ *
107
+ * Optional attribute transformation enables specification of the location and orientation of this CoordinateFrame as dependent
108
+ * and nested with respect to another (reference) coordinate frame. Typically the other CoordinateFrame is the frame of
109
+ * the next higher element (Object, Item or Part) in a composite structure.
110
+ */
111
+
112
+ attribute transformation: CoordinateTransformation[0..1] {
113
+ attribute :>> target = that;
114
+ }
115
+ }
116
+
117
+ attribute def '3dCoordinateFrame' :> CoordinateFrame {
118
+ doc
119
+ /*
120
+ * Most general 3-dimensional coordinate frame
121
+ */
122
+ attribute :>> dimensions = 3;
123
+ }
124
+ alias ThreeDCoordinateFrame for '3dCoordinateFrame';
125
+
126
+ abstract attribute def CoordinateTransformation {
127
+ doc
128
+ /*
129
+ * CoordinateTransformation is the most general representation of the transformation of a target VectorMeasurementReference
130
+ * with respect to a source VectorMeasurementReference.
131
+ */
132
+ attribute source: VectorMeasurementReference[1];
133
+ attribute target: VectorMeasurementReference[1];
134
+ assert constraint validSourceTargetDimensions { source.dimensions == target.dimensions }
135
+ }
136
+
137
+ attribute def CoordinateFramePlacement :> CoordinateTransformation {
138
+ doc
139
+ /*
140
+ * CoordinateFramePlacement is a CoordinateTransformation by placement of the target frame in the source frame.
141
+ *
142
+ * Attribute origin specifies the location of the origin of the target frame as a vector in the source frame.
143
+ *
144
+ * Attribute basisDirections specifies the orientation of the target frame by specifying the directions of
145
+ * the respective basis vectors of the target frame via direction vectors in the source frame. An empty sequence of
146
+ * basisDirections signifies no change of orientation of the target coordinate frame.
147
+ */
148
+
149
+ attribute origin : VectorQuantityValue[1];
150
+ attribute basisDirections : VectorQuantityValue[0..*] ordered nonunique;
151
+ assert constraint validOriginDimensions { origin.dimensions == source.dimensions }
152
+ assert constraint { size(basisDirections) == 0 or size(basisDirections) == source.dimensions#(1)}
153
+ assert constraint validateBasisDirections { basisDirections->forAll { in basisDirection : VectorQuantityValue;
154
+ basisDirection.dimensions->equals(source.dimensions) }
155
+ }
156
+ }
157
+
158
+ abstract attribute def TranslationOrRotation {
159
+ doc
160
+ /*
161
+ * TranslationOrRotation is an abstract union of Translation and Rotation
162
+ */
163
+ }
164
+
165
+ attribute def Translation :> TranslationOrRotation {
166
+ doc
167
+ /*
168
+ * Representation of a translation with respect to a coordinate frame
169
+ *
170
+ * Attribute translationVector specifies the displacement vector that constitutes the translation.
171
+ */
172
+
173
+ attribute translationVector : VectorQuantityValue[1];
174
+ }
175
+
176
+ attribute def Rotation :> TranslationOrRotation {
177
+ doc
178
+ /*
179
+ * Representation of a rotation about an axis over an angle
180
+ *
181
+ * Attribute axisDirection specifies the direction of the rotation axis.
182
+ * Attribute angle specifies the angle of rotation, where a positive value implies right-handed rotation.
183
+ * Attribute isIntrinsic asserts whether the intermediate coordinate frame moves with the rotation or not,
184
+ * i.e. whether an instrinsic or extrinsic rotation is specified.
185
+ *
186
+ * See https://en.wikipedia.org/wiki/Davenport_chained_rotations for details.
187
+ */
188
+
189
+ attribute axisDirection : VectorQuantityValue[1];
190
+ attribute angle :>> angularMeasure;
191
+ attribute isIntrinsic : Boolean[1] default true;
192
+ }
193
+
194
+ attribute def TranslationRotationSequence :> CoordinateTransformation, List {
195
+ doc
196
+ /*
197
+ * Coordinate frame transformation specified by a sequence of translations and/or rotations
198
+ *
199
+ * Note: This is a coordinate transformation that is convenient for interpretation by humans.
200
+ * In particular a sequence of rotations about the principal axes of a coordinate frame is much more easy understandable
201
+ * than a rotation about an arbitrary axis.
202
+ * Any sequence can be reduced to a single combination of a translation and a rotation about a particular axis, but in general
203
+ * the original sequence cannot be retrieved as there are infinitely many sequences representing the reduced transformation.
204
+ */
205
+
206
+ attribute :>> elements : TranslationOrRotation[1..*] ordered nonunique;
207
+ }
208
+
209
+ attribute def AffineTransformationMatrix3d :> CoordinateTransformation, Array {
210
+ doc
211
+ /*
212
+ * AffineTransformationMatrix3d is a three dimensional CoordinateTransformation specified via an affine transformation matrix
213
+ *
214
+ * The interpretation of the matrix is as follows:
215
+ * - the upper left 3x3 matrix represents the rotation matrix
216
+ * - the uper right 3x1 column vector represents the translation vector
217
+ * - the bottom row must be the row vector (0, 0, 0, 1).
218
+ *
219
+ * I.e. the matrix has the following form:
220
+ * ( R, R, R, T,
221
+ * R, R, R, T,
222
+ * R, R, R, T,
223
+ * 0, 0, 0, 1 )
224
+ * where the cells marked R form the rotation matrix and the cells marked T form the translation vector.
225
+ *
226
+ * Note: See https://en.wikipedia.org/wiki/Transformation_matrix, under affine transformations for a general explanation.
227
+ */
228
+
229
+ attribute rotationMatrix : Array {
230
+ attribute :>> elements : Real[9] ordered nonunique;
231
+ attribute :>> dimensions = (3, 3);
232
+ }
233
+ attribute translationVector : ThreeVectorValue[1] { :>> elements : Real[3]; }
234
+ attribute :>> dimensions = (4, 4);
235
+ attribute :>> elements : Real[16] ordered nonunique = (
236
+ rotationMatrix.elements#(1), rotationMatrix.elements#(2), rotationMatrix.elements#(3), translationVector#(1),
237
+ rotationMatrix.elements#(4), rotationMatrix.elements#(5), rotationMatrix.elements#(6), translationVector#(2),
238
+ rotationMatrix.elements#(7), rotationMatrix.elements#(8), rotationMatrix.elements#(9), translationVector#(3),
239
+ 0, 0, 0, 1);
240
+ assert constraint validSourceDimensions { source.dimensions == 3 }
241
+ }
242
+
243
+ attribute def NullTransformation :> AffineTransformationMatrix3d {
244
+ doc
245
+ /*
246
+ * NullTransformation is a three dimensional CoordinateTransformation that places the target CoordinateFrame at the
247
+ * same position and orientation as the source CoordinateFrame.
248
+ */
249
+ attribute :>> rotationMatrix {
250
+ attribute :>> elements = (1, 0, 0, 0, 1, 0, 0, 0, 1);
251
+ }
252
+ attribute :>> translationVector {
253
+ attribute :>> elements = (0, 0, 0);
254
+ }
255
+ }
256
+
257
+ attribute nullTransformation : NullTransformation [1];
258
+
259
+ abstract attribute def MeasurementUnit :> ScalarMeasurementReference {
260
+ doc
261
+ /*
262
+ * Representation of a measurement unit.
263
+ *
264
+ * Note: MeasurementUnit directly specializes ScalarMeasurementReference in order to allow for efficient and intuitive definition of a ratio scale.
265
+ *
266
+ * A MeasurementUnit can be used in two ways:
267
+ * 1. Directly as the mRef in a ScalarQuantityValue, which implies that the effective measurement reference is a ratio scale defined by the unit.
268
+ * 2. As the unit of a MeasurementScale.
269
+ *
270
+ * A MeasurementUnit specifies one or more UnitPowerFactors.
271
+ */
272
+
273
+ attribute :>> isBound = false;
274
+ attribute unitPowerFactors: UnitPowerFactor[0..*] ordered;
275
+ attribute unitConversion: UnitConversion[0..1];
276
+ assert constraint hasValidUnitPowerFactors : VerifyUnitPowerFactors {
277
+ in unitPowerFactors = MeasurementUnit::unitPowerFactors;
278
+ in quantityDimension = MeasurementUnit::quantityDimension;
279
+ }
280
+ }
281
+
282
+
283
+ abstract attribute def SimpleUnit :> MeasurementUnit {
284
+ doc
285
+ /*
286
+ * Representation of a measurement unit that does not depend on any other measurement unit.
287
+ */
288
+
289
+ private attribute simpleUnitSelf: SimpleUnit = self;
290
+ attribute :>> unitPowerFactors: UnitPowerFactor[1] {
291
+ attribute unit :>> UnitPowerFactor::unit = simpleUnitSelf;
292
+ attribute exponent :>> UnitPowerFactor::exponent = 1;
293
+ }
294
+ }
295
+
296
+
297
+ abstract attribute def DerivedUnit :> MeasurementUnit {
298
+ doc
299
+ /*
300
+ * Representation of a derived measurement unit that depends on one or more powers of other measurement units.
301
+ *
302
+ * VIM defines "derived unit" as "measurement unit for a derived quantity", see https://jcgm.bipm.org/vim/en/1.11.html .
303
+ */
304
+ }
305
+
306
+
307
+ attribute def UnitPowerFactor {
308
+ doc
309
+ /*
310
+ * Representation of a measurement unit power factor, which is a tuple
311
+ * of a referenced measurement unit and an exponent.
312
+ */
313
+
314
+ attribute unit: MeasurementUnit;
315
+ attribute exponent: Real;
316
+ }
317
+
318
+ abstract attribute def UnitConversion {
319
+ doc
320
+ /*
321
+ * Representation of the linear conversion relationship between one measurement unit and another measurement unit, that acts as a reference.
322
+ *
323
+ * Attribute isExact asserts whether the conversionFactor is exact or not. By default it is set true.
324
+ */
325
+
326
+ attribute referenceUnit: MeasurementUnit;
327
+ attribute conversionFactor: Real;
328
+ attribute isExact: Boolean default true;
329
+ }
330
+
331
+ attribute def ConversionByConvention :> UnitConversion {
332
+ doc
333
+ /*
334
+ * Representation of a UnitConversion that is defined according to some convention.
335
+ */
336
+ }
337
+
338
+ attribute def ConversionByPrefix :> UnitConversion {
339
+ doc
340
+ /*
341
+ * Representation of a UnitConversion that is defined through reference to a named unit prefix,
342
+ * that in turn represents a decimal or binary multiple or sub-multiple, as defined in ISO/IEC 80000-1.
343
+ *
344
+ * Note: The actual value of the conversion factor is derived from the definition of the unit prefix.
345
+ *
346
+ * Examples: kilometre for conversion factor 1000 with reference unit metre, nanofarad for 1E-9 farad.
347
+ */
348
+
349
+ attribute prefix: UnitPrefix[1];
350
+ attribute conversionFactor redefines UnitConversion::conversionFactor = prefix.conversionFactor;
351
+ }
352
+
353
+ attribute def UnitPrefix {
354
+ doc
355
+ /*
356
+ * Representation of a multiple or sub-multiple measurement unit prefix as defined in ISO/IEC 80000-1.
357
+ */
358
+
359
+ attribute longName: String;
360
+ attribute symbol: String;
361
+ attribute conversionFactor: Real;
362
+ }
363
+
364
+
365
+ abstract attribute def MeasurementScale :> ScalarMeasurementReference {
366
+ doc
367
+ /*
368
+ * Representation of a non-ratio measurement scale as opposed to a ratio measurement scale defined by a MeasurementUnit.
369
+ *
370
+ * Note: A ratio scale is implied by direct use of a MeasurementUnit as the mRef in a ScalarQuantityValue.
371
+ */
372
+
373
+ attribute unit: MeasurementUnit;
374
+ attribute quantityValueMapping: QuantityValueMapping[0..1];
375
+ }
376
+
377
+ attribute def OrdinalScale :> MeasurementScale {
378
+ doc
379
+ /*
380
+ * Representation of an ordinal measurement scale.
381
+ */
382
+ }
383
+
384
+ attribute def IntervalScale :> MeasurementScale, CoordinateFrame {
385
+ doc
386
+ /*
387
+ * Representation of an interval measurement scale.
388
+ *
389
+ * An IntervalScale is also a CoordinateFrame
390
+ * The offset of one interval measurement scale w.r.t. another interval or ratio scale is defined through a quantityValueMapping, see MeasurementReference.
391
+ */
392
+
393
+ attribute :>> isBound = true;
394
+ }
395
+
396
+ attribute def CyclicRatioScale :> MeasurementScale {
397
+ doc
398
+ /*
399
+ * Representation of a ratio measurement scale with a periodic cycle.
400
+ *
401
+ * Note: The magnitude of the periodic cycle is defined by the modulus of the scale.
402
+ * Example: Planar angle with modulus 360 degrees, therefore on such a cyclic ratio scale,
403
+ * an angle of 450 degrees is equivalent to an angle of 90 degrees, and -60 degrees is equivalent to 300 degrees.
404
+ */
405
+
406
+ attribute modulus: Number;
407
+ }
408
+
409
+ attribute def LogarithmicScale :> MeasurementScale {
410
+ doc
411
+ /*
412
+ * Representation of a logarithmic measurement scale
413
+ *
414
+ * The magnitude v of a ratio quantity value expressed on a logarithmic scale
415
+ * for a magnitude x of a quantity value expressed on a ratio scale is computed as follows:
416
+ * v = f * log_base( (x / x_ref )^a )
417
+ * where:
418
+ * f is a multiplication factor,
419
+ * log_base is the log function for the given logarithm base,
420
+ * x is the actual quantity,
421
+ * x_ref is a reference quantity,
422
+ * a is an exponent.
423
+ */
424
+
425
+ attribute logarithmBase: Number;
426
+ attribute factor: Number;
427
+ attribute exponent: Number;
428
+ attribute referenceQuantity: ScalarQuantityValue[0..1];
429
+ }
430
+
431
+ attribute def QuantityValueMapping {
432
+ doc
433
+ /*
434
+ * Representation of the mapping of equivalent quantity values expressed on two different MeasurementReferences
435
+ *
436
+ * A QuantityValueMapping specifies a mapping from a given mappedQuantityValue owned by the MeasurementReference
437
+ * that owns the QuantityValueMapping to a referenceQuantityValue owned by another MeasurementReference.
438
+ *
439
+ * Example: The mapping between the temperature value of 0.01 degree Celsius on the celsius temperature scale
440
+ * to the equivalent temperature value of 273.16 K on the kelvin temperature scale,
441
+ * would specify a mappedQuantityValue referencing the
442
+ * the DefinitionalQuantityValue (0.01, "absolute thermodynamic temperature of the triple point of water")
443
+ * of the celsius interval scale, and a referenceQuantityValue referencing the
444
+ * DefinitionalQuantityValue (273.16, "absolute thermodynamic temperature of the triple point of water")
445
+ * of the kelvin ratio scale.
446
+ */
447
+
448
+ attribute mappedQuantityValue: DefinitionalQuantityValue;
449
+ attribute referenceQuantityValue: DefinitionalQuantityValue;
450
+ }
451
+
452
+ attribute def DefinitionalQuantityValue {
453
+ doc
454
+ /*
455
+ * Representation of a particular quantity value that is used in the definition of a TensorMeasurementReference
456
+ *
457
+ * Typically such a particular value is defined by convention. It can be used to define a selected reference value,
458
+ * such as the meaning of zero on a measurement scale or the origin of a top-level coordinate frame.
459
+ *
460
+ * Example: The 'kelvin' MeasurementReference for thermodynamic temperature could have a
461
+ * DefinitionalQuantityValue {
462
+ * :>> num = 273.16;
463
+ * :>> definition = "thermodynamic temperature of the triple point of Vienna Standard Mean Ocean Water in kelvin";
464
+ * }
465
+ * that is value of the definition of the scale.
466
+ */
467
+
468
+ attribute num: Number[1..*];
469
+ attribute definition: String;
470
+ }
471
+
472
+ attribute def DimensionOneUnit :> DerivedUnit {
473
+ doc
474
+ /*
475
+ * Explicit definition of "unit of dimension one", also known as "dimensionless unit".
476
+ */
477
+
478
+ attribute :>> unitPowerFactors = ();
479
+ }
480
+ attribute def DimensionOneValue :> ScalarQuantityValue {
481
+ doc
482
+ /*
483
+ * A ScalarQuantityValue with a DimensionOneUnit.
484
+ */
485
+ attribute :>> num: Real;
486
+ attribute :>> mRef: DimensionOneUnit;
487
+ }
488
+ attribute dimensionOneQuantities : DimensionOneValue[*] nonunique :> scalarQuantities;
489
+
490
+ attribute one : DimensionOneUnit[1] = new DimensionOneUnit();
491
+
492
+ attribute def CountValue :> DimensionOneValue {
493
+ doc
494
+ /*
495
+ * Explicit definition of a generic "count" quantity as a DimensionOneValue.
496
+ */
497
+ }
498
+ attribute countQuantities : CountValue[*] nonunique :> dimensionOneQuantities;
499
+
500
+ attribute def SystemOfUnits {
501
+ doc
502
+ /*
503
+ * A SystemOfUnits represents the essentials of [VIM] concept "system of units" (https://jcgm.bipm.org/vim/en/1.13.html), defined as a
504
+ * "set of base units and derived units, together with their multiples and submultiples, defined in accordance with given rules,
505
+ * for a given system of quantities".
506
+ * The base units are a particular selection of measurement units for each of the base quantities of a system of quantities,
507
+ * that form the basis on top of which all other (derived) units are defined.
508
+ *
509
+ * Attribute systemOfQuantities speficies the associated SystemOfQuantities.
510
+ */
511
+
512
+ attribute longName: String[1];
513
+ attribute systemOfQuantities : SystemOfQuantities[1];
514
+ attribute baseUnits: SimpleUnit[1..*] ordered;
515
+ }
516
+
517
+ constraint def VerifyUnitPowerFactors {
518
+ doc
519
+ /*
520
+ * Constraint definition to verify that the given unit power factors comply with the required quantity dimension
521
+ */
522
+
523
+ in unitPowerFactors: UnitPowerFactor[*] ordered;
524
+ in quantityDimension: QuantityDimension[1];
525
+ }
526
+ }