Skip to content

Commit

Permalink
Updated for 2022-01.
Browse files Browse the repository at this point in the history
  • Loading branch information
seidewitz committed Feb 14, 2022
1 parent 2d4435d commit 1efbec0
Show file tree
Hide file tree
Showing 39 changed files with 2,769 additions and 522 deletions.
Binary file modified doc/1-Kernel_Modeling_Language.pdf
Binary file not shown.
Binary file modified doc/2-OMG_Systems_Modeling_Language.pdf
Binary file not shown.
Binary file modified doc/3-Systems_Modeling_API_and_Services.pdf
Binary file not shown.
Binary file modified doc/Intro to the SysML v2 Language-Textual Notation.pdf
Binary file not shown.
Binary file modified install/eclipse/org.omg.sysml.site.zip
Binary file not shown.
Binary file modified install/jupyter/README.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion install/jupyter/install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

@echo off

set /A SYSML_VERSION="0.19.0"
set /A SYSML_VERSION="0.20.0"

echo --- Step 1: Testing Conda installation ---
where conda
Expand Down
2 changes: 1 addition & 1 deletion install/jupyter/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

set -e

SYSML_VERSION="0.19.0"
SYSML_VERSION="0.20.0"

echo "--- Step 1: Testing Conda installation ---"
command -v conda || (echo "Conda is not installed. Please install Conda and re-run." && return 1)
Expand Down
26 changes: 14 additions & 12 deletions kerml/src/examples/Simple Tests/Elements.kerml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
element <e145>;

element <'1.2.4'> MyName;

element <A> {
doc /* Element A is related to element B. */
relationship to B;
}

