xsd-d-si issueshttps://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues2024-03-28T10:10:34Zhttps://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/51Precision of tothe exponents for rounding| is 0.3333 1/3 ? Is 0.333252 1/3 As...2024-03-28T10:10:34ZBenediktPrecision of tothe exponents for rounding| is 0.3333 1/3 ? Is 0.333252 1/3 As wellSometimes we have units with rational exponents $$\mathrm{unit}^\frac{c}{d}~~{ c,d\in \N} $$
like $$\mathrm{unit}^{\frac{1}{3}}\Longrightarrow \sqrt[3]{\mathrm{Unit}}$$
But in the dsi we don't save `\tothe{1/3}` but instead `\tothe{0.33...Sometimes we have units with rational exponents $$\mathrm{unit}^\frac{c}{d}~~{ c,d\in \N} $$
like $$\mathrm{unit}^{\frac{1}{3}}\Longrightarrow \sqrt[3]{\mathrm{Unit}}$$
But in the dsi we don't save `\tothe{1/3}` but instead `\tothe{0.33333333333333333333}` or `\tothe{0.3333}`
Leading to my Question:
How extract ratios from this numbers.
Is `\tothe{0.3333}`
$$\mathrm{unit}^\frac{3333}{10000} \Longrightarrow \sqrt[3333]{\mathrm{Unit}^{10000}}$$
Or can i reduce it to
$$\mathrm{unit}^\frac{1}{3} \Longrightarrow \sqrt[3]{\mathrm{Unit}}$$
To reduce the rationals various libraries are available, like shown in the ChatGTP answer below.
Common for all the libraries is that they can use a maximal denominator like 1000 or a number of digits 3 in this case to decide when to reduce the integer ratio.
In our example a maximal denominator of 1000 would convert 0.3333 to 1/3
and a denominator of 10000 would lead to 3333/10000
At the moment the maximum denominator is undefined so either i have to make arbitrary assumptions about the precision or beeing unable to correctly process $$\mathrm{unit}^\frac{1}{3}$$
# Sugestion
Is suggest limiting the precision to 4 digits.
In everyday use units with rational exponents are not super common and if they occur i would assume 99.99% of them being in fact someting like
$$\mathrm{unit}^\frac{c}{d}~~{ c,d\in \N} \text{ with } c,d \leq100 $$
If we limit the exponent precision to 4 digits the exponent can be properly stored in an f16 and we can reduce the fraction to get the $$c,d$$ integers to do proper calculations with them with integer math.
# Other option with braking change
An other option would be changing from decimal representation to an integer fraction representation in the `\tothe{}` like using a `|` for fractions `\tothe{1|3}` but this would be an huge braking change.
I will sugest 4 digits precison decimals to the [BIPM SI endpoint](https://github.com/TheBIPM/SI_Digital_Framework/tree/main/SI_Reference_Point/docs) aswell
## CHAT GTP Answer for ratio finding in various Languages
For dealing with the matching of floating-point numbers to their closest fractions within certain programming languages, you might not find a library that does exactly this—matching decimal approximations to fractions based on a lookup table—as it's a very specific task. However, you can leverage existing numerical or mathematical libraries to help implement such functionality. Below are some libraries and functions in C++, Python, MATLAB, Java, and JavaScript that can be useful in building a solution for this problem:
### C++
- **Boost Rational Library**: Part of the Boost libraries, the Boost Rational Library can be used to work with fractions in C++. While it doesn't provide direct matching from decimal to fraction, it allows for the creation and manipulation of fraction types, which you can use in implementing your lookup or matching logic.
- Website: [Boost Rational](https://www.boost.org/doc/libs/release/libs/rational/)
### Python
- **fractions Module**: Python's standard library includes the `fractions` module, which provides support for rational number arithmetic. You can use it to convert floating-point numbers to their closest fractional representation.
```python
from fractions import Fraction
print(Fraction(0.33333).limit_denominator())
```
### MATLAB
- **Rational Approximation**: MATLAB offers functions like `rats`, which provides a rational approximation of numbers. It displays rational approximations of the elements of a matrix, which you could use for matching purposes.
```matlab
format rat
disp(0.33333)
```
### Java
- **Apache Commons Math**: The Apache Commons Math library provides many mathematical and statistical tools that can be used in Java applications. While it doesn't offer a direct method for matching decimals to fractions, its utilities can assist in implementing such functionality.
- Website: [Apache Commons Math](https://commons.apache.org/proper/commons-math/)
### JavaScript
- **Fraction.js**: This is a library for fractional arithmetic in JavaScript. It can parse a floating-point number into a fraction and might be used as part of a solution for identifying close matches.
```javascript
var Fraction = require('fraction.js');
console.log(new Fraction(0.33333).toFraction(true));
```
- GitHub: [Fraction.js](https://github.com/infusion/Fraction.js)
For each of these languages, while a direct "lookup table for decimal-to-fraction based on precision" function may not exist, you can combine the provided library functionalities with custom logic to approximate this behavior. For instance, converting a decimal to its nearest fraction representation and then comparing this against a predefined set of important fractions you wish to match can achieve the desired result.Daniel HutzschenreuterDaniel Hutzschenreuterhttps://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/50Constrain <si:distributionXMLList> und <si:distribution> to Enum Values to e...2024-02-28T07:50:44ZBenediktConstrain <si:distributionXMLList> und <si:distribution> to Enum Values to ensure correct interpretationAccording to the discussion in the DKD Querschnits-Ausschuss
https://gitlab1.ptb.de/d-ptb/dcc/TCs/dcc-ua-querschnittsthemen/-/issues/54
I sugest constraining <si:distributionXMLList> und <si:distribution> to a redefined Datatype:
```xsd...According to the discussion in the DKD Querschnits-Ausschuss
https://gitlab1.ptb.de/d-ptb/dcc/TCs/dcc-ua-querschnittsthemen/-/issues/54
I sugest constraining <si:distributionXMLList> und <si:distribution> to a redefined Datatype:
```xsd
<xs:simpleType name="distributionType">
<xs:annotation>
<xs:documentation xml:lang="en">
String providing a distribution (statistical distribution of measurement values).
Only predefined distributions are allowed.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="normal"/>
<xs:enumeration value="uniform"/>
<xs:enumeration value="exponential"/>
<xs:enumeration value="gamma"/>
<xs:enumeration value="beta"/>
<xs:enumeration value="log-normal"/>
<xs:enumeration value="weibull"/>
<xs:enumeration value="chi-squared"/>
<xs:enumeration value="student-t"/>
<xs:enumeration value="f-distribution"/>
<xs:enumeration value="pareto"/>
<xs:enumeration value="cauchy"/>
<xs:enumeration value="rayleigh"/>
<xs:enumeration value="other"/>
<!-- Add additional distribution names as needed -->
</xs:restriction>
</xs:simpleType>
```
Or similar the actual included distributions needs to be discussed.
if the distribution have been discussed we could develop python /c++ what ever libraries the allow to get the PDFs and draw from this distributions in an standardized way.
To make actual use of the knowledge of the distribution.
When using str like in the [momentary implementation](https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/blob/master/SI_Format.xsd#L1423-1430)
```
<xs:simpleType name="distributionType">
<xs:annotation>
<xs:documentation xml:lang="en">
String providing a distribution (statistical distribution of measurement values).
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
```
We end with endless possible ways to express the same distribution :
```normal,Normal,gauss,Gauss,gausian,Gausian,Нормальное,```
resulting in incompatibility of any software using this Information.Daniel HutzschenreuterDaniel Hutzschenreuter2024-02-29https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/49Quantity vs Sensitivity2023-10-23T14:35:13ZDiego CoppaQuantity vs SensitivityHello, Question about what to consider a quantity and what a sensitivity. I quote VIM 3 2007:
[1.1 (1.1) quantity property of a phenomenon, body, or substance, where the property has a magnitude that can be expressed as a number and a r...Hello, Question about what to consider a quantity and what a sensitivity. I quote VIM 3 2007:
[1.1 (1.1) quantity property of a phenomenon, body, or substance, where the property has a magnitude that can be expressed as a number and a reference](https://jcgm.bipm.org/vim/en/1.1.html)
[4.12 (5.10) sensitivity of a measuring system sensitivity quotient of the change in an indication of a measuring system and the corresponding change in a value of a quantity being measured](https://jcgm.bipm.org/vim/en/4.12.html)
If the measurand is a sensitivity, for example in the vibration field. Should I consider the Quantity a sensitivity? Shouldnt there be an element for the sensitivity?
Thanks DiegoDaniel HutzschenreuterDaniel Hutzschenreuterhttps://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/48D-SI 2.2.0 ToDo Release Preparation2023-07-19T15:37:41ZDaniel HutzschenreuterD-SI 2.2.0 ToDo Release Preparation- [ ] Create missing documentation for Wiki
- [ ] Implement improvements identified by pilot applications and checks
- [ ] Check if significatnDigitXMLListType is working properly
- [ ] Semantic: Add semantically meaningful value typ...- [ ] Create missing documentation for Wiki
- [ ] Implement improvements identified by pilot applications and checks
- [ ] Check if significatnDigitXMLListType is working properly
- [ ] Semantic: Add semantically meaningful value types in complexListXMLListhttps://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/46Nachbesserungen 2.2.0-Beta2023-05-12T11:03:04ZDaniel HutzschenreuterNachbesserungen 2.2.0-BetaVerbesserungsarbeiten nach Gesprächen am 21. und 22. März mit PTB und DKD
- [x] 1) NaN: Bei Unsicherheitsangaben auch k und p, Regel: entweder alles NaN bei (u,p,k) oder keines NaN in Doku ergänzen
- [x] 2) QuantityType: Nach langer Dis...Verbesserungsarbeiten nach Gesprächen am 21. und 22. März mit PTB und DKD
- [x] 1) NaN: Bei Unsicherheitsangaben auch k und p, Regel: entweder alles NaN bei (u,p,k) oder keines NaN in Doku ergänzen
- [x] 2) QuantityType: Nach langer Diskussion verständigung auf Variante 3 (si:quantityTypeQUDT, auf Basis qudt:quantityKind)
- [x] 3) Noch prüfen, ob Vorkonstruierte Lösung für quantityType als Spezialfall allgemeine Lösung gefunden werden kann.
- [x] 4) Prüfen ob Type bei Bezeichnern uncertaintyValue
- [x] 5) Prüfen ob valueExpandedMU -> valueMUExpanded besser?
- [x] 6) Verbesserung si:distribution Auslegung: Sollte spezifiziert werden. Wenn nich angegeben, dann keine Annahme Normalverteilung als Default, sondern Dokumentation, dass Verteilung dann nicht bekannt.
- [x] 7) Signifikante Stellen: Element ok, aber noch Null Wert aussschließen
- [x] 8) Signifikante Stellen: Nochmal DKD-L 13-1 (DIN 1333), ISO 80000 und ISO/IEC2382:2025(en) auf bessere Definition prüfen.
- [x] 9) B. Seeger könnte Beispiel für richtiges Runden und Verarbeiten Daten in Python beisteuern.
- [x] 10) Bezeichnung CoverageInterval behalten und nicht nur Interval
- [x] 11) Klammer Element "measurementUncertaintyUnivariate" um neu Unsicherheiten in si:real und wo relevant einfügen.https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/45Feature: Dokumentation k Value Anpassen2023-04-05T09:20:50ZDaniel HutzschenreuterFeature: Dokumentation k Value Anpassenhttps://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/44Feature: Improved element names for uncertainty (100%)2023-05-12T08:01:04ZDaniel HutzschenreuterFeature: Improved element names for uncertainty (100%)2023-03-31https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/43XSD: Cleaning up XSD (100%)2023-05-12T08:00:56ZDaniel HutzschenreuterXSD: Cleaning up XSD (100%)2023-03-31https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/42Feature: Operator /per for division of units2023-07-28T08:37:17ZDaniel HutzschenreuterFeature: Operator /per for division of units2023-03-31https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/41Feature: standard uncertainty (100%)2023-05-12T08:01:01ZDaniel HutzschenreuterFeature: standard uncertainty (100%)2023-03-31https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/40Feature: XML List Complex (100%)2023-05-12T08:00:58ZDaniel HutzschenreuterFeature: XML List Complex (100%)2023-03-31https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/39Feature: Value NaN (100%)2023-03-22T14:48:37ZDaniel HutzschenreuterFeature: Value NaN (100%)Daniel HutzschenreuterDaniel Hutzschenreuter2023-03-31https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/38Feature: Significant Digits (100%)2023-05-12T08:00:59ZDaniel HutzschenreuterFeature: Significant Digits (100%)Daniel HutzschenreuterDaniel Hutzschenreuter2023-03-31https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/37D-SI 2.2.0 Beta Übersicht2023-03-22T15:06:41ZDaniel HutzschenreuterD-SI 2.2.0 Beta ÜbersichtDaniel HutzschenreuterDaniel Hutzschenreuter2023-03-31https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/36Computable formula2023-04-12T10:24:47ZHugo Gasca AragonComputable formulaIs DCC intended to be machine actionable? I am exploring a way to deliver an actionable-computable formula/function. However, I do not find it in the current version. I indeed found the dcc:formula inside the dcc:noQuantity node, but thi...Is DCC intended to be machine actionable? I am exploring a way to deliver an actionable-computable formula/function. However, I do not find it in the current version. I indeed found the dcc:formula inside the dcc:noQuantity node, but this is for displaying purposes only. I also explored the alternative of dataBase64 for a programming language (Python, R, js) code defining the formula/function, this works fine. Any suggestion?https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/35D-SI Update quantityType (100%)2023-05-12T08:01:03ZDaniel HutzschenreuterD-SI Update quantityType (100%)We like to add a new element to the D-SI metadata model that can provide information on the kind of quantity (such as length, mass, temperature, etc.).
Comming up:
- new feature si:quantityType in XSD in development branch
- some docume...We like to add a new element to the D-SI metadata model that can provide information on the kind of quantity (such as length, mass, temperature, etc.).
Comming up:
- new feature si:quantityType in XSD in development branch
- some documentation of the si:quantityType in this issueD-SI-XSD-v2.2.0Wafa El jaouaWafa El jaoua2023-03-31https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/34Clean up whitespaces2022-06-28T07:24:25ZMichael WollensackClean up whitespacesWhitespaces should be cleaned up. There is a mixture of spaces and tabs. The indents should be improved as well.Whitespaces should be cleaned up. There is a mixture of spaces and tabs. The indents should be improved as well.https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/33Add support for uncertainty dependencies to D-SI2024-03-27T14:35:56ZMichael WollensackAdd support for uncertainty dependencies to D-SIAdd support for uncertainty dependencies to D-SI to support METAS UncLib, see www.metas.ch/unclib.
There three ways to express uncertainties:
**Standard uncertainty**, expanded uncertainty or coverage interval
This has already be don...Add support for uncertainty dependencies to D-SI to support METAS UncLib, see www.metas.ch/unclib.
There three ways to express uncertainties:
**Standard uncertainty**, expanded uncertainty or coverage interval
This has already be done, see `si:expandedUncType` and `si:coverageIntervalType`. The drawback is, that there is no way to get correlation between multiple output quantities.
**Covariance matrix**
The covariance matrix which describes the variance in diagonal and the covariance in the off-diagonal of multiple quantities.
This has already be done, see `si:covarianceMatrixType`. Now the correlation between multiple output quantities can be described, but not if they are stored in multiple XML files. E.g.: multiple masses in a mass set and each mass has it's on XML file. Or recalibration of standard after on year. There is correlation to the previous calibration which cannot be described.
**Uncertainty dependencies**
The sensitivity from the output quantity to each, in the measurement model used, input quantity times the standard uncertainty of each input quantity should be stored in a `jacobi` element of a new `si:uncDependenciesType`.
An `input` element of `si:uncDependenciesType` should describe each used input quantity. An input quantity should be described using an unique identifier (e.g.: GUID or UUID) and an optional label.
The standard uncertainty of an output quantity can be computed by summing up the square values of the `jacobi` elements and finally taking the square root of it.
The covariance matrix `C` of multiple output quantities can be computed using the following matrix equation: `C = JxJ'` where `J` is the Jacobian matrix. The row index of the Jacobian matrix is used for the different output quantities and the column index is used for the used input quantities. The Jacobian matrix is composed using the `jacobi` elements. If two or more output quantities depends on the same input ids then there will be correlation. This will work as well if the multiple output quantities are not stored in the same XML file.
The disadvantages from above, see 1. and 2., will not exist when using uncertainty dependencies.https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/32Different units for real and imaginary parts2022-04-07T05:46:15ZMichael WollensackDifferent units for real and imaginary partsIt looks like the [`complexQuantityType`](https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/blob/master/SI_Format.xsd#L436) is not supporting different units for the real and imaginary parts.
E.g.: propagation constant:
- real part in Np/m
- ...It looks like the [`complexQuantityType`](https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/blob/master/SI_Format.xsd#L436) is not supporting different units for the real and imaginary parts.
E.g.: propagation constant:
- real part in Np/m
- imaginary part in rad/mhttps://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/issues/31Relative uncertainty2022-05-04T14:21:01ZDiego CoppaRelative uncertaintyHello, I have a question regarding how to express the uncertainty as 17025 points out in the bullet 7.8.4.1 a)
7.8.4 Specific requierements for calibration certificates
"The measurement uncertainty of the measurement result presented i...Hello, I have a question regarding how to express the uncertainty as 17025 points out in the bullet 7.8.4.1 a)
7.8.4 Specific requierements for calibration certificates
"The measurement uncertainty of the measurement result presented in the same unit as that of the measurand or in the term relative to the measurand (e.g. percent)"
For the first case I think there are a lot of examples but for the second I can´t find any.
Thanks
Diego