element <B> {
language "HTML"
/* <a href="https://plm.elsewhere.com/part?id="1234"/> */
package Elements {
element <e145>;

element <'1.2.4'> MyName;

element <A> {
doc /* Element A is related to element B. */
relationship to B;
}

element <B> {
language "HTML"
/* <a href="https://plm.elsewhere.com/part?id="1234"/> */
}
}
2 changes: 1 addition & 1 deletion kerml/src/examples/Simple Tests/Expressions.kerml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package Expressions {
out v_decr : Integer = v - 1;
}
succession decrement then update;
step update : FeatureAccessPerformances::FeatureWritePerformance {
step update : FeatureReferencingPerformances::FeatureWritePerformance {
in redefines onOccurrence = w::self {
feature redefines startingAt : w {
feature redefines accessedFeature redefines v;
Expand Down
43 changes: 31 additions & 12 deletions kerml/src/examples/Simple Tests/Relationships.kerml
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
element <'1'> A;
element <'2'> B;
element <'3'> C;
relationship <'4'> R from A to B, C;

package P1 {
element S;
}
package P2 {
element T;
}
relationship from P1::S to P2::T;
package Relationships {
namespace {
element <'1'> A;
element <'2'> B;
element <'3'> C;
relationship <'4'> R from A to B, C;
}

namespace {
package P1 {
element S;
}
package P2 {
element T;
}
relationship from P1::S to P2::T;
}

namespace N {
element A;
element B {
relationship <x> {
element <y>; // Owned related Element
relationship from A to B; // Relationship as owned related Element
}
}
relationship R from A to B {
doc /* This relationship has no owned related Elements. */
}
}
}
20 changes: 20 additions & 0 deletions sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,24 @@ package ISQ {
import ISQCharacteristicNumbers::*; // ISO 80000-11 "Characteristic numbers"
import ISQCondensedMatter::*; // ISO 80000-12 "Condensed matter physics"
import ISQInformation::*; // IEC 80000-13 "Information science and technology"

/* Additional quantity declarations */

/**
* temperature difference
*
* A separate temperature difference quantity and unit are needed in order to support °C, °F and centrigrade temperature differences
*/
attribute def TemperatureDifferenceUnit :> SimpleUnit {
private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = 1; }
attribute :>> quantityDimension { :>> quantityPowerFactors = thermodynamicTemperaturePF; }
}

attribute def TemperatureDifferenceValue :> ScalarQuantityValue {
attribute :>> num: Real;
attribute :>> mRef: TemperatureDifferenceUnit[1];
}

attribute temperatureDifference: TemperatureDifferenceValue [*] nonunique :> scalarQuantities;

}
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ package ISQBase {
* Declaration of the International System of Quantities (ISQ),
* including its base quantities and symbols as specified in ISO 80000-1:2009.
*/
attribute isq: SystemOfQuantities {
attribute :>> longName = "International System of Quantities";
attribute <isq> 'International System of Quantities': SystemOfQuantities {
attribute :>> baseQuantities = ( L, M, T, I, 'Θ', N, J );

attribute L: LengthValue[1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
*/
package Quantities {
private import Collections::*;
private import ScalarValues::ScalarValue;
private import ScalarValues::NumericalValue;
private import ScalarValues::Number;
private import ScalarValues::Real;
private import ScalarValues::Natural;
private import ScalarValues::Boolean;
private import ScalarValues::String;

/**
* The value of a quantity is a tuple of one or more numbers (i.e. mathematical number values) and a reference to a measurement reference.
Expand All @@ -14,14 +19,13 @@ package Quantities {
* and a ScalarQuantityValue a ScalarMeasurementReference. See package UnitsAndScales for details.
*/
abstract attribute def TensorQuantityValue :> Array {
attribute isBound: ScalarValues::Boolean;
attribute num: ScalarValues::Number[1..*] ordered nonunique :>> elements;
attribute isBound: Boolean;
attribute num: Number[1..*] ordered nonunique :>> elements;
attribute mRef: UnitsAndScales::TensorMeasurementReference;
attribute measure: UnitsAndScales::TensorMeasurementReference;
attribute :>> dimensions = mRef.dimensions;
attribute order :>> rank = mRef.order;
attribute contravariantOrder: ScalarValues::Natural;
attribute covariantOrder: ScalarValues::Natural;
attribute contravariantOrder: Natural;
attribute covariantOrder: Natural;

assert constraint orderSum { contravariantOrder + covariantOrder == order }
assert constraint boundMatch { (isBound == mRef.isBound) || (!isBound && mRef.isBound) }
Expand All @@ -31,7 +35,7 @@ package Quantities {
attribute :>> mRef: UnitsAndScales::VectorMeasurementReference;
}

abstract attribute def ScalarQuantityValue :> VectorQuantityValue, ScalarValue {
abstract attribute def ScalarQuantityValue :> VectorQuantityValue, NumericalValue {
attribute :>> mRef: UnitsAndScales::ScalarMeasurementReference;
}

Expand All @@ -57,7 +61,6 @@ package Quantities {
* completed by adding derived quantities which are products of powers of the base quantities.
*/
attribute def SystemOfQuantities {
attribute longName: ScalarValues::String;
attribute baseQuantities: ScalarQuantityValue[*] ordered :> scalarQuantities;
}

Expand All @@ -68,7 +71,7 @@ package Quantities {
*/
attribute def QuantityPowerFactor {
attribute quantity: ScalarQuantityValue[1];
attribute exponent: ScalarValues::Real[1];
attribute exponent: Real[1];
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package QuantityCalculations {
import ScalarValues::*;
import Quantities::*;
import Quantities::ScalarQuantityValue;
import UnitsAndScales::ScalarMeasurementReference;
import UnitsAndScales::MeasurementReference;
import UnitsAndScales::DimensionOneValue;

calc def '[' specializes BaseFunctions::'[' (x: NumericalValue, y: ScalarMeasurementReference): QuantityValue;
calc def '[' specializes BaseFunctions::'[' (x: NumericalValue, y: ScalarMeasurementReference): ScalarQuantityValue;

calc def Abs specializes NumericalFunctions::Abs (x: ScalarQuantityValue): ScalarQuantityValue;

Expand Down
69 changes: 42 additions & 27 deletions sysml.library/Domain Libraries/Quantities and Units/SI.sysml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
/**
* International System of (Measurement) Units -- Système International d'Unités (SI), as defined in ISO/IEC 80000
*
* Note 1: In accordance with ISO/IEC 80000 en-GB spelling is used for the longNames and definitions of the units.
* Note 1: In accordance with ISO/IEC 80000 en-GB spelling is used for the names and definitions of the units.
* Note 2: This is a representative but not yet complete list of measurement units.
*/
package SI {
private import UnitsAndScales::*;
import ISQ::*;
import SIPrefixes::*;
import QuantityCalculations::*;

/*
* SI simple units needed before creation of base units
* SI simple unit needed in support of creation of the base units
*/
attribute <g> gram : MassUnit;

Expand All @@ -22,7 +21,7 @@ package SI {
attribute <kg> kilogram : MassUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = kilo; :>> referenceUnit = g; } }
attribute <s> second : DurationUnit;
attribute <A> ampere : ElectricCurrentUnit;
attribute <K> kelvin : ThermodynamicTemperatureUnit {
attribute <K> kelvin : ThermodynamicTemperatureUnit, TemperatureDifferenceUnit {
attribute temperatureOfWaterAtTriplePointInK: DefinitionalQuantityValue {
:>> num = 27316/100;
:>> definition = "temperature in kelvin of pure water at the triple point";
Expand All @@ -34,8 +33,10 @@ package SI {

/*
* Declare the SI system of units with its explicit base units
* and its associated system of quantities, the ISQ.
*/
attribute <si> 'ISO/IEC 80000 International System of Units' : SystemOfUnits {
:>> systemOfQuantities = isq;
:>> baseUnits = (m, kg, s, A, K, mol, cd);
}

Expand All @@ -56,6 +57,7 @@ package SI {
attribute <Hart> hartley : InformationContentUnit = one;
attribute <Hz> hertz : FrequencyUnit = s^-1;
attribute <J> joule : EnergyUnit = N*m;
//attribute <kat> katal : CatalyticActivityUnit = mol/s;
attribute <lm> lumen : LuminousFluxUnit = cd*sr;
attribute <lx> lux : IlluminanceUnit = lm/m^2;
attribute <N> newton : ForceUnit = kg*m/s^2;
Expand All @@ -75,19 +77,26 @@ package SI {
attribute <'Ω'> ohm : ResistanceUnit = V/A;

/*
* Units recognized in SI
* Units recognized in SI as specified in ISO 80000-1:2009
*/
attribute <'Å'> 'ångström' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 1.0e-10; } }
attribute <b> barn : AreaUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = 'm²'; :>> conversionFactor = 1.0e-28; } }
attribute <Da> dalton : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg; :>> conversionFactor = 1.66053906660e-27; } }
attribute <eV> electronvolt : EnergyUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = J; :>> conversionFactor = 1.602176487e-19; } }
attribute <d> day: DurationUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = hour; :>> conversionFactor = 24; } }
attribute <Da> dalton : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg; :>> conversionFactor = 1.66053906660e-27; :>> isExact = false; } }
attribute <eV> electronvolt : EnergyUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = J; :>> conversionFactor = 1.602176487e-19; :>> isExact = false; } }
attribute <h> hour: DurationUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = min; :>> conversionFactor = 60; } }
attribute <min> minute : DurationUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = s; :>> conversionFactor = 60; } }
attribute <L> litre : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = 'm³'; :>> conversionFactor = 1.0e-3; } }
attribute tonne : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg; :>> conversionFactor = 1.0e-3; } }
alias 'metric ton' for tonne;
attribute <u> 'atomic mass unit' : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = Da; :>> conversionFactor = 1.0; } }
attribute <ua> 'astronomical unit' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 149597870691e11; } }
attribute <ua> 'astronomical unit' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 149597870691e11; :>> isExact = false; } }
attribute <var> 'volt ampere reactive' : PowerUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = V*A; :>> conversionFactor = 1.0; } }
attribute <'°'> degree : AngularMeasureUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = rad; :>> conversionFactor = 3.141592653589793/180; } } // conversionFactor should become pi/180
attribute <'Å'> 'ångström' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 1.0e-10; } }

attribute <L> litre : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = 'm³'; :>> conversionFactor = 1.0e-3; } }
attribute <mL> millilitre : VolumeUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = milli; :>> referenceUnit = L; } }
attribute <'°'> degree : AngularMeasureUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = rad; :>> conversionFactor = 1.745329E-02; :>> isExact = false; } } // conversionFactor should become pi/180
attribute <''> 'minute (angle)' : AngularMeasureUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = rad; :>> conversionFactor = 2.908882E-04; :>> isExact = false; } }
alias arcmin for '′';
attribute <'″'> 'second (angle)' : AngularMeasureUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = rad; :>> conversionFactor = 4.848137E-06; :>> isExact = false; } }
alias arcsec for '″';

/*
* Derived units used in parts 3 to 12 of ISO/IEC 80000
Expand Down Expand Up @@ -287,37 +296,44 @@ package SI {
/*
* Prefixed units
*/

/* Length */
attribute <nm> nanometre : LengthUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = nano; :>> referenceUnit = m; } }
attribute <mm> millimetre : LengthUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = milli; :>> referenceUnit = m; } }
attribute <cm> centimetre : LengthUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = centi; :>> referenceUnit = m; } }
attribute <km> kilometre : LengthUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = kilo; :>> referenceUnit = m; } }

/* Volume */
attribute <mL> millilitre : VolumeUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = milli; :>> referenceUnit = L; } }

/* Force */
attribute <mN> millinewton : ForceUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = milli; :>> referenceUnit = N; } }

/* Energy */
attribute <kJ> kilojoule : EnergyUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = kilo; :>> referenceUnit = J; } }
attribute <MJ> megajoule : EnergyUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = mega; :>> referenceUnit = J; } }
attribute <GJ> gigajoule : EnergyUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = giga; :>> referenceUnit = J; } }

/* Power */
attribute <kW> kilowatt : PowerUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = kilo; :>> referenceUnit = W; } }

/*
* Non-standard conversion based units that are accepted in SI
*/
attribute <min> minute : DurationUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = s; :>> conversionFactor = 60; } }
attribute <h> hour: DurationUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = min; :>> conversionFactor = 60; } }
/* Speed */
attribute <'km/h'> 'kilometre per hour': SpeedUnit = km/h;

/*
* degree Celsius unit for temperature difference quantities
* degree Celsius unit for temperature interval (i.e. temperature difference) quantities
*/
attribute <'°C_unit'> 'degree celsius (unit)' : TemperatureUnit {
attribute <'°C'> 'degree celsius (temperature interval)' : TemperatureDifferenceUnit {
attribute :>> unitConversion: ConversionByConvention { :>> referenceUnit = K; :>> conversionFactor = 1; }
}

/*
* degree Celsius interval scale for absolute temperature quantities
*
* The interval scale is defined with an explicit mapping to the kelvin ratio scale from which the offset between the scales can be computed.
* The interval scale is defined with an explicit mapping to the kelvin thermodynamic temperature ratio scale from which the offset between the scales can be computed.
*/
attribute <'°C_scale'> 'degree celsius scale' : IntervalScale {
attribute :>> unit = '°C_unit';
attribute <'°C_abs'> 'degree celsius (temperature scale)' : IntervalScale {
attribute :>> unit = '°C';
attribute temperatureWaterAtFreezingPointInC: DefinitionalQuantityValue {
:>> num = 0; :>> definition = "temperature in degree Celsius of pure water at freezing point";
}
Expand All @@ -329,11 +345,10 @@ package SI {
}
attribute :>> definitionalQuantityValues = (temperatureWaterAtTriplePointInC, temperatureWaterAtFreezingPointInC);
attribute :>> quantityValueMapping = celsiusToKelvinScaleMapping;
// Experimental zero shift w.r.t. to K (kelvin) thermodynamic temperature ratio scale
// Such CoordinateTransformation can be used instead of the celsiusToKelvinScaleMapping

/* CoordinateTransformation (zero shift) w.r.t. thermodynamic temperature in kelvin */
private attribute zeroDegreeCelsiusInKelvin: ThermodynamicTemperatureValue = 273.15 [K];
attribute zeroShift : CoordinateTransformation { :>> source = K; :>> target = self; :>> origin = zeroDegreeCelsiusInKelvin; }
attribute zeroShift : CoordinateTransformation { :>> source = K; :>> target = self; :>> origin = zeroDegreeCelsiusInKelvin; :>> basisDirections = 1 [K]; }
attribute :>> placement = zeroShift;
}
alias '°C' for '°C_scale';
}
Loading

0 comments on commit 1efbec0

Please sign in to comment.