diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a98323bd4670dbc17d586a41d57666cb3da08291 --- /dev/null +++ b/README.md @@ -0,0 +1,323 @@ +--- +task_categories: +- text2text-generation +tags: +- modeling +- code +license: other +language: +- code +size_categories: +- n<1K +--- + +# Raw Example Code of SysMLv2 + +This is the raw source code of SysMLv2, based on [Systems-Modeling/SysML-v2-Release](https://github.com/Systems-Modeling/SysML-v2-Release). + +301 source code files in total, 57 of them are standard library files. + +| id | path | is_library | lines | +|-----:|:--------------------------------------------------------------------------------------------------------------------------|:-------------|--------:| +| 1 | src/sysml/src/training/40. Language Extension/User Keyword Example.sysml | False | 32 | +| 2 | src/sysml/src/training/40. Language Extension/Semantic Metadata Example.sysml | False | 25 | +| 3 | src/sysml/src/training/40. Language Extension/Model Library Example.sysml | False | 35 | +| 4 | src/sysml/src/training/21. Opaque Actions/Opaque Action Example.sysml | False | 19 | +| 5 | src/sysml/src/training/37. Allocation/Allocation Usage Example.sysml | False | 34 | +| 6 | src/sysml/src/training/37. Allocation/Allocation Definition Example.sysml | False | 38 | +| 7 | src/sysml/src/training/09. Connections/Connections Example.sysml | False | 42 | +| 8 | src/sysml/src/training/34. Use Cases/Use Case Usage Example.sysml | False | 37 | +| 9 | src/sysml/src/training/34. Use Cases/Use Case Definition Example.sysml | False | 34 | +| 10 | src/sysml/src/training/14. Action Definitions/Action Definition Example.sysml | False | 21 | +| 11 | src/sysml/src/training/14. Action Definitions/Action Succession Example-2.sysml | False | 24 | +| 12 | src/sysml/src/training/14. Action Definitions/Action Shorthand Example.sysml | False | 26 | +| 13 | src/sysml/src/training/14. Action Definitions/Action Succession Example-1.sysml | False | 26 | +| 14 | src/sysml/src/training/24. Transitions/Change and Time Triggers.sysml | False | 43 | +| 15 | src/sysml/src/training/24. Transitions/Local Clock Example.sysml | False | 32 | +| 16 | src/sysml/src/training/24. Transitions/Transition Actions.sysml | False | 44 | +| 17 | src/sysml/src/training/07. Parts/Parts Example-1.sysml | False | 29 | +| 18 | src/sysml/src/training/07. Parts/Parts Example-2.sysml | False | 29 | +| 19 | src/sysml/src/training/11. Interfaces/Interface Example.sysml | False | 19 | +| 20 | src/sysml/src/training/11. Interfaces/Interface Decomposition Example.sysml | False | 23 | +| 21 | src/sysml/src/training/15. Actions/Action Decomposition.sysml | False | 27 | +| 22 | src/sysml/src/training/03. Generalization/Generalization Example.sysml | False | 19 | +| 23 | src/sysml/src/training/36. Dependencies/Dependency Example.sysml | False | 27 | +| 24 | src/sysml/src/training/27. Individuals/Individuals and Roles-1.sysml | False | 22 | +| 25 | src/sysml/src/training/27. Individuals/Individuals and Snapshots Example.sysml | False | 24 | +| 26 | src/sysml/src/training/27. Individuals/Individuals and Time Slices.sysml | False | 26 | +| 27 | src/sysml/src/training/39. Filtering/Filtering Example-1.sysml | False | 37 | +| 28 | src/sysml/src/training/39. Filtering/Filtering Example-2.sysml | False | 35 | +| 29 | src/sysml/src/training/05. Redefinition/Redefinition Example.sysml | False | 24 | +| 30 | src/sysml/src/training/32. Analysis/Trade Study Analysis Example.sysml | False | 43 | +| 31 | src/sysml/src/training/32. Analysis/Analysis Case Usage Example.sysml | False | 33 | +| 32 | src/sysml/src/training/32. Analysis/Analysis Case Definition Example.sysml | False | 86 | +| 33 | src/sysml/src/training/33. Verification/Verification Case Usage Example.sysml | False | 52 | +| 34 | src/sysml/src/training/33. Verification/Verification Case Definition Example.sysml | False | 44 | +| 35 | src/sysml/src/training/19. Assignment Actions/Assignment Example.sysml | False | 41 | +| 36 | src/sysml/src/training/31. Requirements/Requirement Definitions.sysml | False | 42 | +| 37 | src/sysml/src/training/31. Requirements/Requirement Usages.sysml | False | 25 | +| 38 | src/sysml/src/training/31. Requirements/Requirement Groups.sysml | False | 33 | +| 39 | src/sysml/src/training/31. Requirements/Requirement Satisfaction.sysml | False | 27 | +| 40 | src/sysml/src/training/23. States/State Decomposition-2.sysml | False | 32 | +| 41 | src/sysml/src/training/23. States/State Actions.sysml | False | 35 | +| 42 | src/sysml/src/training/23. States/State Decomposition-1.sysml | False | 25 | +| 43 | src/sysml/src/training/04. Subsetting/Subsetting Example.sysml | False | 15 | +| 44 | src/sysml/src/training/28. Expressions/Car Mass Rollup Example 1.sysml | False | 38 | +| 45 | src/sysml/src/training/28. Expressions/Car Mass Rollup Example 2.sysml | False | 38 | +| 46 | src/sysml/src/training/28. Expressions/MassRollup1.sysml | False | 19 | +| 47 | src/sysml/src/training/28. Expressions/MassRollup2.sysml | False | 21 | +| 48 | src/sysml/src/training/02. Part Definitions/Part Definition Example.sysml | False | 20 | +| 49 | src/sysml/src/training/08. Items/Items Example.sysml | False | 17 | +| 50 | src/sysml/src/training/38. Metadata/Metadata Example-1.sysml | False | 32 | +| 51 | src/sysml/src/training/38. Metadata/Metadata Example-2.sysml | False | 20 | +| 52 | src/sysml/src/training/01. Packages/Documentation Example.sysml | False | 14 | +| 53 | src/sysml/src/training/01. Packages/Comment Example.sysml | False | 24 | +| 54 | src/sysml/src/training/01. Packages/Package Example.sysml | False | 9 | +| 55 | src/sysml/src/training/22. State Definitions/State Definition Example-2.sysml | False | 23 | +| 56 | src/sysml/src/training/22. State Definitions/State Definition Example-1.sysml | False | 32 | +| 57 | src/sysml/src/training/12. Binding Connectors/Binding Connectors Example-2.sysml | False | 26 | +| 58 | src/sysml/src/training/12. Binding Connectors/Binding Connectors Example-1.sysml | False | 29 | +| 59 | src/sysml/src/training/17. Control/Merge Example.sysml | False | 42 | +| 60 | src/sysml/src/training/17. Control/Control Structures Example.sysml | False | 29 | +| 61 | src/sysml/src/training/17. Control/Decision Example.sysml | False | 34 | +| 62 | src/sysml/src/training/17. Control/Fork Join Example.sysml | False | 41 | +| 63 | src/sysml/src/training/17. Control/Camera.sysml | False | 25 | +| 64 | src/sysml/src/training/20. Asynchronous Messaging/Messaging Example.sysml | False | 33 | +| 65 | src/sysml/src/training/20. Asynchronous Messaging/Messaging with Ports.sysml | False | 40 | +| 66 | src/sysml/src/training/13. Flow Connections/Flow Connection Interface Example.sysml | False | 22 | +| 67 | src/sysml/src/training/13. Flow Connections/Flow Connection Definition Example.sysml | False | 21 | +| 68 | src/sysml/src/training/13. Flow Connections/Flow Connection Usage Example.sysml | False | 18 | +| 69 | src/sysml/src/training/16. Conditional Succession/Conditional Succession Example-2.sysml | False | 31 | +| 70 | src/sysml/src/training/16. Conditional Succession/Conditional Succession Example-1.sysml | False | 32 | +| 71 | src/sysml/src/training/29. Calculations/Calculation Definitions.sysml | False | 23 | +| 72 | src/sysml/src/training/29. Calculations/Calculation Usages-2.sysml | False | 29 | +| 73 | src/sysml/src/training/29. Calculations/Calculation Usages-1.sysml | False | 42 | +| 74 | src/sysml/src/training/06. Enumeration Definitions/Enumeration Definitions-1.sysml | False | 17 | +| 75 | src/sysml/src/training/06. Enumeration Definitions/Enumeration Definitions-2.sysml | False | 32 | +| 76 | src/sysml/src/training/18. Action Performance/Action Performance Example.sysml | False | 21 | +| 77 | src/sysml/src/training/26. Occurrences/Time Slice and Snapshot Example.sysml | False | 27 | +| 78 | src/sysml/src/training/26. Occurrences/Interaction Example-2.sysml | False | 34 | +| 79 | src/sysml/src/training/26. Occurrences/Interaction Example-1.sysml | False | 23 | +| 80 | src/sysml/src/training/26. Occurrences/Event Occurrence Example.sysml | False | 29 | +| 81 | src/sysml/src/training/26. Occurrences/Interaction Realization-1.sysml | False | 55 | +| 82 | src/sysml/src/training/26. Occurrences/Message Payload Example.sysml | False | 36 | +| 83 | src/sysml/src/training/26. Occurrences/Interaction Realization-2.sysml | False | 82 | +| 84 | src/sysml/src/training/10. Ports/Port Conjugation Example.sysml | False | 20 | +| 85 | src/sysml/src/training/10. Ports/Port Example.sysml | False | 26 | +| 86 | src/sysml/src/training/35. Variability/Variation Usages.sysml | False | 25 | +| 87 | src/sysml/src/training/35. Variability/Variation Definitions.sysml | False | 35 | +| 88 | src/sysml/src/training/35. Variability/Variation Configuration.sysml | False | 14 | +| 89 | src/sysml/src/training/41. Views/Viewpoint Example.sysml | False | 38 | +| 90 | src/sysml/src/training/41. Views/Views Example.sysml | False | 35 | +| 91 | src/sysml/src/training/25. State Exhibition/State Exhibition Example.sysml | False | 15 | +| 92 | src/sysml/src/training/30. Constraints/Time Constraints.sysml | False | 37 | +| 93 | src/sysml/src/training/30. Constraints/Analytical Constraints.sysml | False | 43 | +| 94 | src/sysml/src/training/30. Constraints/Constraint Assertions-1.sysml | False | 32 | +| 95 | src/sysml/src/training/30. Constraints/Constraints Example-1.sysml | False | 32 | +| 96 | src/sysml/src/training/30. Constraints/Constraints Example-2.sysml | False | 32 | +| 97 | src/sysml/src/training/30. Constraints/Derivation Constraints.sysml | False | 25 | +| 98 | src/sysml/src/training/30. Constraints/Constraint Assertions-2.sysml | False | 37 | +| 99 | src/sysml/src/examples/Metadata Examples/IssueMetadataExample.sysml | False | 30 | +| 100 | src/sysml/src/examples/Metadata Examples/RationaleMetadataExample.sysml | False | 24 | +| 101 | src/sysml/src/examples/Metadata Examples/RequirementMetadataExample.sysml | False | 34 | +| 102 | src/sysml/src/examples/Metadata Examples/RiskMetadataExample.sysml | False | 19 | +| 103 | src/sysml/src/examples/Metadata Examples/VerificationMetadataExample.sysml | False | 15 | +| 104 | src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceRealization-3.sysml | False | 151 | +| 105 | src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceRealization-2.sysml | False | 106 | +| 106 | src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceModel.sysml | False | 42 | +| 107 | src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceOutsideRealization-2.sysml | False | 101 | +| 108 | src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceOutsideRealization-3.sysml | False | 159 | +| 109 | src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceModelOutside.sysml | False | 20 | +| 110 | src/sysml/src/examples/v1 Spec Examples/D.4.7.8 Dynamics/HSUVDynamics.sysml | False | 88 | +| 111 | src/sysml/src/examples/v1 Spec Examples/8.4.1 Wheel Hub Assembly/Wheel Package.sysml | False | 94 | +| 112 | src/sysml/src/examples/v1 Spec Examples/8.4.1 Wheel Hub Assembly/Wheel Package - Updated.sysml | False | 92 | +| 113 | src/sysml/src/examples/v1 Spec Examples/8.4.5 Constraining Decomposition/Vehicle Decomposition - Updated.sysml | False | 68 | +| 114 | src/sysml/src/examples/v1 Spec Examples/8.4.5 Constraining Decomposition/Vehicle Decomposition.sysml | False | 55 | +| 115 | src/sysml/src/examples/Arrowhead Framework Example/AHFSequences.sysml | False | 122 | +| 116 | src/sysml/src/examples/Arrowhead Framework Example/AHFCoreLib.sysml | False | 55 | +| 117 | src/sysml/src/examples/Arrowhead Framework Example/AHFNorwayTopics.sysml | False | 160 | +| 118 | src/sysml/src/examples/Arrowhead Framework Example/AHFProfileLib.sysml | False | 117 | +| 119 | src/sysml/src/examples/Requirements Examples/RequirementDerivationExample.sysml | False | 39 | +| 120 | src/sysml/src/examples/Requirements Examples/VehicleRequirementDerivation.sysml | False | 40 | +| 121 | src/sysml/src/examples/Requirements Examples/HSUVRequirements.sysml | False | 39 | +| 122 | src/sysml/src/examples/Variability Examples/VehicleVariabilityModel.sysml | False | 165 | +| 123 | src/sysml/src/examples/Import Tests/QualifiedNameImportTest.sysml | False | 13 | +| 124 | src/sysml/src/examples/Import Tests/AliasImport.sysml | False | 13 | +| 125 | src/sysml/src/examples/Import Tests/PrivateImportTest.sysml | False | 33 | +| 126 | src/sysml/src/examples/Import Tests/CircularImport.sysml | False | 27 | +| 127 | src/sysml/src/examples/Camera Example/PictureTaking.sysml | False | 12 | +| 128 | src/sysml/src/examples/Camera Example/Camera.sysml | False | 14 | +| 129 | src/sysml/src/examples/Vehicle Example/VehicleIndividuals.sysml | False | 111 | +| 130 | src/sysml/src/examples/Vehicle Example/VehicleUsages.sysml | False | 96 | +| 131 | src/sysml/src/examples/Vehicle Example/VehicleDefinitions.sysml | False | 54 | +| 132 | src/sysml/src/examples/Vehicle Example/SysML v2 Spec Annex A SimpleVehicleModel.sysml | False | 1580 | +| 133 | src/sysml/src/examples/Flashlight Example/Flashlight Example.sysml | False | 60 | +| 134 | src/sysml/src/examples/Cause and Effect Examples/CauseAndEffectExample.sysml | False | 55 | +| 135 | src/sysml/src/examples/Cause and Effect Examples/MedicalDeviceFailure.sysml | False | 25 | +| 136 | src/sysml/src/examples/Simple Tests/ActionTest.sysml | False | 33 | +| 137 | src/sysml/src/examples/Simple Tests/EnumerationTest.sysml | False | 54 | +| 138 | src/sysml/src/examples/Simple Tests/TradeStudyTest.sysml | False | 21 | +| 139 | src/sysml/src/examples/Simple Tests/AliasTest.sysml | False | 22 | +| 140 | src/sysml/src/examples/Simple Tests/ConnectionTest.sysml | False | 49 | +| 141 | src/sysml/src/examples/Simple Tests/DependencyTest.sysml | False | 20 | +| 142 | src/sysml/src/examples/Simple Tests/MetadataTest.sysml | False | 42 | +| 143 | src/sysml/src/examples/Simple Tests/ImportTest.sysml | False | 18 | +| 144 | src/sysml/src/examples/Simple Tests/ControlNodeTest.sysml | False | 15 | +| 145 | src/sysml/src/examples/Simple Tests/RequirementTest.sysml | False | 29 | +| 146 | src/sysml/src/examples/Simple Tests/ConjugationTest.sysml | False | 35 | +| 147 | src/sysml/src/examples/Simple Tests/ViewTest.sysml | False | 44 | +| 148 | src/sysml/src/examples/Simple Tests/RootPackageTest.sysml | False | 14 | +| 149 | src/sysml/src/examples/Simple Tests/PartTest.sysml | False | 44 | +| 150 | src/sysml/src/examples/Simple Tests/ConstraintTest.sysml | False | 90 | +| 151 | src/sysml/src/examples/Simple Tests/AssignmentTest.sysml | False | 52 | +| 152 | src/sysml/src/examples/Simple Tests/ParameterTest.sysml | False | 16 | +| 153 | src/sysml/src/examples/Simple Tests/TextualRepresentationTest.sysml | False | 22 | +| 154 | src/sysml/src/examples/Simple Tests/StateTest.sysml | False | 56 | +| 155 | src/sysml/src/examples/Simple Tests/DecisionTest.sysml | False | 22 | +| 156 | src/sysml/src/examples/Simple Tests/CalculationTest.sysml | False | 30 | +| 157 | src/sysml/src/examples/Simple Tests/VerificationTest.sysml | False | 39 | +| 158 | src/sysml/src/examples/Simple Tests/ItemTest.sysml | False | 23 | +| 159 | src/sysml/src/examples/Simple Tests/OccurrenceTest.sysml | False | 33 | +| 160 | src/sysml/src/examples/Simple Tests/MultiplicityTest.sysml | False | 19 | +| 161 | src/sysml/src/examples/Simple Tests/StructuredControlTest.sysml | False | 36 | +| 162 | src/sysml/src/examples/Simple Tests/AnalysisTest.sysml | False | 38 | +| 163 | src/sysml/src/examples/Simple Tests/DefaultValueTest.sysml | False | 18 | +| 164 | src/sysml/src/examples/Simple Tests/VariabilityTest.sysml | False | 41 | +| 165 | src/sysml/src/examples/Simple Tests/FeaturePathTest.sysml | False | 43 | +| 166 | src/sysml/src/examples/Simple Tests/CommentTest.sysml | False | 44 | +| 167 | src/sysml/src/examples/Simple Tests/UseCaseTest.sysml | False | 36 | +| 168 | src/sysml/src/examples/Simple Tests/AllocationTest.sysml | False | 35 | +| 169 | src/sysml/src/examples/Mass Roll-up Example/MassConstraintExample.sysml | False | 117 | +| 170 | src/sysml/src/examples/Mass Roll-up Example/Vehicles.sysml | False | 37 | +| 171 | src/sysml/src/examples/Mass Roll-up Example/MassRollup.sysml | False | 27 | +| 172 | src/sysml/src/examples/Room Model/RoomModel.sysml | False | 77 | +| 173 | src/sysml/src/examples/State Space Representation Examples/CartSample.sysml | False | 64 | +| 174 | src/sysml/src/examples/State Space Representation Examples/EVSample.sysml | False | 319 | +| 175 | src/sysml/src/examples/Analysis Examples/AnalysisAnnotation.sysml | False | 26 | +| 176 | src/sysml/src/examples/Analysis Examples/Turbojet Stage Analysis.sysml | False | 110 | +| 177 | src/sysml/src/examples/Analysis Examples/Vehicle Analysis Demo.sysml | False | 286 | +| 178 | src/sysml/src/examples/Analysis Examples/Dynamics.sysml | False | 91 | +| 179 | src/sysml/src/examples/Geometry Examples/CarWithEnvelopingShape.sysml | False | 17 | +| 180 | src/sysml/src/examples/Geometry Examples/SimpleQuadcopter.sysml | False | 247 | +| 181 | src/sysml/src/examples/Geometry Examples/ExternalShapeRefExample.sysml | False | 31 | +| 182 | src/sysml/src/examples/Geometry Examples/CarWithShapeAndCSG.sysml | False | 88 | +| 183 | src/sysml/src/examples/Geometry Examples/VehicleGeometryAndCoordinateFrames.sysml | False | 131 | +| 184 | src/sysml/src/examples/Packet Example/Packets.sysml | False | 35 | +| 185 | src/sysml/src/examples/Packet Example/PacketUsage.sysml | False | 16 | +| 186 | src/sysml/src/examples/Comment Examples/Comments.sysml | False | 15 | +| 187 | src/sysml/src/examples/Individuals Examples/JohnIndividualExample.sysml | False | 57 | +| 188 | src/sysml/src/examples/Individuals Examples/AnalysisIndividualExample.sysml | False | 95 | +| 189 | src/sysml/src/validation/09-Verification/9-Verification-simplified.sysml | False | 115 | +| 190 | src/sysml/src/validation/18-Use Case/18-Use Case.sysml | False | 87 | +| 191 | src/sysml/src/validation/04-Functional Allocation/4a-Functional Allocation.sysml | False | 110 | +| 192 | src/sysml/src/validation/05-State-based Behavior/5-State-based Behavior-1.sysml | False | 236 | +| 193 | src/sysml/src/validation/05-State-based Behavior/5-State-based Behavior-2.sysml | False | 128 | +| 194 | src/sysml/src/validation/05-State-based Behavior/5-State-based Behavior-1a.sysml | False | 238 | +| 195 | src/sysml/src/validation/03-Function-based Behavior/3a-Function-based Behavior-2.sysml | False | 85 | +| 196 | src/sysml/src/validation/03-Function-based Behavior/3d-Function-based Behavior-item.sysml | False | 83 | +| 197 | src/sysml/src/validation/03-Function-based Behavior/3a-Function-based Behavior-1.sysml | False | 137 | +| 198 | src/sysml/src/validation/03-Function-based Behavior/3a-Function-based Behavior-3.sysml | False | 73 | +| 199 | src/sysml/src/validation/03-Function-based Behavior/3c-Function-based Behavior-structure mod-2.sysml | False | 49 | +| 200 | src/sysml/src/validation/03-Function-based Behavior/3e-Function-based Behavior-item.sysml | False | 64 | +| 201 | src/sysml/src/validation/03-Function-based Behavior/3c-Function-based Behavior-structure mod-1.sysml | False | 51 | +| 202 | src/sysml/src/validation/03-Function-based Behavior/3c-Function-based Behavior-structure mod-3.sysml | False | 33 | +| 203 | src/sysml/src/validation/10-Analysis and Trades/10c-Fuel Economy Analysis.sysml | False | 168 | +| 204 | src/sysml/src/validation/10-Analysis and Trades/10d-Dynamics Analysis.sysml | False | 80 | +| 205 | src/sysml/src/validation/10-Analysis and Trades/10a-Analysis.sysml | False | 74 | +| 206 | src/sysml/src/validation/10-Analysis and Trades/10b-Trade-off Among Alternative Configurations.sysml | False | 97 | +| 207 | src/sysml/src/validation/17-Sequence Modeling/17b-Sequence-Modeling.sysml | False | 42 | +| 208 | src/sysml/src/validation/17-Sequence Modeling/17a-Sequence-Modeling.sysml | False | 42 | +| 209 | src/sysml/src/validation/06-Individual and Snapshots/6-Individual and Snapshots.sysml | False | 167 | +| 210 | src/sysml/src/validation/01-Parts Tree/1a-Parts Tree.sysml | False | 125 | +| 211 | src/sysml/src/validation/01-Parts Tree/1c-Parts Tree Redefinition.sysml | False | 86 | +| 212 | src/sysml/src/validation/01-Parts Tree/1d-Parts Tree with Reference.sysml | False | 51 | +| 213 | src/sysml/src/validation/15-Properties-Values-Expressions/15_04-Logical Expressions.sysml | False | 30 | +| 214 | src/sysml/src/validation/15-Properties-Values-Expressions/15_07-System of Units and Scales.sysml | False | 46 | +| 215 | src/sysml/src/validation/15-Properties-Values-Expressions/15_03-Value Expression.sysml | False | 30 | +| 216 | src/sysml/src/validation/15-Properties-Values-Expressions/15_19-Materials with Properties.sysml | False | 82 | +| 217 | src/sysml/src/validation/15-Properties-Values-Expressions/15_02-Basic Value Properties.sysml | False | 25 | +| 218 | src/sysml/src/validation/15-Properties-Values-Expressions/15_08-Range Restriction.sysml | False | 19 | +| 219 | src/sysml/src/validation/15-Properties-Values-Expressions/15_06-System of Quantities.sysml | False | 40 | +| 220 | src/sysml/src/validation/15-Properties-Values-Expressions/15_10-Primitive Data Types.sysml | False | 89 | +| 221 | src/sysml/src/validation/15-Properties-Values-Expressions/15_12-Compound Value Type.sysml | False | 31 | +| 222 | src/sysml/src/validation/15-Properties-Values-Expressions/15_11-Variable Length Collection Types.sysml | False | 36 | +| 223 | src/sysml/src/validation/15-Properties-Values-Expressions/15_13-Discretely Sampled Function Value.sysml | False | 76 | +| 224 | src/sysml/src/validation/15-Properties-Values-Expressions/15_19a-Materials with Properties.sysml | False | 69 | +| 225 | src/sysml/src/validation/15-Properties-Values-Expressions/15_05-Unification of Expression and Constraint Definition.sysml | False | 56 | +| 226 | src/sysml/src/validation/15-Properties-Values-Expressions/15_01-Constants.sysml | False | 55 | +| 227 | src/sysml/src/validation/13-Model Containment/13a-Model Containment.sysml | False | 62 | +| 228 | src/sysml/src/validation/13-Model Containment/13b-Safety and Security Features Element Group.sysml | False | 40 | +| 229 | src/sysml/src/validation/13-Model Containment/13b-Safety and Security Features Element Group-2.sysml | False | 52 | +| 230 | src/sysml/src/validation/13-Model Containment/13b-Safety and Security Features Element Group-1.sysml | False | 56 | +| 231 | src/sysml/src/validation/02-Parts Interconnection/2c-Parts Interconnection-Multiple Decompositions.sysml | False | 90 | +| 232 | src/sysml/src/validation/02-Parts Interconnection/2a-Parts Interconnection.sysml | False | 206 | +| 233 | src/sysml/src/validation/12-Dependency Relationships/12a-Dependency.sysml | False | 16 | +| 234 | src/sysml/src/validation/12-Dependency Relationships/12b-Allocation.sysml | False | 26 | +| 235 | src/sysml/src/validation/12-Dependency Relationships/12b-Allocation-1.sysml | False | 56 | +| 236 | src/sysml/src/validation/08-Requirements/8-Requirements.sysml | False | 205 | +| 237 | src/sysml/src/validation/14-Language Extensions/14a-Language Extensions.sysml | False | 31 | +| 238 | src/sysml/src/validation/14-Language Extensions/14b-Language Extensions.sysml | False | 51 | +| 239 | src/sysml/src/validation/14-Language Extensions/14c-Language Extensions.sysml | False | 208 | +| 240 | src/sysml/src/validation/07-Variant Configuration/7a-Variant Configuration - General Concept.sysml | False | 53 | +| 241 | src/sysml/src/validation/07-Variant Configuration/7b-Variant Configurations.sysml | False | 140 | +| 242 | src/sysml/src/validation/07-Variant Configuration/7a1-Variant Configuration - General Concept-a.sysml | False | 79 | +| 243 | src/sysml/src/validation/11-View and Viewpoint/11a-View-Viewpoint.sysml | False | 56 | +| 244 | src/sysml/src/validation/11-View and Viewpoint/11b-Safety and Security Feature Views.sysml | False | 65 | +| 245 | src/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml | True | 39 | +| 246 | src/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml | True | 61 | +| 247 | src/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml | True | 100 | +| 248 | src/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml | True | 78 | +| 249 | src/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml | True | 39 | +| 250 | src/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml | True | 143 | +| 251 | src/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml | True | 81 | +| 252 | src/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml | True | 76 | +| 253 | src/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml | True | 2734 | +| 254 | src/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml | True | 958 | +| 255 | src/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml | True | 70 | +| 256 | src/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml | True | 1991 | +| 257 | src/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml | True | 1256 | +| 258 | src/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml | True | 42 | +| 259 | src/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml | True | 1229 | +| 260 | src/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml | True | 444 | +| 261 | src/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml | True | 62 | +| 262 | src/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml | True | 255 | +| 263 | src/sysml.library/Domain Libraries/Quantities and Units/SI.sysml | True | 367 | +| 264 | src/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml | True | 48 | +| 265 | src/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml | True | 2365 | +| 266 | src/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml | True | 526 | +| 267 | src/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml | True | 107 | +| 268 | src/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml | True | 1171 | +| 269 | src/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml | True | 206 | +| 270 | src/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml | True | 1537 | +| 271 | src/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml | True | 1353 | +| 272 | src/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml | True | 1583 | +| 273 | src/sysml.library/Domain Libraries/Quantities and Units/Time.sysml | True | 279 | +| 274 | src/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml | True | 50 | +| 275 | src/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml | True | 30 | +| 276 | src/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml | True | 179 | +| 277 | src/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml | True | 143 | +| 278 | src/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml | True | 119 | +| 279 | src/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml | True | 34 | +| 280 | src/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml | True | 156 | +| 281 | src/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml | True | 835 | +| 282 | src/sysml.library/Systems Library/States.sysml | True | 101 | +| 283 | src/sysml.library/Systems Library/Cases.sysml | True | 71 | +| 284 | src/sysml.library/Systems Library/Metadata.sysml | True | 30 | +| 285 | src/sysml.library/Systems Library/VerificationCases.sysml | True | 103 | +| 286 | src/sysml.library/Systems Library/Actions.sysml | True | 505 | +| 287 | src/sysml.library/Systems Library/Attributes.sysml | True | 25 | +| 288 | src/sysml.library/Systems Library/SysML.sysml | True | 536 | +| 289 | src/sysml.library/Systems Library/Ports.sysml | True | 34 | +| 290 | src/sysml.library/Systems Library/Interfaces.sysml | True | 48 | +| 291 | src/sysml.library/Systems Library/Connections.sysml | True | 153 | +| 292 | src/sysml.library/Systems Library/Requirements.sysml | True | 194 | +| 293 | src/sysml.library/Systems Library/Constraints.sysml | True | 44 | +| 294 | src/sysml.library/Systems Library/UseCases.sysml | True | 57 | +| 295 | src/sysml.library/Systems Library/Parts.sysml | True | 81 | +| 296 | src/sysml.library/Systems Library/Calculations.sysml | True | 37 | +| 297 | src/sysml.library/Systems Library/Items.sysml | True | 149 | +| 298 | src/sysml.library/Systems Library/AnalysisCases.sysml | True | 38 | +| 299 | src/sysml.library/Systems Library/Views.sysml | True | 163 | +| 300 | src/sysml.library/Systems Library/StandardViewDefinitions.sysml | True | 123 | +| 301 | src/sysml.library/Systems Library/Allocations.sysml | True | 29 | + diff --git a/source.parquet b/source.parquet new file mode 100644 index 0000000000000000000000000000000000000000..549e23d5aeb81268d84ae449f0733ef7433d46a0 --- /dev/null +++ b/source.parquet @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f6d955f2b83318365ad41a8946e02a42cc1a0441e31e3b6e45994e9ed83ecd4 +size 448282 diff --git a/src/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml b/src/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml new file mode 100644 index 0000000000000000000000000000000000000000..fb92b9047f3c01ef6862cdd7ad086c07b82490b9 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml @@ -0,0 +1,34 @@ +standard library package AnalysisTooling { + doc + /* + * This package contains definitions for metadata annotations related + * to analysis tool integration. + */ + + private import ScalarValues::*; + + metadata def ToolExecution { + doc + /* + * ToolExecution metadata identifies an external analysis tool to be + * used to implement the annotated action. + */ + + attribute toolName : String; + attribute uri : String; + } + + metadata def ToolVariable { + doc + /* + * ToolVariable metadata is used in the context of an action that has + * been annotated with ToolExecution metadata. It is used to annotate + * a parameter or other feature of the action with the name of the + * variable in the tool that is to correspond to the annotated + * feature. + */ + + attribute name : String; + } + +} \ No newline at end of file diff --git a/src/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml b/src/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4ded11a46238972198111705d86f4b694c5ca058 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml @@ -0,0 +1,119 @@ +standard library package SampledFunctions { + doc + /* + * This package provides a library model of discretely sampled mathematical functions. + */ + + private import Base::Anything; + private import ScalarValues::Positive; + private import Collections::KeyValuePair; + private import Collections::OrderedMap; + private import SequenceFunctions::size; + private import ControlFunctions::forAll; + private import ControlFunctions::collect; + private import ControlFunctions::select; + + attribute def SamplePair :> KeyValuePair { + doc + /* + * SamplePair is a key-value pair of a domain-value and a range-value, used as a sample element in SampledFunction. + */ + + attribute domainValue :>> key; + attribute rangeValue :>> val; + } + + attribute def SampledFunction :> OrderedMap { + doc + /* + * SampledFunction is a variable-size, ordered collection of 'SamplePair' elements that represents a generic, discretely sampled, + * uni-variate or multi-variate mathematical function. The function must be montonic, either strictly increasing or strictly + * decreasing. + * + * It maps discrete domain values to discrete range values. + * The domain of the function is represented by the sequence of 'domainValue' of each 'SamplePair' in 'samples', and + * the range of the function is represented by the sequence of 'rangeValue' of each 'SamplePair' in 'samples'. + */ + + attribute samples: SamplePair[0..*] ordered :>> elements; + + assert constraint { + // Note: Assumes the functions '<' and '>' are defined for the domain type. + (1..size(samples)-1)->forAll { in i; (samples.domainValue#(i) < samples.domainValue#(i+1)) } or // Strictly increasing + (1..size(samples)-1)->forAll { in i; (samples.domainValue#(i) > samples.domainValue#(i+1)) } // Strictly decreasing + } + } + + calc def Domain { + doc + /* + * Domain returns the sequence of the domainValues of all samples in a SampledFunction. + */ + + in fn : SampledFunction; + return : Anything[0..*] = fn.samples.domainValue; + } + + calc def Range { + doc + /* + * Range returns the sequence of the rangeValues of all samples in a SampledFunction. + */ + + in fn : SampledFunction; + return : Anything[0..*] = fn.samples.rangeValue; + } + + calc def Sample { + doc + /* + * Sample returns a SampledFunction that samples a given calculation over a sequence of domainValues. + */ + + in calc calculation { in x; } + in attribute domainValues [0..*]; + return sampling = SampledFunction ( + samples = domainValues->collect { in x; SamplePair(x, calculation(x)) } + ); + } + + calc def Interpolate { + doc + /* + * An Interpolate calculation returns an interpolated range value from a given SampledFunction for a given domain value. + * If the input domain value is outside the bounds of the domainValues of the SampleFunction, null is returned. + */ + + in attribute fn : SampledFunction; + in attribute value; + return attribute result; + } + + calc interpolateLinear : Interpolate { + doc + /* + * interpolateLinear is an Interpolate calculation assuming a linear functional form between SamplePairs. + */ + + in attribute fn : SampledFunction; + in attribute value; + + private attribute domainValues = Domain(fn); + private attribute index : Positive[0..1] = + (1..size(domainValues))->select { in i : Positive; domainValues#(i) <= value }#(1); + + private calc def Linear { + in attribute lowerSample : SamplePair; + in attribute upperSample : SamplePair; + in attribute value; + private attribute f = (value - lowerSample.domainValue) / (lowerSample.domainValue - upperSample.domainValue); + return result = upperSample.rangeValue + f * (lowerSample.rangeValue - upperSample.rangeValue); + } + + return result [0..1] = + if index == null or index == size(domainValues)? null + else if domainValues#(index) < domainValues#(index+1)? Linear(fn.samples#(index), fn.samples#(index+1), value) + else Linear(fn.samples#(index+1), fn.samples#(index), value); + } + +} \ No newline at end of file diff --git a/src/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml b/src/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml new file mode 100644 index 0000000000000000000000000000000000000000..45c28b65b382b20a3ff9916d1fb78fda05ec4538 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml @@ -0,0 +1,143 @@ +standard library package StateSpaceRepresentation { + doc + /* + * This package provides a model of the foundational state-space system representation, + * commonly used in control systems. + */ + + private import ISQ::DurationValue; + private import Quantities::VectorQuantityValue; + private import VectorCalculations::*; + + abstract attribute def StateSpace :> VectorQuantityValue; + abstract attribute def Input :> VectorQuantityValue; + abstract attribute def Output :> VectorQuantityValue; + + abstract calc def GetNextState { + in input: Input; + in stateSpace: StateSpace; + in timeStep: DurationValue; + return : StateSpace; + } + abstract calc def GetOutput { + in input: Input; + in stateSpace: StateSpace; + return : Output; + } + + abstract action def StateSpaceEventDef { + doc + /* + * Events to be received. + */ + } + action def ZeroCrossingEventDef :> StateSpaceEventDef; + + item def StateSpaceItem { + doc + /* + * Item for SSR connection + */ + } + + abstract action def StateSpaceDynamics { + doc + /* + * StateSpaceDynamics is the simplest form of State Space Representation, + * and nextState directly computes the stateSpace of the next timestep. + */ + + in attribute input: Input; + + abstract calc getNextState: GetNextState; + abstract calc getOutput: GetOutput; + attribute stateSpace: StateSpace; + + out attribute output: Output = getOutput(input, stateSpace); + } + + abstract attribute def StateDerivative :> VectorQuantityValue { + doc + /* + * The definition of the time derivative of StateSpace, which means dx/dt, where x is StateSpace + */ + + ref stateSpace: StateSpace; + constraint { stateSpace.order == order } + } + + abstract calc def GetDerivative { + doc + /* + * Computes the time derivative of stateSpace, which corresponds dx/dt = f(u, x), where u is input and x is stateSpace. + */ + + in input: Input; + in stateSpace: StateSpace; + return : StateDerivative; + } + + abstract calc def Integrate { + doc + /* + * Integrates stateSpace to compute the next stateSpace, which corresponds to x + int dx/dt dt. + * Its actual implementation should be given by a solver. + */ + + in getDerivative: GetDerivative; + in input: Input; + in initialState: StateSpace; + in timeInterval: DurationValue; + return result: StateSpace; + } + + abstract action def ContinuousStateSpaceDynamics :> StateSpaceDynamics { + doc + /* + * ContinuousStateSpaceDynamics represents continuous behavior. + * derivative needs to return a time derivative of stateSpace, i.e. dx/dt. + */ + + abstract calc getDerivative: GetDerivative; + calc :>> getNextState: GetNextState { + /* We compute nextState by Integrate defined above by giving derivative calc. */ + calc integrate: Integrate { + in getDerivative = ContinuousStateSpaceDynamics::getDerivative; + in input = GetNextState::input; + in initialState = GetNextState::stateSpace; + in timeInterval = GetNextState::timeStep; + } + return result = integrate.result; + } + + event occurrence zeroCrossingEvents[0..*] : ZeroCrossingEventDef { + /* ContinuousStateSpaceDynamics may cause zero crossings anomaly. */ + } + } + + abstract calc def GetDifference { + doc + /* + * Computes difference of stateSpace by one timestep, that is x(k+1) - x(k), + * where k is the timestep number. + */ + + in input: Input; + in stateSpace: StateSpace; + return : StateSpace; + } + + abstract action def DiscreteStateSpaceDynamics :> StateSpaceDynamics { + doc + /* + * DiscreteStateSpaceDynamics represents discrete behavior. + * differences needs to return difference of the stateSpace for each timestep. + */ + + abstract calc getDifference: GetDifference; + calc :>> getNextState: GetNextState { + attribute diff: StateSpace = getDifference(input, stateSpace); + return result = stateSpace + diff; + } + } +} diff --git a/src/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml b/src/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f4510a6d634c9cb7d26e6571aebe199dd2cf9d3c --- /dev/null +++ b/src/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml @@ -0,0 +1,179 @@ +standard library package TradeStudies { + doc + /* + * This package provides a simple framework for defining trade-off study analysis cases. + */ + + private import Base::Anything; + private import ScalarValues::*; + private import ScalarFunctions::*; + private import ControlFunctions::*; + + abstract calc def EvaluationFunction { + doc + /* + * An EvaluationFunction is a calculation that evaluates a TradeStudy alternative, + * producing a ScalarValue that can be comparted with the evaluation of other + * alternatives. + */ + + in ref alternative : Anything { + doc + /* + * The alternative to be evaluated. + */ + } + + return attribute result : ScalarValue[1] { + doc + /* + * A ScalarValue representing the evaluation of the given alternative. + */ + } + } + + abstract requirement def TradeStudyObjective { + doc + /* + * A TradeStudyObjective is the base definition for the objective of a TradeStudy. + * The requirement is to choose from a given set of alternatives the selectedAlternative + * for that has the best evaluation according to a given EvaluationFunction. What + * value is considered "best" is not defined in the abstract base definition but must be + * computed in any concrete specialization. + */ + + subject selectedAlternative : Anything { + doc + /* + * The alternative that should be selected, as evaluated using the given + * ObjectiveFunction. + */ + } + + in ref alternatives : Anything[1..*] { + doc + /* + * The alternatives being considered in the TradeStudy for which this TradeStudyObjective + * is the objective. + */ + } + + in calc fn : EvaluationFunction { + doc + /* + * The EvaluationFunction to be used in evaluating the given alternatives. + */ + } + + out attribute best : ScalarValue { + doc + /* + * Out of the evaluation results of all the given alternatives, the one that is considered + * "best", in the sense that it is the value the selectedAlternative should have. This + * value must be computed in any concrete specialization of TradeStudyObjective. + */ + } + + require constraint { fn(selectedAlternative) == best } + } + + requirement def MinimizeObjective :> TradeStudyObjective { + doc + /* + * A MinimizeObjective is a TradeStudyObjective that requires that the + * selectedAlternative have the minimum ObjectiveFunction value of all the + * given alternatives. + */ + + subject :>> selectedAlternative; + in ref :>> alternatives; + in calc :>>fn; + + out attribute :>> best = alternatives->minimize { + doc + /* + * For a MinimizeObjective, the best value is the minimum one. + */ + + in x; fn(x) + }; + } + + requirement def MaximizeObjective :> TradeStudyObjective { + doc + /* + * A MaximizeObjective is a TradeStudyObjective that requires that the + * selectedAlternative have the maximum ObjectiveFunction value of all the + * given alternatives. + */ + + subject :>> selectedAlternative; + in ref :>> alternatives; + in calc :>>fn; + + out attribute :>> best = alternatives->maximize { + doc + /* + * For a MinimizeObjective, the best value is the maximum one. + */ + + in x; fn(x) + }; + } + + abstract analysis def TradeStudy { + doc + /* + * A TradeStudy is an analysis case whose subject is a set of alternatives + * (at least one) and whose result is a selection of one of those alternatives. + * The alternatives are evaluated based on a given ObjectiveFunction and the + * selection is made such that it satisfies the objective of the TradeStudy + * (which must be a TradeStudyObjective). + */ + + subject studyAlternatives : Anything[1..*] { + doc + /* + * The set of alternatives being considered in this TradeStudy. + * + * In a TradeStudy usage, bind this feature to the actual collection of + * alternatives to be considered. + */ + } + + abstract calc evaluationFunction : EvaluationFunction { + doc + /* + * The EvaluationFunction to be used to evaluate the alternatives. + * + * In a TradeStudy usage, redefine this feature to provide the desired + * calculation (or bind it to a calculation usage that does so). + */ + } + + objective tradeStudyObjective : TradeStudyObjective { + doc + /* + * The objective of this TradeStudy. + * + * Redefine this feature to give it a definition that is a concrete + * specialization of TradeStudyObjective. That can either be one of the + * specializations provided in this package, or a more specific user- + * defined one. + */ + + subject :>> selectedAlternative; + in ref :>> alternatives = studyAlternatives; + in calc :>> fn = evaluationFunction; + } + + return selectedAlternative : Anything = studyAlternatives->selectOne {in ref a { + doc + /* + * The alternative selected by this TradeStudy, which is the one that meets the + * requirement of the tradeStudyObjective. + */ + } tradeStudyObjective(selectedAlternative = a)}; + } + +} \ No newline at end of file diff --git a/src/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml b/src/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f527d0991a412d68210a50654597564f90b8ec2e --- /dev/null +++ b/src/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml @@ -0,0 +1,76 @@ +standard library package CausationConnections { + doc + /* + * This package provides a library model modeling causes, effects, and causation connections + * between them. + */ + + private import SequenceFunctions::isEmpty; + private import SequenceFunctions::size; + private import SequenceFunctions::intersection; + + abstract occurrence causes[*] { + doc /* Occurrences that are causes. */ + } + + abstract occurrence effects[*] { + doc /* Occurrences that are effects. */ + } + + abstract connection def Multicausation { + doc + /* + * A Multicausation connection models the situation in which one set of + * occurrences causes another. + * + * To create a Multicausation connection, specialize this connection definition + * adding specific end features of the relavent types. Ends representing causes + * should subset 'causes', while ends representing effects should subset 'effects'. + * There must be at least one cause and at least one effect. + */ + + ref occurrence causes[1..*] :>> causes :> participant { + doc /* The causing occurrences. */ + } + ref occurrence effects[1..*] :>> effects :> participant { + doc /* The effect occurrences caused by the causing occurrences. */ + } + + private assert constraint disjointCauseEffect { + doc /* causes must be disjoint from effects. */ + isEmpty(intersection(causes, effects)) + } + + private succession causalOrdering first causes.startShot[nCauses] then effects[nEffects] { + doc /* All causes must exist before all effects. */ + attribute nCauses = size(causes); + attribute nEffects = size(effects); + } + } + + abstract connection multicausations : Multicausation[*] { + doc /* multicausations is the base feature for Multicausation ConnectionUsages. */ + } + + connection def Causation :> Multicausation { + doc + /* + * A Causation is a binary Multicausation in which a single cause occurrence + * causes a single effect occurrence. (However, a single cause can separately + * have multiple effects, and a single effect can have separate Causation + * connections with multiple causes.) + */ + + end occurrence theCause[*] :>> causes :>> source { + doc /* The single causing occurrence. */ + } + + end occurrence theEffect[*] :>> effects :>> target { + doc /* The single effect occurrence resulting from the cause. */ + } + } + + abstract connection causations : Causation[*] :> multicausations { + doc /* causations is the base feature for Causation ConnectionUsages. */ + } +} \ No newline at end of file diff --git a/src/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml b/src/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml new file mode 100644 index 0000000000000000000000000000000000000000..6a104d9a5b3a59d986033739b9616785e21421e6 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml @@ -0,0 +1,81 @@ +standard library package CauseAndEffect { + doc /* This package provides language-extension metadata for cause-effect modeling. */ + + public import CausationConnections::*; + private import ScalarValues::*; + private import Metaobjects::SemanticMetadata; + + metadata def CauseMetadata :> SemanticMetadata { + doc + /* + * CauseMetadata identifies a usage as being a cause occurrence. + * It is intended to be used to tag the cause ends of a Multicausation. + */ + + ref :>> annotatedElement : SysML::Usage; + ref :>> baseType = causes as SysML::Usage; + } + + metadata def EffectMetadata :> SemanticMetadata { + doc + /* + * EffectMetadata identifies a usage as being an effect occurrence. + * It is intended to be used to tag the effect ends of a Multicausation. + */ + + ref :>> annotatedElement : SysML::Usage; + ref :>> baseType = effects as SysML::Usage; + } + + metadata def CausationMetadata { + doc + /* + * CausationMetadata allows for the specification of additional metadata about + * a cause-effect connection definition or usage. + */ + + ref :> annotatedElement : SysML::ConnectionDefinition; + ref :> annotatedElement : SysML::ConnectionUsage; + + attribute isNecessary : Boolean default false { + doc + /* + * Whether all the causes are necessary for all the effects to occur. + * If this is false (the default), then some or all of the effects may + * still have occurred even if some of the causes did not. + */ + } + + attribute isSufficient : Boolean default false { + doc + /* + * Whether the causes were sufficient for all the effects to occur. + * If this is false (the default), then it may be the case that some + * other occurrences were also necessary for some or all of the effects + * to have occurred. + */ + } + + attribute probability : Real[0..1] { + doc /* The probability that the causes will actually result in effects occurring. */ + } + } + + metadata def MulticausationSemanticMetadata :> CausationMetadata, SemanticMetadata { + doc + /* + * MulticausationMetadata is SemanticMetadata for a Multicausation connection. + */ + + ref :>> baseType = multicausations meta SysML::Usage; + } + + metadata def CausationSemanticMetadadata :> CausationMetadata, SemanticMetadata { + doc + /* + * CausationMetadata is SemanticMetadata for a Causation connection. + */ + + ref :>> baseType = causations meta SysML::Usage; + } +} diff --git a/src/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml b/src/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml new file mode 100644 index 0000000000000000000000000000000000000000..63c8c467d38aeb5160e174f2f51ae6ce9cc1bb6f --- /dev/null +++ b/src/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml @@ -0,0 +1,835 @@ +standard library package ShapeItems { + doc + /* + * This package provides a model of items that represent basic geometric shapes. + */ + + private import ScalarValues::Boolean; + private import ScalarValues::Positive; + private import ISQ::*; + private import SI::m; + private import Occurrences::MatesWith; + private import Objects::*; + private import Items::Item; + private import SequenceFunctions::equals; + private import SequenceFunctions::isEmpty; + private import SequenceFunctions::notEmpty; + private import SequenceFunctions::size; + private import SequenceFunctions::includes; + private import ControlFunctions::'if'; + private import ControlFunctions::forAll; + private import ControlFunctions::exists; + private import Quantities::scalarQuantities; + + item def PlanarCurve :> Curve { + doc + /* + * A PlanarCurve is a Curve with a given length embeddable in a plane. + */ + + attribute :>> length [1]; + + attribute :>> outerSpaceDimension; + assert constraint { notEmpty(outerSpaceDimension) & outerSpaceDimension <= 2 } + } + + item def PlanarSurface :> Surface { + doc + /* + * A PlanarSurface is a flat Surface with a given area. + */ + + attribute :>> area [1]; + attribute :>> outerSpaceDimension = 2; + + item :>> shape : PlanarCurve; + } + + item def Line :> PlanarCurve { + doc + /* + * A Line is a Curve that is a straight line of a given length. + */ + + attribute :>> length [1]; + attribute :>> outerSpaceDimension = 1; + } + + abstract item def Path :> StructuredSpaceObject, Curve { + doc + /* + * Path is the most general structured Curve. + */ + + item :>> faces [0]; + item :>> edges [1..*] { + item :>> vertices [0..2]; + } + item :>> vertices = edges.vertices; + + assert constraint { isClosed == vertices->forAll{in p1 : Point; + vertices->exists{p2 : Point; p1 != p2 and + includes(p1.matingOccurrences, p2) } } } + } + + attribute semiMajorAxis : LengthValue [0..*] :> scalarQuantities; + attribute semiMinorAxis : LengthValue [0..*] :> scalarQuantities; + attribute xoffset : LengthValue [0..*] :> scalarQuantities default 0 [m]; + attribute yoffset : LengthValue [0..*] :> scalarQuantities default 0 [m]; + attribute baseLength : LengthValue [0..*] :> scalarQuantities; + attribute baseWidth : LengthValue [0..*] :> scalarQuantities; + + item def ConicSection :> Path, PlanarCurve { + doc + /* + * A ConicSection is a closed PlanarCurve, possibly disconnected, see Hyperbola. + */ + + + item :>> edges [1..2]; + + item :>> vertices [0]; + } + + item def Ellipse :> ConicSection { + doc + /* + * An Ellipse is a ConicSection in the shape of an ellipse of a given semiaxes. + */ + + attribute :>> semiMajorAxis [1]; + attribute :>> semiMinorAxis [1]; + + item :>> edges [1]; + } + + item def Circle :> Ellipse { + doc + /* + * A Circle is an Ellipse with semiaxes equal to its radius. + */ + + attribute :>> radius [1]; + attribute :>> semiMajorAxis [1] = radius; + attribute :>> semiMinorAxis [1] = radius; + + item :>> edges { + attribute length [1] = Circle::radius * TrigFunctions::pi * 2; + } + } + + item def Parabola :> ConicSection { + doc + /* + * A Parabola is a ConicSection in the shape of a parabola of a given focal length. + */ + + attribute focalDistance : LengthValue [1] :> scalarQuantities; + + item :>> edges [1]; + } + + item def Hyperbola :> ConicSection { + doc + /* + * A Hyperbola is a ConicSection in the shape of a hyperbola with given axes. + */ + + attribute tranverseAxis : LengthValue [1] :> scalarQuantities; + attribute conjugateAxis : LengthValue [1] :> scalarQuantities; + } + + item def Polygon :> Path, PlanarCurve { + doc + /* + * A Polygon is a closed planar Path with straight edges. + */ + + item :>> edges : Line { item :>> vertices [2]; } + + attribute :>> isClosed = true; + + assert constraint { (1..size(edges))->forAll {in i; + edges#(i).vertices->equals((vertices#((2*i)-1), vertices#(2*i))) and + includes((edges#(i).vertices#(2) as Item).matingOccurrences, + edges#(if i==size(edges) ? 1 else i+1).vertices#(1)) } } + } + + item def Triangle :> Polygon { + doc + /* + * A Triangle is three-sided Polygon with given length (base), width (perpendicular distance + * from base to apex), and offset of this perpendicular at the base from the center of the base. + */ + + attribute :>> length [1]; + attribute :>> width [1]; + attribute :>> xoffset [1]; + + item :>> edges [3] = (base, e2, e3); + item base [1] { length = Triangle::length; } + item e2 [1]; + item e3 [1]; + + item :>> vertices [6]; + item v12 [2] ordered = (vertices#(2), vertices#(3)); + item apex [2] ordered = (vertices#(4), vertices#(5)); + item v31 [2] ordered = (vertices#(6), vertices#(1)); + } + + item def RightTriangle :> Triangle { + doc + /* + * A RightTriangle is a Triangle with sides opposite the hypotenuse at right angles. + */ + + attribute :>> xoffset = length / 2; + + item :>> e2 { attribute :>> length = Triangle::width; } + + item hypotenuse :>> e3 { + attribute :>> length = ( Triangle::length^2 + Triangle::width^2 ); + } + } + + item def Quadrilateral :> Polygon { + doc + /* + * A Quadrilateral is a four-sided Polygon. + */ + + item :>> edges [4] = (e1, e2, e3, e4); + item e1 [1]; + item e2 [1]; + item e3 [1]; + item e4 [1]; + + item :>> vertices [8]; + item v12 [2] ordered = (vertices#(2), vertices#(3)); + item v23 [2] ordered = (vertices#(4), vertices#(5)); + item v34 [2] ordered = (vertices#(6), vertices#(7)); + item v41 [2] ordered = (vertices#(6), vertices#(1)); + } + + item def Rectangle :> Quadrilateral { + doc + /* + * A Rectangle is a Quadrilateral four right angles and given length and width. + */ + + attribute :>> length [1]; + attribute :>> width [1]; + + item :>> e1 { attribute :>> length = Rectangle::length; } + item :>> e2 { attribute :>> length = Rectangle::width; } + item :>> e3 { attribute :>> length = e1.length; } + item :>> e4 { attribute :>> length = e2.length; } + } + + abstract item def Shell :> StructuredSpaceObject, Surface { + doc + /* + * Shell is the most general structured Surface. + */ + } + + item def Disc :> Shell, PlanarSurface { + doc + /* + * A Disc is a Shell bound by an Ellipse. + */ + + attribute :>> semiMajorAxis [1]; + attribute :>> semiMinorAxis [1]; + + item :>> shape : Ellipse [1] { + attribute :>> semiMajorAxis = Disc::semiMajorAxis; + attribute :>> semiMinorAxis = Disc::semiMinorAxis; + } + + item :>> faces : PlanarSurface [1] { + item :>> edges [1]; + } + item :>> edges : Ellipse [1] = shape; + item :>> vertices [0]; + } + + item def CircularDisc :> Disc { + doc + /* + * A CircularDisc is a Disc bound by a Circle. + */ + + attribute :>> radius [1] = semiMajorAxis; + item :>> shape : Circle; + item :>> edges : Circle; + } + + item def ConicSurface :> Shell { + doc + /* + * A ConicSurface is a Surface that has ConicSection cross-sections. + */ + + item :>> faces [1..2]; + item :>> edges [0]; + item :>> vertices [0]; + + attribute :>> genus = 0; + } + + item def Ellipsoid :> ConicSurface { + doc + /* + * An Ellipsoid is a ConicSurface with only elliptical cross-sections. + */ + + attribute semiAxis1 : LengthValue [1] :> scalarQuantities; + attribute semiAxis2 : LengthValue [1] :> scalarQuantities; + attribute semiAxis3 : LengthValue [1] :> scalarQuantities; + + item :>> faces [1]; + } + + item def Sphere :> Ellipsoid { + doc + /* + * A Sphere is an Ellipsoid with all the same semiaxes. + */ + + attribute :>> radius [1] = semiAxis1; + + assert constraint { ( semiAxis1 == semiAxis2 ) & + ( semiAxis2 == semiAxis3 ) } + } + + item def Paraboloid :> ConicSurface { + doc + /* + * A Paraboloid is a ConicSurface with only parabolic cross-sections. + */ + + attribute focalDistance : LengthValue [1] :> scalarQuantities; + + item :>> faces [1]; + } + + item def Hyperboloid :> ConicSurface { + doc + /* + * A Hyperboloid is a ConicSurface with only hyperbolic cross-sections. + */ + + attribute transverseAxis : LengthValue [1] :> scalarQuantities; + attribute conjugateAxis : LengthValue [1] :> scalarQuantities; + } + + item def Toroid :> Shell { + doc + /* + * A Toroid is a surface generated from revolving a planar closed curve about an line coplanar + * with the curve. It is single sided with one hole. + */ + + attribute revolutionRadius : LengthValue [1] :> scalarQuantities; + + item revolvedCurve : PlanarCurve [1] { attribute :>> isClosed = true; } + + item :>> faces [1]; + item :>> edges [0]; + item :>> vertices [0]; + + attribute :>> genus = 1; + } + + item def Torus :> Toroid { + doc + /* + * A Torus is a revolution of a Circle. + */ + + attribute majorRadius :>> revolutionRadius; + attribute minorRadius : LengthValue [1] :> scalarQuantities; + + item :>> revolvedCurve: Circle [1] { attribute :>> radius = minorRadius; } + } + + + item def RectangularToroid :> Toroid { + doc + /* + * A RectangularToroid is a revolution of a Rectangle. + */ + + attribute rectangleLength : LengthValue [1] :> scalarQuantities; + attribute rectangleWidth : LengthValue [1] :> scalarQuantities; + + item :>> revolvedCurve: Rectangle [1] { + attribute :>> length = rectangleLength; + attribute :>> width = rectangleWidth; + } + } + + item def ConeOrCylinder :> Shell { + doc + /* + * A ConeOrCylinder is Shell that a Cone or a Cylinder with a given elliptical base, + * height, width (perpendicular distance from the base to the center of the top side or vertex), + * and offsets of this perpendicular at the base from the center of the base. + */ + + attribute :>> semiMajorAxis [1]; + attribute :>> semiMinorAxis [1]; + attribute :>> height [1]; + + attribute :>> xoffset [1]; + attribute :>> yoffset [1]; + + item :>> faces [2..3]; + item base : Disc [1] :> faces; + item af : Disc [0..1] :> faces; + item cf : Surface [1] :> faces; + + item :>> edges [2..4] = faces.edges; + item be [2] :> edges { + attribute :>> semiMajorAxis = ConeOrCylinder::semiMajorAxis; + attribute :>> semiMinorAxis = ConeOrCylinder::semiMinorAxis; + } + item ae [0..2] :> edges { + attribute :>> semiMajorAxis = be.semiMajorAxis; + attribute :>> semiMinorAxis = be.semiMinorAxis; + } + assert constraint { size(ae) == (if isEmpty(af) ? 0 else 2) and + size(edges) == (if isEmpty(af) ? 2 else 4) } + + item :>> vertices [0..1] = faces.vertices; + assert constraint { isEmpty(af) == notEmpty(vertices) } + + /* Bind face edges to specific edges */ + binding [1] bind base.edges [0..*] = be [0..*]; + binding [1] bind cf.edges [0..*] = be [0..*]; + + /* Meeting edges */ + connection :MatesWith connect be [1] to be [1]; + + attribute :>> genus = 0; + } + + item def Cone :> ConeOrCylinder { + doc + /* + * A Cone has one elliptical sides joined to a point by a curved side. + */ + + item :>> faces [2]; + + item apex :>> vertices; + + /* Bind face vertices to specific vertices */ + binding [1] bind cf.vertices [0..*] = apex [0..*]; + } + + item def EccentricCone :> Cone { + doc + /* + * An EccentricCone is a Cone with least one positive offset. + */ + + assert constraint { xoffset > 0 or yoffset > 0 } + } + + item def CircularCone :> Cone { + doc + /* + * A CircularCone is a Cone with a circular base. + */ + + attribute :>> radius [1] = semiMajorAxis; + + assert constraint { semiMajorAxis == semiMinorAxis } + + item :>> base : CircularDisc; + } + + item def RightCircularCone :> CircularCone { + doc + /* + * A RightCircularCone is a CircularCone with zero offsets. + */ + + attribute :>> xoffset { attribute :>> num = 0; } + attribute :>> yoffset { attribute :>> num = 0; } + } + + item def Cylinder :> ConeOrCylinder { + doc + /* + * A Cylinder has two elliptical sides joined by a curved side. + */ + + item :>> af [1]; + + binding [1] bind cf.edges [0..*] = ae [0..*]; + + connection :MatesWith connect ae [1] to ae [1] { + doc /* Meeting edges */ + } + } + + item def EccentricCylinder :> Cylinder { + doc + /* + * An EccentricCylinder is a Cylinder with least one positive offset. + */ + + assert constraint { xoffset > 0 or yoffset > 0 } + } + + item def CircularCylinder :> Cylinder { + doc + /* + * A CircularCylinder is a Cylinder with two circular sides. + */ + + attribute :>> radius [1] = semiMajorAxis; + + assert constraint { semiMajorAxis == semiMinorAxis } + + item :>> base : CircularDisc; + item :>> af : CircularDisc; + } + + item def RightCircularCylinder :> CircularCylinder { + doc + /* + * A RightCircularCylinder is a CircularCylinder with zero offsets. + */ + + attribute :>> xoffset { attribute :>> num = 0; } + attribute :>> yoffset { attribute :>> num = 0; } + } + + item def Polyhedron :> Shell { + doc + /* + * A Polyhedron is a closed Shell with polygonal sides. + */ + + attribute :>> isClosed = true; + + item :>> faces : Polygon [2..*]; + + item :>> edges = faces.edges; + + attribute :>> outerSpaceDimension = if size(faces) > 2 ? 3 else 2; + + attribute :>> genus = 0; + } + + item def CuboidOrTriangularPrism :> Polyhedron { + doc + /* + * A CuboidOrTriangularPrism is a Polyhedron that is either a Cuboid or TriangularPrism. + */ + + item :>> faces [5..6]; + item tf : Quadrilateral [1] :> faces; + item bf : Quadrilateral [1] :> faces; + item ff : Polygon [1] :> faces { item :>> edges [3..4]; } + item rf : Polygon [1] :> faces { item :>> edges [3..4]; } + item slf : Quadrilateral [1] :> faces; + item srf : Quadrilateral [0..1] :> faces; + + item :>> edges; + assert constraint { size(edges) == 18 or size(edges) == 24 } + + item tfe [2] :> edges; + item tre [2] :> edges; + item tsle [2] :> edges; + item tsre [0..2] :> edges; + item bfe [2] :> edges; + item bre [2] :> edges; + item bsle [2] :> edges; + item bsre [2] :> edges; + item ufle [2] :> edges; + item ufre [0..2] :> edges; + item urle [2] :> edges; + item urre [0..2] :> edges; + + assert constraint { ( isEmpty(srf) implies isEmpty(tsre) ) and + ( isEmpty(tsre) == isEmpty(ufre) ) and + ( isEmpty(ufre) == isEmpty(urre) ) } + + item :>> vertices; + assert constraint { size(vertices) == size(edges) } + + item tflv [3] :> vertices; + item tfrv [0..3] :> vertices; + item trlv [3] :> vertices; + item trrv [0..3] :> vertices; + item bflv [3] :> vertices; + item bfrv [3] :> vertices; + item brlv [3] :> vertices; + item brrv [3] :> vertices; + + assert constraint { ( isEmpty(tfrv) == isEmpty(trrv) ) } + + /* Bind face edges to specific edges */ + binding [1] bind tf.edges [0..1] = tfe [0..1]; + binding [1] bind tf.edges [0..1] = tre [0..1]; + binding [1] bind tf.edges [0..1] = tsle [0..1]; + binding [1] bind bf.edges [0..1] = bfe [0..1]; + binding [1] bind bf.edges [0..1] = bre [0..1]; + binding [1] bind bf.edges [0..1] = bsle [0..1]; + binding [1] bind bf.edges [0..1] = bsre [0..1]; + + binding [1] bind ff.edges [0..1] = tfe [0..1]; + binding [1] bind ff.edges [0..1] = bfe [0..1]; + binding [1] bind ff.edges [0..1] = ufle [0..1]; + + binding [1] bind rf.edges [0..1] = tre [0..1]; + binding [1] bind rf.edges [0..1] = bre [0..1]; + binding [1] bind rf.edges [0..1] = urle [0..1]; + + /* Bind edge vertices to specific vertices */ + binding [1] bind tfe.vertices [0..1] = tflv [0..1]; + binding [1] bind tre.vertices [0..1] = trlv [0..1]; + binding [1] bind tsle.vertices [0..1] = tflv [0..1]; + binding [1] bind tsle.vertices [0..1] = trlv [0..1]; + + binding [1] bind bfe.vertices [0..1] = bflv [0..1]; + binding [1] bind bfe.vertices [0..1] = bfrv [0..1]; + binding [1] bind bre.vertices [0..1] = brlv [0..1]; + binding [1] bind bre.vertices [0..1] = brrv [0..1]; + binding [1] bind bsle.vertices [0..1] = bflv [0..1]; + binding [1] bind bsle.vertices [0..1] = brlv [0..1]; + binding [1] bind bsre.vertices [0..1] = bfrv [0..1]; + binding [1] bind bsre.vertices [0..1] = brrv [0..1]; + + binding [1] bind ufle.vertices [0..1] = tflv [0..1]; + binding [1] bind ufle.vertices [0..1] = bflv [0..1]; + binding [1] bind urle.vertices [0..1] = trlv [0..1]; + binding [1] bind urle.vertices [0..1] = brlv [0..1]; + + /* Meeting edges */ + connection :MatesWith connect tfe [1] to tfe [1]; + connection :MatesWith connect tre [1] to tre [1]; + connection :MatesWith connect tsle [1] to tsle [1]; + connection :MatesWith connect bfe [1] to bfe [1]; + connection :MatesWith connect bre [1] to bre [1]; + connection :MatesWith connect bsle [1] to bsle [1]; + connection :MatesWith connect bsre [1] to bsre [1]; + connection :MatesWith connect ufle [1] to ufle [1]; + connection :MatesWith connect urle [1] to urle [1]; + connection :MatesWith connect bsre [1] to bsre [1]; + + /* Meeting vertices */ + connection :MatesWith connect tflv [2] to tflv [2]; + connection :MatesWith connect trlv [2] to trlv [2]; + connection :MatesWith connect bflv [2] to bflv [2]; + connection :MatesWith connect bfrv [2] to bfrv [2]; + connection :MatesWith connect brlv [2] to brlv [2]; + connection :MatesWith connect brrv [2] to brrv [2]; + } + + item def TriangularPrism :> CuboidOrTriangularPrism { + doc + /* + * A TriangularPrism is a Polyhedron with five sides, two triangular and + * the others quadrilateral. + */ + + + item :>> faces [5]; + item :>> ff : Triangle; + item :>> rf : Triangle; + + item :>> edges [18]; + + item :>> vertices; + + /* Bind face edges to specific edges */ + binding [1] bind tf.edges [0..1] = bsre [0..1]; + + /* Bind edge vertices to specific vertices */ + binding [1] bind tfe.vertices [0..1] = bfrv [0..1]; + binding [1] bind tre.vertices [0..1] = bfrv [0..1]; + } + + item def RightTriangularPrism :> TriangularPrism { + doc + /* + * A RightTriangularPrism a TriangularPrism with two right triangluar sides, + * with given length, width, and height. + */ + + attribute :>> length [1]; + attribute :>> width [1]; + attribute :>> height [1]; + + item :>> tf : Rectangle; + item :>> bf : Rectangle; + item :>> ff : RightTriangle { + attribute :>> length = RightTriangularPrism::length; + attribute :>> width = RightTriangularPrism::width; + } + item :>> rf : RightTriangle { + attribute :>> length = ff.length; + attribute :>> width = rf.width; + } + item :>> slf : Rectangle; + item :>> srf : Rectangle; + + item :>> tfe { attribute :>> length = ff.hypotenuse.length; } + item :>> tre { attribute :>> length = tfe.length; } + item :>> tsle { attribute :>> length = height; } + item :>> bfe { attribute :>> length = RightTriangularPrism::length; } + item :>> bre { attribute :>> length = RightTriangularPrism::length; } + item :>> bsle { attribute :>> length = height; } + item :>> bsre { attribute :>> length = height; } + item :>> ufle { attribute :>> length = width; } + item :>> urle { attribute :>> length = width; } + } + alias Wedge for RightTriangularPrism; + + item def Cuboid :> CuboidOrTriangularPrism { + doc + /* + * A Cuboid is a Polyhedron with six sides, all quadrilateral. + */ + + item :>> faces [6]; + item :>> ff : Quadrilateral; + item :>> rf : Quadrilateral; + + item :>> edges [24]; + + item :>> vertices; + + /* Bind face edges to specific edges */ + binding [1] bind tf.edges [0..1] = tsre [0..1]; + binding [1] bind ff.edges [0..1] = ufre [0..1]; + binding [1] bind rf.edges [0..1] = urre [0..1]; + + binding [1] bind srf.edges [0..1] = tsre [0..1]; + binding [1] bind srf.edges [0..1] = bsre [0..1]; + binding [1] bind srf.edges [0..1] = ufre [0..1]; + binding [1] bind srf.edges [0..1] = urre [0..1]; + + /* Bind edge vertices to specific vertices */ + binding [1] bind tfe.vertices [0..1] = tfrv [0..1]; + binding [1] bind tre.vertices [0..1] = trrv [0..1]; + binding [1] bind tsre.vertices [0..1] = tfrv [0..1]; + binding [1] bind tsre.vertices [0..1] = trrv [0..1]; + + binding [1] bind ufre.vertices [0..1] = tfrv [0..1]; + binding [1] bind ufre.vertices [0..1] = bfrv [0..1]; + binding [1] bind urre.vertices [0..1] = trrv [0..1]; + binding [1] bind urre.vertices [0..1] = brrv [0..1]; + + /* Meeting edges */ + connection :MatesWith connect tsre [1] to tsre [1]; + connection :MatesWith connect ufre [1] to ufre [1]; + connection :MatesWith connect urre [1] to urre [1]; + connection :MatesWith connect bsre [1] to bsre [1]; + + /* Meeting vertices */ + connection :MatesWith connect tfrv [2] to tfrv [2]; + connection :MatesWith connect trrv [2] to trrv [2]; + } + + item def RectangularCuboid :> Cuboid { + doc + /* + * A RectangularCuboid is a Cuboid with all Rectangular sides. + */ + + attribute :>> length [1]; + attribute :>> width [1]; + attribute :>> height [1]; + + item :>> tf : Rectangle { attribute :>> length = RectangularCuboid::length; + attribute :>> width = RectangularCuboid::height; } + item :>> bf : Rectangle { attribute :>> length = RectangularCuboid::length; + attribute :>> width = RectangularCuboid::height; } + item :>> ff : Rectangle { attribute :>> length = RectangularCuboid::length; + attribute :>> width = RectangularCuboid::width; } + item :>> rf : Rectangle { attribute :>> length = RectangularCuboid::length; + attribute :>> width = RectangularCuboid::width; } + item :>> slf : Rectangle { attribute :>> length = RectangularCuboid::height; + attribute :>> width = RectangularCuboid::width; } + item :>> srf : Rectangle { attribute :>> length = RectangularCuboid::height; + attribute :>> width = RectangularCuboid::width; } + } + alias Box for RectangularCuboid; + + item def Pyramid :> Polyhedron { + doc + /* + * A Pyramid is a Polyhedron with the sides of a polygon (base) forming the bases of triangles + * that join at an apex point. Its height is the perpendicular distance from the base to the apex, + * and its offsets are between this perpendicular at the base and the center of the base. + */ + + attribute :>> height [1]; + attribute :>> xoffset; + attribute :>> yoffset; + + item :>> faces; + item base [1] :> faces; + item wall : Triangle :> faces; + attribute wallNumber : Positive = size(wall); + + assert constraint { size(faces) == wallNumber + 1 } + assert constraint { size(wall) == size(base.edges) } + + item :>> edges; + + assert constraint { size(edges) == wallNumber * 4 } + + item :>> vertices; + item apex :> vertices = wall.apex; + + assert constraint { size(apex) == wallNumber } + + /* Base to wall and wall to wall edge mating. */ + assert constraint { (1..wallNumber)->forAll {in i; + includes(wall#(i).base.matingOccurrences, + Pyramid::base.edges#(i)) and + includes((wall#(i).edges#(3) as Item).matingOccurrences, + wall#(if i==wallNumber ? 1 else i+1).edges#(2)) } } + + /* Meeting apices. */ + connection :MatesWith connect apex [wallNumber] to apex [wallNumber]; + } + + item def Tetrahedron :> Pyramid { + doc + /* + * A Tetrahedron is Pyramid with a triangular base. + */ + + attribute :>> baseLength [1]; + attribute :>> baseWidth [1]; + + item :>> base : Triangle { + attribute :>> length = Tetrahedron::baseLength; + attribute :>> width = Tetrahedron::baseWidth; + } + } + + item def RectangularPyramid :> Pyramid { + doc + /* + * A RectangularPyramid is Pyramid with a rectangular base. + */ + + attribute :>> baseLength [1]; + attribute :>> baseWidth [1]; + + item :>> base : Rectangle { + attribute :>> length = RectangularPyramid::baseLength; + attribute :>> width = RectangularPyramid::baseWidth; + } + } +} \ No newline at end of file diff --git a/src/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml b/src/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml new file mode 100644 index 0000000000000000000000000000000000000000..2a1fc8f251a613dbac3f4e7749ba26bb81dc594b --- /dev/null +++ b/src/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml @@ -0,0 +1,156 @@ +standard library package SpatialItems { + doc + /* + * This package models physical items that have a spatial extent and act as a spatial frame of reference + * for obtaining position and displacement vectors of points within them. + */ + + private import Objects::Point; + private import SpatialFrames::SpatialFrame; + private import Quantities::VectorQuantityValue; + private import MeasurementReferences::ThreeDCoordinateFrame; + private import MeasurementReferences::nullTransformation; + private import Time::Clock; + private import Time::TimeInstantValue; + private import ScalarValues::Natural; + private import ISQ::universalCartesianSpatial3dCoordinateFrame; + private import ISQ::Position3dVector; + private import ISQ::Displacement3dVector; + private import VectorFunctions::isZeroVector; + private import SequenceFunctions::isEmpty; + private import ControlFunctions::forAll; + + item def SpatialItem :> SpatialFrame { + doc + /* + * A SpatialItem is an Item with a three-dimensional spatial extent that also acts as a SpatialFrame of reference. + */ + + ref item :>> localClock : Clock[1] default Time::universalClock { + doc + /* + * A local Clock to be used as the corresponding time reference within this SpatialItem. + * By default this is the singleton universalClock. + */ + } + + attribute coordinateFrame : ThreeDCoordinateFrame[1] default universalCartesianSpatial3dCoordinateFrame { + doc + /* + * The three-dimensional CoordinateFrame to be used as the measurement reference for position + * and displacement vector values relative to this SpatialItem. + * By default this is the singleton universalCartesianSpatial3dCoordinateFrame. + */ + } + + item originPoint : Point[1] :> spaceShots { + doc + /* + * The Point at the origin of the coordinateFrame of this SpatialItem. + */ + } + + assert constraint originPointConstraint { + doc + /* + * The CurrentPositionOf the originPoint must always be a zero vector. + */ + + isZeroVector(CurrentPositionOf(originPoint, that)) + } + + item componentItems : SpatialItem[1..*] :> subitems { + doc + /* + * A SpatialItem with componentItems is entirely made up of those items (the SpatialItem occurs only + * as a collection of its componentItems). By default they have the same localClock and equivalent + * coordinate frame as the SpatialItem they make up. A SpatialItem without componentItems occurs + * on its own, separately from its subitems. + */ + item :>> localClock default (that as SpatialItem).localClock; + attribute :>> coordinateFrame { + attribute :>> mRefs default (that.that as SpatialItem).coordinateFrame.mRefs; + attribute :>> transformation[1] default nullTransformation { + attribute :>> source default (that.that.that as SpatialItem).coordinateFrame; + } + } + } + + private attribute cunionNum: Natural [1] = if isEmpty(componentItems) ? 0 else 1; + private attribute componentUnion[cunionNum] :> unionsOf { + doc + /* + * A SpatialItem with componentItems is is a spatial union of them. + */ + + item :>> elements : SpatialItem [1..*] = componentItems; + } + } + + calc def PositionOf :> SpatialFrames::PositionOf { + doc + /* + * The PositionOf a Point relative to a SpatialItem, at a specific TimeInstantValue relative to a given Clock, + * is a positionVector that is a VectorQuantityValue in the coordinateFrame of the SpatialItem. + * The default Clock is the localClock of the SpatialItem. + */ + + in point : Point[1]; + in timeInstant : TimeInstantValue[1]; + in enclosingItem :>> 'frame' : SpatialItem[1]; + in clock : Clock[1] default enclosingItem.localClock; + return positionVector : Position3dVector[1] { + attribute :>> mRef = enclosingItem.coordinateFrame; + } + } + + calc def CurrentPositionOf :> SpatialFrames::CurrentPositionOf { + doc + /* + * The CurrentPositionOf a Point relative to a SpatialItem and a Clock is the PositionOf + * the Point relative to the SpatialItem at the currentTime of the Clock. + */ + + in point : Point[1]; + in enclosingItem :>> 'frame' : SpatialItem[1]; + in clock : Clock[1] default enclosingItem.localClock; + return positionVector : Position3dVector[1] { + attribute :>> mRef = enclosingItem.coordinateFrame; + } + } + + calc def DisplacementOf :> SpatialFrames::DisplacementOf { + doc + /* + * The DisplacementOf two Points relative to a SpatialItem, at a specific TimeInstantValue relative to a + * given Clock, is the displacementVector computed as the difference between the PositionOf the + * first Point and PositionOf the second Point, relative to that SpatialItem, at that timeInstant. + */ + + in point1 : Point[1]; + in point2 : Point[1]; + in timeInstant : TimeInstantValue[1]; + in spatialItem :>> 'frame' : SpatialItem[1]; + in clock : Clock[1] default spatialItem.localClock; + return displacementVector : Displacement3dVector[1] { + attribute :>> mRef = spatialItem.coordinateFrame; + } + } + + calc def CurrentDisplacementOf :> SpatialFrames::CurrentDisplacementOf { + doc + /* + * The CurrentDisplacementOf two Points relative to a SpatialItem and a Clock is the DisplacementOf + * the Points relative to the SpatialItem, at the currentTime of the Clock. + */ + + in point1 : Point[1]; + in point2 : Point[1]; + in spatialItem :>> 'frame' : SpatialItem[1]; + in clock : Clock[1] default spatialItem.localClock; + return displacementVector : Displacement3dVector[1] { + attribute :>> mRef = spatialItem.coordinateFrame; + } + } + +} \ No newline at end of file diff --git a/src/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml b/src/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml new file mode 100644 index 0000000000000000000000000000000000000000..1ea7f565c9e42409423d4e229f3108cbddafdeee --- /dev/null +++ b/src/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml @@ -0,0 +1,78 @@ +standard library package ImageMetadata { + doc + /* + * This package provides attributive data and metadata to allow a model element to be + * annotated with an image to be used in its graphical rendering or as a marker to + * adorn graphical or textual renderings. + */ + + private import ScalarValues::String; + + attribute def Image { + doc + /* + * Image provides the data necessary for the physical definition of + * a graphical image. + */ + + attribute content : String[0..1] { + doc + /* + * Binary data for the image according to the given MIME type, + * encoded as given by the encoding. + */ + } + + attribute encoding : String[0..1] { + doc + /* + * Describes how characters in the content are to be decoded into + * binary data. At least "base64", "hex", "identify", and "JSONescape" + * shall be supported. + */ + } + + attribute type : String[0..1] { + doc + /* + * The MIME type according to which the content should be interpreted. + */ + } + + attribute location : String[0..1] { + doc + /* + * A URI for the location of a resource containing the image content, + * as an alternative for embedding it in the content attribute. + */ + } + } + + metadata def Icon { + doc + /* + * Icon metadata can be used to annotate a model element with an image to be used + * to show render the element on a diagram and/or a small image to be used as an + * adornment on a graphical or textual rendering. Alternatively, another metadata + * definition can be annotated with an Icon to indicate that any model element + * annotated by the containing metadata can be rendered according to the Icon. + */ + + attribute fullImage : Image[0..1] { + doc + /* + * A full-sized image that can be used to render the annotated element on a + * graphical view, potentially as an alternative to its standard rendering. + */ + } + + attribute smallImage : Image[0..1] { + doc + /* + * A smaller image that can be used as an adornment on the graphical rendering + * of the annotated element or as a marker in a textual rendering. + */ + } + } + +} \ No newline at end of file diff --git a/src/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml b/src/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml new file mode 100644 index 0000000000000000000000000000000000000000..0fbdaf538720afdadc75ff4a95122cbe4b5b756e --- /dev/null +++ b/src/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml @@ -0,0 +1,143 @@ +standard library package ModelingMetadata { + doc + /* + * This package contains definitions of metadata generally useful for annotating models. + */ + + private import Base::Anything; + private import ScalarValues::String; + private import RiskMetadata::Risk; + + enum def StatusKind { + doc + /* + * StatusKind enumerates the possible statuses of work on a model element. + */ + + open { + doc + /* + * Status is open. + */ + } + + tbd { + doc + /* + * Status is to be determined. + */ + } + + tbr { + doc + /* + * Status is to be resolved. + */ + } + + tbc { + doc + /* + * Status is to be confirmed. + */ + } + + done { + doc + /* + * Status is done. + */ + } + + closed { + doc + /* + * Status is closed. + */ + } + } + + metadata def StatusInfo { + doc + /* + * StatusInfo is used to annotate a model element with status information. + */ + + attribute originator : String [0..1] { + doc + /* + * The originator of the annotated element. + */ + } + + attribute owner : String [0..1] { + doc + /* + * The current owner of the annotated element. + */ + } + + attribute status : StatusKind { + doc + /* + * The current status of work on the annotated element (required). + */ + } + + item risk : Risk [0..1] { + doc + /* + * An assessment of risk for the annotated element. + */ + } + } + + metadata def Rationale { + doc + /* + * Rationale is used to explain a choice or other decision made related to the + * annotated element. + */ + + attribute text : String { + doc + /* + * A textual description of the rationale (required). + */ + } + + ref explanation : Anything [0..1] { + doc + /* + * A reference to a feature that provides a formal explanation of the rationale. + * (For example, a trade study whose result explains the choice of a certain alternative). + */ + } + } + + metadata def Issue { + doc + /* + * Issue is used to record some issue concerning the annotated element. + */ + + attribute text : String { + doc + /* + * A textual description of the issue. + */ + } + } + + metadata def Refinement { + doc + /* + * Refinement is used to identify a dependency as modeling a refinement relationship. + * In such a relationship, the source elements of the relationship provide a more precise and/or + * accurate representation than the target elements. + */ + + :>> annotatedElement : SysML::Dependency; + } + +} \ No newline at end of file diff --git a/src/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml b/src/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml new file mode 100644 index 0000000000000000000000000000000000000000..42b3e59cda2cbf85c334b92deff53b2ba47eb85b --- /dev/null +++ b/src/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml @@ -0,0 +1,39 @@ +standard library package ParametersOfInterestMetadata { + doc + /* + * This package contains definitions of metadata to identify key parameters of interest, + * including measures of effectiveness (MOE) and other key measures of performance (MOP). + */ + + private import Metaobjects::SemanticMetadata; + + attribute measuresOfEffectiveness[*] nonunique { + doc /* Base feature for attributes that are measures of effectiveness. */ + } + + attribute measuresOfPerformance[*] nonunique { + doc /* Base feature for attributes that are measures of performance. */ + } + + metadata def MeasureOfEffectiveness :> SemanticMetadata { + doc + /* + * MeasureOfEffectiveness is semantic metadata for identifying an attribute as a + * measure of effectiveness. + */ + + :>> annotatedElement : SysML::Usage; + :>> baseType = measuresOfEffectiveness meta SysML::Usage; + } + + metadata def MeasureOfPerformance :> SemanticMetadata { + doc + /* + * MeasureOfPerformance is semantic metadata for identifying an attribute as a + * measure of performance. + */ + + :>> annotatedElement : SysML::Usage; + :>> baseType = measuresOfPerformance meta SysML::Usage; + } +} \ No newline at end of file diff --git a/src/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml b/src/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml new file mode 100644 index 0000000000000000000000000000000000000000..95822f6298849599057a17df451d6695ce9994aa --- /dev/null +++ b/src/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml @@ -0,0 +1,100 @@ +standard library package RiskMetadata { + doc + /* + * This package defines metadata for annotating model elements with assessments of risk. + */ + + private import ScalarValues::Real; + + attribute def Level :> Real { + doc + /* + * A Level is a Real number in the interval 0.0 to 1.0, inclusive. + */ + + assert constraint { that >= 0.0 and that <= 1.0 } + } + + enum def LevelEnum :> Level { + doc + /* + * LevelEnum provides standard probability Levels for low, medium and high risks. + */ + + low = 0.25; + medium = 0.50; + high = 0.75; + } + + attribute def RiskLevel { + doc + /* + * RiskLevel gives the probability of a risk occurring and, optionally, the impact + * if the risk occurs. + */ + + attribute probability : Level { + doc + /* + * The probability that a risk will occur. + */ + } + + attribute impact : Level [0..1] { + doc + /* + * The impact of the risk if it occurs (with 0.0 being no impact and 1.0 being + * the most severe impact). + */ + } + } + + enum def RiskLevelEnum :> RiskLevel { + doc + /* + * RiskLevelEnum enumerates standard RiskLevels for low, medium and high risks + * (without including impact). + */ + + low = RiskLevel(probability = LevelEnum::low); + medium = RiskLevel(probability = LevelEnum::medium); + high = RiskLevel(probability = LevelEnum::high); + } + + metadata def Risk { + doc + /* + * Risk is used to annotate a model element with an assessment of the risk related to it + * in some typical risk areas. + */ + + attribute totalRisk : RiskLevel [0..1] { + doc + /* + * The total risk associated with the annotated element. + */ + } + + attribute technicalRisk : RiskLevel [0..1] { + doc + /* + * The risk of unresolved technical issues regarding the annotated element. + */ + } + + attribute scheduleRisk : RiskLevel [0..1] { + doc + /* + * The risk that work on the annotated element will not be completed on schedule. + */ + } + + attribute costRisk : RiskLevel [0..1] { + doc + /* + * The risk that work on the annotated element will exceed its planned cost. + */ + } + } + +} \ No newline at end of file diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml new file mode 100644 index 0000000000000000000000000000000000000000..85ce033787f6d1d553d561cd453f2da753642097 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml @@ -0,0 +1,42 @@ +standard library package ISQ { + doc + /* + * International system of quantities (ISQ), as defined in ISO/IEC 80000 + */ + + private import ScalarValues::Real; + private import Quantities::*; + private import MeasurementReferences::*; + + public import ISQBase::*; // ISO/IEC 80000 base quantities and general concepts + public import ISQSpaceTime::*; // ISO 80000-3 "Space and Time" + public import ISQMechanics::*; // ISO 80000-4 "Mechanics" + public import ISQThermodynamics::*; // ISO 80000-5 "Thermodynamics" + public import ISQElectromagnetism::*; // IEC 80000-6 "Electromagnetism" + public import ISQLight::*; // ISO 80000-7 "Light" + public import ISQAcoustics::*; // ISO 80000-8 "Acoustics" + public import ISQChemistryMolecular::*; // ISO 80000-9 "Physical chemistry and molecular physics" + public import ISQAtomicNuclear::*; // ISO 80000-10 "Atomic and nuclear physics" + public import ISQCharacteristicNumbers::*; // ISO 80000-11 "Characteristic numbers" + public import ISQCondensedMatter::*; // ISO 80000-12 "Condensed matter physics" + public import ISQInformation::*; // IEC 80000-13 "Information science and technology" + + /* Additional quantity declarations */ + + attribute def TemperatureDifferenceValue :> ScalarQuantityValue { + doc + /* + * temperature difference + * A separate temperature difference quantity and unit are needed in order to support °C, °F and centrigrade temperature differences + */ + attribute :>> num: Real; + attribute :>> mRef: TemperatureDifferenceUnit[1]; + } + + attribute temperatureDifference: TemperatureDifferenceValue [*] nonunique :> scalarQuantities; + + attribute def TemperatureDifferenceUnit :> SimpleUnit { + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = thermodynamicTemperaturePF; } + } +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml new file mode 100644 index 0000000000000000000000000000000000000000..b7a12be8243d63bb1e8edcc7c18ac8ac38b01ae6 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml @@ -0,0 +1,444 @@ +standard library package ISQAcoustics { + doc + /* + * International System of Quantities and Units + * Generated on 2022-08-07T14:44:27Z from standard ISO-80000-8:2020 "Acoustics" + * see also https://www.iso.org/obp/ui/#iso:std:iso:80000:-8:ed-2:v1:en + * + * Note 1: In documentation comments, AsciiMath notation (see http://asciimath.org/) is used for mathematical concepts, + * with Greek letters in Unicode encoding. In running text, AsciiMath is placed between backticks. + * Note 2: For vector and tensor quantities currently the unit and quantity value type for their (scalar) magnitude is + * defined, as well as their typical Cartesian 3d VectorMeasurementReference (i.e. coordinate system) + * or TensorMeasurementReference. + */ + + private import ScalarValues::Real; + private import Quantities::*; + private import MeasurementReferences::*; + private import ISQBase::*; + + /* Quantity definitions referenced from other ISQ packages */ + private import ISQMechanics::PowerValue; + private import ISQMechanics::PressureValue; + private import ISQSpaceTime::CartesianSpatial3dCoordinateFrame; + private import ISQSpaceTime::SpeedValue; + private import ISQSpaceTime::CartesianVelocity3dCoordinateFrame; + private import ISQSpaceTime::AccelerationValue; + private import ISQSpaceTime::CartesianAcceleration3dCoordinateFrame; + private import ISQThermodynamics::EnergyValue; + + /* ISO-80000-8 item 8-1 logarithmic frequency range */ + attribute def LogarithmicFrequencyRangeValue :> ScalarQuantityValue { + doc + /* + * source: item 8-1 logarithmic frequency range + * symbol(s): `G` + * application domain: generic + * name: LogarithmicFrequencyRange + * quantity dimension: 1 + * measurement unit(s): oct, dec + * tensor order: 0 + * definition: quantity given by: `G = log_2(f_2/f_1) "[oct]" = log_10(f_2/f_1) "[dec]"`, where `f_1` and `f_2` are two frequencies (ISO 80000-3) + * remarks: One octave (oct) is the logarithmic frequency range between `f_1` and `f_2` when `f_2/f_1 = 2`. Similarly, one decade (dec) is the logarithmic frequency range between `f_1` and `f_2` when `f_2/f_1 = 10`; thus `1 "[dec]" = log_2(10) "[oct]" ≈ 3.322 "[oct]"`. ISO 266 specifies preferred frequencies for acoustics separated by logarithmic frequency ranges equal to one tenth of a decade (`0.1 "[dec]"`). Each `0.1 "[dec]"` logarithmic frequency range is referred to in ISO 266 as a "one-third-octave interval" because `0.1 "[dec]"` is approximately equal to `1/3 "[oct]"`. Similarly, a logarithmic frequency range of `0.3 "[dec]"` is referred to as a "one-octave interval" because `0.3 "[dec]"` is approximately equal to `1 "[oct]"`. A logarithmic frequency range equal to one tenth of a decade can be referred to as a decidecade. + */ + attribute :>> num: Real; + attribute :>> mRef: LogarithmicFrequencyRangeUnit[1]; + } + + attribute logarithmicFrequencyRange: LogarithmicFrequencyRangeValue[*] nonunique :> scalarQuantities; + + attribute def LogarithmicFrequencyRangeUnit :> DimensionOneUnit { + } + + /* ISO-80000-8 item 8-2.1 static pressure */ + attribute staticPressure: PressureValue :> scalarQuantities { + doc + /* + * source: item 8-2.1 static pressure + * symbol(s): `p_s` + * application domain: generic + * name: StaticPressure (specializes Pressure) + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, kg*m^-1*s^-2 + * tensor order: 0 + * definition: pressure (ISO 80000-4) in a medium when no sound wave is present + * remarks: This definition applies to a medium with zero flow. + */ + } + + /* ISO-80000-8 item 8-2.2 sound pressure */ + attribute soundPressure: PressureValue :> scalarQuantities { + doc + /* + * source: item 8-2.2 sound pressure + * symbol(s): `p` + * application domain: generic + * name: SoundPressure (specializes Pressure) + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, kg*m^-1*s^-2 + * tensor order: 0 + * definition: difference between instantaneous total pressure and static pressure (item 8-2.1) + * remarks: None. + */ + } + + /* ISO-80000-8 item 8-3 sound particle displacement */ + attribute def Cartesian3dSoundParticleDisplacementVector :> VectorQuantityValue { + doc + /* + * source: item 8-3 sound particle displacement + * symbol(s): `vec(δ)` + * application domain: generic + * name: SoundParticleDisplacement (specializes Displacement) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity giving the instantaneous displacement (ISO 80000-3) of a particle in a medium from what would be its position in the absence of sound waves + * remarks: None. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: CartesianSpatial3dCoordinateFrame[1]; + } + + attribute soundParticleDisplacementVector: Cartesian3dSoundParticleDisplacementVector :> vectorQuantities; + + /* ISO-80000-8 item 8-4 sound particle velocity */ + attribute def Cartesian3dSoundParticleVelocityVector :> VectorQuantityValue { + doc + /* + * source: item 8-4 sound particle velocity + * symbol(s): `vec(u)`, `(vec(v))` + * application domain: generic + * name: SoundParticleVelocity (specializes Velocity) + * quantity dimension: L^1*T^-1 + * measurement unit(s): m*s^-1 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity given by: `vec(u) = del(vec(δ))/del(t)`, where `vec(δ)` is sound particle displacement (item 8-3) and `t` is time (ISO 80000-3) + * remarks: The definition is limited to small-amplitude acoustic disturbances such that the magnitude of `vec(u)` is small relative to the phase speed (ISO 80000-3) of sound. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: CartesianVelocity3dCoordinateFrame[1]; + } + + attribute soundParticleVelocityVector: Cartesian3dSoundParticleVelocityVector :> vectorQuantities; + + /* ISO-80000-8 item 8-5 sound particle acceleration */ + attribute def Cartesian3dSoundParticleAccelerationVector :> VectorQuantityValue { + doc + /* + * source: item 8-5 sound particle acceleration + * symbol(s): `vec(a)` + * application domain: generic + * name: SoundParticleAcceleration (specializes Acceleration) + * quantity dimension: L^1*T^-2 + * measurement unit(s): m*s^-2 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity given by: `vec(a) = (del(vec(u)))/(del(t))`, where `vec(u)` is sound particle velocity (item 8-4) and `t` is time + * remarks: The definition is limited to small-amplitude acoustic disturbances such that the magnitude of `vec(u)` is small relative to the phase speed (ISO 80000-3) of sound. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: CartesianAcceleration3dCoordinateFrame[1]; + } + + attribute soundParticleAccelerationVector: Cartesian3dSoundParticleAccelerationVector :> vectorQuantities; + + /* ISO-80000-8 item 8-6 volume velocity, volume flow rate */ + attribute volumeVelocity: SpeedValue :> scalarQuantities { + doc + /* + * source: item 8-6 volume velocity, volume flow rate + * symbol(s): `q`, `q_v` + * application domain: generic + * name: VolumeVelocity (specializes Speed) + * quantity dimension: L^3*T^-1 + * measurement unit(s): m^3*s^-1 + * tensor order: 0 + * definition: surface integral of the normal component of the sound particle velocity (item 8-4) over a defined surface + * remarks: None. + */ + } + + alias volumeFlowRate for volumeVelocity; + + /* ISO-80000-8 item 8-7 sound energy density */ + attribute def SoundEnergyDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 8-7 sound energy density + * symbol(s): `w` + * application domain: generic + * name: SoundEnergyDensity + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): J/m^3, kg*m^-1*s^-2 + * tensor order: 0 + * definition: quantity given by: `w = 1/2 ρ_m u^2 + 1/2 p^2/(ρ_m c^2)`, where `ρ_m` is mean density (ISO 80000-4), `u` is the magnitude of the sound particle velocity (item 8-4), `p` is sound pressure (item 8-2.2), and `c` is the phase speed (ISO 80000-3) of sound + * remarks: In formula form: `E = int_(t_1)^(t_2) p^2 dt`, where `t_1` and `t_2` are the starting and ending times for the integral and `p` is sound pressure (item 8-2.2). In airborne acoustics, the sound pressure is frequency-weighted and frequency-band-limited. If frequency weightings as specified in IEC 61672-1 are applied, this should be indicated by appropriate subscripts to the symbol `E`. In underwater acoustics, the term ""sound exposure"" indicates an unweighted quantity unless indicated otherwise. + */ + attribute :>> num: Real; + attribute :>> mRef: SoundEnergyDensityUnit[1]; + } + + attribute soundEnergyDensity: SoundEnergyDensityValue[*] nonunique :> scalarQuantities; + + attribute def SoundEnergyDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-8 item 8-8 sound energy */ + attribute soundEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 8-8 sound energy + * symbol(s): `Q` + * application domain: generic + * name: SoundEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: integral of sound energy density (item 8-7) over a specified volume + * remarks: The sound energy in region `R` can be expressed by: `Q = oint_R w(x) d^3x`, where `d^3x` is an element of volume. + */ + } + + /* ISO-80000-8 item 8-9 sound power */ + attribute soundPower: PowerValue :> scalarQuantities { + doc + /* + * source: item 8-9 sound power + * symbol(s): `P`, `W` + * application domain: generic + * name: SoundPower (specializes Power) + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): W, kg*m^2*s^-3 + * tensor order: 0 + * definition: integral over a surface of the product of sound pressure, `p` (item 8-2.2), and the component `u_n` of the particle velocity (item 8-4) in the direction normal to the surface, at a point on the surface + * remarks: This definition holds for waves in the volume of homogenous fluids or gases. This definition can become inapplicable in situations with a high mean fluid flow. Sound power is for example used to indicate the rate at which energy is radiated by a sound source. Sound power is an oscillatory quantity that can be positive or negative. A positive sound power indicates that the sound power is radiated out of the surface. A negative sound power indicates that the sound power is absorbed into the surface. + */ + } + + /* ISO-80000-8 item 8-10 sound intensity */ + attribute def SoundIntensityValue :> ScalarQuantityValue { + doc + /* + * source: item 8-10 sound intensity (magnitude) + * symbol(s): `I` + * application domain: generic + * name: SoundIntensity + * quantity dimension: M^1*T^-3 + * measurement unit(s): W/m^2, kg*s^-3 + * tensor order: 0 + * definition: vector (ISO 80000-2) quantity given by: `vec(I) = p vec(u)`, where `p` is sound pressure (item 8-2.2) and `vec(u)` is sound particle velocity (item 8-4) + * remarks: This definition can become inapplicable in situations with a high mean fluid flow. + */ + attribute :>> num: Real; + attribute :>> mRef: SoundIntensityUnit[1]; + } + + attribute soundIntensity: SoundIntensityValue[*] nonunique :> scalarQuantities; + + attribute def SoundIntensityUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + attribute def Cartesian3dSoundIntensityVector :> VectorQuantityValue { + doc + /* + * source: item 8-10 sound intensity (vector) + * symbol(s): `vec(I)` + * application domain: generic + * name: SoundIntensity + * quantity dimension: M^1*T^-3 + * measurement unit(s): W/m^2, kg*s^-3 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity given by: `vec(I) = p vec(u)`, where `p` is sound pressure (item 8-2.2) and `vec(u)` is sound particle velocity (item 8-4) + * remarks: This definition can become inapplicable in situations with a high mean fluid flow. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dSoundIntensityCoordinateFrame[1]; + } + + attribute soundIntensityVector: Cartesian3dSoundIntensityVector :> vectorQuantities; + + attribute def Cartesian3dSoundIntensityCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: SoundIntensityUnit[3]; + } + + /* ISO-80000-8 item 8-11 sound exposure */ + attribute def SoundExposureValue :> ScalarQuantityValue { + doc + /* + * source: item 8-11 sound exposure + * symbol(s): `E` + * application domain: generic + * name: SoundExposure + * quantity dimension: L^-2*M^2*T^-3 + * measurement unit(s): Pa^2*s, kg^2*m^-2*s^-3 + * tensor order: 0 + * definition: time-integrated squared sound pressure (item 8-2.2) + * remarks: In formula form: `E = int_(t_1)^(t_2) p^2 dt`, where `t_1` and `t_2` are the starting and ending times for the integral and `p` is sound pressure (item 8-2.2). In airborne acoustics, the sound pressure is frequency-weighted and frequency-band-limited. If frequency weightings as specified in IEC 61672-1 are applied, this should be indicated by appropriate subscripts to the symbol `E`. In underwater acoustics, the term "sound exposure" indicates an unweighted quantity unless indicated otherwise. + */ + attribute :>> num: Real; + attribute :>> mRef: SoundExposureUnit[1]; + } + + attribute soundExposure: SoundExposureValue[*] nonunique :> scalarQuantities; + + attribute def SoundExposureUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-8 item 8-12 characteristic impedance of a medium for longitudinal waves */ + attribute def CharacteristicImpedanceOfAMediumForLongitudinalWavesValue :> ScalarQuantityValue { + doc + /* + * source: item 8-12 characteristic impedance of a medium for longitudinal waves + * symbol(s): `Z_c` + * application domain: generic + * name: CharacteristicImpedanceOfAMediumForLongitudinalWaves + * quantity dimension: L^-2*M^1*T^-1 + * measurement unit(s): Pa*s/m, kg*m^-2*s^-1 + * tensor order: 0 + * definition: quotient of sound pressure (item 8-2.2) and the component of the sound particle velocity (item 8-4) in the direction of the wave propagation + * remarks: The definition is limited to a progressive plane wave in a non-dissipative homogenous gas or fluid. Characteristic impedance is a property of the medium and is equal to `ρ c` where `ρ` is the time-averaged density (ISO 80000-4) of the medium and `c` the phase speed of sound (ISO 80000-3). Longitudinal waves are waves in which the displacement of the medium is in the same direction as, or the opposite direction to, the direction of propagation of the wave. + */ + attribute :>> num: Real; + attribute :>> mRef: CharacteristicImpedanceOfAMediumForLongitudinalWavesUnit[1]; + } + + attribute characteristicImpedanceOfAMediumForLongitudinalWaves: CharacteristicImpedanceOfAMediumForLongitudinalWavesValue[*] nonunique :> scalarQuantities; + + attribute def CharacteristicImpedanceOfAMediumForLongitudinalWavesUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-8 item 8-13 acoustic impedance */ + attribute def AcousticImpedanceValue :> ScalarQuantityValue { + doc + /* + * source: item 8-13 acoustic impedance + * symbol(s): `Z_a` + * application domain: generic + * name: AcousticImpedance + * quantity dimension: L^-4*M^1*T^-1 + * measurement unit(s): Pa*s/m^3, kg*m^-4*s^-1 + * tensor order: 0 + * definition: at a surface, quotient of the average sound pressure (item 8-2.2) over that surface and the sound volume flow rate (item 8-6) through that surface + * remarks: This definition applies to a sound pressure that is in phase with the volume flow rate. In this situation, the acoustic impedance is real. Both the sound pressure, `p`, and sound volume flow rate, `q`, are real quantities that fluctuate with time. If the fluctuations are in phase (phase difference equal to zero), the quotient `p/q` is a constant. If they are out of phase (phase difference not equal to zero), they can be represented by complex quantities in the frequency domain, the quotient of which is also complex. + */ + attribute :>> num: Real; + attribute :>> mRef: AcousticImpedanceUnit[1]; + } + + attribute acousticImpedance: AcousticImpedanceValue[*] nonunique :> scalarQuantities; + + attribute def AcousticImpedanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -4; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-8 item 8-14 sound pressure level */ + attribute def SoundPressureLevelValue :> ScalarQuantityValue { + doc + /* + * source: item 8-14 sound pressure level + * symbol(s): `L_p` + * application domain: generic + * name: SoundPressureLevel + * quantity dimension: 1 + * measurement unit(s): dB + * tensor order: 0 + * definition: quantity given by: `L_p = 10 log_10((p_"RMS"^2)/p_0^2) "[dB]"`, where `p_"RMS"` is the root-mean-square sound pressure in the time domain and `p_0` is the reference value of sound pressure + * remarks: For sound in air and other gases, the reference value of sound pressure is given by `p_0 = 20 "[μPa]"`. For sound in water and other liquids, the reference value of sound pressure is given by `p_0 = 1 "[μPa]"`. When stating a value of sound pressure level, the reference value shall be specified. The value of sound pressure level depends on the selected frequency range and time duration. When stating a value of sound pressure level, the frequency range and time duration shall be specified. In accordance with ISO 80000-1, any attachment to the unit symbol as a means of giving information about the special nature of the quantity or context of measurement under consideration is not permitted. If specific frequency and time weightings as specified in IEC 61672-1 or specific frequency bands or time duration are applied, this should be indicated by appropriate subscripts to the quantity symbol. In some applications the level of the peak sound pressure is required. This is obtained by replacing the root-mean-square sound pressure, with the instantaneous sound pressure having the greatest absolute value during a stated time interval, in the definition of sound pressure level. + */ + attribute :>> num: Real; + attribute :>> mRef: SoundPressureLevelUnit[1]; + } + + attribute soundPressureLevel: SoundPressureLevelValue[*] nonunique :> scalarQuantities; + + attribute def SoundPressureLevelUnit :> DimensionOneUnit { + } + + /* ISO-80000-8 item 8-15 sound power level */ + attribute def SoundPowerLevelValue :> ScalarQuantityValue { + doc + /* + * source: item 8-15 sound power level + * symbol(s): `L_P`, `L_W` + * application domain: generic + * name: SoundPowerLevel + * quantity dimension: 1 + * measurement unit(s): dB + * tensor order: 0 + * definition: quantity given by: `L_P = 10 log_10 ((P_m)/P_0) "[dB]"`, where `P_m` is the magnitude of the time-averaged sound power (item 8-9) and `P_0` is the reference value of sound power + * remarks: The reference value of sound power is given by `P_0 = 1 "[pW]"`. When stating a value of sound power level, the reference value shall be specified. The value of sound power level depends on the selected frequency range and time duration. When stating a value of sound power level, the frequency range and time duration shall be specified. In accordance with ISO 80000-1, any attachment to the unit symbol as a means of giving information about the special nature of the quantity or context of measurement under consideration is not permitted. If specific frequency and time weightings as specified in IEC 61672-1 or specific frequency bands or time duration are applied, this should be indicated by appropriate subscripts to the quantity symbol. + */ + attribute :>> num: Real; + attribute :>> mRef: SoundPowerLevelUnit[1]; + } + + attribute soundPowerLevel: SoundPowerLevelValue[*] nonunique :> scalarQuantities; + + attribute def SoundPowerLevelUnit :> DimensionOneUnit { + } + + /* ISO-80000-8 item 8-16 sound exposure level */ + attribute def SoundExposureLevelValue :> ScalarQuantityValue { + doc + /* + * source: item 8-16 sound exposure level + * symbol(s): `L_E` + * application domain: generic + * name: SoundExposureLevel + * quantity dimension: 1 + * measurement unit(s): dB + * tensor order: 0 + * definition: quantity given by: `L_E = 10 log_10(E/E_0) "[dB]"`, where `E` is sound exposure (item 8-11) and `E_0` is the reference value of sound exposure + * remarks: For sound in air and other gases, the reference value of sound exposure is given by `E_0 = 400 "@"["μPa"^2*"s"]`. For sound in water and other liquids, the reference value of sound exposure is given by `E_0 = 1"@"["μPa"^2*"s"]`. When stating a value of sound exposure level, the reference value shall be specified. The value of sound exposure level depends on the selected frequency range and time duration. When stating a value of sound exposure level, the frequency range and time duration shall be specified. In accordance with ISO 80000-1, any attachment to the unit symbol as a means of giving information about the special nature of the quantity or context of measurement under consideration is not permitted. If specific frequency and time weightings as specified in IEC 61672-1 or specific frequency bands or time duration are applied, this should be indicated by appropriate subscripts to the quantity symbol. + */ + attribute :>> num: Real; + attribute :>> mRef: SoundExposureLevelUnit[1]; + } + + attribute soundExposureLevel: SoundExposureLevelValue[*] nonunique :> scalarQuantities; + + attribute def SoundExposureLevelUnit :> DimensionOneUnit { + } + + /* ISO-80000-8 item 8-17 reverberation time */ + attribute reverberationTime: DurationValue :> scalarQuantities { + doc + /* + * source: item 8-17 reverberation time + * symbol(s): `T` + * application domain: generic + * name: ReverberationTime (specializes Duration) + * quantity dimension: T^1 + * measurement unit(s): s + * tensor order: 0 + * definition: time duration (ISO 80000-3) required for the space-averaged sound energy density (item 8-7) to decrease to `10^(−6)` of its initial value (i.e. for its level to decrease by `60 "[dB]"`) after the source emission has stopped + * remarks: The reverberation time can be evaluated based on a dynamic range smaller than `60 "[dB]"` and extrapolated to a decay time of `60 "[dB]"`. It is then labelled accordingly `T_n`, where `n` is the dynamic range in `"[dB]"`. See also ISO 3382-1. + */ + } + +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml new file mode 100644 index 0000000000000000000000000000000000000000..9041e338e4401495ca5a58cc4e4a2974f04793a7 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml @@ -0,0 +1,2734 @@ +standard library package ISQAtomicNuclear { + doc + /* + * International System of Quantities and Units + * Generated on 2022-08-07T14:44:27Z from standard ISO-80000-10:2019 "Atomic and nuclear physics" + * see also https://www.iso.org/obp/ui/#iso:std:iso:80000:-10:ed-2:v1:en + * + * Note 1: In documentation comments, AsciiMath notation (see http://asciimath.org/) is used for mathematical concepts, + * with Greek letters in Unicode encoding. In running text, AsciiMath is placed between backticks. + * Note 2: For vector and tensor quantities currently the unit and quantity value type for their (scalar) magnitude is + * defined, as well as their typical Cartesian 3d VectorMeasurementReference (i.e. coordinate system) + * or TensorMeasurementReference. + */ + + private import ScalarValues::Real; + private import Quantities::*; + private import MeasurementReferences::*; + private import ISQBase::*; + + /* Quantity definitions referenced from other ISQ packages */ + private import ISQChemistryMolecular::DiffusionCoefficientUnit; + private import ISQChemistryMolecular::DiffusionCoefficientValue; + private import ISQChemistryMolecular::diffusionCoefficient; + private import ISQElectromagnetism::ElectricChargeValue; + private import ISQSpaceTime::AngularFrequencyValue; + private import ISQSpaceTime::AreaValue; + private import ISQThermodynamics::EnergyValue; + + /* ISO-80000-10 item 10-1.1 atomic number, proton number */ + attribute atomicNumber: CountValue :> scalarQuantities { + doc + /* + * source: item 10-1.1 atomic number, proton number + * symbol(s): `Z` + * application domain: generic + * name: AtomicNumber (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: number of protons in an atomic nucleus + * remarks: A nuclide is a species of atom with specified numbers of protons and neutrons. Nuclides with the same value of `Z` but different values of `N` are called isotopes of an element. The ordinal number of an element in the periodic table is equal to the atomic number. The atomic number equals the quotient of the charge (IEC 80000-6) of the nucleus and the elementary charge (ISO 80000-1). + */ + } + + alias protonNumber for atomicNumber; + + /* ISO-80000-10 item 10-1.2 neutron number */ + attribute neutronNumber: CountValue :> scalarQuantities { + doc + /* + * source: item 10-1.2 neutron number + * symbol(s): `N` + * application domain: generic + * name: NeutronNumber (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: number of neutrons in an atomic nucleus + * remarks: Nuclides with the same value of `N` but different values of `Z` are called isotones. `N - Z` is called the neutron excess number. + */ + } + + /* ISO-80000-10 item 10-1.3 nucleon number, mass number */ + attribute nucleonNumber: CountValue :> scalarQuantities { + doc + /* + * source: item 10-1.3 nucleon number, mass number + * symbol(s): `A` + * application domain: generic + * name: NucleonNumber (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: number of nucleons in an atomic nucleus + * remarks: `A` = `Z` + `N` Nuclides with the same value of `A` are called isobars. + */ + } + + alias massNumber for nucleonNumber; + + /* ISO-80000-10 item 10-2 rest mass, proper mass */ + attribute restMass: MassValue :> scalarQuantities { + doc + /* + * source: item 10-2 rest mass, proper mass + * symbol(s): `m(X)`, `m_X` + * application domain: generic + * name: RestMass (specializes Mass) + * quantity dimension: M^1 + * measurement unit(s): kg, Da, u + * tensor order: 0 + * definition: for particle X, mass (ISO 80000-4) of that particle at rest in an inertial frame + * remarks: EXAMPLE `m(H_2O)` for a water molecule, `m_e` for an electron. Rest mass is often denoted `m_0`. 1 u is equal to 1/12 times the mass of a free carbon 12 atom, at rest and in its ground state. 1 Da = 1 u + */ + } + + alias properMass for restMass; + + /* ISO-80000-10 item 10-3 rest energy */ + attribute restEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 10-3 rest energy + * symbol(s): `E_0` + * application domain: generic + * name: RestEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, N*m, kg*m^2*s^-2 + * tensor order: 0 + * definition: energy `E_0` (ISO 80000-5) of a particle at rest: `E_0 = m_0 c_0^2` where `m_0` is the rest mass (item 10-2) of that particle, and `c_0` is speed of light in vacuum (ISO 80000-1) + * remarks: None. + */ + } + + /* ISO-80000-10 item 10-4.1 atomic mass */ + attribute atomicMass: MassValue :> scalarQuantities { + doc + /* + * source: item 10-4.1 atomic mass + * symbol(s): `m(X)`, `m_X` + * application domain: generic + * name: AtomicMass (specializes Mass) + * quantity dimension: M^1 + * measurement unit(s): kg, Da, u + * tensor order: 0 + * definition: rest mass (item 10-2) of an atom X in the ground state + * remarks: `m(X)/m_u` is called the relative atomic mass. 1 u is equal to 1/12 times the mass of a free carbon 12 atom, at rest and in its ground state. 1 Da = 1 u + */ + } + + /* ISO-80000-10 item 10-4.2 nuclidic mass */ + attribute nuclidicMass: MassValue :> scalarQuantities { + doc + /* + * source: item 10-4.2 nuclidic mass + * symbol(s): `m(X)`, `m_X` + * application domain: generic + * name: NuclidicMass (specializes Mass) + * quantity dimension: M^1 + * measurement unit(s): kg, Da, u + * tensor order: 0 + * definition: rest mass (item 10-2) of a nuclide X in the ground state + * remarks: 1 u is equal to 1/12 times the mass of a free carbon 12 atom, at rest and in its ground state. 1 Da = 1 u + */ + } + + /* ISO-80000-10 item 10-4.3 unified atomic mass constant */ + attribute unifiedAtomicMassConstant: MassValue :> scalarQuantities { + doc + /* + * source: item 10-4.3 unified atomic mass constant + * symbol(s): `m_u` + * application domain: generic + * name: UnifiedAtomicMassConstant (specializes Mass) + * quantity dimension: M^1 + * measurement unit(s): kg, Da, u + * tensor order: 0 + * definition: 1/12 of the mass (ISO 80000-4) of an atom of the nuclide ^(12)C in the ground state at rest + * remarks: 1 u is equal to 1/12 times the mass of a free carbon 12 atom, at rest and in its ground state. 1 Da = 1 u + */ + } + + /* ISO-80000-10 item 10-5.1 elementary charge */ + attribute elementaryCharge: ElectricChargeValue :> scalarQuantities { + doc + /* + * source: item 10-5.1 elementary charge + * symbol(s): `e` + * application domain: generic + * name: ElementaryCharge (specializes ElectricCharge) + * quantity dimension: T^1*I^1 + * measurement unit(s): C, s*A + * tensor order: 0 + * definition: one of the fundamental constants in the SI system (ISO 80000-1), equal to the charge of the proton and opposite to the charge of the electron + * remarks: None. + */ + } + + /* ISO-80000-10 item 10-5.2 charge number, ionization number */ + attribute def ChargeNumberValue :> DimensionOneValue { + doc + /* + * source: item 10-5.2 charge number, ionization number + * symbol(s): `c` + * application domain: generic + * name: ChargeNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for a particle, quotient of the electric charge (IEC 80000-6) and the elementary charge (ISO 80000-1) + * remarks: A particle is said to be electrically neutral if its charge number is equal to zero. The charge number of a particle can be positive, negative, or zero. The state of charge of a particle may be presented as a superscript to the symbol of that particle, e.g. `H^+, He^(++), Al^(3+), Cl^-, S^(--), N^(3-)`. + */ + } + attribute chargeNumber: ChargeNumberValue :> scalarQuantities; + + alias ionizationNumber for chargeNumber; + + /* ISO-80000-10 item 10-6 Bohr radius */ + attribute bohrRadius: LengthValue :> scalarQuantities { + doc + /* + * source: item 10-6 Bohr radius + * symbol(s): `a_0` + * application domain: generic + * name: BohrRadius (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m, Å + * tensor order: 0 + * definition: radius (ISO 80000-3) of the electron orbital in the hydrogen atom in its ground state in the Bohr model of the atom: `a_0 = (4 π ε_0 ℏ^2)/(m_e e^2)` where `ε_0` is the electric constant (IEC 80000-6), `ℏ` is the reduced Planck constant (ISO 80000-1), `m_e` is the rest mass (item 10-2) of electron, and `e` is the elementary charge (ISO 80000-1) + * remarks: The radius of the electron orbital in the H atom in its ground state is `a_0` in the Bohr model of the atom. ångström (Å), `1 Å := 10^-10 m`. + */ + } + + /* ISO-80000-10 item 10-7 Rydberg constant */ + attribute def RydbergConstantValue :> ScalarQuantityValue { + doc + /* + * source: item 10-7 Rydberg constant + * symbol(s): `R_∞` + * application domain: generic + * name: RydbergConstant + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: spectroscopic constant that determines the wave numbers of the lines in the spectrum of hydrogen: `R_(oo) = e^2/(8 π ε_0 a_0 h c_0)` where `e` is the elementary charge (ISO 80000-1), `ε_0` is the electric constant (IEC 80000-6), `a_0` is the Bohr radius (item 10-6), `h` is the Planck constant (ISO 80000-1), and `c_0` is the speed of light in vacuum (ISO 80000-1) + * remarks: The quantity `R_y = R_∞ h c_0` is called the Rydberg energy. + */ + attribute :>> num: Real; + attribute :>> mRef: RydbergConstantUnit[1]; + } + + attribute rydbergConstant: RydbergConstantValue[*] nonunique :> scalarQuantities; + + attribute def RydbergConstantUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-10 item 10-8 Hartree energy */ + attribute def HartreeEnergyValue :> ScalarQuantityValue { + doc + /* + * source: item 10-8 Hartree energy + * symbol(s): `E_H`, `E_h` + * application domain: generic + * name: HartreeEnergy + * quantity dimension: L^6*M^3*T^-6 + * measurement unit(s): eV*J*kg*m^2*s^-2 + * tensor order: 0 + * definition: energy (ISO 80000-5) of the electron in a hydrogen atom in its ground state: `E_H = e^2/(4 π ε_0 a_0)` where `e` is the elementary charge (ISO 80000-1), `ε_0` is the electric constant (IEC 80000-6), and `a_0` is the Bohr radius (item 10-6) + * remarks: The energy of the electron in an H atom in its ground state is `E_H`. + */ + attribute :>> num: Real; + attribute :>> mRef: HartreeEnergyUnit[1]; + } + + attribute hartreeEnergy: HartreeEnergyValue[*] nonunique :> scalarQuantities; + + attribute def HartreeEnergyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 6; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 3; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -6; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-10 item 10-9.1 magnetic dipole moment */ + attribute def MagneticDipoleMomentValue :> ScalarQuantityValue { + doc + /* + * source: item 10-9.1 magnetic dipole moment (magnitude) + * symbol(s): `μ` + * application domain: atomic physics + * name: MagneticDipoleMoment + * quantity dimension: L^2*I^1 + * measurement unit(s): m^2*A + * tensor order: 0 + * definition: for a particle, vector (ISO 80000-2) quantity causing a change to its energy (ISO 80000-5) `ΔW` in an external magnetic field of field flux density `vec(B)` (IEC 80000-6): `ΔW` = -`vec(μ)` · `vec(B)` + * remarks: For an atom or nucleus, this energy is quantized and can be written as: `W` = `g μ_x M B` where `g` is the appropriate `g` factor (item 10-14.1 or item 10-14.2), `μ_x` is mostly the Bohr magneton or nuclear magneton (item 10-9.2 or item 10-9.3), `M` is magnetic quantum number (item 10-13.4), and `B` is magnitude of the magnetic flux density. See also IEC 80000-6. + */ + attribute :>> num: Real; + attribute :>> mRef: MagneticDipoleMomentUnit[1]; + } + + attribute magneticDipoleMoment: MagneticDipoleMomentValue[*] nonunique :> scalarQuantities; + + attribute def MagneticDipoleMomentUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, electricCurrentPF); } + } + + attribute def Cartesian3dMagneticDipoleMomentVector :> VectorQuantityValue { + doc + /* + * source: item 10-9.1 magnetic dipole moment (vector) + * symbol(s): `vec(μ)` + * application domain: atomic physics + * name: MagneticDipoleMoment + * quantity dimension: L^2*I^1 + * measurement unit(s): m^2*A + * tensor order: 1 + * definition: for a particle, vector (ISO 80000-2) quantity causing a change to its energy (ISO 80000-5) `ΔW` in an external magnetic field of field flux density `vec(B)` (IEC 80000-6): `ΔW` = -`vec(μ)` · `vec(B)` + * remarks: For an atom or nucleus, this energy is quantized and can be written as: `W` = `g μ_x M B` where `g` is the appropriate `g` factor (item 10-14.1 or item 10-14.2), `μ_x` is mostly the Bohr magneton or nuclear magneton (item 10-9.2 or item 10-9.3), `M` is magnetic quantum number (item 10-13.4), and `B` is magnitude of the magnetic flux density. See also IEC 80000-6. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dMagneticDipoleMomentCoordinateFrame[1]; + } + + attribute magneticDipoleMomentVector: Cartesian3dMagneticDipoleMomentVector :> vectorQuantities; + + attribute def Cartesian3dMagneticDipoleMomentCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: MagneticDipoleMomentUnit[3]; + } + + /* ISO-80000-10 item 10-9.2 Bohr magneton */ + attribute bohrMagneton: MagneticDipoleMomentValue :> scalarQuantities { + doc + /* + * source: item 10-9.2 Bohr magneton + * symbol(s): `μ_B` + * application domain: generic + * name: BohrMagneton (specializes MagneticDipoleMoment) + * quantity dimension: L^2*I^1 + * measurement unit(s): m^2*A + * tensor order: 0 + * definition: magnitude of the magnetic moment of an electron in a state with orbital angular momentum quantum number `l`=1 (item 10-13.3) due to its orbital motion: `μ_B = (e ℏ)/(2 m_e)` where `e` is the elementary charge (ISO 80000-1), `ℏ` is the reduced Planck constant (ISO 80000-1), and `m_e` is the rest mass (item 10-2) of electron + * remarks: None. + */ + } + + /* ISO-80000-10 item 10-9.3 nuclear magneton */ + attribute nuclearMagneton: MagneticDipoleMomentValue :> scalarQuantities { + doc + /* + * source: item 10-9.3 nuclear magneton + * symbol(s): `μ_N` + * application domain: generic + * name: NuclearMagneton (specializes MagneticDipoleMoment) + * quantity dimension: L^2*I^1 + * measurement unit(s): m^2*A + * tensor order: 0 + * definition: absolute value of the magnetic moment of a nucleus: `μ_N = (e ℏ)/(2 m_p)` where `e` is the elementary charge (ISO 80000-1), `ℏ` is the reduced Planck constant (ISO 80000-1), and `m_p` is the rest mass (item 10-2) of proton + * remarks: Subscript N stands for nucleus. For the neutron magnetic moment, subscript n is used. The magnetic moments of protons and neutrons differ from this quantity by their specific `g` factors (item 10-14.2). + */ + } + + /* ISO-80000-10 item 10-10 spin */ + attribute def SpinValue :> ScalarQuantityValue { + doc + /* + * source: item 10-10 spin (magnitude) + * symbol(s): `s` + * application domain: generic + * name: Spin + * quantity dimension: L^2*M^1*T^-1 + * measurement unit(s): kg*m^2*s^-1 + * tensor order: 0 + * definition: vector (ISO 80000-2) quantity expressing the internal angular momentum (ISO 80000-4) of a particle or a particle system + * remarks: Spin is an additive vector quantity. + */ + attribute :>> num: Real; + attribute :>> mRef: SpinUnit[1]; + } + + attribute spin: SpinValue[*] nonunique :> scalarQuantities; + + attribute def SpinUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + attribute def Cartesian3dSpinVector :> VectorQuantityValue { + doc + /* + * source: item 10-10 spin (vector) + * symbol(s): `vec(s)` + * application domain: generic + * name: Spin + * quantity dimension: L^2*M^1*T^-1 + * measurement unit(s): kg*m^2*s^-1 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity expressing the internal angular momentum (ISO 80000-4) of a particle or a particle system + * remarks: Spin is an additive vector quantity. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dSpinCoordinateFrame[1]; + } + + attribute spinVector: Cartesian3dSpinVector :> vectorQuantities; + + attribute def Cartesian3dSpinCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: SpinUnit[3]; + } + + /* ISO-80000-10 item 10-11 total angular momentum */ + attribute def TotalAngularMomentumValue :> ScalarQuantityValue { + doc + /* + * source: item 10-11 total angular momentum (magnitude) + * symbol(s): `J` + * application domain: generic + * name: TotalAngularMomentum + * quantity dimension: L^2*M^1*T^-1 + * measurement unit(s): J*s*eV*s, kg*m^2*s^-1 + * tensor order: 0 + * definition: vector (ISO 80000-2) quantity in a quantum system composed of the vectorial sum of angular momentum `vec(L)` (ISO 80000-4) and spin `vec(s)` (item 10-10) + * remarks: In atomic and nuclear physics, orbital angular momentum is usually denoted by `vec(l)` or `vec(L)`. The magnitude of `vec(J)` is quantized so that: `J^2 = ℏ^2 j (j+1)` where `j` is the total angular momentum quantum number (item 10-13.6). Total angular momentum and magnetic dipole moment have the same direction. `j` is not the magnitude of the total angular momentum `vec(J)` but its projection onto the quantization axis, divided by `ℏ`. + */ + attribute :>> num: Real; + attribute :>> mRef: TotalAngularMomentumUnit[1]; + } + + attribute totalAngularMomentum: TotalAngularMomentumValue[*] nonunique :> scalarQuantities; + + attribute def TotalAngularMomentumUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + attribute def Cartesian3dTotalAngularMomentumVector :> VectorQuantityValue { + doc + /* + * source: item 10-11 total angular momentum (vector) + * symbol(s): `vec(J)` + * application domain: generic + * name: TotalAngularMomentum + * quantity dimension: L^2*M^1*T^-1 + * measurement unit(s): J*s*eV*s, kg*m^2*s^-1 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity in a quantum system composed of the vectorial sum of angular momentum `vec(L)` (ISO 80000-4) and spin `vec(s)` (item 10-10) + * remarks: In atomic and nuclear physics, orbital angular momentum is usually denoted by `vec(l)` or `vec(L)`. The magnitude of `vec(J)` is quantized so that: `J^2 = ℏ^2 j (j+1)` where `j` is the total angular momentum quantum number (item 10-13.6). Total angular momentum and magnetic dipole moment have the same direction. `j` is not the magnitude of the total angular momentum `vec(J)` but its projection onto the quantization axis, divided by `ℏ`. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dTotalAngularMomentumCoordinateFrame[1]; + } + + attribute totalAngularMomentumVector: Cartesian3dTotalAngularMomentumVector :> vectorQuantities; + + attribute def Cartesian3dTotalAngularMomentumCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: TotalAngularMomentumUnit[3]; + } + + /* ISO-80000-10 item 10-12.1 gyromagnetic ratio, magnetogyric ratio, gyromagnetic coefficient */ + attribute def GyromagneticRatioValue :> ScalarQuantityValue { + doc + /* + * source: item 10-12.1 gyromagnetic ratio, magnetogyric ratio, gyromagnetic coefficient + * symbol(s): `γ` + * application domain: generic + * name: GyromagneticRatio + * quantity dimension: M^-1*T^1*I^1 + * measurement unit(s): A*m^2*J^-1*s^-1, A*s/kg, kg^-1*s*A + * tensor order: 0 + * definition: proportionality constant between the magnetic dipole moment and the angular momentum: `vec(μ)` = `γ` `vec(J)` where `vec(μ)` is the magnetic dipole moment (item 10-9.1), and `vec(J)` is the total angular momentum (item 10-11) + * remarks: 1 A·m^2/(J·s) = 1 A·s/kg = 1 T^-1·s^-1 The systematic name is "gyromagnetic coefficient", but "gyromagnetic ratio" is more usual. The gyromagnetic ratio of the proton is denoted by `γ_p`. The gyromagnetic ratio of the neutron is denoted by `γ_n`. + */ + attribute :>> num: Real; + attribute :>> mRef: GyromagneticRatioUnit[1]; + } + + attribute gyromagneticRatio: GyromagneticRatioValue[*] nonunique :> scalarQuantities; + + attribute def GyromagneticRatioUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF, electricCurrentPF); } + } + + alias MagnetogyricRatioUnit for GyromagneticRatioUnit; + alias MagnetogyricRatioValue for GyromagneticRatioValue; + alias magnetogyricRatio for gyromagneticRatio; + + alias GyromagneticCoefficientUnit for GyromagneticRatioUnit; + alias GyromagneticCoefficientValue for GyromagneticRatioValue; + alias gyromagneticCoefficient for gyromagneticRatio; + + /* ISO-80000-10 item 10-12.2 gyromagnetic ratio of the electron, magnetogyric ratio of the electron, gyromagnetic coefficient of the electron */ + attribute def GyromagneticRatioOfTheElectronValue :> ScalarQuantityValue { + doc + /* + * source: item 10-12.2 gyromagnetic ratio of the electron, magnetogyric ratio of the electron, gyromagnetic coefficient of the electron + * symbol(s): `γ_e` + * application domain: generic + * name: GyromagneticRatioOfTheElectron + * quantity dimension: M^-1*T^1*I^1 + * measurement unit(s): A*m^2*J^-1*s^-1, A*s/kg, kg^-1*s*A + * tensor order: 0 + * definition: proportionality constant between the magnetic dipole moment and the angular momentum of the electron `vec(μ)` = `γ_e` `vec(J)` where `vec(μ)` is the magnetic dipole moment (item 10-9.1), and `vec(J)` is the total angular momentum (item 10-11) + * remarks: 1 A·m^2/(J·s) = 1 A·s/kg = 1 T^-1·s^-1 + */ + attribute :>> num: Real; + attribute :>> mRef: GyromagneticRatioOfTheElectronUnit[1]; + } + + attribute gyromagneticRatioOfTheElectron: GyromagneticRatioOfTheElectronValue[*] nonunique :> scalarQuantities; + + attribute def GyromagneticRatioOfTheElectronUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF, electricCurrentPF); } + } + + alias MagnetogyricRatioOfTheElectronUnit for GyromagneticRatioOfTheElectronUnit; + alias MagnetogyricRatioOfTheElectronValue for GyromagneticRatioOfTheElectronValue; + alias magnetogyricRatioOfTheElectron for gyromagneticRatioOfTheElectron; + + alias GyromagneticCoefficientOfTheElectronUnit for GyromagneticRatioOfTheElectronUnit; + alias GyromagneticCoefficientOfTheElectronValue for GyromagneticRatioOfTheElectronValue; + alias gyromagneticCoefficientOfTheElectron for gyromagneticRatioOfTheElectron; + + /* ISO-80000-10 item 10-13.1 quantum number */ + attribute def QuantumNumberValue :> DimensionOneValue { + doc + /* + * source: item 10-13.1 quantum number + * symbol(s): `N`, `L`, `M`, `j`, `s`, `F` + * application domain: generic + * name: QuantumNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: number describing a particular state of a quantum system + * remarks: Electron states determine the binding energy `E = E(n,l,m,j,s,f)` in an atom. Upper case letters `N, L, M, J, S, F` are usually used for the whole system. The spatial probability distribution of an electron is given by `|Ψ|^2`, where `Ψ` is its wave function. For an electron in an H atom in a non-relativistic approximation, the wave function can be presented as: `Ψ(r,θ,φ) = R_(nl)(r)*Y_l^m(θ,φ)`, where `r,θ,φ` are spherical coordinates (ISO 80000-2) with respect to the nucleus and to a given (quantization) axis, `R_(nl)(r)` is the radial distribution function, and `Y_l^m(θ,φ)` are spherical harmonics. In the Bohr model of one-electron atoms, `n`, `l`, and `m` define the possible orbits of an electron about the nucleus. + */ + } + attribute quantumNumber: QuantumNumberValue :> scalarQuantities; + + /* ISO-80000-10 item 10-13.2 principal quantum number */ + attribute principalQuantumNumber: CountValue :> scalarQuantities { + doc + /* + * source: item 10-13.2 principal quantum number + * symbol(s): `n` + * application domain: generic + * name: PrincipalQuantumNumber (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: atomic quantum number related to the number `n`-1 of radial nodes of one-electron wave functions + * remarks: In the Bohr model, `n = 1,2,…,∞` is related to the binding energy of an electron and the radius of spherical orbits (principal axis of the elliptic orbits). For an electron in an H atom, the semi-classical radius of its orbit is `r_n = a_0 n^2` and its binding energy is `E_n = E_H/n^2`. + */ + } + + /* ISO-80000-10 item 10-13.3 orbital angular momentum quantum number */ + attribute orbitalAngularMomentumQuantumNumber: CountValue :> scalarQuantities { + doc + /* + * source: item 10-13.3 orbital angular momentum quantum number + * symbol(s): `l`, `l_i`, `L` + * application domain: generic + * name: OrbitalAngularMomentumQuantumNumber (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: atomic quantum number related to the orbital angular momentum `l` of a one-electron state + * remarks: `abs(l)^2 = ℏ^2 l (l-1)` , `l = 0, 1, …, n-1` where `vec(l)` is the orbital angular momentum and `ℏ` is the reduced Planck constant (ISO 80000-1). If reference is made to a specific particle `i`, the symbol `l_i` is used instead of `l`; if reference is made to the whole system, the symbol `L` is used instead of `l`. An electron in an H atom for `l = 0` appears as a spherical cloud. In the Bohr model, it is related to the form of the orbit. + */ + } + + /* ISO-80000-10 item 10-13.4 magnetic quantum number */ + attribute magneticQuantumNumber: CountValue :> scalarQuantities { + doc + /* + * source: item 10-13.4 magnetic quantum number + * symbol(s): `m`, `m_i`, `M` + * application domain: generic + * name: MagneticQuantumNumber (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: atomic quantum number related to the `z` component `l_z`, `j_z` or `s_z`, of the orbital, total, or spin angular momentum + * remarks: `l_z = m_l ℏ` , `j_z = m_j ℏ` , and `s_z = m_s ℏ` , with the ranges from `-l` to `l`, from `-j` to `j`, and `±1/2`, respectively. `m_i` refers to a specific particle `i`. `M` is used for the whole system. Subscripts `l`, `s`, `j`, etc., as appropriate, indicate the angular momentum involved. `ℏ` is the reduced Planck constant (ISO 80000-1). + */ + } + + /* ISO-80000-10 item 10-13.5 spin quantum number */ + attribute spinQuantumNumber: CountValue :> scalarQuantities { + doc + /* + * source: item 10-13.5 spin quantum number + * symbol(s): `s` + * application domain: generic + * name: SpinQuantumNumber (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: characteristic quantum number `s` of a particle, related to its spin (item 10-10), `vec(s)`: `s^2 = ℏ^2 s (s+1)` where `ℏ` is the reduced Planck constant (ISO 80000-1) + * remarks: Spin quantum numbers of fermions are odd multiples of 1/2, and those of bosons are integers. + */ + } + + /* ISO-80000-10 item 10-13.6 total angular momentum quantum number */ + attribute totalAngularMomentumQuantumNumber: CountValue :> scalarQuantities { + doc + /* + * source: item 10-13.6 total angular momentum quantum number + * symbol(s): `j`, `j_i`, `J` + * application domain: generic + * name: TotalAngularMomentumQuantumNumber (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quantum number in an atom describing the magnitude of total angular momentum `vec(J)` (item 10-11) + * remarks: `j_i` refers to a specific particle `i`; `J` is used for the whole system. The quantum number `J` and the magnitude of total angular momentum `vec(J)` (item 10-11) are different quantities. The two values of `j` are `l`±1/2. (See item 10-13.3.) + */ + } + + /* ISO-80000-10 item 10-13.7 nuclear spin quantum number */ + attribute nuclearSpinQuantumNumber: CountValue :> scalarQuantities { + doc + /* + * source: item 10-13.7 nuclear spin quantum number + * symbol(s): `I` + * application domain: generic + * name: NuclearSpinQuantumNumber (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quantum number related to the total angular momentum (item 10-11), `vec(J)`, of a nucleus in any specified state, normally called nuclear spin: `vec(J)^2 = ℏ^2 I (I+1)` where `ℏ` is the reduced Planck constant (ISO 80000-1) + * remarks: Nuclear spin is composed of spins of the nucleons (protons and neutrons) and their (orbital) motions. In principle there is no upper limit for the nuclear spin quantum number. It has possible values `I` = 0,1,2,… for even `A` and `I = 1/2, 3/2, …` for odd `A`. In nuclear and particle physics, `vec(J)` is often used. + */ + } + + /* ISO-80000-10 item 10-13.8 hyperfine structure quantum number */ + attribute hyperfineStructureQuantumNumber: CountValue :> scalarQuantities { + doc + /* + * source: item 10-13.8 hyperfine structure quantum number + * symbol(s): `F` + * application domain: generic + * name: HyperfineStructureQuantumNumber (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quantum number of an atom describing the inclination of the nuclear spin with respect to a quantization axis given by the magnetic field produced by the orbital electrons + * remarks: The interval of `F` is │`I`-`J`│, │`I`-`J`│+1, ..., `I`-`J`. This is related to the hyperfine splitting of the atomic energy levels due to the interaction between the electron and nuclear magnetic moments. + */ + } + + /* ISO-80000-10 item 10-14.1 Lande factor, g factor of atom */ + attribute def LandeFactorValue :> DimensionOneValue { + doc + /* + * source: item 10-14.1 Lande factor, g factor of atom + * symbol(s): `g` + * application domain: generic + * name: LandeFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the magnetic dipole moment of an atom, and the product of the total angular momentum quantum number and the Bohr magneton: `g = μ/(J*μ_B)` where `μ` is magnitude of magnetic dipole moment (item 10-9.1), `J` is total angular momentum quantum number (item 10-13.6), and `μ_B` is the Bohr magneton (item 10-9.2) + * remarks: These quantities are also called `g` values. The Landé factor can be calculated from the expression: `g(L, S, J) = 1 + (g_e -1) xx (J(J+1) + S(S+1) - L(L+1))/(2J(J+1))` where `g_e` is the` g` factor of the electron. + */ + } + attribute landeFactor: LandeFactorValue :> scalarQuantities; + + alias gFactorOfAtom for landeFactor; + + /* ISO-80000-10 item 10-14.2 g factor of nucleus or nuclear particle */ + attribute def GFactorOfNucleusOrNuclearParticleValue :> DimensionOneValue { + doc + /* + * source: item 10-14.2 g factor of nucleus or nuclear particle + * symbol(s): `g` + * application domain: generic + * name: GFactorOfNucleusOrNuclearParticle (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the magnetic dipole moment of an atom, and the product of the nuclear spin quantum number and the nuclear magneton: `g = μ/(I*μ_N)` where `μ` is magnitude of magnetic dipole moment (item 10-9.1), `I` is nuclear spin quantum number (item 10-13.7), and `μ_N` is the nuclear magneton (item 10-9.3) + * remarks: The `g` factors for nuclei or nucleons are known from measurements. + */ + } + attribute gFactorOfNucleusOrNuclearParticle: GFactorOfNucleusOrNuclearParticleValue :> scalarQuantities; + + /* ISO-80000-10 item 10-15.1 Larmor angular frequency */ + attribute larmorAngularFrequency: AngularFrequencyValue :> scalarQuantities { + doc + /* + * source: item 10-15.1 Larmor angular frequency + * symbol(s): `ω_L` + * application domain: generic + * name: LarmorAngularFrequency (specializes AngularFrequency) + * quantity dimension: T^-1 + * measurement unit(s): rad*s^-1, s^-1 + * tensor order: 0 + * definition: angular frequency (ISO 80000-3) of the electron angular momentum (ISO 80000-4) vector precession about the axis of an external magnetic field: `ω_L = e/(2 m_e) B` where `e` is the elementary charge (ISO 80000-1), `m_e` is the rest mass (item 10-2) of electron, and `B` is magnetic flux density (IEC 80000-6) + * remarks: None. + */ + } + + /* ISO-80000-10 item 10-15.2 Larmor frequency */ + attribute def LarmorFrequencyValue :> ScalarQuantityValue { + doc + /* + * source: item 10-15.2 Larmor frequency + * symbol(s): `ν_L` + * application domain: generic + * name: LarmorFrequency + * quantity dimension: T^-1 + * measurement unit(s): s^-1 + * tensor order: 0 + * definition: quotient of Larmor angular frequency (ISO 80000-3) and 2π + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: LarmorFrequencyUnit[1]; + } + + attribute larmorFrequency: LarmorFrequencyValue[*] nonunique :> scalarQuantities; + + attribute def LarmorFrequencyUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + /* ISO-80000-10 item 10-15.3 nuclear precession angular frequency */ + attribute nuclearPrecessionAngularFrequency: AngularFrequencyValue :> scalarQuantities { + doc + /* + * source: item 10-15.3 nuclear precession angular frequency + * symbol(s): `ω_N` + * application domain: generic + * name: NuclearPrecessionAngularFrequency (specializes AngularFrequency) + * quantity dimension: T^-1 + * measurement unit(s): rad*s^-1, s^-1 + * tensor order: 0 + * definition: frequency (ISO 80000-3) by which the nucleus angular momentum vector (ISO 80000-4) precesses about the axis of an external magnetic field: `ω_N` = `γ` `B` where `γ` is the gyromagnetic ratio (item 10-12.1), and `B` is magnetic flux density (IEC 80000-6) + * remarks: None. + */ + } + + /* ISO-80000-10 item 10-16 cyclotron angular frequency */ + attribute cyclotronAngularFrequency: AngularFrequencyValue :> scalarQuantities { + doc + /* + * source: item 10-16 cyclotron angular frequency + * symbol(s): `ω_c` + * application domain: generic + * name: CyclotronAngularFrequency (specializes AngularFrequency) + * quantity dimension: T^-1 + * measurement unit(s): rad*s^-1, s^-1 + * tensor order: 0 + * definition: quotient of the product of the electric charge of a particle and the magnitude of the magnetic flux density of the magnetic field, and the particle mass: `ω_c = abs(q)/m B` where `q` is the electric charge (IEC 80000-6) of the particle, `m` is the mass (ISO 80000-4) of the particle, and `B` is the absolute value of the magnetic flux density (IEC 80000-6) + * remarks: The quantity `v_c` = `ω_c`/2π is called the cyclotron frequency. + */ + } + + /* ISO-80000-10 item 10-17 gyroradius, Larmor radius */ + attribute gyroradius: LengthValue :> scalarQuantities { + doc + /* + * source: item 10-17 gyroradius, Larmor radius + * symbol(s): `r_g`, `r_L` + * application domain: generic + * name: Gyroradius (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: radius (ISO 80000-3) of circular movement of a particle with mass (ISO 80000-4), velocity `vec(v)` (ISO 80000-3), and electric charge `q` (IEC 80000-6), moving in a magnetic field with magnetic flux density `vec(B)` (IEC 80000-6): `r_g = (m abs(vec(v) xx vec(B)))/(q B^2)` + * remarks: None. + */ + } + + alias larmorRadius for gyroradius; + + /* ISO-80000-10 item 10-18 nuclear quadrupole moment */ + attribute def NuclearQuadrupoleMomentValue :> ScalarQuantityValue { + doc + /* + * source: item 10-18 nuclear quadrupole moment + * symbol(s): `Q` + * application domain: generic + * name: NuclearQuadrupoleMoment + * quantity dimension: L^2 + * measurement unit(s): m^2 + * tensor order: 0 + * definition: `z` component of the diagonalized tensor of nuclear quadrupole moment: `Q = (1/e) int (3z^2 - r^2) ρ(x, y, z) dV` in the quantum state with the nuclear spin in the field direction (`z`), where `e` is the elementary charge (ISO 80000-1), `r^2 = x^2 + y^2 + z^2`, `ρ(x,y,z)` is the nuclear electric charge density (IEC 80000-6), and `dV` is the volume element `dx dy dz` + * remarks: The electric nuclear quadrupole moment is `eQ`. This value is equal to the `z` component of the diagonalized tensor of quadrupole moment. + */ + attribute :>> num: Real; + attribute :>> mRef: NuclearQuadrupoleMomentUnit[1]; + } + + attribute nuclearQuadrupoleMoment: NuclearQuadrupoleMomentValue[*] nonunique :> scalarQuantities; + + attribute def NuclearQuadrupoleMomentUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-10 item 10-19.1 nuclear radius */ + attribute nuclearRadius: LengthValue :> scalarQuantities { + doc + /* + * source: item 10-19.1 nuclear radius + * symbol(s): `R` + * application domain: generic + * name: NuclearRadius (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: conventional radius (ISO 80000-3) of sphere in which the nuclear matter is included + * remarks: This quantity is not exactly defined. It is given approximately for nuclei in their ground state by: `R = r_0 A^(1//3)` where `r_0 ~~ 1.2 * 10^-15` m, and `A` is the nucleon number (item 10-1.3). Nuclear radius is usually expressed in femtometres, 1 fm = 10^(-15) m. + */ + } + + /* ISO-80000-10 item 10-19.2 electron radius */ + attribute electronRadius: LengthValue :> scalarQuantities { + doc + /* + * source: item 10-19.2 electron radius + * symbol(s): `r_e` + * application domain: generic + * name: ElectronRadius (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: radius of a sphere such that the relativistic electron energy is distributed uniformly: `r_e = e^2/(4 π ε_0 m_e c_0^2)` where `e` is the elementary charge (ISO 80000-1), `ε_0` is the electric constant (IEC 80000-6), `m_e` is the rest mass (item 10-2) of electron, and `c_0` is the speed of light in vacuum (ISO 80000-1) + * remarks: This quantity corresponds to the electrostatic energy `E` of a charge distributed inside a sphere of radius `r_e` as if all the rest energy (item 10-3) of the electron were attributed to the energy of electromagnetic origin, using the relation `E = m_e c_0^2`. + */ + } + + /* ISO-80000-10 item 10-20 Compton wavelength */ + attribute comptonWavelength: LengthValue :> scalarQuantities { + doc + /* + * source: item 10-20 Compton wavelength + * symbol(s): `λ_C` + * application domain: generic + * name: ComptonWavelength (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: quotient of the Planck constant and the product of the mass of the particle and the speed of light in vacuum: `λ_C = h / (m c_0)` where `h` is the Planck constant (ISO 80000-1), `m` is the rest mass (item 10-2) of a particle, and `c_0` is the speed of light in vacuum (ISO 80000-1) + * remarks: The wavelength of electromagnetic radiation scattered from free electrons (Compton scattering) is larger than that of the incident radiation by a maximum of 2`λ_C`. + */ + } + + /* ISO-80000-10 item 10-21.1 mass excess */ + attribute massExcess: MassValue :> scalarQuantities { + doc + /* + * source: item 10-21.1 mass excess + * symbol(s): `Δ` + * application domain: generic + * name: MassExcess (specializes Mass) + * quantity dimension: M^1 + * measurement unit(s): kg, Da, u + * tensor order: 0 + * definition: difference between the mass of an atom, and the product of its mass number and the unified mass constant: `Δ = m_a - A*m_u`, where `m_a` is the rest mass (item 10-2) of the atom, `A` is its nucleon number (item 10-1.3), and `m_u` is the unified atomic mass constant (item 10-4.3) + * remarks: The mass excess is usually expressed in daltons, 1 Da = 1 u. See item 10-2. + */ + } + + /* ISO-80000-10 item 10-21.2 mass defect */ + attribute massDefect: MassValue :> scalarQuantities { + doc + /* + * source: item 10-21.2 mass defect + * symbol(s): `B` + * application domain: generic + * name: MassDefect (specializes Mass) + * quantity dimension: M^1 + * measurement unit(s): kg, Da, u + * tensor order: 0 + * definition: sum of the product of the proton number and the hydrogen atomic mass, and the neutron rest mass, minus the rest mass of the atom: `B = Z*m(⁢^1"H") + N*m_n - m_a` where `Z` is the proton number (item 10-1.1) of the atom, `m(⁢^1"H")` is atomic mass (item 10-4.1) of `⁢^1"H"`, `N` is neutron number (item 10-1.2), `m_n` is the rest mass (item 10-2) of the neutron, and `m_a` is the rest mass (item 10-2) of the atom + * remarks: The mass excess is usually expressed in daltons, 1 Da = 1 u. If the binding energy of the orbital electrons is neglected, `B c_0^2` is equal to the binding energy of the nucleus. + */ + } + + /* ISO-80000-10 item 10-22.1 relative mass excess */ + attribute def RelativeMassExcessValue :> DimensionOneValue { + doc + /* + * source: item 10-22.1 relative mass excess + * symbol(s): `Δ_r` + * application domain: generic + * name: RelativeMassExcess (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of mass excess and the unified atomic mass constant: `Δ_r = Δ/m_u` where `Δ` is mass excess (item 10-21.1), and `m_u` is the unified atomic mass constant (item 10-4.3) + * remarks: None. + */ + } + attribute relativeMassExcess: RelativeMassExcessValue :> scalarQuantities; + + /* ISO-80000-10 item 10-22.2 relative mass defect */ + attribute def RelativeMassDefectValue :> DimensionOneValue { + doc + /* + * source: item 10-22.2 relative mass defect + * symbol(s): `B_r` + * application domain: generic + * name: RelativeMassDefect (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of mass defect and the unified atomic mass constant: `B_r = B/m_u` where `B` is mass defect (item 10-21.2), and `m_u` is the unified atomic mass constant (item 10-4.3) + * remarks: None. + */ + } + attribute relativeMassDefect: RelativeMassDefectValue :> scalarQuantities; + + /* ISO-80000-10 item 10-23.1 packing fraction */ + attribute def PackingFractionValue :> DimensionOneValue { + doc + /* + * source: item 10-23.1 packing fraction + * symbol(s): `f` + * application domain: generic + * name: PackingFraction (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of relative mass excess and the nucleon number: `f` = Δ_r/A` where `Δ_r` is relative mass excess (item 10-22.1), and `A` is the nucleon number (item 10-1.3) + * remarks: None. + */ + } + attribute packingFraction: PackingFractionValue :> scalarQuantities; + + /* ISO-80000-10 item 10-23.2 binding fraction */ + attribute def BindingFractionValue :> DimensionOneValue { + doc + /* + * source: item 10-23.2 binding fraction + * symbol(s): `b` + * application domain: generic + * name: BindingFraction (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of relative mass defect and the nucleon number: `b = B_r/A` where `B_r` is relative mass defect (item 10-22.2), and `A` is the nucleon number (item 10-1.3) + * remarks: None. + */ + } + attribute bindingFraction: BindingFractionValue :> scalarQuantities; + + /* ISO-80000-10 item 10-24 decay constant, disintegration constant */ + attribute def DecayConstantValue :> ScalarQuantityValue { + doc + /* + * source: item 10-24 decay constant, disintegration constant + * symbol(s): `λ` + * application domain: generic + * name: DecayConstant + * quantity dimension: T^-1 + * measurement unit(s): s^-1 + * tensor order: 0 + * definition: quotient of `(-dN)/N` and `dt`, where `(dN)/N` is the mean fractional change in the number of nuclei in a particular energy state due to spontaneous transformations in a time interval of duration (ISO 80000-3) `dt`: `λ = -1/N (dN)/(dt)` + * remarks: For exponential decay, this quantity is constant. For more than one decay channel, `λ = sum λ_a` where `λ_a` denotes the decay constant for a specified final state and the sum is taken over all final states. + */ + attribute :>> num: Real; + attribute :>> mRef: DecayConstantUnit[1]; + } + + attribute decayConstant: DecayConstantValue[*] nonunique :> scalarQuantities; + + attribute def DecayConstantUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + alias DisintegrationConstantUnit for DecayConstantUnit; + alias DisintegrationConstantValue for DecayConstantValue; + alias disintegrationConstant for decayConstant; + + /* ISO-80000-10 item 10-25 mean duration of life, mean life time */ + attribute meanDurationOfLife: DurationValue :> scalarQuantities { + doc + /* + * source: item 10-25 mean duration of life, mean life time + * symbol(s): `τ` + * application domain: atomic and nuclear physics + * name: MeanDurationOfLife (specializes Duration) + * quantity dimension: T^1 + * measurement unit(s): s + * tensor order: 0 + * definition: reciprocal of the decay constant `λ` (item 10-24): `τ = 1/λ` + * remarks: Mean duration of life is the expected value of the duration of life of an unstable particle or an excited state of a particle when the number of decay events in a short time interval follows a Poisson distribution. + */ + } + + alias meanLifeTime for meanDurationOfLife; + + /* ISO-80000-10 item 10-26 level width */ + attribute levelWidth: EnergyValue :> scalarQuantities { + doc + /* + * source: item 10-26 level width + * symbol(s): `Γ` + * application domain: generic + * name: LevelWidth (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): eV, J, kg*m^2*s^-2 + * tensor order: 0 + * definition: quotient of the reduced Planck constant and the mean life: `Γ = ℏ/τ` where `ℏ` is the reduced Planck constant (ISO 80000-1), and `τ` is mean duration of life (item 10-25) + * remarks: Level width is the uncertainty of the energy of an unstable particle or an excited state of a system due to the Heisenberg principle. The term energy level refers to the configuration of the distribution function of the density of states. Energy levels may be considered as discrete, like those in an atom, or may have a finite width, like e.g. this item or like e.g. the valence or conduction band in solid state physics. Energy levels are applicable to both real and virtual particles, e.g. electrons and phonons, respectively. + */ + } + + /* ISO-80000-10 item 10-27 nuclear activity */ + attribute def NuclearActivityValue :> ScalarQuantityValue { + doc + /* + * source: item 10-27 nuclear activity + * symbol(s): `A` + * application domain: generic + * name: NuclearActivity + * quantity dimension: T^-1 + * measurement unit(s): Bq, s^-1 + * tensor order: 0 + * definition: differential quotient of `N` with respect to time, where `N` is the mean change in the number of nuclei in a particular energy state due to spontaneous nuclear transformations in a time interval of duration (ISO 80000-3) `dt`: `A = -(dN)/(dt)` + * remarks: For exponential decay, `A = λN`, where `λ` is the decay constant (item 10-24). The becquerel (Bq) is a special name for second to the power minus one, to be used as the coherent SI unit of activity. In report 85a of the ICRU a definition with an equivalent meaning is given as: The activity, `A`, of an amount of a radionuclide in a particular energy state at a given time is the quotient of `-dN` by `dt`, where `dN` is the mean change in the number of nuclei in that energy state due to spontaneous nuclear transformations in the time interval `dt`: `A = -(dN)/(dt)`. See also section 0.3. + */ + attribute :>> num: Real; + attribute :>> mRef: NuclearActivityUnit[1]; + } + + attribute nuclearActivity: NuclearActivityValue[*] nonunique :> scalarQuantities; + + attribute def NuclearActivityUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + /* ISO-80000-10 item 10-28 specific activity, massic activity */ + attribute def SpecificActivityValue :> ScalarQuantityValue { + doc + /* + * source: item 10-28 specific activity, massic activity + * symbol(s): `a` + * application domain: generic + * name: SpecificActivity + * quantity dimension: M^-1*T^-1 + * measurement unit(s): Bq/kg, kg^-1*s^-1 + * tensor order: 0 + * definition: quotient of the activity `A` (item 10-27) of a sample and the mass `m` (ISO 80000-4) of that sample: `a = A/m` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: SpecificActivityUnit[1]; + } + + attribute specificActivity: SpecificActivityValue[*] nonunique :> scalarQuantities; + + attribute def SpecificActivityUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + alias MassicActivityUnit for SpecificActivityUnit; + alias MassicActivityValue for SpecificActivityValue; + alias massicActivity for specificActivity; + + /* ISO-80000-10 item 10-29 activity density, volumic activity, activity concentration */ + attribute def ActivityDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 10-29 activity density, volumic activity, activity concentration + * symbol(s): `c_A` + * application domain: generic + * name: ActivityDensity + * quantity dimension: L^-3*T^-1 + * measurement unit(s): Bq/m^3, m^-3*s^-1 + * tensor order: 0 + * definition: quotient of the activity `A` (item 10-27) of a sample and the mass `m` (ISO 80000-4) of that sample: `a = A/m` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: ActivityDensityUnit[1]; + } + + attribute activityDensity: ActivityDensityValue[*] nonunique :> scalarQuantities; + + attribute def ActivityDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + alias VolumicActivityUnit for ActivityDensityUnit; + alias VolumicActivityValue for ActivityDensityValue; + alias volumicActivity for activityDensity; + + alias ActivityConcentrationUnit for ActivityDensityUnit; + alias ActivityConcentrationValue for ActivityDensityValue; + alias activityConcentration for activityDensity; + + /* ISO-80000-10 item 10-30 surface-activity density */ + attribute def SurfaceActivityDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 10-30 surface-activity density + * symbol(s): `a_S` + * application domain: generic + * name: SurfaceActivityDensity + * quantity dimension: L^-2*T^-1 + * measurement unit(s): Bq/m^2, m^-2*s^-1 + * tensor order: 0 + * definition: quotient of the activity `A` (item 10-27) of a sample and the total area `S` (ISO 80000-3) of the surface of that sample: `a_S` = `A`/`S` + * remarks: This value is usually defined for flat sources, where `S` corresponds to the total area of surface of one side of the source. + */ + attribute :>> num: Real; + attribute :>> mRef: SurfaceActivityDensityUnit[1]; + } + + attribute surfaceActivityDensity: SurfaceActivityDensityValue[*] nonunique :> scalarQuantities; + + attribute def SurfaceActivityDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-10 item 10-31 half life */ + attribute halfLife: DurationValue :> scalarQuantities { + doc + /* + * source: item 10-31 half life + * symbol(s): `T_(1/2)` + * application domain: generic + * name: HalfLife (specializes Duration) + * quantity dimension: T^1 + * measurement unit(s): s + * tensor order: 0 + * definition: mean duration (ISO 80000-3) required for the decay of one half of the atoms or nuclei + * remarks: For exponential decay, `T_(1/2) = (ln2)/λ`, where `λ` is the decay constant (item 10-24). + */ + } + + /* ISO-80000-10 item 10-32 alpha disintegration energy */ + attribute alphaDisintegrationEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 10-32 alpha disintegration energy + * symbol(s): `Q_α` + * application domain: generic + * name: AlphaDisintegrationEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): eV, J, kg*m^2*s^-2 + * tensor order: 0 + * definition: sum of the kinetic energy (ISO 80000-4) of the α-particle produced in the disintegration process and the recoil energy (ISO 80000-5) of the product atom in a reference frame in which the emitting nucleus is at rest before its disintegration + * remarks: The ground-state alpha disintegration energy, `Q_(α,0)`, also includes the energy of any nuclear transitions that take place in the daughter produced. + */ + } + + /* ISO-80000-10 item 10-33 maximum beta-particle energy */ + attribute maximumBetaParticleEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 10-33 maximum beta-particle energy + * symbol(s): `E_β` + * application domain: generic + * name: MaximumBetaParticleEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): eV, J, kg*m^2*s^-2 + * tensor order: 0 + * definition: maximum kinetic energy (ISO 80000-4) of the emitted beta particle produced in the nuclear disintegration process + * remarks: The maximum kinetic energy corresponds to the highest energy of the beta spectrum. + */ + } + + /* ISO-80000-10 item 10-34 beta disintegration energy */ + attribute betaDisintegrationEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 10-34 beta disintegration energy + * symbol(s): `Q_β` + * application domain: generic + * name: BetaDisintegrationEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): eV, J, kg*m^2*s^-2 + * tensor order: 0 + * definition: sum of the maximum beta-particle kinetic energy (item 10-33) and the recoil energy (ISO 80000-5) of the atom produced in a reference frame in which the emitting nucleus is at rest before its disintegration + * remarks: For positron emitters, the energy for the production of the annihilation radiation created in the combination of an electron with the positron is part of the beta disintegration energy. The ground-state beta disintegration energy, `Q_(β,0)`, also includes the energy of any nuclear transitions that take place in the daughter product. + */ + } + + /* ISO-80000-10 item 10-35 internal conversion factor */ + attribute def InternalConversionFactorValue :> DimensionOneValue { + doc + /* + * source: item 10-35 internal conversion factor + * symbol(s): `α` + * application domain: generic + * name: InternalConversionFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the number of internal conversion electrons and the number of gamma quanta emitted by the radioactive atom in a given transition, where a conversion electron represents an orbital electron emitted through the radioactive decay + * remarks: The quantity `α/(α+1)` is also used and called the internal-conversion fraction. Partial conversion fractions referring to the various electron shells `K, L, ...` are indicated by `α_K`, `α_L`, ... `α_K/α_L` is called the K-to-L internal conversion ratio. + */ + } + attribute internalConversionFactor: InternalConversionFactorValue :> scalarQuantities; + + /* ISO-80000-10 item 10-36 particle emission rate */ + attribute def ParticleEmissionRateValue :> ScalarQuantityValue { + doc + /* + * source: item 10-36 particle emission rate + * symbol(s): `dot(N)` + * application domain: generic + * name: ParticleEmissionRate + * quantity dimension: T^-1 + * measurement unit(s): s^-1 + * tensor order: 0 + * definition: differential quotient of `N` with respect to time, where `N` is the number of particles being emitted from an infinitesimally small volume element in the time interval of duration `dt` (ISO 80000-3), and `dt`: `dot(N) = (dN)/(dt)` + * remarks: Usually the kind of particles is specified, e.g. neutron emission rate or alpha particle emission rate. + */ + attribute :>> num: Real; + attribute :>> mRef: ParticleEmissionRateUnit[1]; + } + + attribute particleEmissionRate: ParticleEmissionRateValue[*] nonunique :> scalarQuantities; + + attribute def ParticleEmissionRateUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + /* ISO-80000-10 item 10-37.1 reaction energy */ + attribute reactionEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 10-37.1 reaction energy + * symbol(s): `Q` + * application domain: generic + * name: ReactionEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): eV, J, kg*m^2*s^-2 + * tensor order: 0 + * definition: in a nuclear reaction, sum of the kinetic energies (ISO 80000-4) and photon energies (ISO 80000-5) of the reaction products minus the sum of the kinetic and photon energies of the reactants + * remarks: For exothermic nuclear reactions, `Q>0`. For endothermic nuclear reactions, `Q<0`. + */ + } + + /* ISO-80000-10 item 10-37.2 resonance energy */ + attribute resonanceEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 10-37.2 resonance energy + * symbol(s): `E_r`, `E_"res"` + * application domain: generic + * name: ResonanceEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): eV, J, kg*m^2*s^-2 + * tensor order: 0 + * definition: kinetic energy (ISO 80000-4) of an incident particle, in the reference frame of the target, corresponding to a resonance in a nuclear reaction + * remarks: The energy of the resonance corresponds to the difference of the energy levels involved of the nucleus. + */ + } + + /* ISO-80000-10 item 10-38.1 cross section */ + attribute crossSection: AreaValue :> scalarQuantities { + doc + /* + * source: item 10-38.1 cross section + * symbol(s): `σ` + * application domain: atomic physics + * name: CrossSection (specializes Area) + * quantity dimension: L^2 + * measurement unit(s): m^2, b + * tensor order: 0 + * definition: for a specified target entity and for a specified reaction or process produced by incident charged or uncharged particles of a given type and energy, the quotient of the mean number of such reactions or processes and the incident-particle fluence (item 10-43) + * remarks: The type of process is indicated by subscripts, e.g. absorption cross section `σ_a`, scattering cross section `σ_s`, fission cross section `σ_f`. `1 "barn" ("b") = 10^(-28) "m"^2`. + */ + } + + /* ISO-80000-10 item 10-38.2 total cross section */ + attribute totalCrossSection: AreaValue :> scalarQuantities { + doc + /* + * source: item 10-38.2 total cross section + * symbol(s): `σ_"tot"`, `σ_"T"` + * application domain: atomic physics + * name: TotalCrossSection (specializes Area) + * quantity dimension: L^2 + * measurement unit(s): m^2, b + * tensor order: 0 + * definition: sum of all cross sections (item 10-38.1) corresponding to the various reactions or processes between an incident particle of specified type and energy (ISO 80000-5) and a target entity + * remarks: In the case of a narrow unidirectional beam of incident particles, this is the effective cross section for the removal of an incident particle from the beam. See the Remarks for item 10-52. `1 "barn" ("b") = 10^(-28) "m"^2`. + */ + } + + /* ISO-80000-10 item 10-39 direction distribution of cross section */ + attribute def DirectionDistributionOfCrossSectionValue :> ScalarQuantityValue { + doc + /* + * source: item 10-39 direction distribution of cross section + * symbol(s): `σ_Ω` + * application domain: atomic physics + * name: DirectionDistributionOfCrossSection + * quantity dimension: L^2 + * measurement unit(s): m^2*sr^-1, m^2 + * tensor order: 0 + * definition: differential quotient of `σ` with respect to `Ω`, where `σ` is the cross section (item 10-38.1) for ejecting or scattering a particle into a specified direction, and `Ω` is the solid angle (ISO 80000-3) around that direction: `σ_Ω = (dσ)/(dΩ)` + * remarks: Quantities listed under items 10-39, 10-40 and 10-41 are sometimes called differential cross sections. The type of interaction needs to be specified. + */ + attribute :>> num: Real; + attribute :>> mRef: DirectionDistributionOfCrossSectionUnit[1]; + } + + attribute directionDistributionOfCrossSection: DirectionDistributionOfCrossSectionValue[*] nonunique :> scalarQuantities; + + attribute def DirectionDistributionOfCrossSectionUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-10 item 10-40 energy distribution of cross section */ + attribute def EnergyDistributionOfCrossSectionValue :> ScalarQuantityValue { + doc + /* + * source: item 10-40 energy distribution of cross section + * symbol(s): `σ_E` + * application domain: atomic physics + * name: EnergyDistributionOfCrossSection + * quantity dimension: M^-1*T^2 + * measurement unit(s): m^2/J, kg^-1*s^2 + * tensor order: 0 + * definition: differential quotient of `σ` with respect to energy, where `σ` is the cross section (item 10-38.1) for a process in which the energy `E` (ISO 80000-5) of the ejected or scattered particle is between `E` and `E + dE`: `σ_E = (dσ)/(dE)` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: EnergyDistributionOfCrossSectionUnit[1]; + } + + attribute energyDistributionOfCrossSection: EnergyDistributionOfCrossSectionValue[*] nonunique :> scalarQuantities; + + attribute def EnergyDistributionOfCrossSectionUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + /* ISO-80000-10 item 10-41 direction and energy distribution of cross section */ + attribute def DirectionAndEnergyDistributionOfCrossSectionValue :> ScalarQuantityValue { + doc + /* + * source: item 10-41 direction and energy distribution of cross section + * symbol(s): `σ_(Ω,E)` + * application domain: atomic physics + * name: DirectionAndEnergyDistributionOfCrossSection + * quantity dimension: M^-1*T^2 + * measurement unit(s): m^2/(J*sr), kg^-1*s^2 + * tensor order: 0 + * definition: partial differential quotient of `σ` with respect to solid angle and energy, where `σ` is the cross section (item 10-38.1) for ejecting or scattering a particle into a solid angle `dΩ` around a specified direction and with an energy between `E` and `E+dE`: `σ_(Ω,E) = (del^2 σ) / (del Ω del E)` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: DirectionAndEnergyDistributionOfCrossSectionUnit[1]; + } + + attribute directionAndEnergyDistributionOfCrossSection: DirectionAndEnergyDistributionOfCrossSectionValue[*] nonunique :> scalarQuantities; + + attribute def DirectionAndEnergyDistributionOfCrossSectionUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + /* ISO-80000-10 item 10-42.1 volumic cross section, macroscopic cross section */ + attribute def VolumicCrossSectionValue :> ScalarQuantityValue { + doc + /* + * source: item 10-42.1 volumic cross section, macroscopic cross section + * symbol(s): `Σ` + * application domain: atomic physics + * name: VolumicCrossSection + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: product of the number density `n_a` of the atoms and of the cross section (item 10-38.1) `σ_a` for a given type of atoms: `Σ = n_a σ_a` + * remarks: When the target particles of the medium are at rest, `Σ = 1/l`, where `l` is the mean free path (item 10-71). + */ + attribute :>> num: Real; + attribute :>> mRef: VolumicCrossSectionUnit[1]; + } + + attribute volumicCrossSection: VolumicCrossSectionValue[*] nonunique :> scalarQuantities; + + attribute def VolumicCrossSectionUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + alias MacroscopicCrossSectionUnit for VolumicCrossSectionUnit; + alias MacroscopicCrossSectionValue for VolumicCrossSectionValue; + alias macroscopicCrossSection for volumicCrossSection; + + /* ISO-80000-10 item 10-42.2 volumic total cross section, macroscopic total cross section */ + attribute def VolumicTotalCrossSectionValue :> ScalarQuantityValue { + doc + /* + * source: item 10-42.2 volumic total cross section, macroscopic total cross section + * symbol(s): `Σ_"tot"`, `Σ_"T"` + * application domain: atomic physics + * name: VolumicTotalCrossSection + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: product of the number density `n_a` of the atoms and the cross section (item 10-38.1) `σ_"tot"` for a given type of atoms: `Σ_"tot" = n_a*σ_"tot"` + * remarks: See the Remarks for item 10-49. + */ + attribute :>> num: Real; + attribute :>> mRef: VolumicTotalCrossSectionUnit[1]; + } + + attribute volumicTotalCrossSection: VolumicTotalCrossSectionValue[*] nonunique :> scalarQuantities; + + attribute def VolumicTotalCrossSectionUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + alias MacroscopicTotalCrossSectionUnit for VolumicTotalCrossSectionUnit; + alias MacroscopicTotalCrossSectionValue for VolumicTotalCrossSectionValue; + alias macroscopicTotalCrossSection for volumicTotalCrossSection; + + /* ISO-80000-10 item 10-43 particle fluence */ + attribute def ParticleFluenceValue :> ScalarQuantityValue { + doc + /* + * source: item 10-43 particle fluence + * symbol(s): `Φ` + * application domain: generic + * name: ParticleFluence + * quantity dimension: L^-2 + * measurement unit(s): m^-2 + * tensor order: 0 + * definition: differential quotient of `N` with respect to `a`, where `N` is the number of particles incident on a sphere of cross-sectional area `a` (item 10-38.1): `Φ = (dN)/(da)` + * remarks: The word "particle" is usually replaced by the name of a specific particle, for example `proton` fluence. If a flat area of size `dA` is passed perpendicularly by a number of `dN` particles, the corresponding particle fluence is: `Φ = (dN)/(dA)`. A plane area of size `dA` crossed at an angle `α` with respect to the surface normal by a number of `dN` particles results in the particle fluence: `Φ = (dN)/(cos(α) dA)` In report 85a of the ICRU a definition with an equivalent meaning is given as: The fluence, `Φ` , is the quotient of `dN` and `da`, where `dN` is the number of particles incident on a sphere of cross-sectional area `da`: `Φ = (dN)/(dA)`. See also section 0.3. + */ + attribute :>> num: Real; + attribute :>> mRef: ParticleFluenceUnit[1]; + } + + attribute particleFluence: ParticleFluenceValue[*] nonunique :> scalarQuantities; + + attribute def ParticleFluenceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-10 item 10-44 particle fluence rate */ + attribute def ParticleFluenceRateValue :> ScalarQuantityValue { + doc + /* + * source: item 10-44 particle fluence rate + * symbol(s): `dot(Φ)` + * application domain: generic + * name: ParticleFluenceRate + * quantity dimension: L^-2*T^-1 + * measurement unit(s): m^-2*s^-1 + * tensor order: 0 + * definition: differential quotient of fluence `Φ` (item 10-43) with respect to time (ISO 80000-3): `dot(Φ) = (dΦ)/(dA)` + * remarks: The word "particle" is usually replaced by the name of a specific particle, for example proton fluence rate. The distribution function expressed in terms of speed and energy, `dot(Φ)_v` and `dot(Φ)_E` , are related to by: `dot(Φ) = int dot(Φ)_v dv = int dot(Φ)_E dE`. This quantity has also been termed particle flux density. Because the word "density" has several connotations, the term "fluence rate" is preferred. For a radiation field composed of particles of velocity `v`, the fluence rate is equal to `n`·`v` where `n` is the particle number density. See Remarks for item 10-43. In report 85a of the ICRU a definition with an equivalent meaning is given as: The fluence rate, `dot(Φ)` , is the quotient of `d Φ` and `dt`, where `d Φ` is the increment of the fluence in the time interval `dt`: `dot(Φ) = (dΦ)/(dt)`. See also section 0.3. + */ + attribute :>> num: Real; + attribute :>> mRef: ParticleFluenceRateUnit[1]; + } + + attribute particleFluenceRate: ParticleFluenceRateValue[*] nonunique :> scalarQuantities; + + attribute def ParticleFluenceRateUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-10 item 10-45 radiant energy */ + attribute radiantEnergyForIonizingRadiation: EnergyValue :> scalarQuantities { + doc + /* + * source: item 10-45 radiant energy + * symbol(s): `R` + * application domain: ionizing radiation + * name: RadiantEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): eV, J, kg*m^2*s^-2 + * tensor order: 0 + * definition: mean energy (ISO 80000-5), excluding rest energy (item 10-3), of the particles that are emitted, transferred, or received + * remarks: For particles of energy `E` (excluding rest energy), the radiant energy, `R`, is equal to the product `N·E` where `N` is the number of the particles that are emitted, transferred, or received The distributions, `N_E` and `R_E`, of the particle number and the radiant energy with respect to energy are given by `N_E` = `dN`/d`E` and `R_E` = `dR`/d`E`, respectively, where `dN` is the number of particles with energy between `E` and `E`+d`E`, and `dR` is their radiant energy. The two distributions are related by `R_E` = `E`·`N_E`. + */ + } + + /* ISO-80000-10 item 10-46 energy fluence */ + attribute def EnergyFluenceValue :> ScalarQuantityValue { + doc + /* + * source: item 10-46 energy fluence + * symbol(s): `Ψ` + * application domain: generic + * name: EnergyFluence + * quantity dimension: M^1*T^-2 + * measurement unit(s): eV/m^2, J/m^2, kg*s^-2 + * tensor order: 0 + * definition: differential quotient of radiant energy `R` (item 10-45) incident on a sphere of cross-sectional area (item 10-38.1) `a` with respect to that area: `Ψ = (dR)/(da)` + * remarks: In report 85a of the ICRU a definition with an equivalent meaning is given as: The energy fluence, `Ψ` is the quotient of `dR` and `da`, where `dR` is the radiant energy incident on a sphere of cross-sectional area `da`: `Ψ = (dR)/(da)`. See also section 0.3. + */ + attribute :>> num: Real; + attribute :>> mRef: EnergyFluenceUnit[1]; + } + + attribute energyFluence: EnergyFluenceValue[*] nonunique :> scalarQuantities; + + attribute def EnergyFluenceUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + /* ISO-80000-10 item 10-47 energy fluence rate */ + attribute def EnergyFluenceRateValue :> ScalarQuantityValue { + doc + /* + * source: item 10-47 energy fluence rate + * symbol(s): `dot(Ψ)` + * application domain: generic + * name: EnergyFluenceRate + * quantity dimension: M^1*T^-3 + * measurement unit(s): W/m^2, kg*s^-3 + * tensor order: 0 + * definition: differential quotient of the energy fluence `Ψ` (item 10-46) with respect to time (ISO 80000-3): `dot(Ψ) = (d Ψ)/(dt)` + * remarks: In report 85a of the ICRU a definition with an equivalent meaning is given as: The energy-fluence rate, `dot(Ψ)` , is the quotient of `d Ψ` by `dt`, where `d Ψ` is the increment of the energy fluence in the time interval `dt`: `dot(Ψ) = (d Ψ)/(dt)`. See also section 0.3. + */ + attribute :>> num: Real; + attribute :>> mRef: EnergyFluenceRateUnit[1]; + } + + attribute energyFluenceRate: EnergyFluenceRateValue[*] nonunique :> scalarQuantities; + + attribute def EnergyFluenceRateUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + /* ISO-80000-10 item 10-48 particle current density */ + attribute def ParticleCurrentDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 10-48 particle current density (magnitude) + * symbol(s): `J`, `S` + * application domain: generic + * name: ParticleCurrentDensity + * quantity dimension: L^-2*T^-1 + * measurement unit(s): m^-2*s^-1 + * tensor order: 0 + * definition: vector whose component in direction of an area normal is given by: `vec(J_n) = int Φ_Ω(θ, α) cos(θ) dΩ` where `Φ_Ω(θ, α)` is the directional distribution of the particle fluence rate (item 10-44), and ` θ` and `α` are polar and azimuthal angles, respectively + * remarks: Usually the word "particle" is replaced by the name of a specific particle, for example proton current. Symbol `vec(S)` is recommended when there is a possibility of confusion with the symbol `vec(J)` for electric current density. For neutron current, the symbol `vec(J)` is generally used. The distribution functions expressed in terms of speed and energy, `vec(J_v)` and `vec(J_E)`, are related to `vec(J)` by: `vec(J) = int vec(J_v) dv = int vec(J_E) dE`. The directional distribution of the particle fluence rate is also denoted as particle radiance. + */ + attribute :>> num: Real; + attribute :>> mRef: ParticleCurrentDensityUnit[1]; + } + + attribute particleCurrentDensity: ParticleCurrentDensityValue[*] nonunique :> scalarQuantities; + + attribute def ParticleCurrentDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + attribute def Cartesian3dParticleCurrentDensityVector :> VectorQuantityValue { + doc + /* + * source: item 10-48 particle current density (vector) + * symbol(s): `vec(J)`, `vec(S)` + * application domain: generic + * name: ParticleCurrentDensity + * quantity dimension: L^-2*T^-1 + * measurement unit(s): m^-2*s^-1 + * tensor order: 1 + * definition: vector whose component in direction of an area normal is given by: `vec(J_n) = int Φ_Ω(θ, α) cos(θ) dΩ` where `Φ_Ω(θ, α)` is the directional distribution of the particle fluence rate (item 10-44), and ` θ` and `α` are polar and azimuthal angles, respectively + * remarks: Usually the word "particle" is replaced by the name of a specific particle, for example proton current. Symbol `vec(S)` is recommended when there is a possibility of confusion with the symbol `vec(J)` for electric current density. For neutron current, the symbol `vec(J)` is generally used. The distribution functions expressed in terms of speed and energy, `vec(J_v)` and `vec(J_E)`, are related to `vec(J)` by: `vec(J) = int vec(J_v) dv = int vec(J_E) dE`. The directional distribution of the particle fluence rate is also denoted as particle radiance. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dParticleCurrentDensityCoordinateFrame[1]; + } + + attribute particleCurrentDensityVector: Cartesian3dParticleCurrentDensityVector :> vectorQuantities; + + attribute def Cartesian3dParticleCurrentDensityCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: ParticleCurrentDensityUnit[3]; + } + + /* ISO-80000-10 item 10-49 linear attenuation coefficient */ + attribute def LinearAttenuationCoefficientForIonizingRadiationValue :> ScalarQuantityValue { + doc + /* + * source: item 10-49 linear attenuation coefficient + * symbol(s): `μ`, `μ_l` + * application domain: ionizing radiation + * name: LinearAttenuationCoefficient + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: for uncharged particles of a given type and energy the differential quotient `n` with respect to `l,` where `n` is the fraction of `N` incoming particles that experience interactions in traversing a distance (ISO 80000-3) `l` in a given material: `μ = (dn)/(dl) = 1/N (dN)/(dl)` where `dN` is the number of particles that experience interactions in traversing `dl` + * remarks: `μ` is equal to the macroscopic total cross section `Σ_"tot"` for the removal of particles from the beam. Using the relation `μ_m = μ/ρ` between the linear attenuation coefficient `μ`, the mass attenuation coefficient `μ_m` (item 10-50) and the density `ρ`, the definition given for the mass attenuation coefficient in report 85a of the ICRU can be applied to the linear attenuation coefficient resulting in: The linear attenuation coefficient, `μ`, of a material, for uncharged particles of a given type and energy, is the quotient of `(dN)/N` by `dl`, where `(dN)/N` is the mean fraction of the particles that experience interactions in traversing a distance `dl` in the material: `μ = 1/(dl) (dN)/(N)`. This definition has an equivalent meaning as the one given in column 4 of this item. See also section 0.3. + */ + attribute :>> num: Real; + attribute :>> mRef: LinearAttenuationCoefficientForIonizingRadiationUnit[1]; + } + + attribute linearAttenuationCoefficientForIonizingRadiation: LinearAttenuationCoefficientForIonizingRadiationValue[*] nonunique :> scalarQuantities; + + attribute def LinearAttenuationCoefficientForIonizingRadiationUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-10 item 10-50 mass attenuation coefficient */ + attribute def MassAttenuationCoefficientForIonizingRadiationValue :> ScalarQuantityValue { + doc + /* + * source: item 10-50 mass attenuation coefficient + * symbol(s): `μ_m` + * application domain: ionizing radiation + * name: MassAttenuationCoefficient + * quantity dimension: L^2*M^-1 + * measurement unit(s): kg^-1*m^2 + * tensor order: 0 + * definition: quotient of the linear attenuation coefficient `µ` (item 10-49) and the mass density `ρ` (ISO 80000-4) of the medium: `μ_m = μ/ρ` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MassAttenuationCoefficientForIonizingRadiationUnit[1]; + } + + attribute massAttenuationCoefficientForIonizingRadiation: MassAttenuationCoefficientForIonizingRadiationValue[*] nonunique :> scalarQuantities; + + attribute def MassAttenuationCoefficientForIonizingRadiationUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + + /* ISO-80000-10 item 10-51 molar attenuation coefficient */ + attribute def MolarAttenuationCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 10-51 molar attenuation coefficient + * symbol(s): `μ_c` + * application domain: generic + * name: MolarAttenuationCoefficient + * quantity dimension: L^2*N^-1 + * measurement unit(s): m^2*mol^-1 + * tensor order: 0 + * definition: quotient of linear attenuation coefficient `µ` (item 10-49) and the amount c (ISO 80000-9) of the medium: `μ_c = μ/c` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MolarAttenuationCoefficientUnit[1]; + } + + attribute molarAttenuationCoefficient: MolarAttenuationCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def MolarAttenuationCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, amountOfSubstancePF); } + } + + /* ISO-80000-10 item 10-52 atomic attenuation coefficient */ + attribute def AtomicAttenuationCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 10-52 atomic attenuation coefficient + * symbol(s): `μ_a` + * application domain: generic + * name: AtomicAttenuationCoefficient + * quantity dimension: L^2 + * measurement unit(s): m^2 + * tensor order: 0 + * definition: quotient of the linear attenuation coefficient `µ` (item 10-49) and the number density (item 10-62.1), `n`, of atoms in the substance: `μ_a = μ/n` + * remarks: `μ` is equal to the total cross section `σ_"tot"` for the removal of particles from the beam. See also item 10-38.2. + */ + attribute :>> num: Real; + attribute :>> mRef: AtomicAttenuationCoefficientUnit[1]; + } + + attribute atomicAttenuationCoefficient: AtomicAttenuationCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def AtomicAttenuationCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-10 item 10-53 half-value thickness */ + attribute halfValueThickness: LengthValue :> scalarQuantities { + doc + /* + * source: item 10-53 half-value thickness + * symbol(s): `d_(1//2)` + * application domain: generic + * name: HalfValueThickness (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: thickness (ISO 80000-3) of the attenuating layer that reduces the quantity of interest of a unidirectional beam of infinitesimal width to half of its initial value + * remarks: For exponential attenuation, `d_(1/2) = ln(2)/μ`. The quantity of interest is often the air kerma or exposure. + */ + } + + /* ISO-80000-10 item 10-54 total linear stopping power, linear stopping power */ + attribute def TotalLinearStoppingPowerValue :> ScalarQuantityValue { + doc + /* + * source: item 10-54 total linear stopping power, linear stopping power + * symbol(s): `S`, `S_l` + * application domain: generic + * name: TotalLinearStoppingPower + * quantity dimension: L^1*M^1*T^-2 + * measurement unit(s): eV/m, J/m, kg*m*s^-2 + * tensor order: 0 + * definition: for charged particles of a given type and energy `E_0` the differential quotient of `E` with respect to `x,` where `E` is the mean energy (ISO 80000-4) lost by the charged particles in traversing a distance (ISO 80000-3) `x` in the given material: `S = -(dE)/(dx)` + * remarks: The total linear stopping power is sometimes also called stopping power. Both electronic losses and radiative losses are included. The quotient of the total linear stopping power of a substance and that of a reference substance is called the relative linear stopping power. See also item 10-85. Using the relation `S_m = S/ρ` between the total mass stopping power `S_m` (item 10-55), the total linear stopping power `S`, and the density `ρ`, the definition given for the mass stopping in report 85a of the ICRU can be applied to that of the total linear stopping power resulting in: The linear stopping power, `S`, of a material, for charged particles of a given type and energy, is the quotient of `dE` by `dl`, where `dE` is the mean energy lost by the charged particles in traversing a distance `dl` in the material: `S = -(dE)/(dx)`. This definition has an equivalent meaning as the one given in column 4 of this item. See also section 0.3. + */ + attribute :>> num: Real; + attribute :>> mRef: TotalLinearStoppingPowerUnit[1]; + } + + attribute totalLinearStoppingPower: TotalLinearStoppingPowerValue[*] nonunique :> scalarQuantities; + + attribute def TotalLinearStoppingPowerUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + alias LinearStoppingPowerUnit for TotalLinearStoppingPowerUnit; + alias LinearStoppingPowerValue for TotalLinearStoppingPowerValue; + alias linearStoppingPower for totalLinearStoppingPower; + + /* ISO-80000-10 item 10-55 total mass stopping power, mass stopping power */ + attribute def TotalMassStoppingPowerValue :> ScalarQuantityValue { + doc + /* + * source: item 10-55 total mass stopping power, mass stopping power + * symbol(s): `S_m` + * application domain: generic + * name: TotalMassStoppingPower + * quantity dimension: L^4*T^-2 + * measurement unit(s): eV*m^-2/kg, J*m^2/kg, m^4*s^-2 + * tensor order: 0 + * definition: quotient of the total linear stopping power `S` (item 10-54) and the mass density `ρ` (ISO 80000-4) of the material: `S_m = S/ρ` + * remarks: The quotient of total mass stopping power of a material and that of a reference material is called relative mass stopping power. + */ + attribute :>> num: Real; + attribute :>> mRef: TotalMassStoppingPowerUnit[1]; + } + + attribute totalMassStoppingPower: TotalMassStoppingPowerValue[*] nonunique :> scalarQuantities; + + attribute def TotalMassStoppingPowerUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 4; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + alias MassStoppingPowerUnit for TotalMassStoppingPowerUnit; + alias MassStoppingPowerValue for TotalMassStoppingPowerValue; + alias massStoppingPower for totalMassStoppingPower; + + /* ISO-80000-10 item 10-56 mean linear range */ + attribute meanLinearRange: LengthValue :> scalarQuantities { + doc + /* + * source: item 10-56 mean linear range + * symbol(s): `R`, `R_l` + * application domain: generic + * name: MeanLinearRange (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: mean total rectified path length (ISO 80000-3) travelled by a particle in the course of slowing down to rest in a given material averaged over a group of particles having the same initial energy (ISO 80000-5) + * remarks: None. + */ + } + + /* ISO-80000-10 item 10-57 mean mass range */ + attribute def MeanMassRangeValue :> ScalarQuantityValue { + doc + /* + * source: item 10-57 mean mass range + * symbol(s): `R_ρ`, `R_m` + * application domain: generic + * name: MeanMassRange + * quantity dimension: L^-2*M^1 + * measurement unit(s): kg*m^-2 + * tensor order: 0 + * definition: product of the mean linear range (item 10-56) `R` and the mass density `ρ` (ISO 80000-4) of the material: `R_ρ = R*ρ` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MeanMassRangeUnit[1]; + } + + attribute meanMassRange: MeanMassRangeValue[*] nonunique :> scalarQuantities; + + attribute def MeanMassRangeUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + + /* ISO-80000-10 item 10-58 linear ionization */ + attribute def LinearIonizationValue :> ScalarQuantityValue { + doc + /* + * source: item 10-58 linear ionization + * symbol(s): `N_{i_l}` + * application domain: generic + * name: LinearIonization + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: differential quotient of `q` with respect to `l`, where `q` is the average total charge (IEC 80000-6) of all positive ions produced by an ionizing charged particle over a path `l` (ISO 80000-3), divided by the elementary charge, `e` (ISO 80000-1): `N_{i_l} = 1/e*(dq)/(dl)` + * remarks: Ionization due to secondary ionizing particles is included. + */ + attribute :>> num: Real; + attribute :>> mRef: LinearIonizationUnit[1]; + } + + attribute linearIonization: LinearIonizationValue[*] nonunique :> scalarQuantities; + + attribute def LinearIonizationUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-10 item 10-59 total ionization */ + attribute def TotalIonizationValue :> DimensionOneValue { + doc + /* + * source: item 10-59 total ionization + * symbol(s): `N_i` + * application domain: generic + * name: TotalIonization (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the total mean charge of all positive ions produced by an ionizing charged particle along its entire path and along the paths of any secondary charged particles, and the elementary charge, `e` (ISO 80000-1) + * remarks: `N_i = int N_(il) dl` See item 10-58. + */ + } + attribute totalIonization: TotalIonizationValue :> scalarQuantities; + + /* ISO-80000-10 item 10-60 average energy loss per elementary charge produced */ + attribute def AverageEnergyLossPerElementaryChargeProducedValue :> ScalarQuantityValue { + doc + /* + * source: item 10-60 average energy loss per elementary charge produced + * symbol(s): `W_i` + * application domain: generic + * name: AverageEnergyLossPerElementaryChargeProduced + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): eV, J, kg*m^2*s^-2 + * tensor order: 0 + * definition: quotient of the initial kinetic energy `E_k` (ISO 80000-4) of an ionizing charged particle and the total ionization `N_i` (item 10-59) produced by that particle: `W_i = E_k/N_i` + * remarks: The name "average energy loss per ion pair formed" is usually used, although it is ambiguous. In the practical dosimetry of ionizing radiation the term `W`/`e`, the quotient of `W`, the average energy deposited in dry air per ion pair formed, and `e`, the elementary charge, is used as the factor which, when multiplied with the electric charge of one sign carried by all ion pairs formed in dry air of given mass, gives the energy deposited in this amount of dry air in the form of excitations and ionizations. In ICRU Report 85a, the mean energy expended in a gas per ion pair formed, `W`, is the quotient of `E` by `N,` where `N` is the mean total liberated charge of either sign, divided by the elementary charge when the initial kinetic energy `E` of a charged particle introduced into the gas is completely dissipated in the gas. Thus, `W` = `E`/`N`. It follows from the definition of `W` that the ions produced by bremsstrahlung or other secondary radiation emitted by the initial and secondary charged particles are included in `N`. + */ + attribute :>> num: Real; + attribute :>> mRef: AverageEnergyLossPerElementaryChargeProducedUnit[1]; + } + + attribute averageEnergyLossPerElementaryChargeProduced: AverageEnergyLossPerElementaryChargeProducedValue[*] nonunique :> scalarQuantities; + + attribute def AverageEnergyLossPerElementaryChargeProducedUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-10 item 10-61 mobility */ + attribute def MobilityValue :> ScalarQuantityValue { + doc + /* + * source: item 10-61 mobility + * symbol(s): `μ`, `μ_m` + * application domain: generic + * name: Mobility + * quantity dimension: M^-1*T^2*I^1 + * measurement unit(s): m^2/(V*s), kg^-1*s^2*A + * tensor order: 0 + * definition: quotient of average drift speed (ISO 80000-3) imparted to a charged particle in a medium by an electric field, and the electric field strength (IEC 80000-6) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MobilityUnit[1]; + } + + attribute mobility: MobilityValue[*] nonunique :> scalarQuantities; + + attribute def MobilityUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF, electricCurrentPF); } + } + + /* ISO-80000-10 item 10-62.1 particle number density */ + attribute def ParticleNumberDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 10-62.1 particle number density + * symbol(s): `n` + * application domain: generic + * name: ParticleNumberDensity + * quantity dimension: L^-3 + * measurement unit(s): m^-3 + * tensor order: 0 + * definition: quotient of the mean number `N` of particles in the volume (ISO 80000-3) `V` and volume: `n = N/V` + * remarks: `n` is the general symbol for the number density of particles. The distribution functions expressed in terms of speed and energy, `n_v` and `n_E`, are related to `n` by: `n = int n_v dv = int n_E dE`. The word "particle" is usually replaced by the name of a specific particle, for example `neutron` number density. + */ + attribute :>> num: Real; + attribute :>> mRef: ParticleNumberDensityUnit[1]; + } + + attribute particleNumberDensity: ParticleNumberDensityValue[*] nonunique :> scalarQuantities; + + attribute def ParticleNumberDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-10 item 10-62.2 ion number density, ion density */ + attribute def IonNumberDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 10-62.2 ion number density, ion density + * symbol(s): `n^"+"`, `n^"-"` + * application domain: generic + * name: IonNumberDensity + * quantity dimension: L^-3 + * measurement unit(s): m^-3 + * tensor order: 0 + * definition: quotient of the number of positive and negative ions, `N^"+"` and `N^"-"`, respectively, in the volume `V` (ISO 80000-3), and that volume: `n^"+" = N^"+" / V`, `n^"-" = N^"-" / V` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: IonNumberDensityUnit[1]; + } + + attribute ionNumberDensity: IonNumberDensityValue[*] nonunique :> scalarQuantities; + + attribute def IonNumberDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + alias IonDensityUnit for IonNumberDensityUnit; + alias IonDensityValue for IonNumberDensityValue; + alias ionDensity for ionNumberDensity; + + /* ISO-80000-10 item 10-63 Recombination coefficient */ + attribute def RecombinationCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 10-63 Recombination coefficient + * symbol(s): `α` + * application domain: generic + * name: RecombinationCoefficient + * quantity dimension: L^3*T^-1 + * measurement unit(s): m^3*s^-1 + * tensor order: 0 + * definition: coefficient in the law of recombination: `-(dn^"+")/(dt) = -(dn^"-")/(dt) = α*n^"+"*n^"-"`, where `n^"+"` and `n^"-"` are the ion number densities (item 10-62.2) of positive and negative ions, respectively, recombined during a time interval of duration `dt` (ISO 80000-3) + * remarks: The widely used term "recombination factor" is not correct because "factor" should only be used for quantities with dimension 1. The terms `(dn^"+")/(dt)` , `(dn^"-")/(dt)` are differential quotients. + */ + attribute :>> num: Real; + attribute :>> mRef: RecombinationCoefficientUnit[1]; + } + + attribute recombinationCoefficient: RecombinationCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def RecombinationCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 3; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-10 item 10-64 diffusion coefficient, diffusion coefficient for particle number density */ + /* Refer to declaration for DiffusionCoefficient in ISQChemistryMolecular item 9-39 diffusion coefficient */ + + alias DiffusionCoefficientForParticleNumberDensityUnit for DiffusionCoefficientUnit; + alias DiffusionCoefficientForParticleNumberDensityValue for DiffusionCoefficientValue; + alias diffusionCoefficientForParticleNumberDensity for diffusionCoefficient; + + /* ISO-80000-10 item 10-65 diffusion coefficient for fluence rate */ + attribute diffusionCoefficientForFluenceRate: LengthValue :> scalarQuantities { + doc + /* + * source: item 10-65 diffusion coefficient for fluence rate + * symbol(s): `D_ϕ`, `D` + * application domain: generic + * name: DiffusionCoefficientForFluenceRate (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: proportionality constant between the particle current density `vec(J )`(item 10-48) and the gradient of the particle fluence rate `dot(Φ)` (item 10-44): `vec(J) = -vec(D) * nabla Φ` + * remarks: For a particle of a given speed `v`: `D_Ψ(v) = -J_{v,x}/(partial Ψ // partial x)` and `vec(v) * vec(D_Ψ)(v) = -vec(D_n)(v)` + */ + } + + /* ISO-80000-10 item 10-66 particle source density */ + attribute def ParticleSourceDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 10-66 particle source density + * symbol(s): `S` + * application domain: generic + * name: ParticleSourceDensity + * quantity dimension: L^-3*T^-1 + * measurement unit(s): m^-3*s^-1 + * tensor order: 0 + * definition: quotient of the mean rate of production of particles in a volume, and that volume (ISO 80000-3) + * remarks: The word "particle" is usually replaced by the name of a specific particle, for example `proton` source density. The distribution functions expressed in terms of speed and energy, `S_v` and `S_E`, are related to `S` by: `S = int S_v dv = int S_E dE`. + */ + attribute :>> num: Real; + attribute :>> mRef: ParticleSourceDensityUnit[1]; + } + + attribute particleSourceDensity: ParticleSourceDensityValue[*] nonunique :> scalarQuantities; + + attribute def ParticleSourceDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-10 item 10-67 slowing-down density */ + attribute def SlowingDownDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 10-67 slowing-down density + * symbol(s): `q` + * application domain: generic + * name: SlowingDownDensity + * quantity dimension: L^-3*T^-1 + * measurement unit(s): m^-3*s^-1 + * tensor order: 0 + * definition: differential quotient of `n` with respect to time, where `n` is the number density of particles that are slowed down in a time interval of duration (ISO 80000-3) `t`: `q = -(dn)/(dt)` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: SlowingDownDensityUnit[1]; + } + + attribute slowingDownDensity: SlowingDownDensityValue[*] nonunique :> scalarQuantities; + + attribute def SlowingDownDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-10 item 10-68 resonance escape probability */ + attribute def ResonanceEscapeProbabilityValue :> DimensionOneValue { + doc + /* + * source: item 10-68 resonance escape probability + * symbol(s): `p` + * application domain: generic + * name: ResonanceEscapeProbability (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: in an infinite medium, the probability that a neutron slowing down will traverse all or some specified portion of the range of resonance energies (item 10-37.2) without being absorbed + * remarks: None. + */ + } + attribute resonanceEscapeProbability: ResonanceEscapeProbabilityValue :> scalarQuantities; + + /* ISO-80000-10 item 10-69 lethargy */ + attribute def LethargyValue :> DimensionOneValue { + doc + /* + * source: item 10-69 lethargy + * symbol(s): `u` + * application domain: generic + * name: Lethargy (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for a neutron of kinetic energy `E` (ISO 80000-4) : `u = ln(E_0/E)`, where `E_0` is a reference energy + * remarks: Lethargy is also referred to as logarithmic energy decrement. + */ + } + attribute lethargy: LethargyValue :> scalarQuantities; + + /* ISO-80000-10 item 10-70 average logarithmic energy decrement */ + attribute def AverageLogarithmicEnergyDecrementValue :> DimensionOneValue { + doc + /* + * source: item 10-70 average logarithmic energy decrement + * symbol(s): `ζ` + * application domain: generic + * name: AverageLogarithmicEnergyDecrement (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: average value of the increase in lethargy (item 10-69) in elastic collisions between neutrons and nuclei whose kinetic energy (ISO 80000-4) is negligible compared with that of the neutrons + * remarks: None. + */ + } + attribute averageLogarithmicEnergyDecrement: AverageLogarithmicEnergyDecrementValue :> scalarQuantities; + + /* ISO-80000-10 item 10-71 mean free path */ + attribute meanFreePathForAtomicPhysics: LengthValue :> scalarQuantities { + doc + /* + * source: item 10-71 mean free path + * symbol(s): `l`, `λ` + * application domain: atomic physics + * name: MeanFreePath (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: average distance (ISO 80000-3) that particles travel between two successive specified reactions or processes + * remarks: See the Remarks for item 10-42.1. + */ + } + + /* ISO-80000-10 item 10-72.1 slowing-down area */ + attribute slowingDownArea: AreaValue :> scalarQuantities { + doc + /* + * source: item 10-72.1 slowing-down area + * symbol(s): `L_s^2`, `L_"sl"^2` + * application domain: generic + * name: SlowingDownArea (specializes Area) + * quantity dimension: L^2 + * measurement unit(s): m^2 + * tensor order: 0 + * definition: in an infinite homogenous medium, one-sixth of the mean square of the distance (ISO 80000-3) between the neutron source and the point where a neutron reaches a given energy (ISO 80000-5) + * remarks: None. + */ + } + + /* ISO-80000-10 item 10-72.2 diffusion area */ + attribute diffusionArea: AreaValue :> scalarQuantities { + doc + /* + * source: item 10-72.2 diffusion area + * symbol(s): `L^2` + * application domain: generic + * name: DiffusionArea (specializes Area) + * quantity dimension: L^2 + * measurement unit(s): m^2 + * tensor order: 0 + * definition: in an infinite homogenous medium, one-sixth of the mean square distance (ISO 80000-3) between the point where a neutron enters a specified class and the point where it leaves this class + * remarks: The class of neutrons must be specified, e.g. thermal. + */ + } + + /* ISO-80000-10 item 10-72.3 migration area */ + attribute migrationArea: AreaValue :> scalarQuantities { + doc + /* + * source: item 10-72.3 migration area + * symbol(s): `M^2` + * application domain: generic + * name: MigrationArea (specializes Area) + * quantity dimension: L^2 + * measurement unit(s): m^2 + * tensor order: 0 + * definition: sum of the slowing-down area (item 10-72.1) from fission energy to thermal energy (ISO 80000-5) and the diffusion area (item 10-72.2) for thermal neutrons + * remarks: None. + */ + } + + /* ISO-80000-10 item 10-73.1 slowing-down length */ + attribute slowingDownLength: LengthValue :> scalarQuantities { + doc + /* + * source: item 10-73.1 slowing-down length + * symbol(s): `L_s`, `L_"sl"` + * application domain: generic + * name: SlowingDownLength (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: square root of the slowing down area `L_s^2` (item 10-72.1): `L_s = sqrt(L_s^2)` + * remarks: None. + */ + } + + /* ISO-80000-10 item 10-73.2 diffusion length */ + attribute diffusionLength: LengthValue :> scalarQuantities { + doc + /* + * source: item 10-73.2 diffusion length + * symbol(s): `L` + * application domain: atomic physics + * name: DiffusionLength (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: square root of the diffusion area `L^2` (item 10-72.2): `L = sqrt(L^2)` + * remarks: None. + */ + } + + /* ISO-80000-10 item 10-73.3 migration length */ + attribute migrationLength: LengthValue :> scalarQuantities { + doc + /* + * source: item 10-73.3 migration length + * symbol(s): `M` + * application domain: generic + * name: MigrationLength (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: square root of the migration area `M^2` (item 10-72.3): `M = sqrt(M^2)` + * remarks: None. + */ + } + + /* ISO-80000-10 item 10-74.1 neutron yield per fission */ + attribute neutronYieldPerFission: CountValue :> scalarQuantities { + doc + /* + * source: item 10-74.1 neutron yield per fission + * symbol(s): `ν` + * application domain: generic + * name: NeutronYieldPerFission (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: average number of fission neutrons, both prompt and delayed, emitted per fission event + * remarks: None. + */ + } + + /* ISO-80000-10 item 10-74.2 neutron yield per absorption */ + attribute neutronYieldPerAbsorption: CountValue :> scalarQuantities { + doc + /* + * source: item 10-74.2 neutron yield per absorption + * symbol(s): `η` + * application domain: generic + * name: NeutronYieldPerAbsorption (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: average number of fission neutrons, both prompt and delayed, emitted per neutron absorbed in a fissionable nuclide or in a nuclear fuel, as specified + * remarks: `ν/η` is equal to the quotient of the macroscopic cross section for fission and that for absorption, both for neutrons in the fuel material. + */ + } + + /* ISO-80000-10 item 10-75 fast fission factor */ + attribute def FastFissionFactorValue :> ScalarQuantityValue { + doc + /* + * source: item 10-75 fast fission factor + * symbol(s): `φ` + * application domain: generic + * name: FastFissionFactor + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: in an infinite medium, the quotient of the mean number of neutrons produced by fission due to neutrons of all energies (ISO 80000-5) and the mean number of neutrons produced by fissions due to thermal neutrons only + * remarks: The class of neutrons must be specified, e.g. thermal. + */ + attribute :>> num: Real; + attribute :>> mRef: FastFissionFactorUnit[1]; + } + + attribute fastFissionFactor: FastFissionFactorValue[*] nonunique :> scalarQuantities; + + attribute def FastFissionFactorUnit :> DimensionOneUnit { + } + + /* ISO-80000-10 item 10-76 thermal utilization factor */ + attribute def ThermalUtilizationFactorValue :> ScalarQuantityValue { + doc + /* + * source: item 10-76 thermal utilization factor + * symbol(s): `f` + * application domain: generic + * name: ThermalUtilizationFactor + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: in an infinite medium, the quotient of the number of thermal neutrons absorbed in a fissionable nuclide or in a nuclear fuel, as specified, and the total number of thermal neutrons absorbed + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: ThermalUtilizationFactorUnit[1]; + } + + attribute thermalUtilizationFactor: ThermalUtilizationFactorValue[*] nonunique :> scalarQuantities; + + attribute def ThermalUtilizationFactorUnit :> DimensionOneUnit { + } + + /* ISO-80000-10 item 10-77 non-leakage probability */ + attribute def NonLeakageProbabilityValue :> ScalarQuantityValue { + doc + /* + * source: item 10-77 non-leakage probability + * symbol(s): `Λ` + * application domain: generic + * name: NonLeakageProbability + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: probability that a neutron will not escape from the reactor during the slowing-down process or while it diffuses as a thermal neutron + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: NonLeakageProbabilityUnit[1]; + } + + attribute nonLeakageProbability: NonLeakageProbabilityValue[*] nonunique :> scalarQuantities; + + attribute def NonLeakageProbabilityUnit :> DimensionOneUnit { + } + + /* ISO-80000-10 item 10-78.1 multiplication factor */ + attribute def MultiplicationFactorValue :> ScalarQuantityValue { + doc + /* + * source: item 10-78.1 multiplication factor + * symbol(s): `k` + * application domain: generic + * name: MultiplicationFactor + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the total number of fission or fission-dependent neutrons produced in the duration of a time interval and the total number of neutrons lost by absorption and leakage in that duration + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MultiplicationFactorUnit[1]; + } + + attribute multiplicationFactor: MultiplicationFactorValue[*] nonunique :> scalarQuantities; + + attribute def MultiplicationFactorUnit :> DimensionOneUnit { + } + + /* ISO-80000-10 item 10-78.2 infinite multiplication factor */ + attribute def InfiniteMultiplicationFactorValue :> ScalarQuantityValue { + doc + /* + * source: item 10-78.2 infinite multiplication factor + * symbol(s): `k_∞` + * application domain: generic + * name: InfiniteMultiplicationFactor + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: multiplication factor (item 10-78.1) for an infinite medium or for an infinite repeating lattice + * remarks: For a thermal reactor, `k_∞ = η*ε*p*f` + */ + attribute :>> num: Real; + attribute :>> mRef: InfiniteMultiplicationFactorUnit[1]; + } + + attribute infiniteMultiplicationFactor: InfiniteMultiplicationFactorValue[*] nonunique :> scalarQuantities; + + attribute def InfiniteMultiplicationFactorUnit :> DimensionOneUnit { + } + + /* ISO-80000-10 item 10-79 reactor time constant */ + attribute reactorTimeConstant: DurationValue :> scalarQuantities { + doc + /* + * source: item 10-79 reactor time constant + * symbol(s): `T` + * application domain: generic + * name: ReactorTimeConstant (specializes Duration) + * quantity dimension: T^1 + * measurement unit(s): s + * tensor order: 0 + * definition: duration (ISO 80000-3) required for the neutron fluence rate (item 10-44) in a reactor to change by the factor e when the fluence rate is rising or falling exponentially + * remarks: Also called reactor period. + */ + } + + /* ISO-80000-10 item 10-80.1 energy imparted */ + attribute energyImparted: EnergyValue :> scalarQuantities { + doc + /* + * source: item 10-80.1 energy imparted + * symbol(s): `ε` + * application domain: generic + * name: EnergyImparted (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): eV, J, kg*m^2*s^-2 + * tensor order: 0 + * definition: sum of all energy deposits in a given volume: `ε = sum_i ε_i` where the summation is performed over all energy (ISO 80000-5) deposits `ε_i` of interaction `i` in that volume + * remarks: Energy imparted is a stochastic quantity. `ε_i` is given by: `ε_i = ε_(i n) - ε_"out" + Q` where `ε_(i n)` is the energy (ISO 80000-5) of the incident ionizing particle, excluding rest energy (item 10-3), `ε_"out"` is the sum of the energies (ISO 80000-5) of all ionizing particles leaving the interaction, excluding rest energy (item 10-3), and `Q` is the change in the rest energies (item 10-3) of the nucleus and of all particles involved in the interaction. `Q > 0` means decrease of rest energy; `Q < 0` means increase of rest energy. Stochastic quantities such as the energy imparted and the specific energy imparted (item 10-81.2) and their probability distributions have been introduced as they describe the discontinuous nature of the ionizing radiations as a determinant of radiochemical and radiobiological effects. In radiation applications involving large numbers of ionizing particles, e.g. in medicine, radiation protection and materials testing and processing, these fluctuations are adequately represented by the expectation values of the probability distributions. Non-stochastic quantities such as particle fluence (item 10-43), absorbed dose (item 10-81.1) and kerma (item 10-86.1) are based on these expectation values. + */ + } + + /* ISO-80000-10 item 10-80.2 mean energy imparted */ + attribute meanEnergyImparted: EnergyValue :> scalarQuantities { + doc + /* + * source: item 10-80.2 mean energy imparted + * symbol(s): `bar(ε)` + * application domain: generic + * name: MeanEnergyImparted (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): eV, J, kg*m^2*s^-2 + * tensor order: 0 + * definition: expectation value of the energy imparted (item 10-80.1): `bar(ε) = R_"in" - R_"out" + sum Q` where `R_"in"` is the radiant energy (item 10-45) of all those charged and uncharged ionizing particles that enter the volume, `R_"out"` is the radiant energy of all those charged and uncharged ionizing particles that leave the volume, and `sum Q` is the sum of all changes of the rest energy (item 10-3) of nuclei and elementary particles that occur in that volume + * remarks: Sometimes, it has been called the integral absorbed dose. `Q > 0` means decrease of rest energy; `Q < 0` means increase of rest energy. + */ + } + + /* ISO-80000-10 item 10-81.1 absorbed dose */ + attribute def AbsorbedDoseValue :> ScalarQuantityValue { + doc + /* + * source: item 10-81.1 absorbed dose + * symbol(s): `D` + * application domain: generic + * name: AbsorbedDose + * quantity dimension: L^2*T^-2 + * measurement unit(s): Gy, J/kg, m^2*s^-2 + * tensor order: 0 + * definition: differential quotient of `bar(ε)` with respect to `m`, where `bar(ε)` is the mean energy (ISO 80000-5) imparted by ionizing radiation to matter of mass (ISO 80000-4) `m`: `D = (d bar(ε))/(dm)` + * remarks: The gray is a special name for joule per kilogram, to be used as the coherent SI unit for absorbed dose. `1 "Gy" = 1 "J"/"kg"`. `bar(ε) = int D dm` where `dm` is the element of mass of the irradiated matter. In the limit of a small domain, the mean specific energy `bar(z) = (Δ bar(ε))/(Δ m)` is equal to the absorbed dose `D`. The absorbed dose can also be expressed in terms of the volume of the mass element by: `D = (d bar(ε))/(dm) = (d bar(ε))/(ρ dV)` where `ρ` is the mass density of the mass element. In report 85a of the ICRU a definition with an equivalent meaning is given as: The absorbed dose, `D`, is the quotient of `d bar(ε)` by dm, where `d bar(ε)` is the mean energy imparted by ionizing radiation to matter of mass `dm`: `D = (d bar(ε))/(dm)`. + */ + attribute :>> num: Real; + attribute :>> mRef: AbsorbedDoseUnit[1]; + } + + attribute absorbedDose: AbsorbedDoseValue[*] nonunique :> scalarQuantities; + + attribute def AbsorbedDoseUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-10 item 10-81.2 specific energy imparted */ + attribute specificEnergyImparted: AbsorbedDoseValue :> scalarQuantities { + doc + /* + * source: item 10-81.2 specific energy imparted + * symbol(s): `z` + * application domain: generic + * name: SpecificEnergyImparted (specializes AbsorbedDose) + * quantity dimension: L^2*T^-2 + * measurement unit(s): Gy, J/kg, m^2*s^-2 + * tensor order: 0 + * definition: quotient of the energy imparted `ε` (item 10-80.1) and the mass `m` (ISO 80000-4) of the matter in a given volume element: `z = ε / m` + * remarks: `z` is a stochastic quantity. In the limit of a small domain, the mean specific energy `bar(z)` is equal to the absorbed dose `D`. The specific energy imparted can be due to one or more (energy-deposition) events. + */ + } + + /* ISO-80000-10 item 10-82 quality factor */ + attribute def QualityFactorForIonizingRadiationValue :> ScalarQuantityValue { + doc + /* + * source: item 10-82 quality factor + * symbol(s): `Q` + * application domain: ionizing radiation + * name: QualityFactor + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: factor in the calculation and measurement of dose equivalent (item 10-83.1), by which the absorbed dose (item 10-81.1) is to be weighted in order to account for different biological effectiveness of radiations, for radiation protection purposes + * remarks: `Q` is determined by the linear energy transfer (item 10-85) for `Δ -> ∞` , `L_∞` (often denoted as `L` or LET), of charged particles passing through a small volume element at this point (the value of `L_∞` refers to water, not to tissue; the difference, however, is small). The relationship between `L` and `Q` is given in ICRP Publication 103 (ICRP, 2007). + */ + attribute :>> num: Real; + attribute :>> mRef: QualityFactorForIonizingRadiationUnit[1]; + } + + attribute qualityFactorForIonizingRadiation: QualityFactorForIonizingRadiationValue[*] nonunique :> scalarQuantities; + + attribute def QualityFactorForIonizingRadiationUnit :> DimensionOneUnit { + } + + /* ISO-80000-10 item 10-83.1 dose equivalent */ + attribute def DoseEquivalentValue :> ScalarQuantityValue { + doc + /* + * source: item 10-83.1 dose equivalent + * symbol(s): `H` + * application domain: generic + * name: DoseEquivalent + * quantity dimension: L^2*T^-2 + * measurement unit(s): Sv, J/kg, m^2*s^-2 + * tensor order: 0 + * definition: product of the absorbed dose `D` (item 10-81.1) to tissue at the point of interest and the quality factor `Q` (item 10-82) at that point: `H = DQ` + * remarks: The sievert (Sv) is a special name for joule per kilogram, and is the coherent SI unit for dose equivalent. `1 "Sv" = 1 "J/kg"`. The dose equivalent at a point in tissue is given by: `H = int_0^∞ Q(L) D_L dL` where `D_L = (dD)/(dL)` is the distribution of `D` in `L` at the point of interest. See ICRP Publication 103 (ICRP, 2007). The quantities measured with radiation protection dosimeters are based on the definition `H = Q*D`. If various radiation qualities `i` have to be simultaneously accounted for, the definition is: `H = sum_i Q_i*D_i`. In ICRU 51 this quantity is denoted as "dose equivalent". In order to quantify the radiation exposition of the human body and to specify dose limits, use is made of a quantity defined in ICRP 103, the "equivalent dose to a tissue or organ": `H_T = w_T*sum_R w_R*D_{T,R}`. The weighting factors `w_T` for various tissues and organs `T` and `w_R` for various radiation qualities `R` have been numerically laid down in ICRP 103. `D_{T,R}` is the mean absorbed dose to tissue within a tissue or organ `T`, imparted by radiation with radiation quality `R`. + */ + attribute :>> num: Real; + attribute :>> mRef: DoseEquivalentUnit[1]; + } + + attribute doseEquivalent: DoseEquivalentValue[*] nonunique :> scalarQuantities; + + attribute def DoseEquivalentUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-10 item 10-83.2 dose equivalent rate */ + attribute doseEquivalentRate: DoseEquivalentValue :> scalarQuantities { + doc + /* + * source: item 10-83.2 dose equivalent rate + * symbol(s): `dot(H)` + * application domain: generic + * name: DoseEquivalentRate (specializes DoseEquivalent) + * quantity dimension: L^2*T^-3 + * measurement unit(s): Sv/s, W/kg, m^2*s^-3 + * tensor order: 0 + * definition: differential quotient of dose equivalent `H` (item 10-83.1) with respect to time (ISO 80000-3): `dot(H) = (dH)/(dt)` + * remarks: `1 "Sv/s" = 1 "W/kg"`. See the remarks for item 10-83.1. + */ + } + + /* ISO-80000-10 item 10-84 absorbed-dose rate */ + attribute def AbsorbedDoseRateValue :> ScalarQuantityValue { + doc + /* + * source: item 10-84 absorbed-dose rate + * symbol(s): `dot(D)` + * application domain: generic + * name: AbsorbedDoseRate + * quantity dimension: L^2*T^-3 + * measurement unit(s): Gy/s, W/kg, m^2*s^-3 + * tensor order: 0 + * definition: differential quotient of the absorbed dose `D` (item 10-81.1) with respect to time (ISO 80000-3): `dot(D) = (dD)/(dt)` + * remarks: `1 "Gy/s" = 1 "W/kg"` See the remarks for item 10-81.1. In report 85a of the ICRU a definition with an equivalent meaning is given as: The absorbed-does rate, `dot(D)` , is the quotient of `dD` by `dt`, where `dD` is the increment of absorbed does in the time interval `dt`: `dot(D) = (dD)/(dt)`. + */ + attribute :>> num: Real; + attribute :>> mRef: AbsorbedDoseRateUnit[1]; + } + + attribute absorbedDoseRate: AbsorbedDoseRateValue[*] nonunique :> scalarQuantities; + + attribute def AbsorbedDoseRateUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-10 item 10-85 linear energy transfer */ + attribute def LinearEnergyTransferValue :> ScalarQuantityValue { + doc + /* + * source: item 10-85 linear energy transfer + * symbol(s): `L_Δ` + * application domain: generic + * name: LinearEnergyTransfer + * quantity dimension: L^1*M^1*T^-2 + * measurement unit(s): eV/m, J/m, kg*m*s^-2 + * tensor order: 0 + * definition: quotient of the mean energy (ISO 80000-4) `dE_Δ` lost by the charged particles due to electronic interactions in traversing a distance (ISO 80000-3) `dl`, minus the mean sum of the kinetic energies in excess of `Δ` of all the electrons released by the charged particles and `dl`: `L_Δ = (dE_Δ)/(dl)` + * remarks: This quantity is not completely defined unless `Δ` is specified, i.e. the maximum kinetic energy of secondary electrons whose energy is considered to be "locally deposited". `Δ` may be expressed in `"eV"`. Note that the abbreviation LET specifically refers to the quantity `L_∞` mentioned in the remark to 10-82. + */ + attribute :>> num: Real; + attribute :>> mRef: LinearEnergyTransferUnit[1]; + } + + attribute linearEnergyTransfer: LinearEnergyTransferValue[*] nonunique :> scalarQuantities; + + attribute def LinearEnergyTransferUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-10 item 10-86.1 kerma */ + attribute def KermaValue :> ScalarQuantityValue { + doc + /* + * source: item 10-86.1 kerma + * symbol(s): `K` + * application domain: generic + * name: Kerma + * quantity dimension: L^2*T^-2 + * measurement unit(s): Gy, J/kg, m^2*s^-2 + * tensor order: 0 + * definition: for uncharged ionizing radiation, differential quotient of `E_(`tr) with respect to `m`, where `E_(`tr) is the mean sum of the initial kinetic energies (ISO 80000-4) of all the charged ionizing particles liberated in a mass (ISO 80000-4) `m` of a material: `K = (dE_tr)/(dm)` + * remarks: `1 "Gy" = 1 "J/kg"` See the remarks for item 10-81.1. The name "kerma" is derived from Kinetic Energy Released in MAtter (or MAss or MAterial). The quantity `dE_(tr)` includes also the kinetic energy of the charged particles emitted in the decay of excited atoms, molecules, or nuclei. When the mass element `dm` consists of air the term air kerma is used. It can be convenient to refer to a value of air kerma in free space or at a point inside a material different from air, e.g. to the air kerma at a point inside a water phantom. In report 85a of the ICRU a definition with an equivalent meaning is given as: The kerma, `K`, for ionizing uncharged particles, is the quotient of `dE_(tr)` by `dm`, where `dE_(tr)` is the mean sum of the initial kinetic energies of all the charged particles liberated in a mass `dm` of a material by the uncharged particles incident on `dm`: `K = (dE_(tr))/(dm)`. + */ + attribute :>> num: Real; + attribute :>> mRef: KermaUnit[1]; + } + + attribute kerma: KermaValue[*] nonunique :> scalarQuantities; + + attribute def KermaUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-10 item 10-86.2 kerma rate */ + attribute def KermaRateValue :> ScalarQuantityValue { + doc + /* + * source: item 10-86.2 kerma rate + * symbol(s): `dot(K)` + * application domain: generic + * name: KermaRate + * quantity dimension: L^2*T^-3 + * measurement unit(s): Gy/s, W/kg, m^2*s^-3 + * tensor order: 0 + * definition: differential quotient of kerma (item 10-86.1) with respect to time (ISO 80000-3): `dot(K) = (dK)/(dt)` + * remarks: `1 "Gy/s" = 1 "W/kg"`. See the Remarks for item 10-81.1. In report 85a of the ICRU a definition with an equivalent meaning is given as: The kerma rate, `dot(K)` , is the quotient of `dK` by `dt`, where `dK` is the increment of kerma in the time interval `dt`: `dot(K) = (dK)/(dt)`. + */ + attribute :>> num: Real; + attribute :>> mRef: KermaRateUnit[1]; + } + + attribute kermaRate: KermaRateValue[*] nonunique :> scalarQuantities; + + attribute def KermaRateUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-10 item 10-87 mass energy-transfer coefficient */ + attribute def MassEnergyTransferCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 10-87 mass energy-transfer coefficient + * symbol(s): `μ_"tr"/ρ` + * application domain: generic + * name: MassEnergyTransferCoefficient + * quantity dimension: L^2*M^-1 + * measurement unit(s): kg^-1*m^2 + * tensor order: 0 + * definition: for ionizing uncharged particles of a given type and energy, the differential quotient of `R_"tr"` with respect to `l`: `m_"tr"/ρ = 1/ρ 1/R (dR_"tr")/(dl)` where `R_"tr"` is the mean energy (ISO 80000-5) that is transferred to kinetic energy (ISO 80000-4) of charged particles by interactions of the uncharged particles of incident radiant energy `R` (item 10-45) in traversing a distance (ISO 80000-3) `l` in the material of density (ISO 80000-4) `ρ`, divided by `ρ` and `R` + * remarks: `m_(tr)/ρ = (dot(K))/ψ` , where `dot(K)` is kerma rate (item 10-86.2) and `ψ` is energy fluence rate (item 10-47). The quantity: `μ_(en)/ρ = μ_(tr)/ρ(1-g)` where `g` is mean fraction of the kinetic energy of the liberated charged particles that is lost in radiative processes in the material, is called mass energy-absorption coefficient. The mass energy-absorption coefficient of a compound material depends on the stopping power of the material. Thus, its evaluation cannot, in principle, be reduced to a simple summation of the mass energy-absorption coefficient of the atomic constituents. Such a summation can provide an adequate approximation when the value of `g` is sufficiently small. In report 85a of the ICRU a definition with an equivalent meaning is given as: The mass energy-transfer coefficient, `μ_(tr)/ρ` , of a material, for uncharged particles of a given type and energy, is the quotient of `(dR_(tr))/R` by `ρ dl`, where `dR_(tr)` is the mean energy that is transferred to kinetic energy of charged particles by interactions of the uncharged particles of incident radiant energy `R` in traversing a distance `dl` in the material of density `ρ` : `μ_(tr)/ρ = 1/(ρ dl) (d R_(tr))/R`. + */ + attribute :>> num: Real; + attribute :>> mRef: MassEnergyTransferCoefficientUnit[1]; + } + + attribute massEnergyTransferCoefficient: MassEnergyTransferCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def MassEnergyTransferCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + + /* ISO-80000-10 item 10-88 exposure */ + attribute def ExposureValue :> ScalarQuantityValue { + doc + /* + * source: item 10-88 exposure + * symbol(s): `X` + * application domain: ionizing radiation + * name: Exposure + * quantity dimension: M^-1*T^1*I^1 + * measurement unit(s): C/kg, kg^-1*s*A + * tensor order: 0 + * definition: for X- or gamma radiation the differential quotient of `q` with respect to `m`, where `q` is the absolute value of the mean total electric charge of the ions of one sign produced when all the electrons and positrons liberated or created by photons incident on an element of dry air with mass `m` (ISO 80000-4) are completely stopped in dry air: `X = (dq)/(dm)` + * remarks: The ionization produced by electrons emitted in atomic or molecular relaxation is included in `dq`. The ionization due to photons emitted by radiative processes (i.e. bremsstrahlung and fluorescence photons) is not included in `dq`. This quantity should not be confused with the quantity photon exposure (ISO 80000-7), radiation exposure (ISO 80000-7), or the quantity luminous exposure (ISO 80000-7). It can be convenient to refer to a value of exposure in free space or at a point inside a material different from air, e.g. to the exposure at a point inside a water phantom. The exposure is related to the air kerma, `K_a`, (see item 10-86.1) by: `X = (e (1-g))/W K_a` , where `e` is the elementary charge (ISO 80000-1), `W` the average energy loss per elementary charge produced (item 10-60), and `g` is the fraction of the kinetic energy of liberated charged particles that is lost in radiative processes. In report 85a of the ICRU a definition with an equivalent meaning is given as: The exposure, `X`, is the quotient of `dq` by `dm`, where `dq` is the absolute value of the mean total charge of the ions of one sign produced when all the electrons and positrons liberated or created by photons incident on a mass `dm` of dry air are completely stopped in dry air: `X = (dq)/(dm)`. + */ + attribute :>> num: Real; + attribute :>> mRef: ExposureUnit[1]; + } + + attribute exposure: ExposureValue[*] nonunique :> scalarQuantities; + + attribute def ExposureUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF, electricCurrentPF); } + } + + /* ISO-80000-10 item 10-89 exposure rate */ + attribute def ExposureRateValue :> ScalarQuantityValue { + doc + /* + * source: item 10-89 exposure rate + * symbol(s): `dot(X)` + * application domain: generic + * name: ExposureRate + * quantity dimension: M^-1*I^1 + * measurement unit(s): C/(kg*s), kg^-1*A + * tensor order: 0 + * definition: differential quotient of the exposure `X` (item 10-88) with respect to time (ISO 80000-3): `dot(X) = (dX)/(dt)` + * remarks: `1 "C/(kg s)" = 1 "A/kg"`. In report 85a of the ICRU a definition with an equivalent meaning is given as: The exposure rate, `dot(X)` , is the quotient of `dX` by `dt`, where `dX` is the increment of exposure in the time interval `dt`: `dot(X) = (dX)/(dt)`. + */ + attribute :>> num: Real; + attribute :>> mRef: ExposureRateUnit[1]; + } + + attribute exposureRate: ExposureRateValue[*] nonunique :> scalarQuantities; + + attribute def ExposureRateUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, electricCurrentPF); } + } + +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml new file mode 100644 index 0000000000000000000000000000000000000000..49abb8df35539900653509eb18c7d0bf17b5dc56 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml @@ -0,0 +1,206 @@ +standard library package ISQBase { + doc + /* + * International System of Quantities and Units + * Generated on 2022-08-07T14:44:27Z from standard ISO/IEC 80000 + * + * Note 1: In documentation comments, AsciiMath notation (see http://asciimath.org/) is used for mathematical concepts, + * with Greek letters in Unicode encoding. In running text, AsciiMath is placed between backticks. + */ + + private import ScalarValues::Real; + private import Quantities::*; + private import MeasurementReferences::*; + + /* ISO-80000-3 item 3-1.1 length */ + attribute def LengthValue :> ScalarQuantityValue { + doc + /* + * source: item 3-1.1 length + * symbol(s): `l`, `L` + * application domain: generic + * name: Length + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: linear extent in space between any two points + * remarks: Length does not need to be measured along a straight line. Length is one of the seven base quantities in the International System of Units (ISO 80000-1). + */ + attribute :>> num: Real; + attribute :>> mRef: LengthUnit[1]; + } + + attribute length: LengthValue[*] nonunique :> scalarQuantities; + + attribute def LengthUnit :> SimpleUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-3 item 3-9 duration, time */ + attribute def DurationValue :> ScalarQuantityValue { + doc + /* + * source: item 3-9 duration, time + * symbol(s): `t` + * application domain: generic + * name: Duration + * quantity dimension: T^1 + * measurement unit(s): s + * tensor order: 0 + * definition: measure of the time difference between two events + * remarks: Duration is often just called time. Time is one of the seven base quantities in the International System of Quantities, ISQ (see ISO 80000-1). Duration is a measure of a time interval. + */ + attribute :>> num: Real; + attribute :>> mRef: DurationUnit[1]; + } + + attribute duration: DurationValue[*] nonunique :> scalarQuantities; + + attribute def DurationUnit :> SimpleUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + /* ISO-80000-4 item 4-1 mass */ + attribute def MassValue :> ScalarQuantityValue { + doc + /* + * source: item 4-1 mass + * symbol(s): `m` + * application domain: generic + * name: Mass + * quantity dimension: M^1 + * measurement unit(s): kg + * tensor order: 0 + * definition: property of a body which expresses itself in terms of inertia with regard to changes in its state of motion as well as its gravitational attraction to other bodies + * remarks: The kilogram (kg) is one of the seven base units (see ISO 80000-1) of the International System of Units, the SI. See also IEC 60050-113. + */ + attribute :>> num: Real; + attribute :>> mRef: MassUnit[1]; + } + + attribute mass: MassValue[*] nonunique :> scalarQuantities; + + attribute def MassUnit :> SimpleUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = massPF; } + } + + /* ISO-80000-5 item 5-1 thermodynamic temperature, temperature */ + attribute def ThermodynamicTemperatureValue :> ScalarQuantityValue { + doc + /* + * source: item 5-1 thermodynamic temperature, temperature + * symbol(s): `T`, `Θ` + * application domain: generic + * name: ThermodynamicTemperature + * quantity dimension: Θ^1 + * measurement unit(s): K + * tensor order: 0 + * definition: partial derivative of internal energy with respect to entropy at constant volume and constant number of particles in the system: `T = ((partial U)/(partial S))_(V,N)` where `U` is internal energy (item 5-20.2), `S` is entropy (item 5-18), `V` is volume (ISO 80000-3), and `N` is number of particles + * remarks: It is measured with a primary thermometer, examples of which are gas thermometers of different kinds, noise thermometers, or radiation thermometers. The Boltzmann constant (ISO 80000-1) relates energy at the individual particle level with thermodynamic temperature. Differences of thermodynamic temperatures or changes may be expressed either in kelvin, symbol K, or in degrees Celsius, symbol °C (item 5-2). Thermodynamic temperature is one of the seven base quantities in the International System of Quantities, ISQ (see ISO 80000-1). The International Temperature Scale of 1990. For the purpose of practical measurements, the International Temperature Scale of 1990, ITS-90, was adopted by CIPM in 1989, which is a close approximation to the thermodynamic temperature scale. The quantities defined by this scale are denoted `T_90` and `t_90`, respectively (replacing `T_68` and `t_68` defined by the International Practical Temperature Scale of 1968, IPTS-68), where `t_90/(1 °C) = T_90/(1 K) - 273,15`. The units of `T_90` and `t_90` are the kelvin, symbol K, and the degree Celsius, symbol °C (item 5-2), respectively. For further information, see References [5], [6]. For ready conversion between temperatures reported on the International Temperature Scale and thermodynamic temperatures the systematic deviations can be found in Reference [7]. + */ + attribute :>> num: Real; + attribute :>> mRef: ThermodynamicTemperatureUnit[1]; + } + + attribute thermodynamicTemperature: ThermodynamicTemperatureValue[*] nonunique :> scalarQuantities; + + attribute def ThermodynamicTemperatureUnit :> SimpleUnit { + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = thermodynamicTemperaturePF; } + } + + /* IEC-80000-6 item 6-1 electric current */ + attribute def ElectricCurrentValue :> ScalarQuantityValue { + doc + /* + * source: item 6-1 electric current + * symbol(s): `I`, `i` + * application domain: generic + * name: ElectricCurrent + * quantity dimension: I^1 + * measurement unit(s): A + * tensor order: 0 + * definition: electric current is one of the base quantities in the International System of Quantities, ISQ, on which the International System of Units, SI, is based + * remarks: Electric current is the quantity that can often be measured with an ammeter. The electric current through a surface is the quotient of the electric charge (item 6-2) transferred through the surface during a time interval by the duration of that interval. For a more complete definition, see item 6-8 and IEC 60050-121, item 121-11-13. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectricCurrentUnit[1]; + } + + attribute electricCurrent: ElectricCurrentValue[*] nonunique :> scalarQuantities; + + attribute def ElectricCurrentUnit :> SimpleUnit { + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = electricCurrentPF; } + } + + /* ISO-80000-7 item 7-14 luminous intensity */ + attribute def LuminousIntensityValue :> ScalarQuantityValue { + doc + /* + * source: item 7-14 luminous intensity + * symbol(s): `I_v`, `(I)` + * application domain: generic + * name: LuminousIntensity + * quantity dimension: J^1 + * measurement unit(s): cd + * tensor order: 0 + * definition: density of luminous flux with respect to solid angle in a specified direction, expressed by `I_v = (dΦ_v)/(dΩ)` where `Φ_v` is the luminous flux (item 7-13) emitted in a specified direction, and `Ω` is the solid angle (ISO 80000-3) containing that direction + * remarks: The definition holds strictly only for a point source. The distribution of the luminous intensities as a function of the direction of emission, e.g. given by the polar angles `(θ,ϕ)`, is used to determine the luminous flux (item 7-13) within a certain solid angle (ISO 80000-3) `Ω` of a source: `Φ_v = int int_Ω I_v(θ,φ) sin(θ) dφ dθ`. Luminous intensity can be derived from the spectral radiant intensity distribution by `I_v = K_m int_0^∞ I_(e,λ)(λ) V(λ) dλ`, where `K_m` is maximum luminous efficacy (item 7-11.3), `I_(e,λ)(λ)` is the spectral radiant intensity (item 7-5.2) at wavelength `λ` (ISO 80000-3), and `V(λ)` is spectral luminous efficiency (item 7-10.2). The corresponding radiometric quantity is "radiant intensity" (item 7-5.1). The corresponding quantity for photons is "photon intensity" (item 7-21). + */ + attribute :>> num: Real; + attribute :>> mRef: LuminousIntensityUnit[1]; + } + + attribute luminousIntensity: LuminousIntensityValue[*] nonunique :> scalarQuantities; + + attribute def LuminousIntensityUnit :> SimpleUnit { + private attribute luminousIntensityPF: QuantityPowerFactor[1] { :>> quantity = isq.J; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = luminousIntensityPF; } + } + + /* ISO-80000-9 item 9-2 amount of substance, number of moles */ + attribute def AmountOfSubstanceValue :> ScalarQuantityValue { + doc + /* + * source: item 9-2 amount of substance, number of moles + * symbol(s): `n(X)` + * application domain: generic + * name: AmountOfSubstance + * quantity dimension: N^1 + * measurement unit(s): mol + * tensor order: 0 + * definition: quotient of number `N` of specified elementary entities of kind `X` (item 9-1) in a sample, and the Avogadro constant `N_A` (ISO 80000-1): `n(X) = N(X)/N_A` + * remarks: Amount of substance is one of the seven base quantities in the International System of Quantities, ISQ (see ISO 80000-1). Elementary entities, such as molecules, atoms, ions, electrons, holes and other quasi-particles, double bonds can be used. It is necessary to specify precisely the entity involved, e.g. atoms of hydrogen `H` vs. molecules of hydrogen `H_2`, preferably by giving the molecular chemical formula of the material involved. In the name "amount of substance", the words "of substance" could be replaced by words specifying the substance concerned, e.g. "amount of hydrogen chloride, `HCl`", or "amount of benzene, `C_6H_6`". The name "number of moles" is often used for "amount of substance", but this is deprecated because the name of a quantity should be distinguished from the name of the unit. + */ + attribute :>> num: Real; + attribute :>> mRef: AmountOfSubstanceUnit[1]; + } + + attribute amountOfSubstance: AmountOfSubstanceValue[*] nonunique :> scalarQuantities; + + attribute def AmountOfSubstanceUnit :> SimpleUnit { + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = amountOfSubstancePF; } + } + + attribute 'International System of Quantities': SystemOfQuantities { + doc + /* + * Declaration of the International System of Quantities (ISQ), + * including its base quantities and symbols as specified in ISO 80000-1:2009. + */ + attribute :>> baseQuantities = ( L, M, T, I, 'Θ', N, J ); + + attribute L: LengthValue[1]; + attribute M: MassValue[1]; + attribute T: DurationValue[1]; + attribute I: ElectricCurrentValue[1]; + attribute 'Θ': ThermodynamicTemperatureValue[1]; + attribute N: AmountOfSubstanceValue[1]; + attribute J: LuminousIntensityValue[1]; + } +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml new file mode 100644 index 0000000000000000000000000000000000000000..ec6f85a89a714d01d1286081275bf57167bc4456 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml @@ -0,0 +1,1991 @@ +standard library package ISQCharacteristicNumbers { + doc + /* + * International System of Quantities and Units + * Generated on 2022-08-07T19:40:39Z from standard ISO-80000-11:2019 "Characteristic numbers" + * see also https://www.iso.org/obp/ui/#iso:std:iso:80000:-11:ed-2:v1:en + * + * Note 1: In documentation comments, AsciiMath notation (see http://asciimath.org/) is used for mathematical concepts, + * with Greek letters in Unicode encoding. In running text, AsciiMath is placed between backticks. + * Note 2: For vector and tensor quantities currently the unit and quantity value type for their (scalar) magnitude is + * defined, as well as their typical Cartesian 3d VectorMeasurementReference (i.e. coordinate system) + * or TensorMeasurementReference. + */ + + private import ScalarValues::Real; + private import Quantities::*; + private import MeasurementReferences::*; + private import ISQBase::*; + + /* ISO-80000-11 item 11-4.1 Reynolds number */ + attribute def ReynoldsNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.1 Reynolds number + * symbol(s): `Re` + * application domain: generic + * name: ReynoldsNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of inertial forces and viscous forces in a fluid flow, expressed by `Re = (ρ*v*l)/η = (v*l)/ν`, where `ρ` is mass density (ISO 80000-4), `v` is speed (ISO 80000-3), `l` is characteristic length (ISO 80000-3), `η` is dynamic viscosity (ISO 80000-4), and `ν` is kinematic viscosity (ISO 80000-4) + * remarks: The value of the Reynolds number gives an estimate on the flow state: laminar flow or turbulent flow. In rotating movement, the speed `v = ω*l`, where `l` is the distance from the rotation axis and `ω` is the angular velocity. + */ + } + attribute reynoldsNumber: ReynoldsNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.2 Euler number */ + attribute def EulerNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.2 Euler number + * symbol(s): `Eu` + * application domain: generic + * name: EulerNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relationship between pressure drop in a flow and the kinetic energy per volume for flow of fluids in a pipe, expressed by `Eu = (Δp)/(ρ*v^2)`, where `Δp` is drop of pressure (ISO 80000-4), `ρ` is mass density (ISO 80000-4), and `v` is speed (ISO 80000-3) + * remarks: The Euler number is used to characterize losses in the flow. A modification of the Euler number is considering the dimensions of the containment (pipe): `Eu^"'" = d/l*Eu`, where `d` is inner diameter (ISO 80000-3) of the pipe, and `l` is length (ISO 80000-3). + */ + } + attribute eulerNumber: EulerNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.3 Froude number */ + attribute def FroudeNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.3 Froude number + * symbol(s): `Fr` + * application domain: generic + * name: FroudeNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of a body’s inertial forces and its gravitational forces for flow of fluids, expressed by `Fr = v/sqrt(l*g)`, where `v` is speed (ISO 80000-3) of flow, `l` is characteristic length (ISO 80000-3), and `g` is acceleration of free fall (ISO 80000-3) + * remarks: The Froude number can be modified by buoyancy. Sometimes the square and sometimes the inverse of the Froude number as defined here is wrongly used. + */ + } + attribute froudeNumber: FroudeNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.4 Grashof number */ + attribute def GrashofNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.4 Grashof number + * symbol(s): `Gr` + * application domain: generic + * name: GrashofNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of buoyancy forces due to thermal expansion which results in a change of mass density and viscous forces for free convection due to temperature differences, expressed by `Gr = l^3*g*α_V*(ΔT)/ν^2`, where `l` is characteristic length (ISO 80000-3), `g` is acceleration of free fall (ISO 80000-3), `α_V` is thermal cubic expansion coefficient (ISO 80000-5), `ΔT` is difference of thermodynamic temperature `T` (ISO 80000-5) between surface of the body and the fluid far away from the body, and `ν` is kinematic viscosity (ISO 80000-4) + * remarks: Heating can occur near hot vertical walls, in pipes, or by a bluff body. The characteristic length can be the vertical height of a hot plate, the diameter of a pipe, or the effective length of a body. See also Rayleigh number (item 11-5.3). + */ + } + attribute grashofNumber: GrashofNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.5 Weber number */ + attribute def WeberNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.5 Weber number + * symbol(s): `We` + * application domain: generic + * name: WeberNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between inertial forces and capillary forces due to surface tension at the interface between two different fluids, expressed by `We = (ρ*v^2*l)/γ`, where `ρ` is mass density (ISO 80000-4), `v` is speed (ISO 80000-3), `l` is characteristic length (ISO 80000-3), and `γ` is surface tension (ISO 80000-4) + * remarks: The fluids can be gases or liquids. The different fluids often are drops moving in a gas or bubbles in a liquid. The characteristic length is commonly the diameter of bubbles or drops. The square root of the Weber number is called Rayleigh number. Sometimes the square root of the Weber number as defined here is called the Weber number. That definition is deprecated. Interfaces only exist between two fluids which are not miscible. + */ + } + attribute weberNumber: WeberNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.6 Mach number */ + attribute def MachNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.6 Mach number + * symbol(s): `Ma` + * application domain: generic + * name: MachNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the speed of flow and the speed of sound, expressed by `Ma = v/c`, where `v` is speed (ISO 80000-3) of the body, and `c` is speed of sound (ISO 80000-8) in the fluid + * remarks: The Mach number represents the relationship of inertial forces compared to compression forces. For an ideal gas `c = sqrt(γ p/rho) = sqrt(γ (RT)/M) = sqrt(γ (kT)/m)`, where `γ` is ratio of the specific heat capacity (ISO 80000-5). + */ + } + attribute machNumber: MachNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.7 Knudsen number */ + attribute def KnudsenNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.7 Knudsen number + * symbol(s): `Kn` + * application domain: generic + * name: KnudsenNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of free path length of a particle and a characteristic length, expressed by `Kn = λ/l`, where `λ` is mean free path (ISO 80000-9), and `l` is characteristic length (ISO 80000-3) + * remarks: The Knudsen number is a measure to estimate whether the gas in flow behaves like a continuum. The characteristic length, `l`, can be a characteristic size of the gas flow region like a pipe diameter. + */ + } + attribute knudsenNumber: KnudsenNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.8 Strouhal number, Thomson number */ + attribute def StrouhalNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.8 Strouhal number, Thomson number + * symbol(s): `Sr`, `Sh` + * application domain: generic + * name: StrouhalNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between a characteristic frequency and a characteristic speed for unsteady flow with periodic behaviour, expressed by `Sr = f*l/v`, where `f` is frequency (ISO 80000-3) of vortex shedding, `l` is characteristic length (ISO 80000-3), and `v` is speed (ISO 80000-3) of flow + * remarks: The characteristic length, `l`, can be the diameter of an obstacle in the flow which can cause vortex shedding, or the length of it. + */ + } + attribute strouhalNumber: StrouhalNumberValue :> scalarQuantities; + + alias thomsonNumber for strouhalNumber; + + /* ISO-80000-11 item 11-4.9 drag coefficient */ + /* Refer to declaration for DragCoefficient in ISQMechanics item 4-23.4 drag coefficient */ + + /* ISO-80000-11 item 11-4.10 Bagnold number */ + attribute def BagnoldNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.10 Bagnold number + * symbol(s): `Bg` + * application domain: generic + * name: BagnoldNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of drag force and gravitational force for a body moving in a fluid, expressed by `Bg = (c_D*ρ*v^2)/(l*g*ρ_b)`, where `c_D` is drag coefficient (item 11-4.9) of the body, `ρ` is mass density (ISO 80000-4) of the fluid, `v` is speed (ISO 80000-3) of the body, `l` is characteristic length (ISO 80000-3), `g` is acceleration of free fall (ISO 80000-3), and `ρ_b` is mass density (ISO 80000-4) of the body + * remarks: The characteristic length, `l`, is the body’s volume divided by its cross-sectional area. + */ + } + attribute bagnoldNumber: BagnoldNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.11 Bagnold number */ + attribute def BagnoldNumberForSolidParticlesValue :> DimensionOneValue { + doc + /* + * source: item 11-4.11 Bagnold number + * symbol(s): `Ba_2` + * application domain: solid particles + * name: BagnoldNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of drag force and viscous force in a fluid transferring solid particles, expressed by `Ba_2 = (ρ_s*d^2*dot(γ))/η*sqrt(1/(f_s^(1/2) - 1))`, where `ρ_s` is mass density (ISO 80000-4) of particles, `d` is diameter (ISO 80000-3) of particles, `dot(γ) = v/d` is shear rate time-derivative of shear strain (ISO 80000-4), `η` is dynamic viscosity (ISO 80000-4) of fluid, and `f_s` is volumic fraction of solid particles + * remarks: None. + */ + } + attribute bagnoldNumberForSolidParticles: BagnoldNumberForSolidParticlesValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.12 lift coefficient */ + attribute def LiftCoefficientValue :> DimensionOneValue { + doc + /* + * source: item 11-4.12 lift coefficient + * symbol(s): `c_l`, `c_A` + * application domain: generic + * name: LiftCoefficient (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the lift force available from a wing at a given angle and the inertial force for a wing shaped body moving in a fluid, expressed by `c_l = ( 2*F_l)/(ρ*v^2*S) = F_l/(q*S)`, where `F_l` is lift force (ISO 80000-4) on the wing, `ρ` is mass density (ISO 80000-4) of the fluid, `v` is speed (ISO 80000-3) of the body, `S = A*cos(α)` is effective area (ISO 80000-3) when `α` is the angle of attack and `A` is area of the wing, and `q = 1/2*ρ*v^2` is dynamic pressure + * remarks: The lift coefficient is dependant on the shape of the wing. + */ + } + attribute liftCoefficient: LiftCoefficientValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.13 thrust coefficient */ + attribute def ThrustCoefficientValue :> DimensionOneValue { + doc + /* + * source: item 11-4.13 thrust coefficient + * symbol(s): `c_t` + * application domain: generic + * name: ThrustCoefficient (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the effective thrust force available from a propeller and the inertial force in a fluid, expressed by `c_t = F_T/(ρ*n^2*d^4)`, where `F_T` is thrust force (ISO 80000-4) of the propeller, `ρ` is mass density (ISO 80000-4) of the fluid, `n` is rotational frequency (ISO 80000-3), and `d` is tip diameter (ISO 80000-3) of the propeller + * remarks: The thrust coefficient is dependant on the shape of the propeller. + */ + } + attribute thrustCoefficient: ThrustCoefficientValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.14 Dean number */ + attribute def DeanNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.14 Dean number + * symbol(s): `Dn` + * application domain: generic + * name: DeanNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between centrifugal force and inertial force, for flows of fluids in curved pipes, expressed by `Dn = (2*v*r)/ν*sqrt(r/R)`, where `v` is (axial) speed (ISO 80000-3), `r` is radius (ISO 80000-3) of the pipe, `ν` is kinematic viscosity (ISO 80000-4) of the fluid, and `R` is radius of curvature (ISO 80000-3) of the path of the pipe + * remarks: None. + */ + } + attribute deanNumber: DeanNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.15 Bejan number */ + attribute def BejanNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.15 Bejan number + * symbol(s): `Be` + * application domain: generic + * name: BejanNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of mechanical work and frictional energy loss in fluid dynamics in a pipe, expressed by `Be = (Δp*ρ*l^2)/(η*ν)`, where `p` is drop of pressure (ISO 80000-4) along the pipe, `l` is characteristic length (ISO 80000-3), `η` is dynamic viscosity (ISO 80000-4), `ν` is kinematic viscosity (ISO 80000-4), and `ρ` is mass density (ISO 80000-4) + * remarks: A similar number exists for heat transfer (item 11-5.9). The kinematic viscosity is also called momentum diffusivity. + */ + } + attribute bejanNumber: BejanNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.16 Lagrange number */ + attribute def LagrangeNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.16 Lagrange number + * symbol(s): `Lg` + * application domain: generic + * name: LagrangeNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of mechanical work and frictional energy loss in fluid dynamics in a pipe, expressed by `Lg = (l*Δp)/(η*v)`, where `l` is length (ISO 80000-3) of the pipe, `Δp` is drop of pressure (ISO 80000-4) along the pipe, `η` is dynamic viscosity (ISO 80000-4), and `v` is speed (ISO 80000-3) + * remarks: The Lagrange number is also given by `Lg = Re*Eu`, where `Re` is the Reynolds number (item 11-4.1), and `Eu` is the Euler number (item 11-4.2). + */ + } + attribute lagrangeNumber: LagrangeNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.17 Bingham number, plasticity number */ + attribute def BinghamNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.17 Bingham number, plasticity number + * symbol(s): `Bm`, `Bn` + * application domain: generic + * name: BinghamNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of yield stress and viscous stress in a viscous material for flow of viscoplastic material in channels, expressed by `Bm = (τ*d)/(η*v)`, where `τ` is shear stress (ISO 80000-4), `d` is characteristic diameter (ISO 80000-3), e.g. effective channel width, `η` is dynamic viscosity (ISO 80000-4), and `v` is speed (ISO 80000-3) + * remarks: None. + */ + } + attribute binghamNumber: BinghamNumberValue :> scalarQuantities; + + alias plasticityNumber for binghamNumber; + + /* ISO-80000-11 item 11-4.18 Hedström number */ + attribute def 'HedströmNumberValue' :> DimensionOneValue { + doc + /* + * source: item 11-4.18 Hedström number + * symbol(s): `He`, `Hd` + * application domain: generic + * name: HedströmNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of yield stress and viscous stress of a viscous material at flow limit for visco-plastic material in a channel, expressed by `He = (τ_0*d^2*ρ)/η^2`, where `τ_0` is shear stress (ISO 80000-4) at flow limit, `d` is characteristic diameter (ISO 80000-3), e.g. effective channel width, `ρ` is mass density (ISO 80000-4), and `η` is dynamic viscosity (ISO 80000-4) + * remarks: None. + */ + } + attribute 'hedströmNumber': 'HedströmNumberValue' :> scalarQuantities; + + /* ISO-80000-11 item 11-4.19 Bodenstein number */ + attribute def BodensteinNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.19 Bodenstein number + * symbol(s): `Bd` + * application domain: generic + * name: BodensteinNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: mathematical expression of the transfer of matter by convection in reactors with respect to diffusion, `Bd = (v*l)/D`, where `v` is speed (ISO 80000-3), `l` is length (ISO 80000-3) of the reactor, and `D` is diffusion coefficient (ISO 80000-9) + * remarks: The Bodenstein number is also given by `Bd = Pe^"*" = Re*Sc`, where `Pe^"*"` is the Péclet number for mass transfer (item 11-6.2), `Re` is the Reynolds number (item 11-4.1), and `Sc = η/(ρ*D) = ν/D` is the Schmidt number (item 11-7.2). + */ + } + attribute bodensteinNumber: BodensteinNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.20 Rossby number, Kiebel number */ + attribute def RossbyNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.20 Rossby number, Kiebel number + * symbol(s): `Ro` + * application domain: generic + * name: RossbyNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of inertial forces and Coriolis forces in the context of transfer of matter in geophysics, expressed by `Ro = v/(2*l*ω_E*sin(φ)`, where `v` is speed (ISO 80000-3) of motion, `l` is characteristic length (ISO 80000-3), the scale of the phenomenon, `ω_E` is angular velocity (ISO 80000-3) of the Earth's rotation, and `φ` is angle (ISO 80000-3) of latitude + * remarks: The Rossby number represents the effect of Earth's rotation on flow in pipes, rivers, ocean currents, tornadoes, etc. The quantity `ω_E*sin(φ)` is called Coriolis frequency. + */ + } + attribute rossbyNumber: RossbyNumberValue :> scalarQuantities; + + alias kiebelNumber for rossbyNumber; + + /* ISO-80000-11 item 11-4.21 Ekman number */ + attribute def EkmanNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.21 Ekman number + * symbol(s): `Ek` + * application domain: generic + * name: EkmanNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of viscous forces and Coriolis forces in the context of transfer of matter for the flow of a rotating fluid, expressed by `Ek = ν/(2*l^2*ω_E*sin(φ))`, where `ν` is kinematic viscosity (ISO 80000-4), `l` is characteristic length (ISO 80000-3), the scale of the phenomenon, `ω_E` is angular frequency (ISO 80000-3) of the Earth’s rotation, and `φ` is angle of latitude + * remarks: In plasma physics, the square root of this number is used. The Ekman number is also given by `Ek = (Ro)/(Re)`, where `Ro` is the Rossby number (item 11-4.20), and `Re` is the Reynolds number (item 11-4.1). + */ + } + attribute ekmanNumber: EkmanNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.22 elasticity number */ + attribute def ElasticityNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.22 elasticity number + * symbol(s): `El` + * application domain: generic + * name: ElasticityNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between relaxation time and diffusion time in viscoelastic flows, expressed by `El = (t_r*ν)/r^2`, where `t_r` is relaxation time (ISO 80000-12), `ν` is kinematic viscosity (ISO 80000-4), and `r` is radius (ISO 80000-3) of pipe + * remarks: See also Deborah number (item 11-7.8). + */ + } + attribute elasticityNumber: ElasticityNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.23 Darcy friction factor, Moody friction factor */ + attribute def DarcyFrictionFactorValue :> DimensionOneValue { + doc + /* + * source: item 11-4.23 Darcy friction factor, Moody friction factor + * symbol(s): `f_D` + * application domain: generic + * name: DarcyFrictionFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: representation of pressure loss in a pipe due to friction within a laminar or turbulent flow of a fluid in a pipe, expressed by `f_D = (2*Δp)/(ρ*v^2)*d/l`, where `Δp` is drop of pressure (ISO 80000-4) due to friction, `ρ` is mass density (ISO 80000-4) of the fluid, `v` is (average) speed (ISO 80000-3) of the fluid in the pipe, `d` is diameter (ISO 80000-3) of the pipe, and `l` is length (ISO 80000-3) of the pipe + * remarks: None. + */ + } + attribute darcyFrictionFactor: DarcyFrictionFactorValue :> scalarQuantities; + + alias moodyFrictionFactor for darcyFrictionFactor; + + /* ISO-80000-11 item 11-4.24 Fanning number */ + attribute def FanningNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.24 Fanning number + * symbol(s): `f_n`, `f` + * application domain: generic + * name: FanningNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between shear stress and dynamic pressure in the flow of a fluid in a containment, expressed by `f_n = (2*τ)/(ρ*v^2)`, where `τ` is shear stress (ISO 80000-4) at the wall, `ρ` is mass density (ISO 80000-4) of the fluid, and `v` is speed (ISO 80000-3) of the fluid in the pipe + * remarks: The Fanning number describes the flow of fluids in a pipe with friction at the walls represented by its shear stress. Symbol `f` may be used where no conflicts are possible. + */ + } + attribute fanningNumber: FanningNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.25 Goertler number, Goertler parameter */ + attribute def GoertlerNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.25 Goertler number, Goertler parameter + * symbol(s): `Go` + * application domain: generic + * name: GoertlerNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: characterization of the stability of laminar boundary layer flows in transfer of matter in a boundary layer on curved surfaces, expressed by `Go = (v*l_b)/ν * sqrt(l_b/r_c)`, where `v` is speed (ISO 80000-3), `l_b` is boundary layer thickness (ISO 80000-3), `ν` is kinematic viscosity (ISO 80000-4), and `r_c` is radius of curvature (ISO 80000-3) + * remarks: The Goertler number represents the ratio of centrifugal effects to viscous effects. + */ + } + attribute goertlerNumber: GoertlerNumberValue :> scalarQuantities; + + alias goertlerParameter for goertlerNumber; + + /* ISO-80000-11 item 11-4.26 Hagen number */ + attribute def HagenNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.26 Hagen number + * symbol(s): `Hg`, `Ha` + * application domain: generic + * name: HagenNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: generalization of the Grashof number for forced or free convection in laminar flow, expressed by `Hg = -1/ρ*(dp)/(dx)*l^3/ν^2`, where `ρ` is mass density (ISO 80000-4) of fluid, `(dp)/(dx)` is gradient of pressure (ISO 80000-4), `l` is characteristic length (ISO 80000-3), and `ν` is kinematic viscosity (ISO 80000-4) + * remarks: For free thermal convection with `(dp)/(dx) = ρ*g*α_V*ΔT`, the Hagen number then coincides with the Grashof number (item 11-4.4). See also the Poiseuille number (item 11-4.28). + */ + } + attribute hagenNumber: HagenNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.27 Laval number */ + attribute def LavalNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.27 Laval number + * symbol(s): `La` + * application domain: generic + * name: LavalNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of speed and the (critical) sound speed at the throat of a nozzle, expressed by `La = v/sqrt((R_s*T*2*γ)/(γ+1))`, where `v` is speed (ISO 80000-3),  `R_s = R/M` is specific gas constant, where `R` is molar gas constant (ISO 80000-9), and `M` is molar mass (ISO 80000-9), `T` is thermodynamic temperature (ISO 80000-5), and `γ` is ratio of the specific heat capacities (ISO 80000-5) + * remarks: The Laval number is a specific kind of Mach number (item 11-4.6). + */ + } + attribute lavalNumber: LavalNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.28 Poiseuille number */ + attribute def PoiseuilleNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.28 Poiseuille number + * symbol(s): `Poi` + * application domain: generic + * name: PoiseuilleNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of propulsive force by pressure and viscous force for a flow of fluids in a pipe, expressed by `Poi = -(Δp)/l*d^2/(η*v)`, where `Δp` is drop of pressure (ISO 80000-4) along the pipe, `l` is length (ISO 80000-3) of the pipe, `d` is diameter (ISO 80000-3) of the pipe, `η` is dynamic viscosity (ISO 80000-4) of the fluid, and `v` is characteristic speed (ISO 80000-3) of the fluid + * remarks: The Poiseuille number is `Poi=32` for laminar flow in a round pipe. See also the Hagen number (item 11-4.26). + */ + } + attribute poiseuilleNumber: PoiseuilleNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.29 power number */ + attribute def PowerNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.29 power number + * symbol(s): `Pn` + * application domain: generic + * name: PowerNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of power consumption by agitators due to drag and rotational inertial power in fluids, expressed by `Pn = P/(ρ*n^3*d^5)`, where `P` is active power (IEC 80000-6) consumed by a stirrer, `ρ` is mass density (ISO 80000-4) of fluid, `n` is rotational frequency (ISO 80000-3), and `d` is diameter (ISO 80000-3) of stirrer + * remarks: None. + */ + } + attribute powerNumber: PowerNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.30 Richardson number */ + attribute def RichardsonNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.30 Richardson number + * symbol(s): `Ri` + * application domain: generic + * name: RichardsonNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of potential energy and kinetic energy for a falling body, expressed by `Ri = (g*h)/v^2`, where `g` is acceleration of free fall (ISO 80000-3), `h` is characteristic height (ISO 80000-3), and `v` is characteristic speed (ISO 80000-3) + * remarks: In geophysics differences of these quantities are of interest. + */ + } + attribute richardsonNumber: RichardsonNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.31 Reech number */ + attribute def ReechNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.31 Reech number + * symbol(s): `Ree` + * application domain: generic + * name: ReechNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between the speed of an object submerged in water relative to the water, and wave propagation speed, expressed by `Ree = (g*l)/v`, where `g` is acceleration of free fall (ISO 80000-3), `l` is characteristic length (ISO 80000-3), and `v` is speed (ISO 80000-3) of the object relative to the water + * remarks: The Reech number can be used to determine the resistance of a partially submerged object (e.g. a ship) of length `l` (in direction of the motion) moving through water. A similar quantity is defined as the Boussinesq number `Bs = v/sqrt(2*g*l)` . + */ + } + attribute reechNumber: ReechNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.32 Stokes number */ + attribute def StokesNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.32 Stokes number + * symbol(s): `Stk` + * application domain: time-related + * name: StokesNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of friction and inertia forces for particles in a fluid or in a plasma, expressed by `Stk = t_r/t_a`, where `t_r` is relaxation time (ISO 80000-12) of particles to achieve fluid’s velocity due to friction (viscosity), and `t_a` is time (ISO 80000-3) of fluid to alter its velocity under external influence + * remarks: In most cases `t_r = l/v`, where `l` is characteristic length, and `v` is speed of fluid. The characteristic length can be the diameter of an obstacle or hole. + */ + } + attribute stokesNumber: StokesNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.33 Stokes number */ + attribute def StokesNumberForVibratingParticlesValue :> DimensionOneValue { + doc + /* + * source: item 11-4.33 Stokes number + * symbol(s): `Stk_1` + * application domain: vibrating particles + * name: StokesNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of friction and inertia forces for the special case of particles vibrating in a fluid or plasma, expressed by `Stk_1 = ν/(d^2*f)`, where `ν` is kinematic viscosity (ISO 80000-4) of the fluid or plasma, `d` is diameter (ISO 80000-3) of particle, and `f` is frequency (ISO 80000-3) of particle vibrations + * remarks: Sometimes the inverse of this number is wrongly used. + */ + } + attribute stokesNumberForVibratingParticles: StokesNumberForVibratingParticlesValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.34 Stokes number, power coefficient */ + attribute def StokesNumberForRotameterValue :> DimensionOneValue { + doc + /* + * source: item 11-4.34 Stokes number, power coefficient + * symbol(s): `Stk_2` + * application domain: rotameter + * name: StokesNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: Stokes number for calibration of rotameters metering vertical flows of fluids by means of a floating body, expressed by `Stk_2 = (r^3*g*m*ρ)/(η^2) * (ρ_b-ρ)/(ρ_b) = (r^3*g*m)/ν^2 * (1/ρ-1/ρ_b)`, where `r` is ratio of pipe and float radii, `g` is acceleration of free fall (ISO 80000-3), `m` is mass (ISO 80000-4) of the body, `ρ` is mass density (ISO 80000-4) of the fluid, `η` is dynamic viscosity (ISO 80000-4) of the fluid, `ρ_b` is mass density (ISO 80000-4) of the body, and `ν` is kinematic viscosity (ISO 80000-4) of the fluid + * remarks: In general use, this value is multiplied by 1,042. See also the Archimedes number (item 11-6.12). + */ + } + attribute stokesNumberForRotameter: StokesNumberForRotameterValue :> scalarQuantities; + + alias powerCoefficient for stokesNumber; + + /* ISO-80000-11 item 11-4.35 Stokes number */ + attribute def StokesNumberForGravityValue :> DimensionOneValue { + doc + /* + * source: item 11-4.35 Stokes number + * symbol(s): `Stk_3` + * application domain: gravity + * name: StokesNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between viscous forces and gravity forces for particles falling in a fluid, expressed by `Stk_3 = (v*ν)/(g*l^2)`, where `v` is characteristic speed (ISO 80000-3) of particles, `ν` is kinematic viscosity (ISO 80000-4) of the fluid, `g` is acceleration of free fall (ISO 80000-3), and `l` is length (ISO 80000-3) of fall + * remarks: None. + */ + } + attribute stokesNumberForGravity: StokesNumberForGravityValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.36 Stokes number */ + attribute def StokesNumberForDragValue :> DimensionOneValue { + doc + /* + * source: item 11-4.36 Stokes number + * symbol(s): `Stk_4` + * application domain: drag + * name: StokesNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of drag force and internal friction forces for particles dragged in a fluid `Stk_4 = F_D/(η*v*l)`, where `F_D` is drag force (ISO 80000-4), `η` is dynamic viscosity (ISO 80000-4), `v` is speed (ISO 80000-3), and `l` is characteristic length (ISO 80000-3) + * remarks: None. + */ + } + attribute stokesNumberForDrag: StokesNumberForDragValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.37 Laplace number, Suratman number */ + attribute def LaplaceNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.37 Laplace number, Suratman number + * symbol(s): `La`, `Su` + * application domain: generic + * name: LaplaceNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between capillary forces and viscous forces when characterizing free surface flow, expressed by `La = Su = (γ*ρ*l)/η^2`, where `γ` is surface tension (ISO 80000-4), `ρ` is mass density (ISO 80000-4) of the fluid, `l` is characteristic length (ISO 80000-3), and `η` is dynamic viscosity (ISO 80000-4) of the fluid + * remarks: The Laplace number is also the ratio of surface tension to momentum transfer, especially dissipation, inside a fluid. The Laplace number is also given by `La = Su = 1/(Oh)^2 = (Re)^2/(We)`, where `Oh` is the Ohnesorge number (item 11-7.4), `Re` is the Reynolds number (item 11-4.1), and `We` is the Weber number (item 11-4.5). + */ + } + attribute laplaceNumber: LaplaceNumberValue :> scalarQuantities; + + alias suratmanNumber for laplaceNumber; + + /* ISO-80000-11 item 11-4.38 Blake number */ + attribute def BlakeNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.38 Blake number + * symbol(s): `Bl` + * application domain: generic + * name: BlakeNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between inertial forces and viscous forces in a porous material, expressed by `Bl = (v*ρ*l)/(η*(1-ε))`, where `v` is speed (ISO 80000-3) of the fluid, `ρ` is mass density (ISO 80000-4) of the fluid, `l` is characteristic length (ISO 80000-3) defined as the volume of a particle divided by its surface area, `η` is dynamic viscosity (ISO 80000-4) of the fluid, and `ε` is porosity of the material (=void fraction) + * remarks: The Blake number can be interpreted as a Reynolds number for flow in porous material. + */ + } + attribute blakeNumber: BlakeNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.39 Sommerfeld number */ + attribute def SommerfeldNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.39 Sommerfeld number + * symbol(s): `So`, `Sm` + * application domain: generic + * name: SommerfeldNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between viscous force and load force in a lubrication boundary, expressed by `So = (η*n)/p*(r/c)^2`, where `η` is dynamic viscosity (ISO 80000-4) of the lubricant, `n` is rotational frequency (ISO 80000-3), `p` is mean bearing pressure (ISO 80000-4), `r` is radius (ISO 80000-3) of the shaft, and `c` is radial distance (ISO 80000-3) between rotating shaft and annulus + * remarks: Sometimes the inverse of this number is wrongly used. + */ + } + attribute sommerfeldNumber: SommerfeldNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.40 Taylor number */ + attribute def TaylorNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.40 Taylor number + * symbol(s): `Ta` + * application domain: momentum transfer + * name: TaylorNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between centrifugal force and viscous force of a rotating shaft, expressed by `Ta = (4*ω^2*l^4)/ν^2`, where `ω` is angular velocity (ISO 80000-3) of rotation, `l` is length (ISO 80000-3) perpendicular to the rotation axis, and `ν` is kinematic viscosity (ISO 80000-4) + * remarks: Sometimes the square root of this quantity is wrongly used. The Taylor number for a rotating shaft relative to an annulus is given by `Ta_a = (ω/nu)^2*r*a^3`, where `ω` is angular velocity (ISO 80000-3) of the shaft, `nu` is kinematic viscosity (ISO 80000-4), `r = (r_2+r_1)/2` is mean radius (ISO 80000-3) of the annulus, and `a = (r_2 - r_1)` is width of the annulus, where `r_1` is inner radius of the annulus, and `r_2` is outer radius of the annulus. Sometimes the square root of this quantity is used; this use is deprecated. + */ + } + attribute taylorNumber: TaylorNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.41 Galilei number */ + attribute def GalileiNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.41 Galilei number + * symbol(s): `Ga` + * application domain: generic + * name: GalileiNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between gravitational force and viscous force in fluid films flowing over walls, expressed by `Ga = (g*l^3)/ν^2`, where `g` is acceleration of free fall (ISO 80000-3), `l` is characteristic length (ISO 80000-3), and `ν` is kinematic viscosity (ISO 80000-4) of the fluid + * remarks: The Galilei number is also given by `Ga = Re^2*Ri` or `Ga = {:Re:}^2/{:Fr:}^2`, where `Re` is the Reynolds number (item 11-4.1), `Ri` is the Richardson number (item 11-4.30), and `Fr` is the Froude number (item 11-4.3). + */ + } + attribute galileiNumber: GalileiNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-4.42 Womersley number */ + attribute def WomersleyNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-4.42 Womersley number + * symbol(s): `Wo`, `α` + * application domain: generic + * name: WomersleyNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between inertial forces and viscous forces in oscillating flows of fluids in pipes, expressed by `Wo = R*sqrt(ω/ν)`, where `R` is (effective) radius (ISO 80000-3) of the pipe, `ω` is angular frequency (ISO 80000-3) of oscillations, and `ν` is kinematic viscosity (ISO 80000-4) + * remarks: The Womersley number is used for pulsating flows e.g. in blood flow. + */ + } + attribute womersleyNumber: WomersleyNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.1 Fourier number */ + attribute def FourierNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.1 Fourier number + * symbol(s): `Fo` + * application domain: heat transfer + * name: FourierNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between heat conduction rate and the rate of thermal energy storage in a body for conductive heat transfer into a body, expressed by `Fo = (a*t)/l^2`, where `a` is thermal diffusivity (ISO 80000-5), `t` is time (ISO 80000-3), and `l` is characteristic length (ISO 80000-3) + * remarks: The characteristic length `l` of the body is often defined as the quotient of the body’s volume and its heated surface. Sometimes the reciprocal of this number is wrongly used. + */ + } + attribute fourierNumber: FourierNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.2 Péclet number */ + attribute def 'PécletNumberValue' :> DimensionOneValue { + doc + /* + * source: item 11-5.2 Péclet number + * symbol(s): `Pe` + * application domain: heat transfer + * name: PécletNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between convective heat transfer rate and conductive heat transfer rate, expressed by `Pe = (v*l)/a`, where `v` is speed (ISO 80000-3), `l` is length (ISO 80000-3) in the direction of heat transfer, and `a` is thermal diffusivity (ISO 80000-5) + * remarks: The thermal Péclet number is also given by `Pe = Re*Pr`, where `Re` is the Reynolds number (item 11-4.1), and `Pr` is the Prandtl number (item 11-7.1). Compare with item 11-6.2, Péclet number for mass transfer. + */ + } + attribute 'pécletNumber': 'PécletNumberValue' :> scalarQuantities; + + /* ISO-80000-11 item 11-5.3 Rayleigh number */ + attribute def RayleighNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.3 Rayleigh number + * symbol(s): `Ra` + * application domain: generic + * name: RayleighNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between buoyancy forces due to thermal expansion and viscous forces in free convection in buoyancy driven flow near a heated surface perpendicular to the gravity force, expressed by `Ra = (l^3*g*α_V*ΔT)/(ν*a)`, where `l` is distance (ISO 80000-3) from the wall, `g` is acceleration of free fall (ISO 80000-3), `α_V` is cubic expansion coefficient (ISO 80000-5) of the fluid, `ΔT` is difference of thermodynamic temperature (ISO 80000-5) between surface of the wall and the fluid far away from the wall, `ν` is kinematic viscosity (ISO 80000-4) of the fluid, and `a` is thermal diffusivity (ISO 80000-5) of the fluid + * remarks: The Rayleigh number is also given by `Ra = Gr*Pr`, where `Gr` is the Grashof number (item 11-4.4), and `Pr` is the Prandtl number (item 11-7.1). + */ + } + attribute rayleighNumber: RayleighNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.4 Froude number */ + attribute def FroudeNumberForHeatTransferValue :> DimensionOneValue { + doc + /* + * source: item 11-5.4 Froude number + * symbol(s): `Fr^"*"` + * application domain: heat transfer + * name: FroudeNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of gravitational forces and thermodiffusion forces for heat transfer in forced convection of fluids, expressed by `Fr^"*" = (g*l^3)/a^2`, where `g` is acceleration of free fall (ISO 80000-3), `l` is characteristic length (ISO 80000-3), and `a` is thermal diffusivity (ISO 80000-5)" + * remarks: None. + */ + } + attribute froudeNumberForHeatTransfer: FroudeNumberForHeatTransferValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.5 Nusselt number */ + attribute def NusseltNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.5 Nusselt number + * symbol(s): `Nu` + * application domain: heat transfer + * name: NusseltNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between the internal thermal resistance of a body and its surface thermal resistance in a body transferring heat from a surface into its interior or vice versa, expressed by `Nu = (K*l)/λ = (K*l)/(a*ρ*c_p)`, where `K` is coefficient of heat transfer (ISO 80000-5) through the surface, `l` is length (ISO 80000-3) of the body in direction of heat flow, `λ` is thermal conductivity (ISO 80000-5) of the surface, `a` is thermal diffusivity (ISO 80000-5), `ρ` is mass density (ISO 80000-4), and `c_p` is specific heat capacity at constant pressure (ISO 80000-5) + * remarks: The body under consideration can be a solid body, a fluid, or their combination, and additional heat transfer due to convective motion can occur. In case of merely conductive heat transfer especially in a solid body, the "Biot number for heat transfer" (item 11-5.6) is used. + */ + } + attribute nusseltNumber: NusseltNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.6 Biot number */ + attribute def BiotNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.6 Biot number + * symbol(s): `Bi` + * application domain: heat transfer + * name: BiotNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: special case of the Nusselt number for heat transfer (item 11-5.5) in case of conductive heat transfer in a solid body, expressed by `Bi = (K*l)/λ`, where `K` is coefficient of heat transfer (ISO 80000-5) through the surface, `l` is characteristic length (ISO 80000-3), and `λ` is thermal conductivity (ISO 80000-5) of the body + * remarks: The characteristic length is commonly defined as the volume of the body divided by its surface area. + */ + } + attribute biotNumber: BiotNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.7 Stanton number */ + attribute def StantonNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.7 Stanton number + * symbol(s): `St` + * application domain: heat transfer + * name: StantonNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between heat transfer into a fluid from a surface and its heat transfer by convection, expressed by `St = K/(ρ*v*c_p)`, where `K` is coefficient of heat transfer (ISO 80000-5) through the surface, `ρ` is mass density (ISO 80000-4), `v` is speed (ISO 80000-3), and `c_p` is specific heat capacity at constant pressure (ISO 80000-5) of the fluid + * remarks: The Stanton number is also given by `St = (Nu)/(Re*Pr) = (Nu)/(Pe)`, where `Nu` is Nusselt number for heat transfer (item 11-5.5), `Re` is the Reynolds number (item 11-4.1), `Pr` is the Prandtl number (item 11-7.1), and Pe is the Péclet number (item 11-5.2). Sometimes this quantity is called Margoulis number, symbol `Ms` or `Mg`. + */ + } + attribute stantonNumber: StantonNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.8 j-factor, heat transfer factor, Colburn number */ + attribute def JFactorValue :> DimensionOneValue { + doc + /* + * source: item 11-5.8 j-factor, heat transfer factor, Colburn number + * symbol(s): `j`, `Co`, `Jq` + * application domain: heat transfer + * name: JFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between heat transfer and mass transfer in a fluid, expressed by `j = K/(c_p*ρ*v)*((c_p*η)/λ)^(2/3)`, where `K` is coefficient of heat transfer (ISO 80000-5), `c_p` is specific heat capacity at constant pressure (ISO 80000-5), `ρ` is mass density (ISO 80000-4), `v` is speed (ISO 80000-3), `η` is dynamic viscosity (ISO 80000-4), and `λ` is thermal conductivity (ISO 80000-5) + * remarks: The heat transfer factor is also given by `j = St*Pr^(2/3)`, where `St` is the Stanton number for heat transfer (item 11-5.7), and `Pr` is the Prandtl number (item 11-7.1). See also mass transfer factor (item 11-6.7). + */ + } + attribute jFactor: JFactorValue :> scalarQuantities; + + alias heatTransferFactor for jFactor; + + alias colburnNumber for jFactor; + + /* ISO-80000-11 item 11-5.9 Bejan number */ + attribute def BejanNumberForHeatTransferValue :> DimensionOneValue { + doc + /* + * source: item 11-5.9 Bejan number + * symbol(s): `Be_1` + * application domain: heat transfer + * name: BejanNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of mechanical work and frictional and thermal diffusion energy losses for a forced flow, expressed by `Be_1 = (Δp*l^2)/(η*a)`, where `Δp` is drop of pressure (ISO 80000-4) along a pipe, `l` is length (ISO 80000-3) of the pipe, `η` is dynamic viscosity (ISO 80000-4), and `a` is thermal diffusivity (ISO 80000-5) + * remarks: None. + */ + } + attribute bejanNumberForHeatTransfer: BejanNumberForHeatTransferValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.10 Bejan number */ + attribute def BejanNumberForEntropyValue :> DimensionOneValue { + doc + /* + * source: item 11-5.10 Bejan number + * symbol(s): `Be_S` + * application domain: entropy + * name: BejanNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: efficiency of heat transfer by a fluid, expressed by `Be_S = (S(ΔT))/(S(ΔT)+S(Δp))`, where `S(ΔT)` is entropy generation contributed by heat transfer, and `S(Δp)` is entropy generation contributed by fluid friction + * remarks: None. + */ + } + attribute bejanNumberForEntropy: BejanNumberForEntropyValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.11 Stefan number */ + attribute def StefanNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.11 Stefan number + * symbol(s): `Ste`, `Stf` + * application domain: phase transition + * name: StefanNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between heat content and latent heat content in a binary mixture undergoing a phase transition, expressed by `Ste = (c_p*ΔT)/Q`, where `c_p` is specific heat capacity at constant pressure (ISO 80000-5), `ΔT` is difference of thermodynamic temperature T (ISO 80000-5) between the phases, and `Q` is quotient of latent heat of phase transition (ISO 80000-5) and mass (ISO 80000-4) + * remarks: None. + */ + } + attribute stefanNumber: StefanNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.12 Brinkman number */ + attribute def BrinkmanNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.12 Brinkman number + * symbol(s): `Br`, `N_(Br)` + * application domain: generic + * name: BrinkmanNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between heat produced by viscosity and heat conducted from a wall adjacent to a fluid moving relative to it, expressed by `Br = (η*v^2)/(λ*ΔT)`, where `η` is dynamic viscosity (ISO 80000-4), `v` is characteristic speed (ISO 80000-3), `λ` is thermal conductivity (ISO 80000-5), and `ΔT = T_W - T_0` is difference of thermodynamic temperature `T` (ISO 80000-5), where `T_0` is bulk fluid temperature, and `T_W` is wall temperature + * remarks: None. + */ + } + attribute brinkmanNumber: BrinkmanNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.13 Clausius number */ + attribute def ClausiusNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.13 Clausius number + * symbol(s): `Cl` + * application domain: generic + * name: ClausiusNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between energy transfer associated with fluid momentum and energy transfer by thermal conduction in forced heating, expressed by `Cl = (v^3*l*ρ)/(λ*ΔT)`, where `v` is speed (ISO 80000-3), `l` is length (ISO 80000-3) of the path of energy transfer, `ρ` is mass density (ISO 80000-4), `λ` is thermal conductivity (ISO 80000-5), and `ΔT` is difference of thermodynamic temperature `T` (ISO 80000-5) along length `l` + * remarks: None. + */ + } + attribute clausiusNumber: ClausiusNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.14 Carnot number */ + attribute def CarnotNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.14 Carnot number + * symbol(s): `Ca` + * application domain: generic + * name: CarnotNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: theoretical maximum efficiency (ISO 80000-5) of a Carnot cycle operating between temperature reservoirs `Ca = (T_2 - T_1)/T_2`, where `T` is thermodynamic temperature (ISO 80000-5), and `T_2`, `T_1` are the thermodynamic temperatures of a heat source and a heat sink, respectively + * remarks: None. + */ + } + attribute carnotNumber: CarnotNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.15 Eckert number, Dulong number */ + attribute def EckertNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.15 Eckert number, Dulong number + * symbol(s): `Ec` + * application domain: generic + * name: EckertNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between the kinetic energy of a flow and its enthalpy change in fluid dynamics exhibiting dissipation, expressed by `Ec = v^2/(c_p*ΔT)`, where `v` is characteristic speed (ISO 80000-3), `c_p` is specific heat capacity at constant pressure (ISO 80000-5) of the flow, and `ΔT` is difference of thermodynamic temperature `T` (ISO 80000-5) due to dissipation (by friction) + * remarks: None. + */ + } + attribute eckertNumber: EckertNumberValue :> scalarQuantities; + + alias dulongNumber for eckertNumber; + + /* ISO-80000-11 item 11-5.16 Graetz number */ + attribute def GraetzNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.16 Graetz number + * symbol(s): `Gz` + * application domain: heat transfer + * name: GraetzNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between heat transferred by convection and heat transferred by conduction in a laminar flow in a pipe, expressed by `Gz = (v*d^2)/(a*l)`, where `v` is speed (ISO 80000-3) of the fluid, `d` is diameter (ISO 80000-3) of the pipe, `a` is thermal diffusivity (ISO 80000-5) of the fluid, and `l` is length (ISO 80000-3) of the pipe + * remarks: None. + */ + } + attribute graetzNumber: GraetzNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.17 heat transfer number */ + attribute def HeatTransferNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.17 heat transfer number + * symbol(s): `K_Q` + * application domain: generic + * name: HeatTransferNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between heat transferred by a flow and its kinetic energy, expressed by `K_Q = Φ/(v^3*l^2*ρ)`, where `Φ` is heat flow rate (ISO 80000-5), `v` is characteristic speed (ISO 80000-3), `l` is characteristic length (ISO 80000-3), and `ρ` is mass density (ISO 80000-4) + * remarks: None. + */ + } + attribute heatTransferNumber: HeatTransferNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.18 Pomerantsev number */ + attribute def PomerantsevNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.18 Pomerantsev number + * symbol(s): `Po`, `Pov` + * application domain: heat transfer + * name: PomerantsevNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between heat generated in a body and conducted heat in the body, expressed by `Po = (Q_m*l^2)/(λ*ΔT)`, where `Q_m` is (constant) volumic heat generation rate, `l` is characteristic length (ISO 80000-3), `λ` is thermal conductivity (ISO 80000-5), and `ΔT = T_m - T_0` is difference of thermodynamic temperature (ISO 80000-5) between that of the medium (T_m) and the initial temperature of the body (T_0) + * remarks: Similar numbers are known for areic, lineic and point sources of heat, each with decreasing power of length `l` respectively. + */ + } + attribute pomerantsevNumber: PomerantsevNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.19 Boltzmann number */ + attribute def BoltzmannNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.19 Boltzmann number + * symbol(s): `Bz`, `Bol`, `Bo` + * application domain: generic + * name: BoltzmannNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between convective heat and radiant heat for a fluid in a channel, expressed by `Bz = (ρ*v*c_p)/(ε*σ*T^3)`, where `ρ` is mass density (ISO 80000-4) of the fluid, `v` is characteristic speed (ISO 80000-3) of the fluid, `c_p` is specific heat capacity at constant pressure (ISO 80000-5), `ε` is emissivity (ISO 80000-7), `σ` is the Stefan-Boltzmann constant (ISO 80000-7), and `T` is thermodynamic temperature (ISO 80000-5) + * remarks: None. + */ + } + attribute boltzmannNumber: BoltzmannNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-5.20 Stark number */ + attribute def StarkNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-5.20 Stark number + * symbol(s): `Sk` + * application domain: generic + * name: StarkNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between radiant heat and conductive heat multiplied by the relative temperature difference for a body, expressed by `Sk = (ε*σ*T^3*l)/λ`, where `ε` is emissivity (ISO 80000-7) of the surface, `σ` is the Stefan-Boltzmann constant (ISO 80000-7), `T` is thermodynamic temperature (ISO 80000-5), `l` is characteristic length (ISO 80000-3), and `λ` is thermal conductivity (ISO 80000-5) + * remarks: The relative temperature difference is defined by `(ΔT)/T`, where `ΔT = T_s - T_l` is the difference of the temperature at the surface, `T_s`, and the temperature at a layer at a distance `l` from the surface, `T_l`. Sometimes this characteristic number is wrongly defined without the factor `ε`. Deprecated names are: Stefan number and Biot radiation number. + */ + } + attribute starkNumber: StarkNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.1 Fourier number */ + attribute def FourierNumberForMassTransferValue :> DimensionOneValue { + doc + /* + * source: item 11-6.1 Fourier number + * symbol(s): `Fo^"*"` + * application domain: mass transfer + * name: FourierNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between diffusive mass transfer within a given duration and mass storage rate in transient mass transfer, expressed by `Fo^"*" = (D*t)/l^2`, where `D` is diffusion coefficient (ISO 80000-9), `t` is duration (ISO 80000-3) of observation, and `l` is length (ISO 80000-3) of transfer" + * remarks: The Fourier number for mass transfer is also given by `Fo^*" = (Fo)/(Le)`, where `Fo` is the Fourier number for heat transfer (item 11-5.1), and `Le` is the Lewis number (item 11-7.3). See also the Fourier number for heat transfer (item 11-5.1)." + */ + } + attribute fourierNumberForMassTransfer: FourierNumberForMassTransferValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.2 Péclet number */ + attribute def 'PécletNumberForMassTransferValue' :> DimensionOneValue { + doc + /* + * source: item 11-6.2 Péclet number + * symbol(s): `Pe^"*"`, `Bd`, `Bod` + * application domain: mass transfer + * name: PécletNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between advective mass transfer rate and longitudinal diffusive mass transfer rate for mass transfer in reactors, expressed by `Pe^*" = (v*l)/D`, where `v` is speed (ISO 80000-3), `l` is characteristic length (ISO 80000-3), and `D` is diffusion coefficient (ISO 80000-9)" + * remarks: The Péclet number for mass transfer is also given by `Pe^"*" = Pe*Le = Re*Sc`, where `Pe` is the Péclet number for heat transfer, `Le` is the Lewis number (item 11-7.3), `Re` is the Reynolds number (item 11-4.1), and `Sc` is the Schmidt number (item 11-7.2). Compare with item 11-5.2, the Péclet number for heat transfer. + */ + } + attribute 'pécletNumberForMassTransfer': 'PécletNumberForMassTransferValue' :> scalarQuantities; + + /* ISO-80000-11 item 11-6.3 Grashof number */ + attribute def GrashofNumberForMassTransferValue :> DimensionOneValue { + doc + /* + * source: item 11-6.3 Grashof number + * symbol(s): `Gr^"*"` + * application domain: mass transfer + * name: GrashofNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between buoyancy forces and viscous forces in natural convection of fluids, expressed by `Gr^"*" = (l^3*g*β*Δx)/ν^2`, where `l` is characteristic length (ISO 80000-3), `g` is acceleration of free fall (ISO 80000-3), `β = -1/ρ*((del ρ)/(del x))_(T,p)`, where `ρ` is mass density (ISO 80000-4) of the fluid, and `x` is amount-of-substance fraction (ISO 80000-9), `Δx` is difference of amount-of-substance fraction (ISO 80000-9) along length `l`, and `ν` is kinematic viscosity (ISO 80000-4)" + * remarks: Instead of "amount-of-substance fraction" the "amount-of-substance concentration" (ISO 80000-9) is used also. Compare with item 11-4.4, the Grashof number. + */ + } + attribute grashofNumberForMassTransfer: GrashofNumberForMassTransferValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.4 Nusselt number */ + attribute def NusseltNumberForMassTransferValue :> DimensionOneValue { + doc + /* + * source: item 11-6.4 Nusselt number + * symbol(s): `Nu^"*"` + * application domain: mass transfer + * name: NusseltNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between mass flux at an interface and specific flux by pure molecular diffusion in a layer of thickness `l` for mass transfer at the boundary of a fluid, expressed by `Nu^"*" = (k’*l)/(ρ*D)`, where `k’` is mass flux density `q_m/A` through the surface, where `q_m` is mass flow rate (ISO 80000-4), and `A` is area (ISO 80000-3), `l` is thickness (ISO 80000-3), `ρ` is mass density (ISO 80000-4) of the fluid, and `D` is diffusion coefficient (ISO 80000-9)" + * remarks: Sometimes this quantity is called the Sherwood number, `Sh`. Compare with item 11-5.5, Nusselt number for heat transfer. + */ + } + attribute nusseltNumberForMassTransfer: NusseltNumberForMassTransferValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.5 Stanton number */ + attribute def StantonNumberForMassTransferValue :> DimensionOneValue { + doc + /* + * source: item 11-6.5 Stanton number + * symbol(s): `St^"*"` + * application domain: mass transfer + * name: StantonNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between mass transfer perpendicular to the surface of a fluid flow and mass transfer parallel to the surface in a free surface flow, expressed by `St^"*" = k^"*" + * remarks: The Stanton number for mass transfer is also given by `St^*" = (Nu^"*")/(Pe^"*"*)`, where `Nu^"*"` is the Nusselt number for mass transfer (item 11-6.4), and `Pe^"*"` is the Péclet number for mass transfer (item 11-6.2). Compare with item 11-5.7, the Stanton number for heat transfer." + */ + } + attribute stantonNumberForMassTransfer: StantonNumberForMassTransferValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.6 Graetz number */ + attribute def GraetzNumberForMassTransferValue :> DimensionOneValue { + doc + /* + * source: item 11-6.6 Graetz number + * symbol(s): `Gz^"*"` + * application domain: mass transfer + * name: GraetzNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of advective mass transfer rate and radial diffusive mass transfer rate for mass transfer in pipes, expressed by `Gz^"*" = (v*d)/D = d/l*Pe^"*"`, where `v` is characteristic speed (ISO 80000-3) of the fluid, `d` is hydraulic diameter (ISO 80000-3) of the pipe, `D` is diffusion coefficient (ISO 80000-9), `l` is length (ISO 80000-3) of the pipe, and `Pe^"*"` is the Péclet number for mass transfer (item 11-6.2)" + * remarks: None. + */ + } + attribute graetzNumberForMassTransfer: GraetzNumberForMassTransferValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.7 mass transfer factor */ + attribute def MassTransferFactorValue :> DimensionOneValue { + doc + /* + * source: item 11-6.7 mass transfer factor + * symbol(s): `j^"*"` + * application domain: mass transfer + * name: MassTransferFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between mass transfer perpendicular to the surface of a fluid and mass transfer parallel to the surface in an open flow of fluids, expressed by `j^*" = k/v * (ν/D)^(2/3)`, where `k` is the mass transfer coefficient through the surface, `k = k^'/ρ`, where `ρ` is mass density (ISO 80000-4), `k^'` is mass flux density `q_m/A` through the surface, where `q_m` is mass flow rate (ISO 80000-4), and `A` is area (ISO 80000-3), `v` is speed (ISO 80000-3), `ν` is kinematic viscosity (ISO 80000-4), and `D` is diffusion coefficient (ISO 80000-9)" + * remarks: The mass transfer factor is also given by `j_m = j^*" = St^"*" * (Sc)^(2/3)` where `St^"*"` is the Stanton number for mass transfer (item 11-6.5), and `Sc` is the Schmidt number (item 11-7.2). See also heat transfer factor (item 11-5.17)." + */ + } + attribute massTransferFactor: MassTransferFactorValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.8 Atwood number */ + attribute def AtwoodNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-6.8 Atwood number + * symbol(s): `At` + * application domain: generic + * name: AtwoodNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: scaled density difference of heavier and lighter fluids, expressed by `At = (ρ_1 - ρ_2)/(ρ_1 + ρ_2)`, where `ρ_1` is density of heavier fluid, and `ρ_2` is density of lighter fluid + * remarks: The Atwood number is used in the study of hydrodynamic instabilities in density stratified flows. + */ + } + attribute atwoodNumber: AtwoodNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.9 Biot number */ + attribute def BiotNumberForMassTransferValue :> DimensionOneValue { + doc + /* + * source: item 11-6.9 Biot number + * symbol(s): `Bi^"*"` + * application domain: mass transfer + * name: BiotNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between mass transfer rate at the interface and mass transfer rate in the interior of a body, expressed by `Bi^*" = (k*l)/D_"int"`, where `k` is the mass transfer coefficient through the surface, `k = k^'/ρ`, where `ρ` is mass density (ISO 80000-4), `k^'` is mass flux density `q_m/A` through the surface, where `q_m` is mass flow rate (ISO 80000-4), and `A` is area (ISO 80000-3), `l` is thickness (ISO 80000-3) of layer, and `D_"int"` is diffusion coefficient (ISO 80000-9) at the interface" + * remarks: None. + */ + } + attribute biotNumberForMassTransfer: BiotNumberForMassTransferValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.10 Morton number */ + attribute def MortonNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-6.10 Morton number + * symbol(s): `Mo` + * application domain: generic + * name: MortonNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of gravitational forces and viscous forces for gas bubbles in a liquid, or liquid drops in a gas, expressed by `Mo = (g*η^4)/(ρ*γ^3)*(ρ_b/ρ - 1)`, where `g` is acceleration of free fall (ISO 80000-3), `η` is dynamic viscosity (ISO 80000-4) of the surrounding fluid, `ρ` is mass density (ISO 80000-4) of the surrounding fluid, `γ` is surface tension (ISO 80000-4) of the interface, and `ρ_b` is mass density (ISO 80000-4) of the bubble or drop + * remarks: The Morton number is used to determine the shape of bubbles or drops. The Morton number is also given by `Mo = We^3*Fr^-2*Re^-4`, where `We` is the Weber number (item 11-4.5), `Fr` is the Froude number (item 11-4.3), and `Re` is the Reynolds number (item 11-4.1). + */ + } + attribute mortonNumber: MortonNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.11 Bond number, Eötvös number */ + attribute def BondNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-6.11 Bond number, Eötvös number + * symbol(s): `Bo`, `Eo` + * application domain: generic + * name: BondNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of inertial force and capillary force for gas bubbles or liquid drops in a fluid, expressed by `Bo = a/γ * ρ*l^2*(ρ_b/ρ - 1)`, where `a` is the acceleration of the body (ISO 80000-3), mostly acceleration of free fall, `g` (ISO 80000-3), `γ` is surface tension (ISO 80000-4) of the interface, `ρ` is density (ISO 80000-4) of the medium, `l` is characteristic length (ISO 80000-3) (radius of a drop or radius of a capillary tube), and `ρ_b` is mass density (ISO 80000-4) of the drop or bubble + * remarks: In the case of gravity `a = g` acceleration of free fall (ISO 80000-3), the name Eötvös number is mostly used. The Bond number is also given by `Bo = (We)/(Fr)`, where `We` is the Weber number (item 11-4.5), and `Fr` is the Froude number (item11-4.3). The Bond number is also used for capillary action driven by buoyancy. + */ + } + attribute bondNumber: BondNumberValue :> scalarQuantities; + + alias 'eötvösNumber' for bondNumber; + + /* ISO-80000-11 item 11-6.12 Archimedes number */ + attribute def ArchimedesNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-6.12 Archimedes number + * symbol(s): `Ar` + * application domain: generic + * name: ArchimedesNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of buoyancy forces and viscous forces in fluids motion due to density differences for a body in a fluid, expressed by `Ar = (g*l^3)/v^2*(ρ_b/ρ - 1)`, where `g` is acceleration of free fall (ISO 80000-3), `l` is characteristic length (ISO 80000-3) of the body, `ν` is kinematic viscosity (ISO 80000-4) of the fluid, `ρ_b` is mass density (ISO 80000-4) of the body, and `ρ` is mass density (ISO 80000-4) of the fluid + * remarks: In this definition, the body can be replaced by an immiscible fluid. See also Stokes number (item 11-4.34). + */ + } + attribute archimedesNumber: ArchimedesNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.13 expansion number */ + attribute def ExpansionNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-6.13 expansion number + * symbol(s): `Ex` + * application domain: generic + * name: ExpansionNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of buoyancy force and inertial force in moving fluids due to density differences for gas bubbles rising in a liquid, expressed by `Ex = (g*d)/v^2*(1-ρ_b/ρ)`, where `g` is acceleration of free fall (ISO 80000-3), `d` is diameter (ISO 80000-3) of bubbles, `v` is speed (ISO 80000-3) of bubbles, `ρ_b` is mass density (ISO 80000-4) of bubbles, and `ρ` is mass density (ISO 80000-4) of the liquid + * remarks: None. + */ + } + attribute expansionNumber: ExpansionNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.14 Marangoni number */ + attribute def MarangoniNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-6.14 Marangoni number + * symbol(s): `Mg`, `Mar` + * application domain: generic + * name: MarangoniNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of heat transferred by Marangoni convection and heat transferred by thermal diffusivity in thermo-capillary convection of liquid films on a free surface, expressed by `Mg = l*ΔT/(η*a)*((dγ)/(dT))`, where `l` is characteristic thickness (ISO 80000-3) of the film, `ΔT` is difference of thermodynamic temperature `T` (ISO 80000-5) between surface and outer surface of the film, `η` is dynamic viscosity (ISO 80000-4) of the liquid, `a` is thermal diffusivity (ISO 80000-5) of the liquid, and `γ` is surface tension (ISO 80000-4) of the film + * remarks: The Marangoni convection is free surface flow due to different surface tensions caused by a temperature gradient. This quantity is sometimes called Thompson number. + */ + } + attribute marangoniNumber: MarangoniNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.15 Lockhart-Martinelli parameter */ + attribute def LockhartMartinelliParameterValue :> DimensionOneValue { + doc + /* + * source: item 11-6.15 Lockhart-Martinelli parameter + * symbol(s): `Lp` + * application domain: generic + * name: LockhartMartinelliParameter (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of mass flow rates multiplied by the square root of density in a two-phase flow, expressed by `Lp = dot(m)_l/dot(m)_g*sqrt(ρ_m/ρ_l)`, where `dot(m)_l = q_m` is liquid phase mass flow rate (ISO 80000-4), `dot(m)_g` is gas phase mass flow rate, `ρ_g` is gas density (ISO 80000-4), and `ρ_l` is liquid density + * remarks: The Lockhart-Martinelli parameter is used, for example, in boiling or condensing. + */ + } + attribute lockhartMartinelliParameter: LockhartMartinelliParameterValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.16 Bejan number */ + attribute def BejanNumberForMassTransferValue :> DimensionOneValue { + doc + /* + * source: item 11-6.16 Bejan number + * symbol(s): `Be^"*"`, `Be_2` + * application domain: mass transfer + * name: BejanNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of mechanical work and frictional and diffusion energy loss in viscous flow of fluids in pipes, expressed by `Be^*" = (Δp*l^2)/(η*D)`, where `Δp` is drop of pressure (ISO 80000-4) along a pipe or channel, `l` is length (ISO 80000-3) of channel, `η` is dynamic viscosity (ISO 80000-4) of the fluid, and `D` is diffusion coefficient (ISO 80000-9), mass diffusivity" + * remarks: A similar quantity exists for heat transfer (item 11-5.9). + */ + } + attribute bejanNumberForMassTransfer: BejanNumberForMassTransferValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.17 cavitation number */ + attribute def CavitationNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-6.17 cavitation number + * symbol(s): `Ca`, `Cn` + * application domain: generic + * name: CavitationNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the excess of local static head over vapour pressure head and velocity head for fast flow in liquids, expressed by `Ca = (p-p_v)/(1/2*ρ*v^2)`, where `p` is local static pressure (ISO 80000-4), `p_v` is vapour pressure (ISO 80000-4) of the fluid, `ρ` is mass density (ISO 80000-4) of the fluid, and `v` is characteristic speed (ISO 80000-3) of the flow + * remarks: The cavitation number represents the ratio of the excess of local static head over vapour pressure head to velocity head. + */ + } + attribute cavitationNumber: CavitationNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.18 absorption number */ + attribute def AbsorptionNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-6.18 absorption number + * symbol(s): `Ab` + * application domain: generic + * name: AbsorptionNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between mass flow rate and surface area for gas absorption at wetted walls, expressed by `Ab = k*sqrt((l*d)/(D*q_V))`, where `k` is the mass transfer coefficient through the surface, `k = k^'/ρ`, where `ρ` is mass density (ISO 80000-4), and `k^'` is mass flux density through the surface, `k^' = q_m/A`, where `q_m` is mass flow rate (ISO 80000-4), and `A` is area (ISO 80000-3), `l` is length (ISO 80000-3) of wetted surface, `d` is thickness (ISO 80000-3) of liquid film, `D` is diffusion coefficient (ISO 80000-9), and `q_V` is volume flow rate (ISO 80000-4) per wetted perimeter + * remarks: None. + */ + } + attribute absorptionNumber: AbsorptionNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.19 capillary number */ + attribute def CapillaryNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-6.19 capillary number + * symbol(s): `Ca` + * application domain: generic + * name: CapillaryNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of gravitational forces and capillary forces for fluids in narrow pipes, expressed by `Ca = (d^2*ρ*g)/γ`, where `d` is diameter (ISO 80000-3) of the pipe, `ρ` is mass density (ISO 80000-4) of the fluid, `g` is acceleration of free fall (ISO 80000-3), and `γ` is surface tension (ISO 80000-4) of the fluid + * remarks: None. + */ + } + attribute capillaryNumber: CapillaryNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-6.20 dynamic capillary number */ + attribute def DynamicCapillaryNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-6.20 dynamic capillary number + * symbol(s): `Ca^"*"`, `Cn` + * application domain: generic + * name: DynamicCapillaryNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of viscous force and capillary force acting across an interface between a liquid and a gas, or between two immiscible liquids for a flow of fluid influenced by interfacial tension, expressed by `Ca^*" = (η*v)/γ`, where `η` is dynamic viscosity (ISO 80000-4) of the fluid, `v` is characteristic speed (ISO 80000-3), and `γ` is surface or interfacial tension (ISO 80000-4)" + * remarks: The dynamic capillary number is also given by the quotient of the Weber number and the Reynolds number. + */ + } + attribute dynamicCapillaryNumber: DynamicCapillaryNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-7.1 Prandtl number */ + attribute def PrandtlNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-7.1 Prandtl number + * symbol(s): `Pr` + * application domain: generic + * name: PrandtlNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of kinematic viscosity and thermal diffusivity for a fluid, expressed by `Pr = ν/a`, where `ν` is kinematic viscosity (ISO 80000-4), and `a` is thermal diffusivity (ISO 80000-5) + * remarks: The Prandtl number also represents the quotient of heat produced by viscosity and heat transferred by thermal diffusivity. The mass transfer analogue of the Prandtl number is the Schmidt number (item 11-7.2). The Prandtl number is also given by `Pr = (Pe)/(Re)`; where `Pe` is the Péclet number (item 11-5.2), and `Re` is the Reynolds number (item 11-4.1). + */ + } + attribute prandtlNumber: PrandtlNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-7.2 Schmidt number */ + attribute def SchmidtNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-7.2 Schmidt number + * symbol(s): `Sc` + * application domain: generic + * name: SchmidtNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of kinematic viscosity and diffusion coefficient for a fluid, expressed by `Sc = ν/D`, where `ν` is kinematic viscosity (ISO 80000-4), and `D` is diffusion coefficient (ISO 80000-9) + * remarks: The heat transfer analogue of the Schmidt number is the Prandtl number (item 11-7.1). A deprecated name is Colburn number. + */ + } + attribute schmidtNumber: SchmidtNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-7.3 Lewis number */ + attribute def LewisNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-7.3 Lewis number + * symbol(s): `Le` + * application domain: generic + * name: LewisNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of thermal diffusivity and diffusion coefficient for heat transfer in a fluid, expressed by `Le = a/D`, where `a` is thermal diffusivity (ISO 80000-5), and `D` is diffusion coefficient (ISO 80000-9) + * remarks: The Lewis number is also given by `Le = (Sc)/(Pr)`, where `Sc` is the Schmidt number (item 11-7.2), and `Pr` is the Prandtl number (item 11-7.1). Compare with item 11-5.2. The Lewis number is sometimes defined as reciprocal of this quantity. + */ + } + attribute lewisNumber: LewisNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-7.4 Ohnesorge number */ + attribute def OhnesorgeNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-7.4 Ohnesorge number + * symbol(s): `Oh` + * application domain: generic + * name: OhnesorgeNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between viscous force and the square root of the product of inertia force and capillary force for atomization of liquids, expressed by `Oh = η/sqrt(γ*ρ*l)`, where `η` is dynamic viscosity (ISO 80000-4), `γ` is surface tension (ISO 80000-4), `ρ` is mass density (ISO 80000-4), and `l` is characteristic length (ISO 80000-3) + * remarks: The Ohnesorge number is also given by `Oh = sqrt(We)/(Re)` where `We` is the Weber number (item 11-4.5), and `Re` is the Reynolds number (item 11-4.1). See also Laplace number (item 11-4.37). The characteristic length typically is the drop diameter. + */ + } + attribute ohnesorgeNumber: OhnesorgeNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-7.5 Cauchy number, aeroelasticity parameter */ + attribute def CauchyNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-7.5 Cauchy number, aeroelasticity parameter + * symbol(s): `Cy` + * application domain: generic + * name: CauchyNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between inertia forces and compression forces in compressible fluids, expressed by `Cy = `, where `ρ` is mass density (ISO 80000-4), `v` is speed (ISO 80000-3), and `K` is modulus of compression, bulk modulus (ISO 80000-4) + * remarks: None. + */ + } + attribute cauchyNumber: CauchyNumberValue :> scalarQuantities; + + alias aeroelasticityParameter for cauchyNumber; + + /* ISO-80000-11 item 11-7.6 Hooke number */ + attribute def HookeNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-7.6 Hooke number + * symbol(s): `Ho_2` + * application domain: generic + * name: HookeNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between inertia forces and linear stress forces in elastic fluids, expressed by `Ho_2 = (ρ*v^2)/E`, where `ρ` is mass density (ISO 80000-4), `v` is speed (ISO 80000-3), and `E` is modulus of elasticity (ISO 80000-4) + * remarks: None. + */ + } + attribute hookeNumber: HookeNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-7.7 Weissenberg number */ + attribute def WeissenbergNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-7.7 Weissenberg number + * symbol(s): `Wi` + * application domain: generic + * name: WeissenbergNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: product of time derivative of shear rate and relaxation time in viscoelastic flows, expressed by `Wi = dot(γ)*t_r`, where `dot(γ)` is time derivative of shear strain (ISO 80000-4), and `t_r` is relaxation time (ISO 80000-12) + * remarks: The Weissenberg number represents the relative importance of viscous forces when compared to elastic forces. The time derivative of shear strain is sometimes called the shear rate. + */ + } + attribute weissenbergNumber: WeissenbergNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-7.8 Deborah number */ + attribute def DeborahNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-7.8 Deborah number + * symbol(s): `De` + * application domain: generic + * name: DeborahNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of relaxation time of viscoelastic fluids and observation duration in rheology of viscoelastic fluids, expressed by `De = t_c/t_p`, where `t_c` is stress relaxation time, and `t_p` is observation duration (ISO 80000-3) + * remarks: The stress relaxation time is sometimes called the Maxwell relaxation time. + */ + } + attribute deborahNumber: DeborahNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-7.9 Lorentz number */ + attribute def LorentzNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-7.9 Lorentz number + * symbol(s): `Lo` + * application domain: generic + * name: LorentzNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of electrical conductivity and thermal conductivity, expressed by `Lo = (σ*(ΔU)^2)/(λ*ΔT)`, where `σ` is electrical conductivity (IEC 80000-6), `ΔU` is difference of voltage `U` (ISO 80000-6) between two reference points, `λ` is thermal conductivity (ISO 80000-5), and `ΔT` is difference in thermodynamic temperature `T` (ISO 80000-5) between the reference points + * remarks: None. + */ + } + attribute lorentzNumber: LorentzNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-7.10 compressibility number */ + attribute def CompressibilityNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-7.10 compressibility number + * symbol(s): `Z` + * application domain: generic + * name: CompressibilityNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of isothermal compressibility (ISO 80000-5) of a gas and that of an ideal gas, expressed by `Z = p/(ρ*R_s*T)`, where `p` is pressure (ISO 80000-4), `ρ` is mass density (ISO 80000-4), `R_s` is specific gas constant (ISO 80000-5), and `T` is thermodynamic temperature (ISO 80000-5) + * remarks: None. + */ + } + attribute compressibilityNumber: CompressibilityNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.1 Reynolds magnetic number */ + attribute def ReynoldsMagneticNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.1 Reynolds magnetic number + * symbol(s): `Rm` + * application domain: generic + * name: ReynoldsMagneticNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between inertial force and magneto-dynamic viscous force in an electrically conducting fluid, expressed by `Rm = v*l*μ*σ = (v*l)/ν_m`, where `v` is speed (ISO 80000-3) of the fluid, `l` is characteristic length (ISO 80000-3), `μ` is magnetic permeability (IEC 80000-6), `σ` is electrical conductivity (IEC 80000-6), and `ν_m = 1/(μ*σ)` is magnetic viscosity (magnetic diffusivity) + * remarks: This number is also called magnetic Reynolds number. The Reynolds magnetic number is also given by `Rm = Re*Pr_m`, where `Re` is the Reynolds number (item 11-4.1), and `Pr_m` is the Prandtl magnetic number (item 11-8.10). + */ + } + attribute reynoldsMagneticNumber: ReynoldsMagneticNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.2 Batchelor number */ + attribute def BatchelorNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.2 Batchelor number + * symbol(s): `Bt` + * application domain: generic + * name: BatchelorNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between inertia and magneto-dynamic diffusion in an electrically conducting liquid, expressed by `Bt = (v*l*σ*μ)/(ε_r*μ_r)`, where `v` is speed (ISO 80000-3), `l` is characteristic length (ISO 80000-3), `σ` is electrical conductivity (IEC 80000-6), `μ` is magnetic permeability (IEC 80000-6), `ε_r` is relative permittivity (IEC 80000-6), and `μ_r` is relative permeability (IEC 80000-6) + * remarks: None. + */ + } + attribute batchelorNumber: BatchelorNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.3 Nusselt electric number */ + attribute def NusseltElectricNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.3 Nusselt electric number + * symbol(s): `Ne` + * application domain: generic + * name: NusseltElectricNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between convective current and diffusive current of ions in electrochemistry, expressed by `Ne = (v*l)/D^*"`, where `v` is speed (ISO 80000-3), `l` is characteristic length (ISO 80000-3), and `D^"*" = D^"+" + D^"-"`, where `D^"+"`, `D^"-"` are diffusion coefficients (ISO 80000-9) of positive or negative ions respectively" + * remarks: This number is also called electric Nusselt number. Sometimes this quantity is called the Reynolds electric number. + */ + } + attribute nusseltElectricNumber: NusseltElectricNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.4 Alfvén number, Mach magnetic number, Kárman number */ + attribute def 'AlfvénNumberValue' :> DimensionOneValue { + doc + /* + * source: item 11-8.4 Alfvén number, Mach magnetic number, Kárman number + * symbol(s): `Al` + * application domain: generic + * name: AlfvénNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between speed of a plasma and the Alfvén wave speed, expressed by `Al = v/(B/sqrt(ρ*μ))`, where `v` is speed (ISO 80000-3), `B` is magnetic flux density (IEC 80000-6), `ρ` is mass density (ISO 80000-4), and `μ` is magnetic permeability (IEC 80000-6) + * remarks: Often, the inverse of this number is wrongly used. The name "Alfvén Mach number" is used in investigations on the solar wind. The quantity `v_A = B/sqrt(ρ*μ)` is called Alfvén wave speed, where `B` is magnetic flux density (IEC 80000-6), `ρ` is mass density (ISO 80000-4), and `μ` is magnetic permeability (IEC 80000-6). + */ + } + attribute 'alfvénNumber': 'AlfvénNumberValue' :> scalarQuantities; + + alias machMagneticNumber for 'alfvénNumber'; + + alias 'kármanNumber' for 'alfvénNumber'; + + /* ISO-80000-11 item 11-8.5 Hartmann number */ + attribute def HartmannNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.5 Hartmann number + * symbol(s): `Ha` + * application domain: generic + * name: HartmannNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between magnetically induced stress and hydrodynamic shear stress in an electrically conducting fluid, expressed by `Ha = B*l*sqrt(σ/η)`, where `B` is magnetic flux density (IEC 80000-6), `l` is characteristic length (ISO 80000-3), `σ` is electrical conductivity (IEC 80000-6), and `η` is dynamic viscosity (ISO 80000-4) + * remarks: The Hartmann number represents also the ratio of magnetic force to viscous force. + */ + } + attribute hartmannNumber: HartmannNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.6 Cowling number, Euler magnetic number */ + attribute def CowlingNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.6 Cowling number, Euler magnetic number + * symbol(s): `Co` + * application domain: magnetism + * name: CowlingNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of magnetic and kinematic energy density in a plasma, expressed by `Co = B^2/(μ*ρ*v^2)`, where `B` is magnetic flux density (IEC 80000-6), `μ` is magnetic permeability (IEC 80000-6), `ρ` is mass density (ISO 80000-4), and `v` is speed (ISO 80000-3) + * remarks: The Cowling number also represents the ratio of magnetic to dynamic pressure. This quantity is equal to the square of the inverse of the Alfvén number. This quantity is often called the second Cowling number, `Co_2`. The first Cowling number is then defined as `Co_1 = Co*Rm`, where `Rm` is the Reynolds magnetic number (item 11-8.1). + */ + } + attribute cowlingNumber: CowlingNumberValue :> scalarQuantities; + + alias eulerMagneticNumber for cowlingNumber; + + /* ISO-80000-11 item 11-8.7 Stuart electrical number */ + attribute def StuartElectricalNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.7 Stuart electrical number + * symbol(s): `Se` + * application domain: generic + * name: StuartElectricalNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of electric energy density and kinematic energy density in a plasma, expressed by `Se = (ε*E^2)/(ρ*v^2)`, where `ε` is electric permittivity (IEC 80000-6), E is electric field strength (IEC 80000-6), ρ is mass density (ISO 80000-4), and `v` is speed (ISO 80000-3) + * remarks: The Stuart electrical number is the electrical counterpart of the Cowling number (item 11-8.6). + */ + } + attribute stuartElectricalNumber: StuartElectricalNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.8 magnetic pressure number */ + attribute def MagneticPressureNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.8 magnetic pressure number + * symbol(s): `N_(mp)` + * application domain: generic + * name: MagneticPressureNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of gas pressure and magnetic pressure in a gas or plasma, expressed by `N_(mp) = p*(2*μ)/B^2`, where `p` is pressure (ISO 80000-4), `μ` is magnetic permeability (IEC 80000-6), and `B` is magnetic flux density (IEC 80000-6) + * remarks: The quantity `p_m = B^2/(2*μ)` is called magnetic pressure, where `B` is magnetic flux density (IEC 80000-6), and `μ` is magnetic permeability (IEC 80000-6). + */ + } + attribute magneticPressureNumber: MagneticPressureNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.9 Chandrasekhar number */ + attribute def ChandrasekharNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.9 Chandrasekhar number + * symbol(s): `Q`, `Ch` + * application domain: generic + * name: ChandrasekharNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of Lorentz force and viscous force in magnetic convection in a fluid, expressed by `Q = ((B*l)^2*σ)/(ρ*ν)`, where `B` is magnetic flux density (IEC 80000-6), `l` is characteristic length (ISO 80000-3), a length scale of the system, `σ` is electrical conductivity (IEC 80000-6), `ρ` is mass density (ISO 80000-4), and `ν` is kinematic viscosity (ISO 80000-4) + * remarks: The Chandrasekhar number is also given by `Q = Ha^2` where `Ha` is the Hartmann number (item 11-8.5). + */ + } + attribute chandrasekharNumber: ChandrasekharNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.10 Prandtl magnetic number */ + attribute def PrandtlMagneticNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.10 Prandtl magnetic number + * symbol(s): `Pr_m` + * application domain: generic + * name: PrandtlMagneticNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of kinematic viscosity and magnetic viscosity in an electrically conducting liquid, expressed by `Pr_m = ν*σ*μ`, where `ν` is kinematic viscosity (ISO 80000-4), `σ` is electrical conductivity (IEC 80000-6), and `μ` is magnetic permeability (IEC 80000-6) + * remarks: The quantity `ν_m = 1/(μ*σ)` is called magnetic viscosity or magnetic diffusivity. See item 11-8.11. The Prandtl magnetic number is also given by `Pr_m = (Rm)/(Re)`, where `Rm` is the Reynolds magnetic number (item 11-8.1), and `Re` is the Reynolds number (item 11-4.1). This number is also called magnetic Prandtl number. + */ + } + attribute prandtlMagneticNumber: PrandtlMagneticNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.11 Roberts number */ + attribute def RobertsNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.11 Roberts number + * symbol(s): `Ro` + * application domain: generic + * name: RobertsNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of thermal diffusivity and magnetic viscosity in an electrically conducting liquid, expressed by `Ro = a*σ*μ`, where `a` is thermal diffusivity (ISO 80000-5), `σ` is electrical conductivity (IEC 80000-6), and `μ` is magnetic permeability (IEC 80000-6) + * remarks: The quantity `ν_m = 1/(μ*σ)` is called magnetic viscosity or magnetic diffusivity; where `μ` is magnetic permeability (IEC 80000-6), and `σ` is electrical conductivity (IEC 80000-6). + */ + } + attribute robertsNumber: RobertsNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.12 Stuart number */ + attribute def StuartNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.12 Stuart number + * symbol(s): `Stw` + * application domain: generic + * name: StuartNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of magnetic forces and inertia forces in an electrically conducting liquid, expressed by `Stw = (B^2*l*σ)/(v*ρ)`, where `B` is magnetic flux density (IEC 80000-6), `l` is characteristic length (ISO 80000-3), `σ` is electrical conductivity (IEC 80000-6), `v` is characteristic speed (ISO 80000-3), and `ρ` is mass density (ISO 80000-4) + * remarks: The Stuart number sometimes is called magnetic force parameter. Sometimes the square root is wrongly used. The Stuart number is also given by `Stw = (Ha^2)/(Re)`, where `Ha` is the Hartmann number, and `Re` is the Reynolds number. + */ + } + attribute stuartNumber: StuartNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.13 magnetic number */ + attribute def MagneticNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.13 magnetic number + * symbol(s): `N_(mg)` + * application domain: generic + * name: MagneticNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of magnetic forces and viscous forces in an electrically conducting fluid, expressed by `N_(mg) = B*sqrt((l*σ)/(η*v))`, where `B` is magnetic flux density (IEC 80000-6), `l` is characteristic length (ISO 80000-3), `σ` is electrical conductivity (IEC 80000-6), `η` is dynamic viscosity (ISO 80000-4), and `v` is speed (ISO 80000-3) + * remarks: None. + */ + } + attribute magneticNumber: MagneticNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.14 electric field parameter */ + attribute def ElectricFieldParameterValue :> DimensionOneValue { + doc + /* + * source: item 11-8.14 electric field parameter + * symbol(s): `Ef` + * application domain: generic + * name: ElectricFieldParameter (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of Coulomb force and Lorentz force on moving electrically charged material or particles, expressed by `Ef = E/(v*B)`, where `E` is electric field strength (IEC 80000-6), `v` is speed (ISO 80000-3), and `B` is magnetic flux density (IEC 80000-6) + * remarks: None. + */ + } + attribute electricFieldParameter: ElectricFieldParameterValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.15 Hall number */ + attribute def HallNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.15 Hall number + * symbol(s): `Hc`, `CH` + * application domain: generic + * name: HallNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of gyro frequency and collision frequency in a plasma, expressed by `H_c = (ω_c*λ)/(2*π*v)`, where `ω_c` is cyclotron angular frequency (ISO 80000-10), `λ` is mean free path (ISO 80000-9), and `v` is average speed (ISO 80000-3) + * remarks: Sometimes the inverse of this number is wrongly used. `2*π` times this quantity is called the Hall parameter. + */ + } + attribute hallNumber: HallNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.16 Lundquist number */ + attribute def LundquistNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.16 Lundquist number + * symbol(s): `Lu` + * application domain: generic + * name: LundquistNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of Alfvén speed and magneto-dynamic speed in a plasma, expressed by `Lu = B*l*σ*sqrt(μ/ρ)`, where `B` is magnetic flux density (IEC 80000-6), `l` is characteristic length (ISO 80000-3), `σ` is electrical conductivity (IEC 80000-6), `μ` is magnetic permeability (IEC 80000-6), and `ρ` is mass density (ISO 80000-4) + * remarks: The quantity `v_A = B/sqrt(ρ*μ)` is called Alfvén wave speed. See item 11-8.4. The quantity `v_m = 1/(l*σ*μ)` is called magneto dynamic speed, where `l` is characteristic length (ISO 80000-3), `σ` is electrical conductivity (IEC 80000-6), and `μ` is magnetic permeability (IEC 80000-6). The Lundquist number is also given by `Lu = (Rm)/(Al)`, where `Rm` is the Reynolds magnetic number (item 11-8.1), and `Al` is the Alfvén number (item 11-8.4). See also Hartmann number (item 11-8.5). + */ + } + attribute lundquistNumber: LundquistNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.17 Joule magnetic number */ + attribute def JouleMagneticNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.17 Joule magnetic number + * symbol(s): `Jo_m` + * application domain: generic + * name: JouleMagneticNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of Joule heating energy and magnetic field energy in a plasma, expressed by `Jo_m = (2*ρ*μ*c_p*ΔT)/B^2`, where `ρ` is mass density (ISO 80000-4), `μ` is magnetic permeability (IEC 80000-6), `c_p` is specific heat capacity at constant pressure (ISO 80000-5), `T` is thermodynamic temperature (ISO 80000-5), and `B` is magnetic flux density (IEC 80000-6) + * remarks: This number is also called magnetic Joule number. + */ + } + attribute jouleMagneticNumber: JouleMagneticNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.18 Grashof magnetic number */ + attribute def GrashofMagneticNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.18 Grashof magnetic number + * symbol(s): `Gr_m` + * application domain: generic + * name: GrashofMagneticNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: mathematical expression for the heat transfer by free thermo-magnetic convection of a paramagnetic fluid under gravity, `Gr_m = (4*π*σ_e*μ_e*g*α_V*ΔT*l^3)/ν`, where `σ_e` is electrical conductivity (IEC 80000-6), `μ_e` is magnetic permeability (IEC 80000-6), `g` is acceleration of free fall (ISO 80000-3), `α_V` is cubic expansion coefficient (ISO 80000-5), `ΔT = T_S - T_∞` is difference of thermodynamic temperature `T` (ISO 80000-5), where `T_S` is surface temperature and `T_∞` is bulk temperature, `l` is characteristic length (ISO 80000-3), and `ν` is kinematic viscosity (ISO 80000-4) + * remarks: This number is also called magnetic Grashof number. See also Grashof number (item 11-4.4). + */ + } + attribute grashofMagneticNumber: GrashofMagneticNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.19 Naze number */ + attribute def NazeNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.19 Naze number + * symbol(s): `Na` + * application domain: generic + * name: NazeNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of velocity of Alfvén waves and velocity of sound in a plasma, expressed by `Na = B/(c*sqrt(ρ*μ))`, where `B` is magnetic flux density (IEC 80000-6), `c` is speed of sound (ISO 80000-8), `ρ` is mass density (ISO 80000-4), and `μ` is magnetic permeability (IEC 80000-6) + * remarks: The quantity `v_A = B/sqrt(ρ*μ)` is called Alfvén wave speed. See item 11-8.4. + */ + } + attribute nazeNumber: NazeNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.20 Reynolds electric number */ + attribute def ReynoldsElectricNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-8.20 Reynolds electric number + * symbol(s): `Re_e` + * application domain: generic + * name: ReynoldsElectricNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of speed of a fluid and average drift speed of the charged particles in an electrically conducting fluid, expressed by `Re_e = (v*ε_e)/(ρ_e*l*μ)`, where `v` is characteristic speed (ISO 80000-3) of the fluid, `ε_e` is electric permittivity (IEC 80000-6), `ρ_e` is electric charge density (IEC 80000-6), `l` is characteristic length (ISO 80000-3), and `μ` is mobility (ISO 80000-10) of charge carriers + * remarks: This number is also called electrical Reynolds number. The drift speed of the charged particles in an electric field is given by `v_d = 1/(μ*E)`, where `E` is electric field strength (IEC 80000-6), and `μ` is mobility (ISO 80000-10) of charge carriers. + */ + } + attribute reynoldsElectricNumber: ReynoldsElectricNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-8.21 Ampère number */ + attribute def 'AmpèreNumberValue' :> DimensionOneValue { + doc + /* + * source: item 11-8.21 Ampère number + * symbol(s): `Am` + * application domain: generic + * name: AmpèreNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: relation between electric surface current and magnetic field strength in an electrically conducting liquid, expressed by `Am = I_A/(l*H)`, where `I_A` is electric surface current, `l` is characteristic length (ISO 80000-3), and `H` is magnetic field strength (IEC 80000-6) + * remarks: This number is also called magnetic field number. The electric surface current is given by `I_A = ρ_A*l*µ*E`, where `ρ_A` is surface density of electric charge (IEC 80000-6), `l` is characteristic length (ISO 80000-3), `µ` is mobility (ISO 80000-10) of charge carriers, and `E` is electric field strength (IEC 80000-6). + */ + } + attribute 'ampèreNumber': 'AmpèreNumberValue' :> scalarQuantities; + + /* ISO-80000-11 item 11-9.1 Arrhenius number */ + attribute def ArrheniusNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-9.1 Arrhenius number + * symbol(s): `α` + * application domain: generic + * name: ArrheniusNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of chemical activation energy and thermal energy; in a chemical reaction it is the exponential factor of the reaction rate constant, `k`, expressed by `k ~ exp(α)`, with `α = E_0/(R*T)`, where `E_0` is activation energy (ISO 80000-5), `R` is molar gas constant (ISO 80000-9), and `T` is thermodynamic temperature (ISO 80000-5) + * remarks: None. + */ + } + attribute arrheniusNumber: ArrheniusNumberValue :> scalarQuantities; + + /* ISO-80000-11 item 11-9.2 Landau-Ginzburg number */ + attribute def LandauGinzburgNumberValue :> DimensionOneValue { + doc + /* + * source: item 11-9.2 Landau-Ginzburg number + * symbol(s): `κ` + * application domain: generic + * name: LandauGinzburgNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of penetration depth of a magnetic field into a superconductor and the coherence length of thermodynamic fluctuations within a superconducting phase in a material at zero thermodynamic temperature, expressed by `κ = λ_L/(ξ*sqrt(2))`, where `λ_L` is London penetration depth (ISO 80000-12), and `ξ` is coherence length (ISO 80000-12) + * remarks: None. + */ + } + attribute landauGinzburgNumber: LandauGinzburgNumberValue :> scalarQuantities; + +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml new file mode 100644 index 0000000000000000000000000000000000000000..9be3f4e43e05902f98bfd86823d2f4476df94ba7 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml @@ -0,0 +1,1353 @@ +standard library package ISQChemistryMolecular { + doc + /* + * International System of Quantities and Units + * Generated on 2022-08-07T14:44:27Z from standard ISO-80000-9:2019 "Physical chemistry and molecular physics" + * see also https://www.iso.org/obp/ui/#iso:std:iso:80000:-9:ed-2:v1:en + * + * Note 1: In documentation comments, AsciiMath notation (see http://asciimath.org/) is used for mathematical concepts, + * with Greek letters in Unicode encoding. In running text, AsciiMath is placed between backticks. + * Note 2: For vector and tensor quantities currently the unit and quantity value type for their (scalar) magnitude is + * defined, as well as their typical Cartesian 3d VectorMeasurementReference (i.e. coordinate system) + * or TensorMeasurementReference. + */ + + private import ScalarValues::Real; + private import Quantities::*; + private import MeasurementReferences::*; + private import ISQBase::*; + + /* Quantity definitions referenced from other ISQ packages */ + private import ISQSpaceTime::AngularMeasureValue; + private import ISQThermodynamics::EnergyValue; + + /* ISO-80000-9 item 9-1 number of entities */ + attribute numberOfEntities: CountValue :> scalarQuantities { + doc + /* + * source: item 9-1 number of entities + * symbol(s): `N(X)`, `N_X` + * application domain: generic + * name: NumberOfEntities (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: number of elementary entities of kind `X` in a system + * remarks: The elementary entities must be specified and can be atoms, molecules, ions, electrons, other particle, or a specified group of such particles. It is important to always give a precise specification of the entity involved; this should preferably be done by the empirical chemical formula of the material involved. + */ + } + + /* ISO-80000-9 item 9-2 amount of substance, number of moles */ + /* See package ISQBase for the declarations of AmountOfSubstanceValue and AmountOfSubstanceUnit */ + + alias NumberOfMolesUnit for AmountOfSubstanceUnit; + alias NumberOfMolesValue for AmountOfSubstanceValue; + alias numberOfMoles for amountOfSubstance; + + /* ISO-80000-9 item 9-3 relative atomic mass */ + attribute def RelativeAtomicMassValue :> DimensionOneValue { + doc + /* + * source: item 9-3 relative atomic mass + * symbol(s): `A_r(X)` + * application domain: generic + * name: RelativeAtomicMass (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the average mass (ISO 80000-4) of atom `X` and the unified atomic mass (ISO 80000-10) + * remarks: A similar quantity "relative molecular mass" can be defined for molecules. EXAMPLE `A_r(Cl) ~~ 35.453` `A_r(CO_2) ~~ 44` The relative atomic or relative molecular mass depends on the nuclidic composition. The International Union of Pure and Applied Chemistry (IUPAC) accepts the use of the special names "atomic weight" and "molecular weight" for the quantities "relative atomic mass" and "relative molecular mass", respectively. The use of these traditional names is deprecated. + */ + } + attribute relativeAtomicMass: RelativeAtomicMassValue :> scalarQuantities; + + /* ISO-80000-9 item 9-4 molar mass */ + attribute def MolarMassValue :> ScalarQuantityValue { + doc + /* + * source: item 9-4 molar mass + * symbol(s): `M(X)` + * application domain: generic + * name: MolarMass + * quantity dimension: M^1*N^-1 + * measurement unit(s): g/mol, kg*mol^-1 + * tensor order: 0 + * definition: for a pure substance `X`, quotient of mass `m(X)` (ISO 80000-4) and amount `n` of substance (item 9-2): `M = m/n` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MolarMassUnit[1]; + } + + attribute molarMass: MolarMassValue[*] nonunique :> scalarQuantities; + + attribute def MolarMassUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-5 molar volume */ + attribute def MolarVolumeValue :> ScalarQuantityValue { + doc + /* + * source: item 9-5 molar volume + * symbol(s): `V_m` + * application domain: generic + * name: MolarVolume + * quantity dimension: L^3*N^-1 + * measurement unit(s): m^3*mol^-1 + * tensor order: 0 + * definition: for a pure substance, quotient of its volume `V` (ISO 80000-3) and amount `n` of substance (item 9-2): `V_m = V/n` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MolarVolumeUnit[1]; + } + + attribute molarVolume: MolarVolumeValue[*] nonunique :> scalarQuantities; + + attribute def MolarVolumeUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 3; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-6.1 molar internal energy */ + attribute def MolarInternalEnergyValue :> ScalarQuantityValue { + doc + /* + * source: item 9-6.1 molar internal energy + * symbol(s): `U_m` + * application domain: generic + * name: MolarInternalEnergy + * quantity dimension: L^2*M^1*T^-2*N^-1 + * measurement unit(s): J/mol, kg*m^2*s^-2*mol^-1 + * tensor order: 0 + * definition: quotient of internal energy `U` (ISO 80000-5) and amount `n` of substance (item 9-2): `U_m = U/n` + * remarks: Molar quantities are normally only used with reference to pure substances. + */ + attribute :>> num: Real; + attribute :>> mRef: MolarInternalEnergyUnit[1]; + } + + attribute molarInternalEnergy: MolarInternalEnergyValue[*] nonunique :> scalarQuantities; + + attribute def MolarInternalEnergyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-6.2 molar enthalpy */ + attribute def MolarEnthalpyValue :> ScalarQuantityValue { + doc + /* + * source: item 9-6.2 molar enthalpy + * symbol(s): `H_m` + * application domain: generic + * name: MolarEnthalpy + * quantity dimension: L^2*M^1*T^-2*N^-1 + * measurement unit(s): J/mol, kg*m^2*s^-2*mol^-1 + * tensor order: 0 + * definition: quotient of enthalpy `H` (ISO 80000-5) and amount `n` of substance (item 9-2): `H_m = H/n` + * remarks: Molar quantities are normally only used with reference to pure substances. + */ + attribute :>> num: Real; + attribute :>> mRef: MolarEnthalpyUnit[1]; + } + + attribute molarEnthalpy: MolarEnthalpyValue[*] nonunique :> scalarQuantities; + + attribute def MolarEnthalpyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-6.3 molar Helmholtz energy */ + attribute def MolarHelmholtzEnergyValue :> ScalarQuantityValue { + doc + /* + * source: item 9-6.3 molar Helmholtz energy + * symbol(s): `F_m` + * application domain: generic + * name: MolarHelmholtzEnergy + * quantity dimension: L^2*M^1*T^-2*N^-1 + * measurement unit(s): J/mol, kg*m^2*s^-2*mol^-1 + * tensor order: 0 + * definition: quotient of the Helmholtz energy `F` (ISO 80000-5) and amount `n` of substance (item 9-2): `F_m = F/n` + * remarks: Molar quantities are normally only used with reference to pure substances. + */ + attribute :>> num: Real; + attribute :>> mRef: MolarHelmholtzEnergyUnit[1]; + } + + attribute molarHelmholtzEnergy: MolarHelmholtzEnergyValue[*] nonunique :> scalarQuantities; + + attribute def MolarHelmholtzEnergyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-6.4 molar Gibbs energy */ + attribute def MolarGibbsEnergyValue :> ScalarQuantityValue { + doc + /* + * source: item 9-6.4 molar Gibbs energy + * symbol(s): `G_m` + * application domain: generic + * name: MolarGibbsEnergy + * quantity dimension: L^2*M^1*T^-2*N^-1 + * measurement unit(s): J/mol, kg*m^2*s^-2*mol^-1 + * tensor order: 0 + * definition: quotient of the Gibbs energy `G` (ISO 80000-5) and amount `n` of substance (item 9-2): `G_m = G/n` + * remarks: Molar quantities are normally only used with reference to pure substances. + */ + attribute :>> num: Real; + attribute :>> mRef: MolarGibbsEnergyUnit[1]; + } + + attribute molarGibbsEnergy: MolarGibbsEnergyValue[*] nonunique :> scalarQuantities; + + attribute def MolarGibbsEnergyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-7 molar heat capacity */ + attribute def MolarHeatCapacityValue :> ScalarQuantityValue { + doc + /* + * source: item 9-7 molar heat capacity + * symbol(s): `C_m` + * application domain: generic + * name: MolarHeatCapacity + * quantity dimension: L^2*M^1*T^-2*Θ^-1*N^-1 + * measurement unit(s): J/(mol*K), kg*m^2*s^-2*K^-1*mol^-1 + * tensor order: 0 + * definition: quotient of heat capacity `C` (ISO 80000-5) and amount of substance `n` (item 9-2): `C_m = C/n` + * remarks: Conditions (constant pressure or volume etc.) must be specified. + */ + attribute :>> num: Real; + attribute :>> mRef: MolarHeatCapacityUnit[1]; + } + + attribute molarHeatCapacity: MolarHeatCapacityValue[*] nonunique :> scalarQuantities; + + attribute def MolarHeatCapacityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, thermodynamicTemperaturePF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-8 molar entropy */ + attribute def MolarEntropyValue :> ScalarQuantityValue { + doc + /* + * source: item 9-8 molar entropy + * symbol(s): `S_m` + * application domain: generic + * name: MolarEntropy + * quantity dimension: L^2*M^1*T^-2*Θ^-1*N^-1 + * measurement unit(s): J/(mol*K), kg*m^2*s^-2*K^-1*mol^-1 + * tensor order: 0 + * definition: quotient of entropy `S` (ISO 80000-5) and amount `n` of substance (item 9-2): `S_m = S/n` + * remarks: Conditions (constant pressure or volume etc.) must be specified. + */ + attribute :>> num: Real; + attribute :>> mRef: MolarEntropyUnit[1]; + } + + attribute molarEntropy: MolarEntropyValue[*] nonunique :> scalarQuantities; + + attribute def MolarEntropyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, thermodynamicTemperaturePF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-9.1 particle concentration */ + attribute def ParticleConcentrationValue :> ScalarQuantityValue { + doc + /* + * source: item 9-9.1 particle concentration + * symbol(s): `n`, `(C)` + * application domain: generic + * name: ParticleConcentration + * quantity dimension: L^-3 + * measurement unit(s): m^-3 + * tensor order: 0 + * definition: quotient of number `N` of particles (item 9-1) and volume `V `(ISO 80000-3): `n = N/V` + * remarks: The term "number density" is also used. + */ + attribute :>> num: Real; + attribute :>> mRef: ParticleConcentrationUnit[1]; + } + + attribute particleConcentration: ParticleConcentrationValue[*] nonunique :> scalarQuantities; + + attribute def ParticleConcentrationUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-9 item 9-9.2 molecular concentration */ + attribute molecularConcentration: ParticleConcentrationValue :> scalarQuantities { + doc + /* + * source: item 9-9.2 molecular concentration + * symbol(s): `C(X)`, `C_X` + * application domain: generic + * name: MolecularConcentration (specializes ParticleConcentration) + * quantity dimension: L^-3 + * measurement unit(s): m^-3 + * tensor order: 0 + * definition: for substance `X` in a mixture, quotient of number `N_X` of molecules of substance `X` and volume `V` (ISO 80000-3) of the mixture: `C_X = N_X/V` + * remarks: None. + */ + } + + /* ISO-80000-9 item 9-10 mass concentration */ + attribute def MassConcentrationValue :> ScalarQuantityValue { + doc + /* + * source: item 9-10 mass concentration + * symbol(s): `γ_X`, `(ρ_X)` + * application domain: generic + * name: MassConcentration + * quantity dimension: L^-3*M^1 + * measurement unit(s): g/l, kg*m^-3 + * tensor order: 0 + * definition: for substance `X` in a mixture, quotient of mass `m_X` (ISO 80000-4) of substance `X` and volume `V` (ISO 80000-3) of the mixture: `γ_X = m_X/V` + * remarks: Decided by the 16th CGPM (1979), both "l" and "L" are allowed for the symbols for the litre. + */ + attribute :>> num: Real; + attribute :>> mRef: MassConcentrationUnit[1]; + } + + attribute massConcentration: MassConcentrationValue[*] nonunique :> scalarQuantities; + + attribute def MassConcentrationUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + + /* ISO-80000-9 item 9-11 mass fraction */ + attribute def MassFractionValue :> DimensionOneValue { + doc + /* + * source: item 9-11 mass fraction + * symbol(s): `w_X` + * application domain: generic + * name: MassFraction (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for substance `X` in a mixture, quotient of mass `m_X` (ISO 80000-4) of substance `X` and total mass `m` of the mixture: `w_X = m_X/m` + * remarks: None. + */ + } + attribute massFraction: MassFractionValue :> scalarQuantities; + + /* ISO-80000-9 item 9-12.1 amount-of-substance concentration */ + attribute def AmountOfSubstanceConcentrationValue :> ScalarQuantityValue { + doc + /* + * source: item 9-12.1 amount-of-substance concentration + * symbol(s): `c_X` + * application domain: generic + * name: AmountOfSubstanceConcentration + * quantity dimension: L^-3*N^1 + * measurement unit(s): mol/l, mol*m^-3 + * tensor order: 0 + * definition: for substance `X` in a mixture, quotient of amount `n_X` of substance (item 9-2) of `X` and volume `V` (ISO 80000-3) of the mixture: `c_X = n_X/V` + * remarks: In chemistry, the name "amount-of-substance concentration" is generally abbreviated to the single word "concentration", it being assumed that the adjective "amount-of-substance" is intended. For this reason, however, the word "mass" should never be omitted from the name "mass concentration" in item 9-10. Decided by the 16th CGPM (1979), both "l" and "L" are allowed for the symbols for the litre. + */ + attribute :>> num: Real; + attribute :>> mRef: AmountOfSubstanceConcentrationUnit[1]; + } + + attribute amountOfSubstanceConcentration: AmountOfSubstanceConcentrationValue[*] nonunique :> scalarQuantities; + + attribute def AmountOfSubstanceConcentrationUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-12.2 standard amount-of-substance concentration */ + attribute standardAmountOfSubstanceConcentration: AmountOfSubstanceConcentrationValue :> scalarQuantities { + doc + /* + * source: item 9-12.2 standard amount-of-substance concentration + * symbol(s): `c^!(X)` + * application domain: generic + * name: StandardAmountOfSubstanceConcentration (specializes AmountOfSubstanceConcentration) + * quantity dimension: L^-3*N^1 + * measurement unit(s): mol/l, mol*m^-3 + * tensor order: 0 + * definition: for substance `X`, one mole per litre + * remarks: Decided by the 16th CGPM (1979), both "l" and "L" are allowed for the symbols for the litre. + */ + } + + /* ISO-80000-9 item 9-13 amount-of-substance fraction mole fraction */ + attribute def AmountOfSubstanceFractionMoleFractionValue :> DimensionOneValue { + doc + /* + * source: item 9-13 amount-of-substance fraction mole fraction + * symbol(s): `x_X`, `y_X` + * application domain: generic + * name: AmountOfSubstanceFractionMoleFraction (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for substance `X` in a mixture, quotient of amount of substance `n_X` (item 9-2) of `X` and total amount `n` of substance (item 9-2) in the mixture: `x_X = n_X/n` + * remarks: For condensed phases, `x_X` is used, and for gaseous mixtures `y_X` may be used. The unsystematic name "mole fraction" is still used. However, the use of this name is deprecated. For this quantity, the entity used to define the amount of substance should always be a single molecule for every species in the mixture. + */ + } + attribute amountOfSubstanceFractionMoleFraction: AmountOfSubstanceFractionMoleFractionValue :> scalarQuantities; + + /* ISO-80000-9 item 9-14 volume fraction */ + attribute def VolumeFractionValue :> ScalarQuantityValue { + doc + /* + * source: item 9-14 volume fraction + * symbol(s): `φ_X` + * application domain: generic + * name: VolumeFraction + * quantity dimension: 1 + * measurement unit(s): ml/l, 1 + * tensor order: 0 + * definition: for substance `X`, quotient of product of amount of substance fraction `x_X` (item 9-13) of `X` and molar volume `V_(m,X)` (item 9-5) of the pure substance `X` at the same temperature (ISO 80000-5) and pressure (ISO 80000-4), and sum over all substances `i` of products of amount-of-substance fractions `x_i` (item 9-13) of substance `i` and their molar volumes `V_(m,i)` (item 9-5): `φ_X = (x_X V_(m,X))/(sum_i x_i V_(m,i))` + * remarks: Generally, the volume fraction is temperature dependent. Decided by the 16th CGPM (1979), both "l" and "L" are allowed for the symbols for the litre. + */ + attribute :>> num: Real; + attribute :>> mRef: VolumeFractionUnit[1]; + } + + attribute volumeFraction: VolumeFractionValue[*] nonunique :> scalarQuantities; + + attribute def VolumeFractionUnit :> DimensionOneUnit { + } + + /* ISO-80000-9 item 9-15 molality */ + attribute def MolalityValue :> ScalarQuantityValue { + doc + /* + * source: item 9-15 molality + * symbol(s): `b_B`, `m_B` + * application domain: generic + * name: Molality + * quantity dimension: M^-1*N^1 + * measurement unit(s): mol/kg + * tensor order: 0 + * definition: quotient of amount of substance (item 9-2) of solute `B` and mass `m_A` (ISO 80000-4) of the solvent substance `A`: `b_B = n_B/m_A` + * remarks: The alternative symbol `m_B` should be avoided in situations where it might be mistaken for the mass of substance B. However, the symbol `m_B` is much more commonly used than the symbol `b_B` for molality, despite the possible confusion with mass. + */ + attribute :>> num: Real; + attribute :>> mRef: MolalityUnit[1]; + } + + attribute molality: MolalityValue[*] nonunique :> scalarQuantities; + + attribute def MolalityUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-16 latent heat of phase transition, enthalpy of phase transition */ + attribute latentHeatOfPhaseTransition: EnergyValue :> scalarQuantities { + doc + /* + * source: item 9-16 latent heat of phase transition, enthalpy of phase transition + * symbol(s): `C_"pt"` + * application domain: generic + * name: LatentHeatOfPhaseTransition (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: energy (ISO 80000-5) necessary to be added or subtracted isothermally and isobarically to a system to completely undergo the phase transition + * remarks: Mostly, molar or specific quantity is used and phase transition is expressed explicitly, e.g. molar latent heat of evaporation. The subscript "pt" is the qualifier for the phase transition, which may be changed to e.g. "l-g". The term "enthalpy of phase transition" is mainly used in theory. + */ + } + + alias enthalpyOfPhaseTransition for latentHeatOfPhaseTransition; + + /* ISO-80000-9 item 9-17 chemical potential */ + attribute def ChemicalPotentialValue :> ScalarQuantityValue { + doc + /* + * source: item 9-17 chemical potential + * symbol(s): `μ_X` + * application domain: chemistry + * name: ChemicalPotential + * quantity dimension: L^2*M^1*T^-2*N^-1 + * measurement unit(s): J/mol, kg*m^2*s^-2*mol^-1 + * tensor order: 0 + * definition: partial derivative of the Gibbs energy (ISO 80000-5) with respect to amount `n_X` of substance `X` (item 9-2) at constant temperature `T` (ISO 80000-5) and pressure `p `(ISO 80000-4): `μ_X = ((del G)/(del n_X))_(T,p)` + * remarks: For a pure substance, where `G_m` is the molar Gibbs energy. In a mixture, `μ_B` is the partial molar Gibbs energy. In condensed matter physics, the chemical potential of electrons is energy. + */ + attribute :>> num: Real; + attribute :>> mRef: ChemicalPotentialUnit[1]; + } + + attribute chemicalPotential: ChemicalPotentialValue[*] nonunique :> scalarQuantities; + + attribute def ChemicalPotentialUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-18 absolute activity */ + attribute def AbsoluteActivityValue :> DimensionOneValue { + doc + /* + * source: item 9-18 absolute activity + * symbol(s): `λ_X` + * application domain: generic + * name: AbsoluteActivity (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for substance `X`, exponential of quotient of chemical potential `μ_X` of substance `B` (item 9-17), and product of molar gas constant `R` (item 9-37.1) and thermodynamic temperature `T` (ISO 80000-5): `λ_X = exp(μ_X/(RT))` + * remarks: None. + */ + } + attribute absoluteActivity: AbsoluteActivityValue :> scalarQuantities; + + /* ISO-80000-9 item 9-19 partial pressure */ + attribute def PartialPressureValue :> ScalarQuantityValue { + doc + /* + * source: item 9-19 partial pressure + * symbol(s): `p_X` + * application domain: generic + * name: PartialPressure + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, kg*m^-1*s^-2 + * tensor order: 0 + * definition: for substance `X` in a gaseous mixture, product of amount-of-substance fraction `y_X` of substance X (item 9-13) and total pressure `p` (ISO 80000-4): `p_X = y_X p` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: PartialPressureUnit[1]; + } + + attribute partialPressure: PartialPressureValue[*] nonunique :> scalarQuantities; + + attribute def PartialPressureUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-9 item 9-20 fugacity */ + attribute def FugacityValue :> ScalarQuantityValue { + doc + /* + * source: item 9-20 fugacity + * symbol(s): `tilde(p)_X` + * application domain: generic + * name: Fugacity + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, kg*m^-1*s^-2 + * tensor order: 0 + * definition: for substance `X`, quantity proportional to the absolute activity, `λ_X` (item 9-18), the proportionality factor, which is a function of temperature (ISO 80000-5) only, being determined by the condition that, at constant temperature and composition, `p_X/tilde(p)_X` tends to 1 for an indefinitely dilute gas + * remarks: `tilde(p)_X = λ_X * lim_(p->0) (p_X/λ_X)` where `p` is total pressure (ISO 80000-4). The IUPAC preferred symbol for fugacity is `f`. + */ + attribute :>> num: Real; + attribute :>> mRef: FugacityUnit[1]; + } + + attribute fugacity: FugacityValue[*] nonunique :> scalarQuantities; + + attribute def FugacityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-9 item 9-21 standard chemical potential */ + attribute def StandardChemicalPotentialValue :> ScalarQuantityValue { + doc + /* + * source: item 9-21 standard chemical potential + * symbol(s): `μ_B^!`, `μ^!` + * application domain: generic + * name: StandardChemicalPotential + * quantity dimension: L^2*M^1*T^-2*N^-1 + * measurement unit(s): J/mol, kg*m^2*s^-2*mol^-1 + * tensor order: 0 + * definition: for substance `B`, value of the chemical potential (item 9-17) at specified standard conditions + * remarks: `μ_B^! = RT ln(λ^!)` where `μ_B^!` is a function of temperature `T` at the standard pressure `p = p^!` The standard chemical potential depends on the choice of standard state, which must be specified. In a liquid or solid solution, the standard state is referenced to the ideal dilute behaviour of the solute (substance `B`). + */ + attribute :>> num: Real; + attribute :>> mRef: StandardChemicalPotentialUnit[1]; + } + + attribute standardChemicalPotential: StandardChemicalPotentialValue[*] nonunique :> scalarQuantities; + + attribute def StandardChemicalPotentialUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-22 activity factor */ + attribute def ActivityFactorValue :> DimensionOneValue { + doc + /* + * source: item 9-22 activity factor + * symbol(s): `f_X` + * application domain: generic + * name: ActivityFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for substance `X` in a liquid or a solid mixture, quotient of absolute activity `λ_X` (item 9-18) of substance `X` and the product of absolute activity `λ_X^"*"` of the pure substance `X` at the same temperature (ISO 80000-5) and pressure (ISO 80000-4) and amount-of-substance fraction `x_X` of substance `X` (item 9-13): `f_X = λ_X/(λ_X^"*" x_X)` + * remarks: The systematic name is "activity factor", but the name "activity coefficient" is also commonly used (see item 9-25). Activity factors can also be obtained applying Raoult’s law or Henry’s law. + */ + } + attribute activityFactor: ActivityFactorValue :> scalarQuantities; + + /* ISO-80000-9 item 9-23 standard absolute activity in mixture */ + attribute def StandardAbsoluteActivityInMixtureValue :> DimensionOneValue { + doc + /* + * source: item 9-23 standard absolute activity in mixture + * symbol(s): `λ_X^!` + * application domain: in a mixture + * name: StandardAbsoluteActivityInMixture (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for substance `X` in a liquid or a solid mixture, absolute activity `λ_X^"*"` (item 9-18) of the pure substance `X` at the same temperature (ISO 80000-5) but at standard pressure (ISO 80000-4) `10^5 ["Pa"]`: `λ_X^! = λ_X"*" (p^!)` + * remarks: This quantity is a function of temperature only. + */ + } + attribute standardAbsoluteActivityInMixture: StandardAbsoluteActivityInMixtureValue :> scalarQuantities; + + /* ISO-80000-9 item 9-24 activity of solute, relative activity of solute */ + attribute def ActivityOfSoluteValue :> DimensionOneValue { + doc + /* + * source: item 9-24 activity of solute, relative activity of solute + * symbol(s): `a_X`, `a_(m,X)` + * application domain: generic + * name: ActivityOfSolute (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for a solute `X` in a solution, quantity proportional to the absolute activity, `λ_X` (item 9-18), the proportionality factor, which is a function of temperature (ISO 80000-5) and pressure (ISO 80000-4) only, being determined by the condition that, at constant temperature and pressure, `a_X` divided by the molality (item 9-15) ratio, `b_X/b^!` tends to 1 at infinite dilution; `b_X` is the molality of solute `X` (item 9-15), and `b^!` is standard molality: `a_X = λ_X * lim_(sum b_X -> 0) (b_X//b^!)/λ_X` + * remarks: The quantity `a_(c,X)` , similarly defined in terms of the concentration ratio `c_X/c^!` , is also called the activity or relative activity of solute `X`; `c^!` is a standard amount-of-substance concentration (item 9-12.2): `a_(c,X) = λ_X * lim_(sum c_X -> 0) (c_X//c^!)/λ_X`, where `sum` denotes summation over all the solute substances. This especially applies to a dilute liquid solution. + */ + } + attribute activityOfSolute: ActivityOfSoluteValue :> scalarQuantities; + + alias relativeActivityOfSolute for activityOfSolute; + + /* ISO-80000-9 item 9-25 activity coefficient */ + attribute def ActivityCoefficientValue :> DimensionOneValue { + doc + /* + * source: item 9-25 activity coefficient + * symbol(s): `γ_B` + * application domain: generic + * name: ActivityCoefficient (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for a solute `B` in a solution, quotient of activity `a_B` of solute `B` (item 9-24), and quotient of the molality (item 9-15) `b_B` of substance `B` and standard molality `b^!`: `γ_B = a_B/(b_B//b^!)` + * remarks: The name "activity coefficient of solute B" is also used for the quantity `γ_B` defined as: `γ_B = a_(c,B)/(c_B//c^!)` See item 9-22. + */ + } + attribute activityCoefficient: ActivityCoefficientValue :> scalarQuantities; + + /* ISO-80000-9 item 9-26 standard absolute activity in solution */ + attribute def StandardAbsoluteActivityInSolutionValue :> DimensionOneValue { + doc + /* + * source: item 9-26 standard absolute activity in solution + * symbol(s): `λ_B^!` + * application domain: in a solution + * name: StandardAbsoluteActivityInSolution (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for a solute `B` in a solution: `λ_B^! = lim_(sum b_B -> 0) [λ_B ((p^!)b^!)/b_B]` where ∑ denotes summation over all solutes, `p^!` is a standard pressure (ISO 80000-4), `b^!` is standard molality, and `b_B` is the molality of substance `B` (item 9-15) + * remarks: This quantity is a function of temperature only. It especially applies to a dilute liquid solution. The standard pressure is `10^5 ["Pa"]`. + */ + } + attribute standardAbsoluteActivityInSolution: StandardAbsoluteActivityInSolutionValue :> scalarQuantities; + + /* ISO-80000-9 item 9-27.1 activity of solvent, relative activity of solvent */ + attribute def ActivityOfSolventValue :> DimensionOneValue { + doc + /* + * source: item 9-27.1 activity of solvent, relative activity of solvent + * symbol(s): `a_A` + * application domain: generic + * name: ActivityOfSolvent (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for the solvent `A` in a solution, quotient of the absolute activity of substance `A`, `λ_A` (item 9-18), and that, `λ_A^"*"` , of the pure solvent at the same temperature (ISO 80000-5) and pressure (ISO 80000-4): `a_A = λ_A/λ_A^"*"` + * remarks: None. + */ + } + attribute activityOfSolvent: ActivityOfSolventValue :> scalarQuantities; + + alias relativeActivityOfSolvent for activityOfSolvent; + + /* ISO-80000-9 item 9-27.2 osmotic factor of solvent, osmotic coefficient of solvent A */ + attribute def OsmoticFactorOfSolventValue :> DimensionOneValue { + doc + /* + * source: item 9-27.2 osmotic factor of solvent, osmotic coefficient of solvent A + * symbol(s): `φ` + * application domain: generic + * name: OsmoticFactorOfSolvent (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quantity given by: `φ = -(M_A sum b_B)^-1 ln(a_A)` where `M_A` is the molar mass (item 9-4) of the solvent A, ∑ denotes summation over all the solutes, `b_B` is the molality of solute B (item 9-15), and `a_A` is the activity of solvent A (item 9-27.1) + * remarks: The name "osmotic coefficient" is generally used, although the name "osmotic factor" is more systematic. This concept especially applies to a dilute liquid solution. + */ + } + attribute osmoticFactorOfSolvent: OsmoticFactorOfSolventValue :> scalarQuantities; + + alias osmoticCoefficientOfSolventA for osmoticFactorOfSolvent; + + /* ISO-80000-9 item 9-27.3 standard absolute activity of solvent */ + attribute def StandardAbsoluteActivityOfSolventValue :> DimensionOneValue { + doc + /* + * source: item 9-27.3 standard absolute activity of solvent + * symbol(s): `λ_A^!` + * application domain: in a dilute solution + * name: StandardAbsoluteActivityOfSolvent (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for solvent `A`, standard absolute activity (item 9-23) of the pure substance `A` at the same temperature (ISO 80000-5) and at a standard pressure `p^!` (ISO 80000-4): `λ_A^! = λ_A^"*" p^!` + * remarks: None. + */ + } + attribute standardAbsoluteActivityOfSolvent: StandardAbsoluteActivityOfSolventValue :> scalarQuantities; + + /* ISO-80000-9 item 9-28 osmotic pressure */ + attribute def OsmoticPressureValue :> ScalarQuantityValue { + doc + /* + * source: item 9-28 osmotic pressure + * symbol(s): `Π` + * application domain: generic + * name: OsmoticPressure + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, kg*m^-1*s^-2 + * tensor order: 0 + * definition: excess pressure (ISO 80000-4) required to maintain osmotic equilibrium between a solution and the pure solvent separated by a membrane permeable to the solvent only + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: OsmoticPressureUnit[1]; + } + + attribute osmoticPressure: OsmoticPressureValue[*] nonunique :> scalarQuantities; + + attribute def OsmoticPressureUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-9 item 9-29 stoichiometric number of substance */ + attribute def StoichiometricNumberOfSubstanceValue :> DimensionOneValue { + doc + /* + * source: item 9-29 stoichiometric number of substance + * symbol(s): `ν_B` + * application domain: generic + * name: StoichiometricNumberOfSubstance (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for substance `B`, an integer number or a simple fraction, being negative for a reactant and positive for a product, occurring in the expression for a chemical reaction: `0 = sum ν_B` where the symbol `B` denotes the reactants and products involved in the reaction + * remarks: EXAMPLE `(1/2)"N"_2 + (3/2)"H"_2 = "N""H"_3` ; `ν("N"_2) = -1/2`, `ν("H"_2) = -3/2`, `ν("N""H"_3) = +1`. + */ + } + attribute stoichiometricNumberOfSubstance: StoichiometricNumberOfSubstanceValue :> scalarQuantities; + + /* ISO-80000-9 item 9-30 affinity of a chemical reaction */ + attribute def AffinityOfAChemicalReactionValue :> ScalarQuantityValue { + doc + /* + * source: item 9-30 affinity of a chemical reaction + * symbol(s): `A` + * application domain: generic + * name: AffinityOfAChemicalReaction + * quantity dimension: L^2*M^1*T^-2*N^-1 + * measurement unit(s): J/mol, kg*m^2*s^-2*mol^-1 + * tensor order: 0 + * definition: negative of the sum over all substances `B` of products of stoichiometric number `ν_B` of substance `B` (item 9-29) and chemical potential `μ_B` of substance `B` (item 9-17): `A = -sum ν_B μ_B` + * remarks: The affinity of a reaction is a measure of the "driving force" of the reaction. When it is positive, the reaction goes spontaneously from reactants to products, and when it is negative, the reaction goes in the opposite direction. Another way to write the definition is: `A = ((del G)/(del ξ))_(p,T)` where `G` is Gibbs energy (ISO 80000-5) and `ξ` is the extent of the reaction (item 9-31). Note that `ν_B` is negative for reactants and positive for products. + */ + attribute :>> num: Real; + attribute :>> mRef: AffinityOfAChemicalReactionUnit[1]; + } + + attribute affinityOfAChemicalReaction: AffinityOfAChemicalReactionValue[*] nonunique :> scalarQuantities; + + attribute def AffinityOfAChemicalReactionUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-31 extent of reaction */ + attribute extentOfReaction: AmountOfSubstanceValue :> scalarQuantities { + doc + /* + * source: item 9-31 extent of reaction + * symbol(s): `ξ` + * application domain: generic + * name: ExtentOfReaction (specializes AmountOfSubstance) + * quantity dimension: N^1 + * measurement unit(s): mol + * tensor order: 0 + * definition: difference of initial amount `n_(B "in")` of substance `B` (item 9-2) and equilibrium amount `n_(B "eq")` of substance `B` (item 9-2) divided by stoichiometric number `ν_B` of substance `B` (item 9-29): `ξ = (n_(B "eq") - n_(B "in"))/ν_B` + * remarks: See remark to item 9-30. + */ + } + + /* ISO-80000-9 item 9-32 standard equilibrium constant, thermodynamic equilibrium constant */ + attribute def StandardEquilibriumConstantValue :> DimensionOneValue { + doc + /* + * source: item 9-32 standard equilibrium constant, thermodynamic equilibrium constant + * symbol(s): `K^!` + * application domain: generic + * name: StandardEquilibriumConstant (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for a chemical reaction, product for all substances `B` of standard absolute activity `λ_B^!` of substance `B` (item 9-26) in power of minus stoichiometric number `ν_B` of substance `B` (item 9-29): `K^! = prod_B (tilde(a) λ_B^!)^(-ν_B)` + * remarks: This quantity is a function of temperature only. Others depend on temperature, pressure, and composition. One can define in an analogous way an equilibrium constant in terms of fugacity, `K_f`, molality, `K_m`, etc. + */ + } + attribute standardEquilibriumConstant: StandardEquilibriumConstantValue :> scalarQuantities; + + alias thermodynamicEquilibriumConstant for standardEquilibriumConstant; + + /* ISO-80000-9 item 9-33 equilibrium constant on pressure basis */ + attribute def EquilibriumConstantOnPressureBasisValue :> ScalarQuantityValue { + doc + /* + * source: item 9-33 equilibrium constant on pressure basis + * symbol(s): `K_p` + * application domain: pressure basis + * name: EquilibriumConstantOnPressureBasis + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, kg*m^-1*s^-2 + * tensor order: 0 + * definition: for gases, product for all substances `B` of partial pressure `p_B` of substance `B` (item 9-19) in power of its stoichiometric number `ν_B` (item 9-29): `K_p = prod_B (p_B)^(ν_B)` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: EquilibriumConstantOnPressureBasisUnit[1]; + } + + attribute equilibriumConstantOnPressureBasis: EquilibriumConstantOnPressureBasisValue[*] nonunique :> scalarQuantities; + + attribute def EquilibriumConstantOnPressureBasisUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-9 item 9-34 equilibrium constant on concentration basis */ + attribute def EquilibriumConstantOnConcentrationBasisValue :> ScalarQuantityValue { + doc + /* + * source: item 9-34 equilibrium constant on concentration basis + * symbol(s): `K_c` + * application domain: concentration basis + * name: EquilibriumConstantOnConcentrationBasis + * quantity dimension: L^-3*N^1 + * measurement unit(s): mol/m^3 + * tensor order: 0 + * definition: for solutions, product for all substances `B` of concentration `c_B` of substance `B` (item 9-9.1) in power of its stoichiometric number `ν_B` (item 9-29): `K_c = prod_B (c_B)^(ν_B)` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: EquilibriumConstantOnConcentrationBasisUnit[1]; + } + + attribute equilibriumConstantOnConcentrationBasis: EquilibriumConstantOnConcentrationBasisValue[*] nonunique :> scalarQuantities; + + attribute def EquilibriumConstantOnConcentrationBasisUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-35.1 microcanonical partition function */ + attribute microcanonicalPartitionFunction: CountValue :> scalarQuantities { + doc + /* + * source: item 9-35.1 microcanonical partition function + * symbol(s): `Ω` + * application domain: generic + * name: MicrocanonicalPartitionFunction (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: number of all quantum states `r` consistent with given energy `E` (ISO 80000-4), volume (ISO 80000-3), and external fields: `Ω = sum_r 1` + * remarks: `S = k ln(Ω)` where `S` is entropy (ISO 80000-5) and `k` is the Boltzmann constant (ISO 80000-1). + */ + } + + /* ISO-80000-9 item 9-35.2 canonical partition function */ + attribute def CanonicalPartitionFunctionValue :> DimensionOneValue { + doc + /* + * source: item 9-35.2 canonical partition function + * symbol(s): `Z` + * application domain: generic + * name: CanonicalPartitionFunction (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: sum over quantum states of energy `E_r` (ISO 80000-4), expressed by: `Z = sum_r exp(-E_r/(kT))` where `k` is the Boltzmann constant (ISO 80000-1), and `T` is thermodynamic temperature (ISO 80000-5) + * remarks: `A = -kT ln(Z)` where `A` is Helmholtz energy (ISO 80000-5). + */ + } + attribute canonicalPartitionFunction: CanonicalPartitionFunctionValue :> scalarQuantities; + + /* ISO-80000-9 item 9-35.3 grand-canonical partition function, grand partition function */ + attribute def GrandCanonicalPartitionFunctionValue :> DimensionOneValue { + doc + /* + * source: item 9-35.3 grand-canonical partition function, grand partition function + * symbol(s): `Ξ` + * application domain: generic + * name: GrandCanonicalPartitionFunction (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: sum of canonical partition function `Z(N_A,N_B,…)` for the given number of particles `A,B` multiplied by absolute activities (item 9-18) `λ_A, λ_B, ...` of particles `A, B`: `Ξ = sum_(N_A, N_B, ...) Z(N_A, N_B, …) * λ_A^(N_A) * λ_B^(N_B) * ...` + * remarks: `A - sum μ_B n_B = -kT ln(Ξ)` where `A` is Helmholtz energy (ISO 80000-5), `μ_B` is the chemical potential of substance `B`, and `n_B` is the amount of substance `B`. + */ + } + attribute grandCanonicalPartitionFunction: GrandCanonicalPartitionFunctionValue :> scalarQuantities; + + alias grandPartitionFunction for grandCanonicalPartitionFunction; + + /* ISO-80000-9 item 9-35.4 molecular partition function, partition function of a molecule */ + attribute def MolecularPartitionFunctionValue :> DimensionOneValue { + doc + /* + * source: item 9-35.4 molecular partition function, partition function of a molecule + * symbol(s): `q` + * application domain: generic + * name: MolecularPartitionFunction (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quantity given by: `q = sum_r exp(-ε_r/(kT))` where `ε_r` is the energy (ISO 80000-5) of the `r`-th level of the molecule consistent with given volume (ISO 80000-3) and external fields, `k` is the Boltzmann constant (ISO 80000-1), and `T` is thermodynamic temperature (ISO 80000-5) + * remarks: None. + */ + } + attribute molecularPartitionFunction: MolecularPartitionFunctionValue :> scalarQuantities; + + alias partitionFunctionOfAMolecule for molecularPartitionFunction; + + /* ISO-80000-9 item 9-36.1 statistical weight of subsystem */ + attribute statisticalWeightOfSubsystem: CountValue :> scalarQuantities { + doc + /* + * source: item 9-36.1 statistical weight of subsystem + * symbol(s): `g` + * application domain: generic + * name: StatisticalWeightOfSubsystem (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: number of different microstates in a subsystem + * remarks: None. + */ + } + + /* ISO-80000-9 item 9-36.2 degeneracy, multiplicity */ + attribute def DegeneracyValue :> DimensionOneValue { + doc + /* + * source: item 9-36.2 degeneracy, multiplicity + * symbol(s): `g` + * application domain: generic + * name: Degeneracy (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for quantum level, statistical weight of that level + * remarks: If `g = 1`, the level is called non-degenerate. + */ + } + attribute degeneracy: DegeneracyValue :> scalarQuantities; + + alias multiplicity for degeneracy; + + /* ISO-80000-9 item 9-37.1 molar gas constant */ + attribute def MolarGasConstantValue :> ScalarQuantityValue { + doc + /* + * source: item 9-37.1 molar gas constant + * symbol(s): `R` + * application domain: generic + * name: MolarGasConstant + * quantity dimension: L^2*M^1*T^-2*Θ^-1*N^-1 + * measurement unit(s): J/(mol*K), kg*m^2*s^-2*K^-1*mol^-1 + * tensor order: 0 + * definition: product of the Boltzmann constant (ISO 80000-1) and the Avogadro constant (ISO 80000-1) + * remarks: For an ideal gas, `pV_m = RT` + */ + attribute :>> num: Real; + attribute :>> mRef: MolarGasConstantUnit[1]; + } + + attribute molarGasConstant: MolarGasConstantValue[*] nonunique :> scalarQuantities; + + attribute def MolarGasConstantUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, thermodynamicTemperaturePF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-37.2 specific gas constant */ + /* Refer to declaration for SpecificGasConstant in ISQThermodynamics item 5-26 specific gas constant */ + + /* ISO-80000-9 item 9-38 mean free path */ + attribute meanFreePath: LengthValue :> scalarQuantities { + doc + /* + * source: item 9-38 mean free path + * symbol(s): `l`, `λ` + * application domain: chemistry + * name: MeanFreePath (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: for a particle, the average distance `d` (ISO 80000-3) between two successive collisions with other particles + * remarks: None. + */ + } + + /* ISO-80000-9 item 9-39 diffusion coefficient */ + attribute def DiffusionCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 9-39 diffusion coefficient + * symbol(s): `D` + * application domain: chemistry + * name: DiffusionCoefficient + * quantity dimension: L^2*T^-1 + * measurement unit(s): m^2*s^-1 + * tensor order: 0 + * definition: proportionality coefficient of local molecular concentration `C_B` (item 9-9.2) of substance `B` in the mixture multiplied by the local average velocity (ISO 80000-3) `v_B` of the molecules of `B`, and minus the gradient of the local molecular concentration `C_B` (item 9-9.2) of substance `B` in the mixture, expressed by: `C_B(v_B) = -D grad C_B` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: DiffusionCoefficientUnit[1]; + } + + attribute diffusionCoefficient: DiffusionCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def DiffusionCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-9 item 9-40.1 thermal diffusion ratio */ + attribute def ThermalDiffusionRatioValue :> DimensionOneValue { + doc + /* + * source: item 9-40.1 thermal diffusion ratio + * symbol(s): `k_T` + * application domain: generic + * name: ThermalDiffusionRatio (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: in a steady-state of a binary mixture in which thermal diffusion occurs, proportionality factor between gradient of the amount-of-subsstance fraction `x_B` (item 9-13) of the heavier substance `B`, and negative gradient of the local thermodynamic temperature `T` (ISO 80000-5) divided by that temperature (ISO 80000-5): `grad x_B = -(k_T/T) grad T` + * remarks: None. + */ + } + attribute thermalDiffusionRatio: ThermalDiffusionRatioValue :> scalarQuantities; + + /* ISO-80000-9 item 9-40.2 thermal diffusion factor */ + attribute def ThermalDiffusionFactorValue :> DimensionOneValue { + doc + /* + * source: item 9-40.2 thermal diffusion factor + * symbol(s): `α_T` + * application domain: generic + * name: ThermalDiffusionFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the thermal diffusion ratio `k_T` (item 9-40.1), and the product of the local amount-of-substance fractions `x_A`, `x_B` (item 9-13) of two substances `A` and `B`: `α_T = k_T//(x_A x_B)` + * remarks: None. + */ + } + attribute thermalDiffusionFactor: ThermalDiffusionFactorValue :> scalarQuantities; + + /* ISO-80000-9 item 9-41 thermal diffusion coefficient */ + attribute def ThermalDiffusionCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 9-41 thermal diffusion coefficient + * symbol(s): `D_T` + * application domain: generic + * name: ThermalDiffusionCoefficient + * quantity dimension: L^2*T^-1 + * measurement unit(s): m^2*s^-1 + * tensor order: 0 + * definition: product of the thermal diffusion ratio `k_T` (item 9-40.1) and the diffusion coefficient `D` (item 9-39): `D_T = k_T*D` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: ThermalDiffusionCoefficientUnit[1]; + } + + attribute thermalDiffusionCoefficient: ThermalDiffusionCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def ThermalDiffusionCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-9 item 9-42 ionic strength */ + attribute def IonicStrengthValue :> ScalarQuantityValue { + doc + /* + * source: item 9-42 ionic strength + * symbol(s): `I` + * application domain: generic + * name: IonicStrength + * quantity dimension: M^-1*N^1 + * measurement unit(s): mol*kg^-1 + * tensor order: 0 + * definition: in a sample, one half of the sum of square of the charge number `z_i` (ISO 80000-10) of `i`-th ion multiplied by its molality `b_i` (item 9-15) over any involved ion: `I = 1/2 sum z_i^2 b_i` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: IonicStrengthUnit[1]; + } + + attribute ionicStrength: IonicStrengthValue[*] nonunique :> scalarQuantities; + + attribute def IonicStrengthUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-43 degree of dissociation, dissociation fraction */ + attribute def DegreeOfDissociationValue :> DimensionOneValue { + doc + /* + * source: item 9-43 degree of dissociation, dissociation fraction + * symbol(s): `α` + * application domain: generic + * name: DegreeOfDissociation (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: in a sample, quotient of the number `n_d` of dissociated molecules and the total number `n` of molecules: `α = n_D / n` + * remarks: None. + */ + } + attribute degreeOfDissociation: DegreeOfDissociationValue :> scalarQuantities; + + alias dissociationFraction for degreeOfDissociation; + + /* ISO-80000-9 item 9-44 electrolytic conductivity */ + attribute def ElectrolyticConductivityValue :> ScalarQuantityValue { + doc + /* + * source: item 9-44 electrolytic conductivity + * symbol(s): `κ` + * application domain: generic + * name: ElectrolyticConductivity + * quantity dimension: L^-3*M^-1*T^3*I^2 + * measurement unit(s): S/m, kg^-1*m^-3*s^3*A^2 + * tensor order: 0 + * definition: quotient of the magnitude of electric current density `J` (IEC 80000-6) and the magnitude electric field strength `E` (IEC 80000-6) in an electrolyte: `κ = J/E` + * remarks: For anisotropic media, `κ` is a tensor. In IEC 80000-6 the symbols `σ`, `γ` are used. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectrolyticConductivityUnit[1]; + } + + attribute electrolyticConductivity: ElectrolyticConductivityValue[*] nonunique :> scalarQuantities; + + attribute def ElectrolyticConductivityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* ISO-80000-9 item 9-45 molar conductivity */ + attribute def MolarConductivityValue :> ScalarQuantityValue { + doc + /* + * source: item 9-45 molar conductivity + * symbol(s): `Λ_m` + * application domain: generic + * name: MolarConductivity + * quantity dimension: M^-1*T^3*I^2*N^-1 + * measurement unit(s): S*m^2/mol, kg^-1*s^3*A^2*mol^-1 + * tensor order: 0 + * definition: in an electrolyte, quotient of electrolytic conductivity `κ` (item 9-44) and amount-of-substance concentration `c_B` (item 9-12.1): `Λ_m = κ/c_B` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MolarConductivityUnit[1]; + } + + attribute molarConductivity: MolarConductivityValue[*] nonunique :> scalarQuantities; + + attribute def MolarConductivityUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 2; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF, electricCurrentPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-46 transport number of the ion B, current fraction of the ion B */ + attribute def TransportNumberOfTheIonBValue :> DimensionOneValue { + doc + /* + * source: item 9-46 transport number of the ion B, current fraction of the ion B + * symbol(s): `t_B` + * application domain: generic + * name: TransportNumberOfTheIonB (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for the ion `B`, quotient of electric current `i_B` (IEC 80000-6) carried by the ion `B` and total electric current `i` (IEC 80000-6) in an electrolyte: `t_B = i_B/i` + * remarks: None. + */ + } + attribute transportNumberOfTheIonB: TransportNumberOfTheIonBValue :> scalarQuantities; + + alias currentFractionOfTheIonB for transportNumberOfTheIonB; + + /* ISO-80000-9 item 9-47 angle of optical rotation */ + attribute angleOfOpticalRotation: AngularMeasureValue :> scalarQuantities { + doc + /* + * source: item 9-47 angle of optical rotation + * symbol(s): `α` + * application domain: generic + * name: AngleOfOpticalRotation (specializes AngularMeasure) + * quantity dimension: 1 + * measurement unit(s): rad + * tensor order: 0 + * definition: angle through which plane-polarized light is rotated clockwise, as seen when facing the light source, in passing through an optically active medium + * remarks: None. + */ + } + + /* ISO-80000-9 item 9-48 molar optical rotatory power */ + attribute def MolarOpticalRotatoryPowerValue :> ScalarQuantityValue { + doc + /* + * source: item 9-48 molar optical rotatory power + * symbol(s): `α_n` + * application domain: generic + * name: MolarOpticalRotatoryPower + * quantity dimension: L^2*N^-1 + * measurement unit(s): rad*m^2/mol, m^2*mol^-1 + * tensor order: 0 + * definition: angle `α` of optical rotation (item 9-47), multiplied by the quotient of cross-sectional area `A` (ISO 80000-3) of a linearly polarized light beam and the amount of substance `n` (item 9-2) of the optically active component in the path of the beam: `α_n = (α A)/n` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MolarOpticalRotatoryPowerUnit[1]; + } + + attribute molarOpticalRotatoryPower: MolarOpticalRotatoryPowerValue[*] nonunique :> scalarQuantities; + + attribute def MolarOpticalRotatoryPowerUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, amountOfSubstancePF); } + } + + /* ISO-80000-9 item 9-49 specific optical rotatory power */ + attribute def SpecificOpticalRotatoryPowerValue :> ScalarQuantityValue { + doc + /* + * source: item 9-49 specific optical rotatory power + * symbol(s): `α_m` + * application domain: generic + * name: SpecificOpticalRotatoryPower + * quantity dimension: L^2*M^-1 + * measurement unit(s): rad*m^2/kg^1, kg^-1*m^2 + * tensor order: 0 + * definition: angle `α` of optical rotation (item 9-47), multiplied by the quotient of cross-sectional area `A` (ISO 80000-3) of a linearly polarized light beam and the mass `m` (ISO 80000-4) of the optically active component in the path of the beam: `α_m = (α A)/m` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: SpecificOpticalRotatoryPowerUnit[1]; + } + + attribute specificOpticalRotatoryPower: SpecificOpticalRotatoryPowerValue[*] nonunique :> scalarQuantities; + + attribute def SpecificOpticalRotatoryPowerUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml new file mode 100644 index 0000000000000000000000000000000000000000..81700f2b8ba50beeb9f64161737a293546b4ede5 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml @@ -0,0 +1,1229 @@ +standard library package ISQCondensedMatter { + doc + /* + * International System of Quantities and Units + * Generated on 2022-08-07T14:44:27Z from standard ISO-80000-12:2019 "Condensed matter physics" + * see also https://www.iso.org/obp/ui/#iso:std:iso:80000:-12:ed-2:v1:en + * + * Note 1: In documentation comments, AsciiMath notation (see http://asciimath.org/) is used for mathematical concepts, + * with Greek letters in Unicode encoding. In running text, AsciiMath is placed between backticks. + * Note 2: For vector and tensor quantities currently the unit and quantity value type for their (scalar) magnitude is + * defined, as well as their typical Cartesian 3d VectorMeasurementReference (i.e. coordinate system) + * or TensorMeasurementReference. + */ + + private import ScalarValues::Real; + private import Quantities::*; + private import MeasurementReferences::*; + private import ISQBase::*; + + /* Quantity definitions referenced from other ISQ packages */ + private import ISQElectromagnetism::ElectricPotentialDifferenceValue; + private import ISQElectromagnetism::MagneticFluxDensityValue; + private import ISQElectromagnetism::ResistivityValue; + private import ISQSpaceTime::CartesianSpatial3dCoordinateFrame; + private import ISQSpaceTime::AngularFrequencyValue; + private import ISQSpaceTime::AngularMeasureValue; + private import ISQSpaceTime::RepetencyValue; + private import ISQThermodynamics::EnergyValue; + + /* ISO-80000-12 item 12-1.1 lattice vector */ + attribute def Cartesian3dLatticeVector :> VectorQuantityValue { + doc + /* + * source: item 12-1.1 lattice vector + * symbol(s): `vec(R)` + * application domain: generic + * name: LatticeVector (specializes Displacement) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 1 + * definition: translation vector that maps the crystal lattice on itself + * remarks: The non-SI unit ångström (Å) is widely used by x-ray crystallographers and structural chemists. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: CartesianSpatial3dCoordinateFrame[1]; + } + + attribute latticeVector: Cartesian3dLatticeVector :> vectorQuantities; + + /* ISO-80000-12 item 12-1.2 fundamental lattice vector */ + attribute def Cartesian3dFundamentalLatticeVector :> VectorQuantityValue { + doc + /* + * source: item 12-1.2 fundamental lattice vector + * symbol(s): `vec(a_1),vec(a_2),vec(a_3)`, `vec(a),vec(b),vec(c)` + * application domain: generic + * name: FundamentalLatticeVector (specializes Displacement) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 1 + * definition: fundamental translation vectors for the crystal lattice + * remarks: The lattice vector (item 12-1.1) can be given as `vec(R) = n_1 vec(a_1) + n_2 vec(a_2) + n_3 vec(a_3)` where `n_1`, `n_2` and `n_3` are integers. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: CartesianSpatial3dCoordinateFrame[1]; + } + + attribute fundamentalLatticeVector: Cartesian3dFundamentalLatticeVector :> vectorQuantities; + + /* ISO-80000-12 item 12-2.1 angular reciprocal lattice vector */ + attribute def AngularReciprocalLatticeVectorMagnitudeValue :> ScalarQuantityValue { + doc + /* + * source: item 12-2.1 angular reciprocal lattice vector (magnitude) + * symbol(s): `G` + * application domain: generic + * name: AngularReciprocalLatticeVectorMagnitude + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: vector whose scalar products with all fundamental lattice vectors are integral multiples of `2π` + * remarks: In crystallography, however, the quantity `G/(2π)` is sometimes used. + */ + attribute :>> num: Real; + attribute :>> mRef: AngularReciprocalLatticeVectorMagnitudeUnit[1]; + } + + attribute angularReciprocalLatticeVectorMagnitude: AngularReciprocalLatticeVectorMagnitudeValue[*] nonunique :> scalarQuantities; + + attribute def AngularReciprocalLatticeVectorMagnitudeUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + attribute def Cartesian3dAngularReciprocalLatticeVector :> VectorQuantityValue { + doc + /* + * source: item 12-2.1 angular reciprocal lattice vector + * symbol(s): `vec(G)` + * application domain: generic + * name: AngularReciprocalLatticeVector + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 1 + * definition: vector whose scalar products with all fundamental lattice vectors are integral multiples of `2π` + * remarks: In crystallography, however, the quantity `G/(2π)` is sometimes used. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dAngularReciprocalLatticeCoordinateFrame[1]; + } + + attribute angularReciprocalLatticeVector: Cartesian3dAngularReciprocalLatticeVector :> vectorQuantities; + + attribute def Cartesian3dAngularReciprocalLatticeCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: AngularReciprocalLatticeVectorMagnitudeUnit[3]; + } + + /* ISO-80000-12 item 12-2.2 fundamental reciprocal lattice vector */ + attribute def FundamentalReciprocalLatticeVectorMagnitudeValue :> ScalarQuantityValue { + doc + /* + * source: item 12-2.2 fundamental reciprocal lattice vector (magnitude) + * symbol(s): `b_1,b_2,b_3` + * application domain: generic + * name: FundamentalReciprocalLatticeVectorMagnitude + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: fundamental translation vectors for the reciprocal lattice + * remarks: `vec(a_i) * vec(b_i) = 2π δ_(ij)`. In crystallography, however, the quantities `vec(b_j)/(2π)` are also often used. + */ + attribute :>> num: Real; + attribute :>> mRef: FundamentalReciprocalLatticeVectorMagnitudeUnit[1]; + } + + attribute fundamentalReciprocalLatticeVectorMagnitude: FundamentalReciprocalLatticeVectorMagnitudeValue[*] nonunique :> scalarQuantities; + + attribute def FundamentalReciprocalLatticeVectorMagnitudeUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + attribute def Cartesian3dFundamentalReciprocalLatticeVector :> VectorQuantityValue { + doc + /* + * source: item 12-2.2 fundamental reciprocal lattice vector + * symbol(s): `vec(b_1),vec(b_2),vec(b_3)` + * application domain: generic + * name: FundamentalReciprocalLatticeVector + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 1 + * definition: fundamental translation vectors for the reciprocal lattice + * remarks: `vec(a_i) * vec(b_i) = 2π δ_(ij)`. In crystallography, however, the quantities `vec(b_j)/(2π)` are also often used. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dFundamentalReciprocalLatticeCoordinateFrame[1]; + } + + attribute fundamentalReciprocalLatticeVector: Cartesian3dFundamentalReciprocalLatticeVector :> vectorQuantities; + + attribute def Cartesian3dFundamentalReciprocalLatticeCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: FundamentalReciprocalLatticeVectorMagnitudeUnit[3]; + } + + /* ISO-80000-12 item 12-3 lattice plane spacing */ + attribute latticePlaneSpacing: LengthValue :> scalarQuantities { + doc + /* + * source: item 12-3 lattice plane spacing + * symbol(s): `d` + * application domain: generic + * name: LatticePlaneSpacing (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: distance (ISO 80000-3) between successive lattice planes + * remarks: The non-SI unit ångström (Å) is widely used by x-ray crystallographers and structural chemists. + */ + } + + /* ISO-80000-12 item 12-4 Bragg angle */ + attribute braggAngle: AngularMeasureValue :> scalarQuantities { + doc + /* + * source: item 12-4 Bragg angle + * symbol(s): `ϑ` + * application domain: generic + * name: BraggAngle (specializes AngularMeasure) + * quantity dimension: 1 + * measurement unit(s): °, 1 + * tensor order: 0 + * definition: angle between the scattered ray and the lattice plane + * remarks: Bragg angle `ϑ` is given by `2d sin ϑ = nλ`, where `d` is the lattice plane spacing (item 12-3), `λ` is the wavelength (ISO 80000-7) of the radiation, and `n` is the order of reflexion which is an integer. + */ + } + + /* ISO-80000-12 item 12-5.1 short-range order parameter */ + attribute def ShortRangeOrderParameterValue :> DimensionOneValue { + doc + /* + * source: item 12-5.1 short-range order parameter + * symbol(s): `r`, `σ` + * application domain: generic + * name: ShortRangeOrderParameter (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: fraction of nearest-neighbour atom pairs in an Ising ferromagnet having magnetic moments in one direction, minus the fraction having magnetic moments in the opposite direction + * remarks: Similar definitions apply to other order-disorder phenomena. Other symbols are frequently used. + */ + } + attribute shortRangeOrderParameter: ShortRangeOrderParameterValue :> scalarQuantities; + + /* ISO-80000-12 item 12-5.2 long-range order parameter */ + attribute def LongRangeOrderParameterValue :> DimensionOneValue { + doc + /* + * source: item 12-5.2 long-range order parameter + * symbol(s): `R`, `s` + * application domain: generic + * name: LongRangeOrderParameter (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: fraction of atoms in an Ising ferromagnet having magnetic moments in one direction, minus the fraction having magnetic moments in the opposite direction + * remarks: Similar definitions apply to other order-disorder phenomena. Other symbols are frequently used. + */ + } + attribute longRangeOrderParameter: LongRangeOrderParameterValue :> scalarQuantities; + + /* ISO-80000-12 item 12-5.3 atomic scattering factor */ + attribute def AtomicScatteringFactorValue :> DimensionOneValue { + doc + /* + * source: item 12-5.3 atomic scattering factor + * symbol(s): `f` + * application domain: generic + * name: AtomicScatteringFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of radiation amplitude scattered by the atom and radiation amplitude scattered by a single electron + * remarks: The atomic scattering factor can be expressed by: `f = E_a/(E_e`, where `E_a` is the radiation amplitude scattered by the atom and `E_e` is the radiation amplitude scattered by a single electron. + */ + } + attribute atomicScatteringFactor: AtomicScatteringFactorValue :> scalarQuantities; + + /* ISO-80000-12 item 12-5.4 structure factor */ + attribute def StructureFactorValue :> DimensionOneValue { + doc + /* + * source: item 12-5.4 structure factor + * symbol(s): `F(h,k,l)` + * application domain: generic + * name: StructureFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quantity given by: `F(h,k,l) = sum_(n=1)^N f_n exp[2π i (h x_n + k y_n + l z_n)]`, where `f_n` is the atomic scattering factor (item 12-5.3) for atom `n`, `x_n`, `y_n`, `z_n` are fractional coordinates of its position, `N` is the total number of atoms in the unit cell and `h`, `k`, `l` are the Miller indices + * remarks: For the Miller indices `h`, `k`, `l`, see Annex A. + */ + } + attribute structureFactor: StructureFactorValue :> scalarQuantities; + + /* ISO-80000-12 item 12-6 Burgers vector */ + attribute def Cartesian3dBurgersVector :> VectorQuantityValue { + doc + /* + * source: item 12-6 Burgers vector + * symbol(s): `vec(b)` + * application domain: generic + * name: BurgersVector (specializes Displacement) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 1 + * definition: closing vector in a sequence of vectors encircling a dislocation + * remarks: None. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: CartesianSpatial3dCoordinateFrame[1]; + } + + attribute burgersVector: Cartesian3dBurgersVector :> vectorQuantities; + + /* ISO-80000-12 item 12-7.1 particle position vector */ + attribute def Cartesian3dParticlePositionVector :> VectorQuantityValue { + doc + /* + * source: item 12-7.1 particle position vector + * symbol(s): `vec(r)`, `vec(R)` + * application domain: generic + * name: ParticlePositionVector (specializes PositionVector) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 1 + * definition: position vector (ISO 80000-3) of a particle + * remarks: Often, `r` is used for electrons and `R` is used for atoms and other heavier particles. + */ + attribute :>> isBound = true; + attribute :>> num: Real[3]; + attribute :>> mRef: CartesianSpatial3dCoordinateFrame[1]; + } + + attribute particlePositionVector: Cartesian3dParticlePositionVector :> vectorQuantities; + + /* ISO-80000-12 item 12-7.2 equilibrium position vector */ + attribute def Cartesian3dEquilibriumPositionVector :> VectorQuantityValue { + doc + /* + * source: item 12-7.2 equilibrium position vector + * symbol(s): `vec(R_0)` + * application domain: condensed matter physics + * name: EquilibriumPositionVector (specializes PositionVector) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 1 + * definition: position vector (ISO 80000-3) of an ion or atom in equilibrium + * remarks: None. + */ + attribute :>> isBound = true; + attribute :>> num: Real[3]; + attribute :>> mRef: CartesianSpatial3dCoordinateFrame[1]; + } + + attribute equilibriumPositionVector: Cartesian3dEquilibriumPositionVector :> vectorQuantities; + + /* ISO-80000-12 item 12-7.3 displacement vector */ + attribute def Cartesian3dDisplacementVector :> VectorQuantityValue { + doc + /* + * source: item 12-7.3 displacement vector + * symbol(s): `vec(u)` + * application domain: condensed matter physics + * name: DisplacementVector (specializes Displacement) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 1 + * definition: difference between the position vector (ISO 80000-3) of an ion or atom and its position vector in equilibrium + * remarks: The displacement vector can be expressed by: `vec(u) = vec(R) − vec(R_0)`, where `vec(R)` is particle position vector (item 12-7.1) and `vec(R_0)` is position vector of an ion or atom in equilibrium (item 12-7.2). + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: CartesianSpatial3dCoordinateFrame[1]; + } + + attribute displacementVector: Cartesian3dDisplacementVector :> vectorQuantities; + + /* ISO-80000-12 item 12-8 Debye-Waller factor */ + attribute def DebyeWallerFactorValue :> DimensionOneValue { + doc + /* + * source: item 12-8 Debye-Waller factor + * symbol(s): `D`, `B` + * application domain: generic + * name: DebyeWallerFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: factor by which the intensity of a diffraction line is reduced because of the lattice vibrations + * remarks: `D` is sometimes expressed as `D = exp(−2W)`; in Mössbauer spectroscopy, it is also called the `f` factor and denoted by `f`. + */ + } + attribute debyeWallerFactor: DebyeWallerFactorValue :> scalarQuantities; + + /* ISO-80000-12 item 12-9.1 angular wavenumber, angular repetency */ + attribute angularWavenumber: RepetencyValue :> scalarQuantities { + doc + /* + * source: item 12-9.1 angular wavenumber, angular repetency + * symbol(s): `k`, `q` + * application domain: condensed matter physics + * name: AngularWavenumber (specializes Repetency) + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: quotient of momentum (ISO 80000-4) and the reduced Planck constant (ISO 80000-1) + * remarks: The corresponding vector (ISO 80000-2) quantity is called wave vector (ISO 80000-3), expressed by: `vec(k) = vec(p)/ħ`, where `vec(p)` is the momentum (ISO 80000-4) of quasi free electrons in an electron gas, and `ħ` is the reduced Planck constant (ISO 80000-1); for phonons, its magnitude is `k = 2π/λ`, where `λ` is the wavelength (ISO 80000-3) of the lattice vibrations. When a distinction is needed between `k` and the symbol for the Boltzmann constant (ISO 80000-1), `k_B` can be used for the latter. When a distinction is needed, `q` should be used for phonons, and `k` for particles such as electrons and neutrons. The method of cut-off must be specified. In condensed matter physics, angular wavenumber is often called wavenumber. + */ + } + + alias angularRepetency for angularWavenumber; + + /* ISO-80000-12 item 12-9.2 Fermi angular wavenumber, Fermi angular repetency */ + attribute fermiAngularWavenumber: RepetencyValue :> scalarQuantities { + doc + /* + * source: item 12-9.2 Fermi angular wavenumber, Fermi angular repetency + * symbol(s): `k_F` + * application domain: generic + * name: FermiAngularWavenumber (specializes Repetency) + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: angular wavenumber (item 12-9.1) of electrons in states on the Fermi sphere + * remarks: In condensed matter physics, angular wavenumber is often called wavenumber. + */ + } + + alias fermiAngularRepetency for fermiAngularWavenumber; + + /* ISO-80000-12 item 12-9.3 Debye angular wavenumber, Debye angular repetency */ + attribute debyeAngularWavenumber: RepetencyValue :> scalarQuantities { + doc + /* + * source: item 12-9.3 Debye angular wavenumber, Debye angular repetency + * symbol(s): `q_D` + * application domain: generic + * name: DebyeAngularWavenumber (specializes Repetency) + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: cut-off angular wavenumber (item 12-9.1) in the Debye model of the vibrational spectrum of a solid + * remarks: The method of cut-off must be specified. In condensed matter physics, angular wavenumber is often called wavenumber. + */ + } + + alias debyeAngularRepetency for debyeAngularWavenumber; + + /* ISO-80000-12 item 12-10 Debye angular frequency */ + attribute debyeAngularFrequency: AngularFrequencyValue :> scalarQuantities { + doc + /* + * source: item 12-10 Debye angular frequency + * symbol(s): `ω_D` + * application domain: generic + * name: DebyeAngularFrequency (specializes AngularFrequency) + * quantity dimension: T^-1 + * measurement unit(s): s^-1 + * tensor order: 0 + * definition: cut-off angular frequency (ISO 80000-3) in the Debye model of the vibrational spectrum of a solid + * remarks: The method of cut-off must be specified. + */ + } + + /* ISO-80000-12 item 12-11 Debye temperature */ + attribute debyeTemperature: ThermodynamicTemperatureValue :> scalarQuantities { + doc + /* + * source: item 12-11 Debye temperature + * symbol(s): `Θ_D` + * application domain: generic + * name: DebyeTemperature (specializes ThermodynamicTemperature) + * quantity dimension: Θ^1 + * measurement unit(s): K + * tensor order: 0 + * definition: in the Debye model, quantity given by: `Θ_D = ħ*ω_D/k`, where `k` is the Boltzmann constant, (ISO 80000-1), `ħ` is the reduced Planck constant (ISO 80000-1), and `ω_D` is Debye angular frequency (item 12-10) + * remarks: A Debye temperature can also be defined by fitting a Debye model result to a certain quantity, for instance, the heat capacity at a certain temperature. + */ + } + + /* ISO-80000-12 item 12-12 density of vibrational states */ + attribute def DensityOfVibrationalStatesValue :> ScalarQuantityValue { + doc + /* + * source: item 12-12 density of vibrational states + * symbol(s): `g` + * application domain: angular frequency + * name: DensityOfVibrationalStates + * quantity dimension: L^-3*T^1 + * measurement unit(s): m^-3*s + * tensor order: 0 + * definition: quotient of the number of vibrational modes in an infinitesimal interval of angular frequency (ISO 80000-3), and the product of the width of that interval and volume (ISO 80000-3) + * remarks: `g(ω) = n_ω = (dn(ω))/(dω)`, where `n(ω)` is the total number of vibrational modes per volume with angular frequency less than `ω`. The density of states may also be normalized in other ways instead of with respect to volume. See also item 12-16. + */ + attribute :>> num: Real; + attribute :>> mRef: DensityOfVibrationalStatesUnit[1]; + } + + attribute densityOfVibrationalStates: DensityOfVibrationalStatesValue[*] nonunique :> scalarQuantities; + + attribute def DensityOfVibrationalStatesUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-12 item 12-13 thermodynamic Grüneisen parameter */ + attribute def 'ThermodynamicGrüneisenParameterValue' :> DimensionOneValue { + doc + /* + * source: item 12-13 thermodynamic Grüneisen parameter + * symbol(s): `γ_G`, `Γ_G` + * application domain: generic + * name: ThermodynamicGrüneisenParameter (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quantity given by: `γ_G = (α_V)/(κ_T c_V ρ)`, where `α_V` is cubic expansion coefficient (ISO 80000-5), `κ_T` is isothermal compressibility (ISO 80000-5), `c_V` is specific heat capacity at constant volume (ISO 80000-5), and `ρ` is mass density (ISO 80000-4) + * remarks: None. + */ + } + attribute 'thermodynamicGrüneisenParameter': 'ThermodynamicGrüneisenParameterValue' :> scalarQuantities; + + /* ISO-80000-12 item 12-14 Grüneisen parameter */ + attribute def 'GrüneisenParameterValue' :> DimensionOneValue { + doc + /* + * source: item 12-14 Grüneisen parameter + * symbol(s): `γ` + * application domain: generic + * name: GrüneisenParameter (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quantity given by minus the partial differential quotient: `γ = -(del ln ω)/(del ln V)`, where `ω` is a lattice vibration frequency (ISO 80000-3), and `V` is volume (ISO 80000-3) + * remarks: `ω` can also refer to an average of the vibrational spectrum, for instance as represented by a Debye angular frequency (item 12-10). + */ + } + attribute 'grüneisenParameter': 'GrüneisenParameterValue' :> scalarQuantities; + + /* ISO-80000-12 item 12-15.1 mean free path of phonons */ + attribute meanFreePathOfPhonons: LengthValue :> scalarQuantities { + doc + /* + * source: item 12-15.1 mean free path of phonons + * symbol(s): `l_p` + * application domain: generic + * name: MeanFreePathOfPhonons (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: average distance (ISO 80000-3) that phonons travel between two successive interactions + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-15.2 mean free path of electrons */ + attribute meanFreePathOfElectrons: LengthValue :> scalarQuantities { + doc + /* + * source: item 12-15.2 mean free path of electrons + * symbol(s): `l_e` + * application domain: generic + * name: MeanFreePathOfElectrons (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: average distance (ISO 80000-3) that electrons travel between two successive interactions + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-16 energy density of states */ + attribute def EnergyDensityOfStatesValue :> ScalarQuantityValue { + doc + /* + * source: item 12-16 energy density of states + * symbol(s): `n_E(E)`, `ρ(E)` + * application domain: generic + * name: EnergyDensityOfStates + * quantity dimension: L^-5*M^-1*T^2 + * measurement unit(s): J^-1*m^-3*eV^-1*m^-3, kg^-1*m^-5*s^2 + * tensor order: 0 + * definition: quantity given by the differential quotient with respect to energy: `n_E(E) = (dn(E))/(dE)`, where `n_E(E)` is the total number of one-electron states per volume (ISO 80000-3) with energy less than `E` (ISO 80000-5) + * remarks: Density of states refers to electrons or other entities, e.g. phonons. It may be normalized in other ways instead of with respect to volume, e.g. with respect to amount of substance. See also item 12-12. + */ + attribute :>> num: Real; + attribute :>> mRef: EnergyDensityOfStatesUnit[1]; + } + + attribute energyDensityOfStates: EnergyDensityOfStatesValue[*] nonunique :> scalarQuantities; + + attribute def EnergyDensityOfStatesUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -5; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-12 item 12-17 residual resistivity */ + attribute residualResistivity: ResistivityValue :> scalarQuantities { + doc + /* + * source: item 12-17 residual resistivity + * symbol(s): `ρ_0` + * application domain: generic + * name: ResidualResistivity (specializes Resistivity) + * quantity dimension: L^3*M^1*T^-3*I^-2 + * measurement unit(s): Ω*m, kg*m^3*s^-3*A^-2 + * tensor order: 0 + * definition: for metals, the resistivity (IEC 80000-6) extrapolated to zero thermodynamic temperature (ISO 80000-5) + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-18 Lorenz coefficient */ + attribute def LorenzCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 12-18 Lorenz coefficient + * symbol(s): `L` + * application domain: generic + * name: LorenzCoefficient + * quantity dimension: L^4*M^2*T^-6*I^-2*Θ^-2 + * measurement unit(s): V^2/K^2, kg^2*m^4*s^-6*A^-2*K^-2 + * tensor order: 0 + * definition: quotient of thermal conductivity (ISO 80000-5), and the product of electric conductivity (IEC 80000-6) and thermodynamic temperature (ISO 80000-3) + * remarks: The Lorenz coefficient can be expressed by `L = λ/(σT)`, where `λ` is thermal conductivity (ISO 80000-5), `σ` is electric conductivity (IEC 80000-6), and `T` is thermodynamic temperature (ISO 80000-5). + */ + attribute :>> num: Real; + attribute :>> mRef: LorenzCoefficientUnit[1]; + } + + attribute lorenzCoefficient: LorenzCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def LorenzCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 4; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -6; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-12 item 12-19 Hall coefficient */ + attribute def HallCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 12-19 Hall coefficient + * symbol(s): `R_H`, `A_H` + * application domain: generic + * name: HallCoefficient + * quantity dimension: 1 + * measurement unit(s): m^3/C*m^3*s^-1*A^-1 + * tensor order: 0 + * definition: in an isotropic conductor, relation between electric field strength, `vec(E)`, (IEC 80000-6) and electric current density, `vec(J)`, (IEC 80000-6) expressed as: `vec(E) = ρ vec(J) + R_H (vec(B) xx vec(J))`, where `ρ` is resistivity (IEC 80000-6), and `vec(B)` is magnetic flux density (IEC 80000-6) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: HallCoefficientUnit[1]; + } + + attribute hallCoefficient: HallCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def HallCoefficientUnit :> DimensionOneUnit { + } + + /* ISO-80000-12 item 12-20 thermoelectric voltage (between substances a and b) */ + attribute thermoelectricVoltageBetweenSubstancesAAndB: ElectricPotentialDifferenceValue :> scalarQuantities { + doc + /* + * source: item 12-20 thermoelectric voltage (between substances a and b) + * symbol(s): `E_(ab)` + * application domain: generic + * name: ThermoelectricVoltageBetweenSubstancesAAndB (specializes ElectricPotentialDifference) + * quantity dimension: L^2*M^1*T^-3*I^-1 + * measurement unit(s): V, kg*m^2*s^-3*A^-1 + * tensor order: 0 + * definition: voltage (IEC 80000-6) between substances `a` and `b` caused by the thermoelectric effect + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-21 Seebeck coefficient (for substances a and b) */ + attribute def SeebeckCoefficientForSubstancesAAndBValue :> ScalarQuantityValue { + doc + /* + * source: item 12-21 Seebeck coefficient (for substances a and b) + * symbol(s): `S_(ab)` + * application domain: generic + * name: SeebeckCoefficientForSubstancesAAndB + * quantity dimension: L^2*M^1*T^-3*I^-1*Θ^-1 + * measurement unit(s): V/K, kg*m^2*s^-3*A^-1*K^-1 + * tensor order: 0 + * definition: differential quotient of thermoelectric voltage with respect to thermodynamic temperature: `S_(ab) = (dE_(ab))/(dT)`, where `E_(ab)` is the thermoelectric voltage between substances `a` and `b` (item 12-20) and `T` is thermodynamic temperature (ISO 80000-5) + * remarks: This term is also called "thermoelectric power". + */ + attribute :>> num: Real; + attribute :>> mRef: SeebeckCoefficientForSubstancesAAndBUnit[1]; + } + + attribute seebeckCoefficientForSubstancesAAndB: SeebeckCoefficientForSubstancesAAndBValue[*] nonunique :> scalarQuantities; + + attribute def SeebeckCoefficientForSubstancesAAndBUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -1; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-12 item 12-22 Peltier coefficient (for substances a and b) */ + attribute peltierCoefficientForSubstancesAAndB: ElectricPotentialDifferenceValue :> scalarQuantities { + doc + /* + * source: item 12-22 Peltier coefficient (for substances a and b) + * symbol(s): `Π_(ab)` + * application domain: generic + * name: PeltierCoefficientForSubstancesAAndB (specializes ElectricPotentialDifference) + * quantity dimension: L^2*M^1*T^-3*I^-1 + * measurement unit(s): V, kg*m^2*s^-3*A^-1 + * tensor order: 0 + * definition: quotient of Peltier heat power (ISO 80000-5) developed at a junction, and the electric current (IEC 80000-6) flowing from substance `a` to substance `b` + * remarks: `Π_(ab) = Π_a - Π_b`, where `Π_a` and `Π_b` are the Peltier coefficients of substances `a` and `b`, respectively. + */ + } + + /* ISO-80000-12 item 12-23 Thomson coefficient */ + attribute def ThomsonCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 12-23 Thomson coefficient + * symbol(s): `μ` + * application domain: generic + * name: ThomsonCoefficient + * quantity dimension: L^2*M^1*T^-3*I^-1*Θ^-1 + * measurement unit(s): V/K, kg*m^2*s^-3*A^-1*K^-1 + * tensor order: 0 + * definition: quotient of Thomson heat power (ISO 80000-5) developed, and the electric current (IEC 80000-6) and temperature (ISO 80000-5) difference + * remarks: `μ` is positive if heat is developed when the temperature decreases in the direction of the electric current. + */ + attribute :>> num: Real; + attribute :>> mRef: ThomsonCoefficientUnit[1]; + } + + attribute thomsonCoefficient: ThomsonCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def ThomsonCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -1; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-12 item 12-24.1 work function */ + attribute workFunction: EnergyValue :> scalarQuantities { + doc + /* + * source: item 12-24.1 work function + * symbol(s): `ϕ` + * application domain: generic + * name: WorkFunction (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, eV, kg*m^2*s^-2 + * tensor order: 0 + * definition: difference between energy (ISO 80000-5) of an electron at rest at infinity and the Fermi energy (item 12-27.1) + * remarks: The term "energy level" is often used for the state of the electron, not only for its energy. The contact potential difference between substances `a` and `b` is given by `V_a - V_b = (ϕ_a - ϕ_b)/e`, where `e` is the elementary charge (ISO 80000-1). A set of energy levels, the energies of which occupy an interval practically continuously, is called an energy band. In semi-conductors `E_d` and `E_a` are used for donors and acceptors, respectively. + */ + } + + /* ISO-80000-12 item 12-24.2 ionization energy */ + attribute ionizationEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 12-24.2 ionization energy + * symbol(s): `E_i` + * application domain: generic + * name: IonizationEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, eV, kg*m^2*s^-2 + * tensor order: 0 + * definition: difference between energy (ISO 80000-5) of an electron at rest at infinity and a certain energy level which is the energy of an electron in the interior of a substance + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-25 electron affinity */ + attribute electronAffinity: EnergyValue :> scalarQuantities { + doc + /* + * source: item 12-25 electron affinity + * symbol(s): `χ` + * application domain: condensed matter physics + * name: ElectronAffinity (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, eV, kg*m^2*s^-2 + * tensor order: 0 + * definition: energy (ISO 80000-5) difference between an electron at rest at infinity and an electron at the lowest level of the conduction band in an insulator or semiconductor + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-26 Richardson constant */ + attribute def RichardsonConstantValue :> ScalarQuantityValue { + doc + /* + * source: item 12-26 Richardson constant + * symbol(s): `A` + * application domain: generic + * name: RichardsonConstant + * quantity dimension: L^-2*I^1*Θ^-2 + * measurement unit(s): A*m^-2*K^-2 + * tensor order: 0 + * definition: parameter in the expression for the thermionic emission current density `J` (IEC 80000-6) for a metal in terms of the thermodynamic temperature `T` (ISO 80000-5) and work function `ϕ`, (item 12-24.1): `J = AT^2 exp(ϕ/(kT))`, where `k` is the Boltzmann constant (ISO 80000-1) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: RichardsonConstantUnit[1]; + } + + attribute richardsonConstant: RichardsonConstantValue[*] nonunique :> scalarQuantities; + + attribute def RichardsonConstantUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, electricCurrentPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-12 item 12-27.1 Fermi energy */ + attribute fermiEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 12-27.1 Fermi energy + * symbol(s): `E_F` + * application domain: generic + * name: FermiEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, eV, kg*m^2*s^-2 + * tensor order: 0 + * definition: in a metal, highest occupied energy level at zero thermodynamic temperature (ISO 80000-5), where energy level means the energy (ISO 80000-5) of an electron in the interior of a substance + * remarks: The term "energy level" is often used for the state of the electron, not only for its energy. At `T = 0 [K]`, `E_F` is equal to the chemical potential per electron. In condensed matter physics, the reference level for the energy is sometimes chosen so that, for instance, `E_F = 0`. + */ + } + + /* ISO-80000-12 item 12-27.2 gap energy */ + attribute gapEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 12-27.2 gap energy + * symbol(s): `E_g` + * application domain: generic + * name: GapEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, eV, kg*m^2*s^-2 + * tensor order: 0 + * definition: difference in energy (ISO 80000-5) between the lowest level of conduction band and the highest level of valence band at zero thermodynamic temperature (ISO 80000-5) + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-28 Fermi temperature */ + attribute fermiTemperature: ThermodynamicTemperatureValue :> scalarQuantities { + doc + /* + * source: item 12-28 Fermi temperature + * symbol(s): `T_F` + * application domain: generic + * name: FermiTemperature (specializes ThermodynamicTemperature) + * quantity dimension: Θ^1 + * measurement unit(s): K + * tensor order: 0 + * definition: in the free electron model, the Fermi energy (item 12-27.1) divided by the Boltzmann constant (ISO 80000-1) + * remarks: The Fermi temperature is expressed by: `T_F = E_F/k`, where `E_F` is Fermi energy (item 12-27.1) and `k` is the Boltzmann constant (ISO 80000-1). `E_F` is relative to the lowest occupied state. + */ + } + + /* ISO-80000-12 item 12-29.1 electron density */ + attribute def ElectronDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 12-29.1 electron density + * symbol(s): `n` + * application domain: generic + * name: ElectronDensity + * quantity dimension: L^-3 + * measurement unit(s): m^-3 + * tensor order: 0 + * definition: quotient of number of electrons in conduction band and volume (ISO 80000-3) + * remarks: Subscripts `n` and `p` or `-` and `+` are often used to denote electrons and holes, respectively. `n_n` and `n_p` are also used for electron densities, and `p_n` and `p_p` for hole densities, in `n`-type and `p`-type regions, respectively, of a `n`-`p` junction. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectronDensityUnit[1]; + } + + attribute electronDensity: ElectronDensityValue[*] nonunique :> scalarQuantities; + + attribute def ElectronDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-12 item 12-29.2 hole density */ + attribute def HoleDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 12-29.2 hole density + * symbol(s): `p` + * application domain: generic + * name: HoleDensity + * quantity dimension: L^-3 + * measurement unit(s): m^-3 + * tensor order: 0 + * definition: quotient of number of holes in valence band and volume (ISO 80000-3) + * remarks: Subscripts `n` and `p` or `-` and `+` are often used to denote electrons and holes, respectively. `n_n` and `n_p` are also used for electron densities, and `p_n` and `p_p` for hole densities, in `n`-type and `p`-type regions, respectively, of a `n`-`p` junction. + */ + attribute :>> num: Real; + attribute :>> mRef: HoleDensityUnit[1]; + } + + attribute holeDensity: HoleDensityValue[*] nonunique :> scalarQuantities; + + attribute def HoleDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-12 item 12-29.3 intrinsic carrier density */ + attribute def IntrinsicCarrierDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 12-29.3 intrinsic carrier density + * symbol(s): `n_i` + * application domain: generic + * name: IntrinsicCarrierDensity + * quantity dimension: L^-3 + * measurement unit(s): m^-3 + * tensor order: 0 + * definition: quantity given by: `n_i = sqrt(n p)`, where `n` is electron density (item 12-29.1), and `p` is hole + * remarks: Subscripts `n` and `p` or `-` and `+` are often used to denote electrons and holes, respectively. `n_n` and `n_p` are also used for electron densities, and `p_n` and `p_p` for hole densities, in `n`-type and `p`-type regions, respectively, of a `n`-`p` junction. + */ + attribute :>> num: Real; + attribute :>> mRef: IntrinsicCarrierDensityUnit[1]; + } + + attribute intrinsicCarrierDensity: IntrinsicCarrierDensityValue[*] nonunique :> scalarQuantities; + + attribute def IntrinsicCarrierDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-12 item 12-29.4 donor density */ + attribute def DonorDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 12-29.4 donor density + * symbol(s): `n_d` + * application domain: generic + * name: DonorDensity + * quantity dimension: L^-3 + * measurement unit(s): m^-3 + * tensor order: 0 + * definition: quotient of number of donor levels and volume (ISO 80000-3) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: DonorDensityUnit[1]; + } + + attribute donorDensity: DonorDensityValue[*] nonunique :> scalarQuantities; + + attribute def DonorDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-12 item 12-29.5 acceptor density */ + attribute def AcceptorDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 12-29.5 acceptor density + * symbol(s): `n_a` + * application domain: generic + * name: AcceptorDensity + * quantity dimension: L^-3 + * measurement unit(s): m^-3 + * tensor order: 0 + * definition: quotient of number of acceptor levels and volume (ISO 80000-3) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: AcceptorDensityUnit[1]; + } + + attribute acceptorDensity: AcceptorDensityValue[*] nonunique :> scalarQuantities; + + attribute def AcceptorDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-12 item 12-30 effective mass */ + attribute effectiveMass: MassValue :> scalarQuantities { + doc + /* + * source: item 12-30 effective mass + * symbol(s): `m"*"` + * application domain: generic + * name: EffectiveMass (specializes Mass) + * quantity dimension: M^1 + * measurement unit(s): kg + * tensor order: 0 + * definition: quantity given by: `m^"*" = (ħ^2 k) / ((dε)/(dk))`, where `k` is wavenumber (ISO 80000-3), `ε` is the energy (ISO 80000-5) of an electron in the interior of a substance, and `ħ` is the reduced Planck constant (ISO 80000-1) + * remarks: When `k` refers to a state where `ε` has an extremum, `m"*" = (ħ^2 k) / ((d^2ε)/(dk^2))`. The effective mass can be generalized to refer to an anisotropic system with `ε = ε(k)`. + */ + } + + /* ISO-80000-12 item 12-31 mobility ratio */ + attribute def MobilityRatioValue :> DimensionOneValue { + doc + /* + * source: item 12-31 mobility ratio + * symbol(s): `b` + * application domain: generic + * name: MobilityRatio (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of mobilities (ISO 80000-10) of electrons and holes, respectively + * remarks: The mobility ratio can be expressed by: `b = μ_n/μ_p`, where `μ_n` and `μ_p` are mobilities (ISO 80000-10) for electrons and holes, respectively. + */ + } + attribute mobilityRatio: MobilityRatioValue :> scalarQuantities; + + /* ISO-80000-12 item 12-32.1 relaxation time */ + attribute relaxationTime: DurationValue :> scalarQuantities { + doc + /* + * source: item 12-32.1 relaxation time + * symbol(s): `τ` + * application domain: condensed matter physics + * name: RelaxationTime (specializes Duration) + * quantity dimension: T^1 + * measurement unit(s): s + * tensor order: 0 + * definition: time constant (ISO 80000-3) for scattering, trapping or annihilation of charge carriers, phonons or other quasiparticles + * remarks: For electrons in metals, `τ = l/v_F`, where `l` is mean free path (item 12-15.2) and `v_F` is speed (ISO 80000-3) of electrons on the Fermi surface. + */ + } + + /* ISO-80000-12 item 12-32.2 carrier lifetime */ + attribute carrierLifetime: DurationValue :> scalarQuantities { + doc + /* + * source: item 12-32.2 carrier lifetime + * symbol(s): `τ`, `τ_n`, `τ_p` + * application domain: semiconductors + * name: CarrierLifetime (specializes Duration) + * quantity dimension: T^1 + * measurement unit(s): s + * tensor order: 0 + * definition: time constant (ISO 80000-3) for recombination or trapping of minority charge carriers in semiconductors + * remarks: Indices "n" and "p" denote negative and positive charge carriers, respectively. Positive charge carriers can also be holes. + */ + } + + /* ISO-80000-12 item 12-33 diffusion length */ + attribute diffusionLengthForCondensedMatterPhysics: LengthValue :> scalarQuantities { + doc + /* + * source: item 12-33 diffusion length + * symbol(s): `L`, `L_n`, `L_p` + * application domain: condensed matter physics + * name: DiffusionLength (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: square root of the product of diffusion coefficient (ISO 80000-10) and lifetime (ISO 80000-10) + * remarks: The diffusion length can be expressed by: `L = sqrt(Dτ)`, where `D` is the diffusion coefficient (ISO 80000-9) and `τ` is lifetime (ISO 80000-3). + */ + } + + /* ISO-80000-12 item 12-34 exchange integral */ + attribute exchangeIntegral: EnergyValue :> scalarQuantities { + doc + /* + * source: item 12-34 exchange integral + * symbol(s): `K`, `J` + * application domain: generic + * name: ExchangeIntegral (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, eV, kg*m^2*s^-2 + * tensor order: 0 + * definition: constituent of the interaction energy (ISO 80000-5) between the spins of adjacent electrons in matter arising from the overlap of electron state functions + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-35.1 Curie temperature */ + attribute curieTemperature: ThermodynamicTemperatureValue :> scalarQuantities { + doc + /* + * source: item 12-35.1 Curie temperature + * symbol(s): `T_C` + * application domain: generic + * name: CurieTemperature (specializes ThermodynamicTemperature) + * quantity dimension: Θ^1 + * measurement unit(s): K + * tensor order: 0 + * definition: critical thermodynamic temperature (ISO 80000-5) of a ferromagnet + * remarks: `T_(cr)` is used for critical thermodynamic temperature in general. + */ + } + + /* ISO-80000-12 item 12-35.2 Néel temperature */ + attribute 'néelTemperature': ThermodynamicTemperatureValue :> scalarQuantities { + doc + /* + * source: item 12-35.2 Néel temperature + * symbol(s): `T_N` + * application domain: generic + * name: NéelTemperature (specializes ThermodynamicTemperature) + * quantity dimension: Θ^1 + * measurement unit(s): K + * tensor order: 0 + * definition: critical thermodynamic temperature (ISO 80000-5) of an antiferromagnet + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-35.3 superconduction transition temperature */ + attribute superconductionTransitionTemperature: ThermodynamicTemperatureValue :> scalarQuantities { + doc + /* + * source: item 12-35.3 superconduction transition temperature + * symbol(s): `T_c` + * application domain: generic + * name: SuperconductionTransitionTemperature (specializes ThermodynamicTemperature) + * quantity dimension: Θ^1 + * measurement unit(s): K + * tensor order: 0 + * definition: critical thermodynamic temperature (ISO 80000-5) of a superconductor + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-36.1 thermodynamic critical magnetic flux density */ + attribute thermodynamicCriticalMagneticFluxDensity: MagneticFluxDensityValue :> scalarQuantities { + doc + /* + * source: item 12-36.1 thermodynamic critical magnetic flux density + * symbol(s): `B_c` + * application domain: generic + * name: ThermodynamicCriticalMagneticFluxDensity (specializes MagneticFluxDensity) + * quantity dimension: M^1*T^-2*I^-1 + * measurement unit(s): T, kg*s^-2*A^-1 + * tensor order: 0 + * definition: quantity given by: `B_c = sqrt((2μ_0 (G_n - G_s))/V)`, where `G_n` and `G_s` are the Gibbs energies (ISO 80000-5) at zero magnetic flux density (IEC 80000-6) in a normal conductor and superconductor, respectively, `μ_0` is the magnetic constant (IEC 80000-6), and `V` is volume (ISO 80000-3) + * remarks: In type I superconductors, `B_c` is the critical magnetic flux density for disappearance of superconductivity. The symbol `B_(c3)` is used for the critical magnetic flux density for disappearance of surface superconductivity. + */ + } + + /* ISO-80000-12 item 12-36.2 lower critical magnetic flux density */ + attribute lowerCriticalMagneticFluxDensity: MagneticFluxDensityValue :> scalarQuantities { + doc + /* + * source: item 12-36.2 lower critical magnetic flux density + * symbol(s): `B_(c1)` + * application domain: generic + * name: LowerCriticalMagneticFluxDensity (specializes MagneticFluxDensity) + * quantity dimension: M^1*T^-2*I^-1 + * measurement unit(s): T, kg*s^-2*A^-1 + * tensor order: 0 + * definition: for type II superconductors, the threshold magnetic flux density (IEC 80000-6) for magnetic flux (IEC 80000-6) entering the superconductor + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-36.3 upper critical magnetic flux density */ + attribute upperCriticalMagneticFluxDensity: MagneticFluxDensityValue :> scalarQuantities { + doc + /* + * source: item 12-36.3 upper critical magnetic flux density + * symbol(s): `B_(c2)` + * application domain: generic + * name: UpperCriticalMagneticFluxDensity (specializes MagneticFluxDensity) + * quantity dimension: M^1*T^-2*I^-1 + * measurement unit(s): T, kg*s^-2*A^-1 + * tensor order: 0 + * definition: for type II superconductors, the threshold magnetic flux density (IEC 80000-6) for disappearance of bulk superconductivity + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-37 superconductor energy gap */ + attribute superconductorEnergyGap: EnergyValue :> scalarQuantities { + doc + /* + * source: item 12-37 superconductor energy gap + * symbol(s): `Δ` + * application domain: generic + * name: SuperconductorEnergyGap (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, eV, kg*m^2*s^-2 + * tensor order: 0 + * definition: width of the forbidden energy band (item 12-24.2) in a superconductor + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-38.1 London penetration depth */ + attribute londonPenetrationDepth: LengthValue :> scalarQuantities { + doc + /* + * source: item 12-38.1 London penetration depth + * symbol(s): `λ_L` + * application domain: generic + * name: LondonPenetrationDepth (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: distance (ISO 80000-3) a magnetic field penetrates the plane surface of a semi-finite superconductor according to the expression: `B(x) = B(0) exp(-x/λ_L)`, where `B` is magnetic flux density (IEC 80000-6) and `x` is distance (ISO 80000-3) from the surface + * remarks: None. + */ + } + + /* ISO-80000-12 item 12-38.2 coherence length */ + attribute coherenceLength: LengthValue :> scalarQuantities { + doc + /* + * source: item 12-38.2 coherence length + * symbol(s): `ξ` + * application domain: generic + * name: CoherenceLength (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: distance (ISO 80000-3) in a superconductor over which the effect of a perturbation is appreciable at zero thermodynamic temperature (ISO 80000-5) + * remarks: None. + */ + } + +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml new file mode 100644 index 0000000000000000000000000000000000000000..6b9d46e726a7578b57341a44079d2c63da732a98 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml @@ -0,0 +1,2365 @@ +standard library package ISQElectromagnetism { + doc + /* + * International System of Quantities and Units + * Generated on 2022-08-07T14:44:27Z from standard IEC-80000-6:2008 "Electromagnetism" + * see also https://www.iso.org/obp/ui/#iso:std:iec:80000:-6:ed-1:v1:en,fr + * + * Note 1: In documentation comments, AsciiMath notation (see http://asciimath.org/) is used for mathematical concepts, + * with Greek letters in Unicode encoding. In running text, AsciiMath is placed between backticks. + * Note 2: For vector and tensor quantities currently the unit and quantity value type for their (scalar) magnitude is + * defined, as well as their typical Cartesian 3d VectorMeasurementReference (i.e. coordinate system) + * or TensorMeasurementReference. + */ + + private import ScalarValues::Real; + private import Quantities::*; + private import MeasurementReferences::*; + private import ISQBase::*; + + /* Quantity definitions referenced from other ISQ packages */ + private import ISQMechanics::PowerValue; + private import ISQSpaceTime::AngularMeasureValue; + private import ISQThermodynamics::EnergyValue; + + /* IEC-80000-6 item 6-1 electric current */ + /* See package ISQBase for the declarations of ElectricCurrentValue and ElectricCurrentUnit */ + + /* IEC-80000-6 item 6-2 electric charge */ + attribute def ElectricChargeValue :> ScalarQuantityValue { + doc + /* + * source: item 6-2 electric charge + * symbol(s): `Q`, `q` + * application domain: generic + * name: ElectricCharge + * quantity dimension: T^1*I^1 + * measurement unit(s): C + * tensor order: 0 + * definition: `d(Q) = I dt` where `I` is electric current (item 6-1) and `t` is time (ISO 80000-3, item 3-7) + * remarks: Electric charge is carried by discrete particles and can be positive or negative. The sign convention is such that the elementary electric charge `e`, i.e. the charge of the proton, is positive. See IEC 60050-121, item121-11-01. To denote a point charge `q` is often used, and that is done in the present document. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectricChargeUnit[1]; + } + + attribute electricCharge: ElectricChargeValue[*] nonunique :> scalarQuantities; + + attribute def ElectricChargeUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-3 electric charge density, volumic electric charge */ + attribute def ElectricChargeDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 6-3 electric charge density, volumic electric charge + * symbol(s): `ρ`, `ρ_V` + * application domain: generic + * name: ElectricChargeDensity + * quantity dimension: L^-3*T^1*I^1 + * measurement unit(s): C/m^3 + * tensor order: 0 + * definition: `ρ = (dQ)/(dV)` where `Q` is electric charge (item 6-2) and `V` is volume (ISO 80000-3, item 3-4) + * remarks: See IEC 60050-121, item 121-11-07. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectricChargeDensityUnit[1]; + } + + attribute electricChargeDensity: ElectricChargeDensityValue[*] nonunique :> scalarQuantities; + + attribute def ElectricChargeDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF, electricCurrentPF); } + } + + alias VolumicElectricChargeUnit for ElectricChargeDensityUnit; + alias VolumicElectricChargeValue for ElectricChargeDensityValue; + alias volumicElectricCharge for electricChargeDensity; + + /* IEC-80000-6 item 6-4 surface density of electric charge, areic electric charge */ + attribute def SurfaceDensityOfElectricChargeValue :> ScalarQuantityValue { + doc + /* + * source: item 6-4 surface density of electric charge, areic electric charge + * symbol(s): `ρ_A`, `sigma` + * application domain: generic + * name: SurfaceDensityOfElectricCharge + * quantity dimension: L^-2*T^1*I^1 + * measurement unit(s): C/m^2 + * tensor order: 0 + * definition: `ρ_A = (dQ)/(dA)` where `Q` is electric charge (item 6-2) and `A` is area (ISO 80000-3, item 3-3)` + * remarks: See IEC 60050-121, item 121-11-08. + */ + attribute :>> num: Real; + attribute :>> mRef: SurfaceDensityOfElectricChargeUnit[1]; + } + + attribute surfaceDensityOfElectricCharge: SurfaceDensityOfElectricChargeValue[*] nonunique :> scalarQuantities; + + attribute def SurfaceDensityOfElectricChargeUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF, electricCurrentPF); } + } + + alias AreicElectricChargeUnit for SurfaceDensityOfElectricChargeUnit; + alias AreicElectricChargeValue for SurfaceDensityOfElectricChargeValue; + alias areicElectricCharge for surfaceDensityOfElectricCharge; + + /* IEC-80000-6 item 6-5 linear density of electric charge, lineic electric charge */ + attribute def LinearDensityOfElectricChargeValue :> ScalarQuantityValue { + doc + /* + * source: item 6-5 linear density of electric charge, lineic electric charge + * symbol(s): `ρ_l`, `tau` + * application domain: generic + * name: LinearDensityOfElectricCharge + * quantity dimension: L^-1*T^1*I^1 + * measurement unit(s): C/m + * tensor order: 0 + * definition: `ρ_l = (dQ)/(dl)` where `Q` is electric charge (item 6-2) and `l` is length (ISO 80000-3, item 3-1.1) + * remarks: See IEC 60050-121, item121-11-09. + */ + attribute :>> num: Real; + attribute :>> mRef: LinearDensityOfElectricChargeUnit[1]; + } + + attribute linearDensityOfElectricCharge: LinearDensityOfElectricChargeValue[*] nonunique :> scalarQuantities; + + attribute def LinearDensityOfElectricChargeUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF, electricCurrentPF); } + } + + alias LineicElectricChargeUnit for LinearDensityOfElectricChargeUnit; + alias LineicElectricChargeValue for LinearDensityOfElectricChargeValue; + alias lineicElectricCharge for linearDensityOfElectricCharge; + + /* IEC-80000-6 item 6-6 electric dipole moment */ + attribute def ElectricDipoleMomentValue :> ScalarQuantityValue { + doc + /* + * source: item 6-6 electric dipole moment (magnitude) + * symbol(s): `p` + * application domain: generic + * name: ElectricDipoleMoment + * quantity dimension: L^1*T^1*I^1 + * measurement unit(s): C*m + * tensor order: 0 + * definition: `vec(p) = q (vec(r_+) - vec(r_-))` where `vec(r_+)` and `vec(r_-)` are the position vectors (ISO 80000-3, item 3-1.11) to carriers of electric charges `q` and `-q` (item 6-2), respectively + * remarks: The electric dipole moment of a substance within a domain is the vector sum of electric dipole moments of electric dipoles included in the domain. See IEC 60050-121, items 121-11-35 and 121-11-36. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectricDipoleMomentUnit[1]; + } + + attribute electricDipoleMoment: ElectricDipoleMomentValue[*] nonunique :> scalarQuantities; + + attribute def ElectricDipoleMomentUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF, electricCurrentPF); } + } + + attribute def Cartesian3dElectricDipoleMomentVector :> VectorQuantityValue { + doc + /* + * source: item 6-6 electric dipole moment (vector) + * symbol(s): `vec(p)` + * application domain: generic + * name: ElectricDipoleMoment + * quantity dimension: L^1*T^1*I^1 + * measurement unit(s): C*m + * tensor order: 1 + * definition: `vec(p) = q (vec(r_+) - vec(r_-))` where `vec(r_+)` and `vec(r_-)` are the position vectors (ISO 80000-3, item 3-1.11) to carriers of electric charges `q` and `-q` (item 6-2), respectively + * remarks: The electric dipole moment of a substance within a domain is the vector sum of electric dipole moments of electric dipoles included in the domain. See IEC 60050-121, items 121-11-35 and 121-11-36. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dElectricDipoleMomentCoordinateFrame[1]; + } + + attribute electricDipoleMomentVector: Cartesian3dElectricDipoleMomentVector :> vectorQuantities; + + attribute def Cartesian3dElectricDipoleMomentCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: ElectricDipoleMomentUnit[3]; + } + + /* IEC-80000-6 item 6-7 electric polarization */ + attribute def ElectricPolarizationValue :> ScalarQuantityValue { + doc + /* + * source: item 6-7 electric polarization (magnitude) + * symbol(s): `P` + * application domain: generic + * name: ElectricPolarization + * quantity dimension: L^-2*T^1*I^1 + * measurement unit(s): C/m^2 + * tensor order: 0 + * definition: `vec(P) = (d vec(p))/(dV)` where `vec(p)` is electric dipole moment (item 6-6) of a substance within a domain with volume `V` (ISO 80000-3, item 3-4) + * remarks: See IEC 60050-121, item 121-11-37. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectricPolarizationUnit[1]; + } + + attribute electricPolarization: ElectricPolarizationValue[*] nonunique :> scalarQuantities; + + attribute def ElectricPolarizationUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF, electricCurrentPF); } + } + + attribute def Cartesian3dElectricPolarizationVector :> VectorQuantityValue { + doc + /* + * source: item 6-7 electric polarization (vector) + * symbol(s): `vec(P)` + * application domain: generic + * name: ElectricPolarization + * quantity dimension: L^-2*T^1*I^1 + * measurement unit(s): C/m^2 + * tensor order: 1 + * definition: `vec(P) = (d vec(p))/(dV)` where `vec(p)` is electric dipole moment (item 6-6) of a substance within a domain with volume `V` (ISO 80000-3, item 3-4) + * remarks: See IEC 60050-121, item 121-11-37. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dElectricPolarizationCoordinateFrame[1]; + } + + attribute electricPolarizationVector: Cartesian3dElectricPolarizationVector :> vectorQuantities; + + attribute def Cartesian3dElectricPolarizationCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: ElectricPolarizationUnit[3]; + } + + /* IEC-80000-6 item 6-8 electric current density, areic electric current */ + attribute def ElectricCurrentDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 6-8 electric current density, areic electric current (magnitude) + * symbol(s): `J` + * application domain: generic + * name: ElectricCurrentDensity + * quantity dimension: L^-2*I^1 + * measurement unit(s): A/m^2 + * tensor order: 0 + * definition: `vec(J) = ρ vec(v)` where `ρ` is electric charge density (item 6-3) and `vec(v)` is velocity (ISO 80000-3, item 3-8.1) + * remarks: Electric current `I` (item 6-1) through a surface `S` is `I = int_S vec(J) * vec(e_n) dA` where `vec(e_n) dA` is vector surface element. See IEC 60050-121, item 121-11-11. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectricCurrentDensityUnit[1]; + } + + attribute electricCurrentDensity: ElectricCurrentDensityValue[*] nonunique :> scalarQuantities; + + attribute def ElectricCurrentDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, electricCurrentPF); } + } + + attribute def Cartesian3dElectricCurrentDensityVector :> VectorQuantityValue { + doc + /* + * source: item 6-8 electric current density, areic electric current (vector) + * symbol(s): `vec(J)` + * application domain: generic + * name: ElectricCurrentDensity + * quantity dimension: L^-2*I^1 + * measurement unit(s): A/m^2 + * tensor order: 1 + * definition: `vec(J) = ρ vec(v)` where `ρ` is electric charge density (item 6-3) and `vec(v)` is velocity (ISO 80000-3, item 3-8.1) + * remarks: Electric current `I` (item 6-1) through a surface `S` is `I = int_S vec(J) * vec(e_n) dA` where `vec(e_n) dA` is vector surface element. See IEC 60050-121, item 121-11-11. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dElectricCurrentDensityCoordinateFrame[1]; + } + + attribute electricCurrentDensityVector: Cartesian3dElectricCurrentDensityVector :> vectorQuantities; + + attribute def Cartesian3dElectricCurrentDensityCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: ElectricCurrentDensityUnit[3]; + } + + alias Cartesian3dAreicElectricCurrentCoordinateFrame for Cartesian3dElectricCurrentDensityCoordinateFrame; + alias areicElectricCurrentVector for electricCurrentDensityVector; + + /* IEC-80000-6 item 6-9 linear electric current density, lineic electric current */ + attribute def LinearElectricCurrentDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 6-9 linear electric current density, lineic electric current (magnitude) + * symbol(s): `J_S` + * application domain: generic + * name: LinearElectricCurrentDensity + * quantity dimension: L^-1*I^1 + * measurement unit(s): A/m + * tensor order: 0 + * definition: `vec(J_S) = ρ_A vec(v)` where `ρ_A` is surface density of electric charge (item 6-4) and `vec(v)` is velocity (ISO 80000-3, item 3-8.1) + * remarks: Electric current `I` (item 6-1) through a curve `C` on a surface is `I = int_C vec(J_S) xx vec(e_n) * d vec(r)` where `vec(e_n)` is a unit vector perpendicular to the surface and line vector element and `d vec(r)` is the differential of position vector `vec(r)`. See IEC 60050-121, item 121-11-12. + */ + attribute :>> num: Real; + attribute :>> mRef: LinearElectricCurrentDensityUnit[1]; + } + + attribute linearElectricCurrentDensity: LinearElectricCurrentDensityValue[*] nonunique :> scalarQuantities; + + attribute def LinearElectricCurrentDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, electricCurrentPF); } + } + + attribute def Cartesian3dLinearElectricCurrentDensityVector :> VectorQuantityValue { + doc + /* + * source: item 6-9 linear electric current density, lineic electric current (vector) + * symbol(s): `vec(J_S)` + * application domain: generic + * name: LinearElectricCurrentDensity + * quantity dimension: L^-1*I^1 + * measurement unit(s): A/m + * tensor order: 1 + * definition: `vec(J_S) = ρ_A vec(v)` where `ρ_A` is surface density of electric charge (item 6-4) and `vec(v)` is velocity (ISO 80000-3, item 3-8.1) + * remarks: Electric current `I` (item 6-1) through a curve `C` on a surface is `I = int_C vec(J_S) xx vec(e_n) * d vec(r)` where `vec(e_n)` is a unit vector perpendicular to the surface and line vector element and `d vec(r)` is the differential of position vector `vec(r)`. See IEC 60050-121, item 121-11-12. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dLinearElectricCurrentDensityCoordinateFrame[1]; + } + + attribute linearElectricCurrentDensityVector: Cartesian3dLinearElectricCurrentDensityVector :> vectorQuantities; + + attribute def Cartesian3dLinearElectricCurrentDensityCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: LinearElectricCurrentDensityUnit[3]; + } + + alias Cartesian3dLineicElectricCurrentCoordinateFrame for Cartesian3dLinearElectricCurrentDensityCoordinateFrame; + alias lineicElectricCurrentVector for linearElectricCurrentDensityVector; + + /* IEC-80000-6 item 6-10 electric field strength */ + attribute def ElectricFieldStrengthValue :> ScalarQuantityValue { + doc + /* + * source: item 6-10 electric field strength (magnitude) + * symbol(s): `E` + * application domain: generic + * name: ElectricFieldStrength + * quantity dimension: L^1*M^1*T^-3*I^-1 + * measurement unit(s): V/m + * tensor order: 0 + * definition: `vec(E) = vec(F)/q` where `vec(F)` is force (ISO 80000-4, item 4-9.1) and `q` is electric charge (item 6-2) + * remarks: See IEC 60050, item 121-11-18. `q` is the charge of a test particle at rest. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectricFieldStrengthUnit[1]; + } + + attribute electricFieldStrength: ElectricFieldStrengthValue[*] nonunique :> scalarQuantities; + + attribute def ElectricFieldStrengthUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + attribute def Cartesian3dElectricFieldStrengthVector :> VectorQuantityValue { + doc + /* + * source: item 6-10 electric field strength (vector) + * symbol(s): `vec(E)` + * application domain: generic + * name: ElectricFieldStrength + * quantity dimension: L^1*M^1*T^-3*I^-1 + * measurement unit(s): V/m + * tensor order: 1 + * definition: `vec(E) = vec(F)/q` where `vec(F)` is force (ISO 80000-4, item 4-9.1) and `q` is electric charge (item 6-2) + * remarks: See IEC 60050, item 121-11-18. `q` is the charge of a test particle at rest. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dElectricFieldStrengthCoordinateFrame[1]; + } + + attribute electricFieldStrengthVector: Cartesian3dElectricFieldStrengthVector :> vectorQuantities; + + attribute def Cartesian3dElectricFieldStrengthCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: ElectricFieldStrengthUnit[3]; + } + + /* IEC-80000-6 item 6-11.1 electric potential */ + attribute def ElectricPotentialValue :> ScalarQuantityValue { + doc + /* + * source: item 6-11.1 electric potential + * symbol(s): `V`, `φ` + * application domain: generic + * name: ElectricPotential + * quantity dimension: L^2*M^1*T^-3*I^-1 + * measurement unit(s): V + * tensor order: 0 + * definition: `-grad(V) = vec(E) + (del A)/(del t)` where `vec(E)` is electric field strength (item 610), `A` is magnetic vector potential (item 6-32) and `t` is time (ISO 80000-3, item 3-7) + * remarks: The electric potential is not unique, since any constant scalar field quantity can be added to it without changing its gradient. See IEC 60050-121, item 121-11-25. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectricPotentialUnit[1]; + } + + attribute electricPotential: ElectricPotentialValue[*] nonunique :> scalarQuantities; + + attribute def ElectricPotentialUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-11.2 electric potential difference */ + attribute def ElectricPotentialDifferenceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-11.2 electric potential difference + * symbol(s): `V_(ab)` + * application domain: generic + * name: ElectricPotentialDifference + * quantity dimension: L^2*M^1*T^-3*I^-1 + * measurement unit(s): V + * tensor order: 0 + * definition: `V_(ab) = int_(vec(r_a))^(vec(r_b)) (vec(E) + (del A)/(del t)) * d vec(r)` where `vec(E)` is electric field strength (item 610), `A` is magnetic vector potential (item 6-32), `t` is time (ISO 80000-3, item 3-7), and `vec(r)` is position vector (ISO 80000-3, item 3-1.11) along a given curve `C` from point `a` to point `b` + * remarks: `V_(ab) = V_a - V_b` where `V_a` and `V_b` are the potentials at points `a` and `b`, respectively. See IEC 60050-121, item 121-11-26. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectricPotentialDifferenceUnit[1]; + } + + attribute electricPotentialDifference: ElectricPotentialDifferenceValue[*] nonunique :> scalarQuantities; + + attribute def ElectricPotentialDifferenceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-11.3 voltage, electric tension */ + attribute voltage: ElectricPotentialDifferenceValue :> scalarQuantities { + doc + /* + * source: item 6-11.3 voltage, electric tension + * symbol(s): `U`, `U_(ab)` + * application domain: generic + * name: Voltage (specializes ElectricPotentialDifference) + * quantity dimension: L^2*M^1*T^-3*I^-1 + * measurement unit(s): V + * tensor order: 0 + * definition: in electric circuit theory, `U_(ab) = V_a - V_b` where `V_a` and `V_b` are the electric potentials (item 6-11.1) at points `a` and `b`, respectively + * remarks: For an electric field within a medium `U_(ab) = int_(vec(r_a) (C))^(vec(r_b)) vec(E) * d vec(r)` where `vec(E)` is electric field strength (item 6-10) and `vec(r)` is position vector (ISO 80000-3, item 3-1.11) along a given curve `C` from point `a` to point `b`. For an irrotational electric field, the voltage is independent of the path between the two points `a` and `b`. See IEC 60050-121, item 121-11-27. + */ + } + + alias electricTension for voltage; + + /* IEC-80000-6 item 6-12 electric flux density, electric displacement */ + attribute def ElectricFluxDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 6-12 electric flux density, electric displacement (magnitude) + * symbol(s): `D` + * application domain: generic + * name: ElectricFluxDensity + * quantity dimension: L^-2*T^1*I^1 + * measurement unit(s): C/m^2 + * tensor order: 0 + * definition: `vec(D) = ε_0 vec(E) + vec(P)` where `ε_0` is the electric constant (item 6-14.1 ), `vec(E)` is electric field strength (item 6-10), and `vec(P)` is electric polarization (item 6-7) + * remarks: The electric flux density is related to electric charge density via `nabla * vec(D) = ρ` where `nabla * vec(D)` denotes the divergence of `vec(D)`. See IEC 60050-121, item 121-11-40. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectricFluxDensityUnit[1]; + } + + attribute electricFluxDensity: ElectricFluxDensityValue[*] nonunique :> scalarQuantities; + + attribute def ElectricFluxDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF, electricCurrentPF); } + } + + attribute def Cartesian3dElectricFluxDensityVector :> VectorQuantityValue { + doc + /* + * source: item 6-12 electric flux density, electric displacement (vector) + * symbol(s): `vec(D)` + * application domain: generic + * name: ElectricFluxDensity + * quantity dimension: L^-2*T^1*I^1 + * measurement unit(s): C/m^2 + * tensor order: 1 + * definition: `vec(D) = ε_0 vec(E) + vec(P)` where `ε_0` is the electric constant (item 6-14.1 ), `vec(E)` is electric field strength (item 6-10), and `vec(P)` is electric polarization (item 6-7) + * remarks: The electric flux density is related to electric charge density via `nabla * vec(D) = ρ` where `nabla * vec(D)` denotes the divergence of `vec(D)`. See IEC 60050-121, item 121-11-40. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dElectricFluxDensityCoordinateFrame[1]; + } + + attribute electricFluxDensityVector: Cartesian3dElectricFluxDensityVector :> vectorQuantities; + + attribute def Cartesian3dElectricFluxDensityCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: ElectricFluxDensityUnit[3]; + } + + alias Cartesian3dElectricDisplacementCoordinateFrame for Cartesian3dElectricFluxDensityCoordinateFrame; + alias electricDisplacementVector for electricFluxDensityVector; + + /* IEC-80000-6 item 6-13 capacitance */ + attribute def CapacitanceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-13 capacitance + * symbol(s): `C` + * application domain: generic + * name: Capacitance + * quantity dimension: L^-2*M^-1*T^4*I^2 + * measurement unit(s): F + * tensor order: 0 + * definition: `C = Q/U` where `Q` is electric charge (item 6-2) and `U` is voltage (6-11.3) + * remarks: See IEC 60050-131, item 131-12-13. + */ + attribute :>> num: Real; + attribute :>> mRef: CapacitanceUnit[1]; + } + + attribute capacitance: CapacitanceValue[*] nonunique :> scalarQuantities; + + attribute def CapacitanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 4; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-14.1 electric constant, permittivity of vacuum */ + attribute def ElectricConstantValue :> ScalarQuantityValue { + doc + /* + * source: item 6-14.1 electric constant, permittivity of vacuum + * symbol(s): `ε_0` + * application domain: generic + * name: ElectricConstant + * quantity dimension: L^-3*M^-1*T^4*I^2 + * measurement unit(s): F/m + * tensor order: 0 + * definition: `ε_0 = 1 / (μ_0 * c_0^2)` where `μ_0` is the magnetic constant (item 6-26.1) and `c_0` is the speed of light (item 6-35.2) + * remarks: `ε_0 = 8.854188 * 10^-12` F/m. See IEC 60050-121, item 121-11-03. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectricConstantUnit[1]; + } + + attribute electricConstant: ElectricConstantValue[*] nonunique :> scalarQuantities; + + attribute def ElectricConstantUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 4; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + alias PermittivityOfVacuumUnit for ElectricConstantUnit; + alias PermittivityOfVacuumValue for ElectricConstantValue; + alias permittivityOfVacuum for electricConstant; + + /* IEC-80000-6 item 6-14.2 permittivity */ + attribute def PermittivityValue :> ScalarQuantityValue { + doc + /* + * source: item 6-14.2 permittivity + * symbol(s): `ε` + * application domain: generic + * name: Permittivity + * quantity dimension: L^-3*M^-1*T^4*I^2 + * measurement unit(s): F/m + * tensor order: 0 + * definition: `vec(D) = ε vec(E)` where `vec(D)` is electric flux density (item 6-12) and `vec(E)` is electric field strength (item 6-10) + * remarks: This definition applies to an isotropic medium. For an anisotropic medium, permittivity is a second order tensor. See IEC 60050-121, item 121-12-12. + */ + attribute :>> num: Real; + attribute :>> mRef: PermittivityUnit[1]; + } + + attribute permittivity: PermittivityValue[*] nonunique :> scalarQuantities; + + attribute def PermittivityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 4; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-15 relative permittivity */ + attribute def RelativePermittivityValue :> DimensionOneValue { + doc + /* + * source: item 6-15 relative permittivity + * symbol(s): `ε_r` + * application domain: generic + * name: RelativePermittivity (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: `ε_r = ε / ε_0` where `ε` is permittivity (item 6-14.2) and `ε_0` is the electric constant (item 6-14.1) + * remarks: See IEC 60050-121, item 121-12-13. + */ + } + attribute relativePermittivity: RelativePermittivityValue :> scalarQuantities; + + /* IEC-80000-6 item 6-16 electric susceptibility */ + attribute def ElectricSusceptibilityValue :> DimensionOneValue { + doc + /* + * source: item 6-16 electric susceptibility + * symbol(s): `χ` + * application domain: generic + * name: ElectricSusceptibility (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: `vec(P) = ε_0 χ vec(E)` where `vec(P)` is electric polarization (item 6-7), `ε_0` is the electric constant (item 6-14. 1) and `vec(E)` is electric field strength (item 6-10) + * remarks: `χ = ε_r - 1`. The definition applies to an isotropic medium. For an anisotropic medium, electric susceptibility is a second order tensor. See IEC 60050-121, item 121-12-19. + */ + } + attribute electricSusceptibility: ElectricSusceptibilityValue :> scalarQuantities; + + /* IEC-80000-6 item 6-17 electric flux */ + attribute def ElectricFluxValue :> ScalarQuantityValue { + doc + /* + * source: item 6-17 electric flux + * symbol(s): `Ψ` + * application domain: generic + * name: ElectricFlux + * quantity dimension: T^1*I^1 + * measurement unit(s): C + * tensor order: 0 + * definition: `Ψ = int_S vec(D) * vec(e_n) dA` over a surface `S`, where `vec(D)` is electric flux (item 6-12) en `vec(e_n) dA` is the vector surface element (ISO 80000-3 item 3-3) + * remarks: See IEC 60050-121, item 121-11-41. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectricFluxUnit[1]; + } + + attribute electricFlux: ElectricFluxValue[*] nonunique :> scalarQuantities; + + attribute def ElectricFluxUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-18 displacement current density */ + attribute def DisplacementCurrentDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 6-18 displacement current density (magnitude) + * symbol(s): `J_D` + * application domain: generic + * name: DisplacementCurrentDensity + * quantity dimension: L^-2*I^1 + * measurement unit(s): A/m^2 + * tensor order: 0 + * definition: `vec(J_D) = (del vec(D))/(del t)` where `vec(D)` is electric flux density (item 6-12) and `t` is time (ISO 80000-3, item 3-7) + * remarks: See IEC 60050-121, item 121-11-42. + */ + attribute :>> num: Real; + attribute :>> mRef: DisplacementCurrentDensityUnit[1]; + } + + attribute displacementCurrentDensity: DisplacementCurrentDensityValue[*] nonunique :> scalarQuantities; + + attribute def DisplacementCurrentDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, electricCurrentPF); } + } + + attribute def Cartesian3dDisplacementCurrentDensityVector :> VectorQuantityValue { + doc + /* + * source: item 6-18 displacement current density (vector) + * symbol(s): `vec(J_D)` + * application domain: generic + * name: DisplacementCurrentDensity + * quantity dimension: L^-2*I^1 + * measurement unit(s): A/m^2 + * tensor order: 1 + * definition: `vec(J_D) = (del vec(D))/(del t)` where `vec(D)` is electric flux density (item 6-12) and `t` is time (ISO 80000-3, item 3-7) + * remarks: See IEC 60050-121, item 121-11-42. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dDisplacementCurrentDensityCoordinateFrame[1]; + } + + attribute displacementCurrentDensityVector: Cartesian3dDisplacementCurrentDensityVector :> vectorQuantities; + + attribute def Cartesian3dDisplacementCurrentDensityCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: DisplacementCurrentDensityUnit[3]; + } + + /* IEC-80000-6 item 6-19.1 displacement current */ + attribute displacementCurrent: ElectricCurrentValue :> scalarQuantities { + doc + /* + * source: item 6-19.1 displacement current + * symbol(s): `I_D` + * application domain: generic + * name: DisplacementCurrent (specializes ElectricCurrent) + * quantity dimension: I^1 + * measurement unit(s): A + * tensor order: 0 + * definition: `I = int_S vec(J_D) * vec(e_n) dA` over a surface `S`, where `vec(J_D)` is displacement current density (item 6-18) en `vec(e_n) dA` is the vector surface element (ISO 80000-3 item 3-3) + * remarks: See IEC 60050-121, item 121-11-43. + */ + } + + /* IEC-80000-6 item 6-19.2 total current */ + attribute totalCurrent: ElectricCurrentValue :> scalarQuantities { + doc + /* + * source: item 6-19.2 total current + * symbol(s): `I_"tot"`, `I_t` + * application domain: generic + * name: TotalCurrent (specializes ElectricCurrent) + * quantity dimension: I^1 + * measurement unit(s): A + * tensor order: 0 + * definition: `I_(tot) = I + I_D` where `I` is electric current (item 6-1) and `I_D` is displacement current (item 6-19.1) + * remarks: See IEC 60050-121, item 121-11-45. + */ + } + + /* IEC-80000-6 item 6-20 total current density */ + attribute def TotalCurrentDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 6-20 total current density (magnitude) + * symbol(s): `J_"tot"`, `J_t` + * application domain: generic + * name: TotalCurrentDensity + * quantity dimension: L^-2*I^1 + * measurement unit(s): A/m^2 + * tensor order: 0 + * definition: `vec(J_(tot)) = vec(J) +vec(J_D)` where `vec(J)` is electric current density (item 6-8) and `vec(J_D)` is displacement current density (item 6-18) + * remarks: See IEC 60050-121, item 121-11-44. + */ + attribute :>> num: Real; + attribute :>> mRef: TotalCurrentDensityUnit[1]; + } + + attribute totalCurrentDensity: TotalCurrentDensityValue[*] nonunique :> scalarQuantities; + + attribute def TotalCurrentDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, electricCurrentPF); } + } + + attribute def Cartesian3dTotalCurrentDensityVector :> VectorQuantityValue { + doc + /* + * source: item 6-20 total current density (vector) + * symbol(s): `vec(J_"tot")`, `vec(J_t)` + * application domain: generic + * name: TotalCurrentDensity + * quantity dimension: L^-2*I^1 + * measurement unit(s): A/m^2 + * tensor order: 1 + * definition: `vec(J_(tot)) = vec(J) +vec(J_D)` where `vec(J)` is electric current density (item 6-8) and `vec(J_D)` is displacement current density (item 6-18) + * remarks: See IEC 60050-121, item 121-11-44. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dTotalCurrentDensityCoordinateFrame[1]; + } + + attribute totalCurrentDensityVector: Cartesian3dTotalCurrentDensityVector :> vectorQuantities; + + attribute def Cartesian3dTotalCurrentDensityCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: TotalCurrentDensityUnit[3]; + } + + /* IEC-80000-6 item 6-21 magnetic flux density */ + attribute def MagneticFluxDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 6-21 magnetic flux density (magnitude) + * symbol(s): `B` + * application domain: generic + * name: MagneticFluxDensity + * quantity dimension: M^1*T^-2*I^-1 + * measurement unit(s): T + * tensor order: 0 + * definition: `vec(F) = q vec(v) xx vec(B)` where `vec(F)` is force (ISO 80000-4, item 4-9.1) and `vec(v)` is velocity (ISO 80000-3, item 3-8.1) of any test particle with electric charge `q` (item 6-2) + * remarks: The magnetic flux density has zero divergence, `nabla * vec(B) = 0`. See IEC 60050-121, item 121-11-19. + */ + attribute :>> num: Real; + attribute :>> mRef: MagneticFluxDensityUnit[1]; + } + + attribute magneticFluxDensity: MagneticFluxDensityValue[*] nonunique :> scalarQuantities; + + attribute def MagneticFluxDensityUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF, electricCurrentPF); } + } + + attribute def Cartesian3dMagneticFluxDensityVector :> VectorQuantityValue { + doc + /* + * source: item 6-21 magnetic flux density (vector) + * symbol(s): `vec(B)` + * application domain: generic + * name: MagneticFluxDensity + * quantity dimension: M^1*T^-2*I^-1 + * measurement unit(s): T + * tensor order: 1 + * definition: `vec(F) = q vec(v) xx vec(B)` where `vec(F)` is force (ISO 80000-4, item 4-9.1) and `vec(v)` is velocity (ISO 80000-3, item 3-8.1) of any test particle with electric charge `q` (item 6-2) + * remarks: The magnetic flux density has zero divergence, `nabla * vec(B) = 0`. See IEC 60050-121, item 121-11-19. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dMagneticFluxDensityCoordinateFrame[1]; + } + + attribute magneticFluxDensityVector: Cartesian3dMagneticFluxDensityVector :> vectorQuantities; + + attribute def Cartesian3dMagneticFluxDensityCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: MagneticFluxDensityUnit[3]; + } + + /* IEC-80000-6 item 6-22.1 magnetic flux */ + attribute def MagneticFluxValue :> ScalarQuantityValue { + doc + /* + * source: item 6-22.1 magnetic flux + * symbol(s): `Φ` + * application domain: generic + * name: MagneticFlux + * quantity dimension: L^2*M^1*T^-2*I^-1 + * measurement unit(s): Wb + * tensor order: 0 + * definition: `Φ = int_S vec(B) * vec(e_n) dA` over a surface `S`, where `vec(B)` is magnetic flux density (item 6-21) and `vec(e_n) dA` is vector surface element (ISO 80000-3, item 3-3) + * remarks: See IEC 60050-121, item 121-11-21. + */ + attribute :>> num: Real; + attribute :>> mRef: MagneticFluxUnit[1]; + } + + attribute magneticFlux: MagneticFluxValue[*] nonunique :> scalarQuantities; + + attribute def MagneticFluxUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-22.2 linked flux */ + attribute def LinkedFluxValue :> ScalarQuantityValue { + doc + /* + * source: item 6-22.2 linked flux + * symbol(s): `Ψ_m`, `Ψ` + * application domain: generic + * name: LinkedFlux + * quantity dimension: L^2*M^1*T^-2*I^-1 + * measurement unit(s): Wb + * tensor order: 0 + * definition: `Ψ_m = int_C vec(A) * d vec(r)` where `vec(A)` is magnetic vector potential (item 6-32) and `d vec(r)` is line vector element of the curve `C` + * remarks: Line vector element `d vec(r)` is the differential of position vector `vec(r)` (ISO 80000-3, item 3-1.11). See IEC 60050-121, item 121-11-24. + */ + attribute :>> num: Real; + attribute :>> mRef: LinkedFluxUnit[1]; + } + + attribute linkedFlux: LinkedFluxValue[*] nonunique :> scalarQuantities; + + attribute def LinkedFluxUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-23 magnetic moment, magnetic area moment */ + attribute def MagneticMomentValue :> ScalarQuantityValue { + doc + /* + * source: item 6-23 magnetic moment, magnetic area moment (magnitude) + * symbol(s): `m` + * application domain: generic + * name: MagneticMoment + * quantity dimension: L^2*I^1 + * measurement unit(s): A*m^2 + * tensor order: 0 + * definition: `vec(m) = I vec(e_n) A` where `I` is electric current (item 6-1) in a small closed loop, `vec(e_n)` is a unit vector perpendicular to the loop, and `A` is area (ISO 80000-3, item 3-3) of the loop + * remarks: The magnetic moment of a substance within a domain is the vector sum of the magnetic moments of all entities included in the domain. See IEC 60050-121, items 121-11-49 and 121-11-50. + */ + attribute :>> num: Real; + attribute :>> mRef: MagneticMomentUnit[1]; + } + + attribute magneticMoment: MagneticMomentValue[*] nonunique :> scalarQuantities; + + attribute def MagneticMomentUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, electricCurrentPF); } + } + + attribute def Cartesian3dMagneticMomentVector :> VectorQuantityValue { + doc + /* + * source: item 6-23 magnetic moment, magnetic area moment (vector) + * symbol(s): `vec(m)` + * application domain: generic + * name: MagneticMoment + * quantity dimension: L^2*I^1 + * measurement unit(s): A*m^2 + * tensor order: 1 + * definition: `vec(m) = I vec(e_n) A` where `I` is electric current (item 6-1) in a small closed loop, `vec(e_n)` is a unit vector perpendicular to the loop, and `A` is area (ISO 80000-3, item 3-3) of the loop + * remarks: The magnetic moment of a substance within a domain is the vector sum of the magnetic moments of all entities included in the domain. See IEC 60050-121, items 121-11-49 and 121-11-50. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dMagneticMomentCoordinateFrame[1]; + } + + attribute magneticMomentVector: Cartesian3dMagneticMomentVector :> vectorQuantities; + + attribute def Cartesian3dMagneticMomentCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: MagneticMomentUnit[3]; + } + + alias Cartesian3dMagneticAreaMomentCoordinateFrame for Cartesian3dMagneticMomentCoordinateFrame; + alias magneticAreaMomentVector for magneticMomentVector; + + /* IEC-80000-6 item 6-24 magnetization */ + attribute def MagnetizationValue :> ScalarQuantityValue { + doc + /* + * source: item 6-24 magnetization (magnitude) + * symbol(s): `M`, `H_i` + * application domain: generic + * name: Magnetization + * quantity dimension: L^-1*I^1 + * measurement unit(s): A/m + * tensor order: 0 + * definition: `vec(M) = (d vec(m)) / (dV)` where `vec(m)` is magnetic moment (item 6-23) of a substance in a domain with volume `V` (ISO 80000-3, item 3-4) + * remarks: See IEC 60050-121, item 121-11-52. + */ + attribute :>> num: Real; + attribute :>> mRef: MagnetizationUnit[1]; + } + + attribute magnetization: MagnetizationValue[*] nonunique :> scalarQuantities; + + attribute def MagnetizationUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, electricCurrentPF); } + } + + attribute def Cartesian3dMagnetizationVector :> VectorQuantityValue { + doc + /* + * source: item 6-24 magnetization (vector) + * symbol(s): `vec(M)`, `vec(H_i)` + * application domain: generic + * name: Magnetization + * quantity dimension: L^-1*I^1 + * measurement unit(s): A/m + * tensor order: 1 + * definition: `vec(M) = (d vec(m)) / (dV)` where `vec(m)` is magnetic moment (item 6-23) of a substance in a domain with volume `V` (ISO 80000-3, item 3-4) + * remarks: See IEC 60050-121, item 121-11-52. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dMagnetizationCoordinateFrame[1]; + } + + attribute magnetizationVector: Cartesian3dMagnetizationVector :> vectorQuantities; + + attribute def Cartesian3dMagnetizationCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: MagnetizationUnit[3]; + } + + /* IEC-80000-6 item 6-25 magnetic field strength, magnetizing field */ + attribute def MagneticFieldStrengthValue :> ScalarQuantityValue { + doc + /* + * source: item 6-25 magnetic field strength, magnetizing field (magnitude) + * symbol(s): `H` + * application domain: generic + * name: MagneticFieldStrength + * quantity dimension: L^-1*I^1 + * measurement unit(s): A/m + * tensor order: 0 + * definition: `vec(H) = vec(B)/μ_0 - vec(M)` where `vec(B)` is magnetic flux density (item 6-21), `μ_0` is the magnetic constant (item 6-26.1), and `vec(M)` is magnetization (item 6-24) + * remarks: The magnetic field strength is related to the total current density `vec(J_(t ot))` (item 6-20) via `rot vec(H) = vec(J_(t ot))`. See IEC 60050-121, item 121-11-56. + */ + attribute :>> num: Real; + attribute :>> mRef: MagneticFieldStrengthUnit[1]; + } + + attribute magneticFieldStrength: MagneticFieldStrengthValue[*] nonunique :> scalarQuantities; + + attribute def MagneticFieldStrengthUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, electricCurrentPF); } + } + + attribute def Cartesian3dMagneticFieldStrengthVector :> VectorQuantityValue { + doc + /* + * source: item 6-25 magnetic field strength, magnetizing field (vector) + * symbol(s): `vec(H)` + * application domain: generic + * name: MagneticFieldStrength + * quantity dimension: L^-1*I^1 + * measurement unit(s): A/m + * tensor order: 1 + * definition: `vec(H) = vec(B)/μ_0 - vec(M)` where `vec(B)` is magnetic flux density (item 6-21), `μ_0` is the magnetic constant (item 6-26.1), and `vec(M)` is magnetization (item 6-24) + * remarks: The magnetic field strength is related to the total current density `vec(J_(t ot))` (item 6-20) via `rot vec(H) = vec(J_(t ot))`. See IEC 60050-121, item 121-11-56. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dMagneticFieldStrengthCoordinateFrame[1]; + } + + attribute magneticFieldStrengthVector: Cartesian3dMagneticFieldStrengthVector :> vectorQuantities; + + attribute def Cartesian3dMagneticFieldStrengthCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: MagneticFieldStrengthUnit[3]; + } + + alias Cartesian3dMagnetizingFieldCoordinateFrame for Cartesian3dMagneticFieldStrengthCoordinateFrame; + alias magnetizingFieldVector for magneticFieldStrengthVector; + + /* IEC-80000-6 item 6-26.1 magnetic constant, permeability of vacuum */ + attribute def MagneticConstantValue :> ScalarQuantityValue { + doc + /* + * source: item 6-26.1 magnetic constant, permeability of vacuum + * symbol(s): `μ_0` + * application domain: generic + * name: MagneticConstant + * quantity dimension: L^1*M^1*T^-2*I^-2 + * measurement unit(s): H/m + * tensor order: 0 + * definition: `μ_0 = 4 π * 10^-7` H/m + * remarks: For this definition of `μ_0` see item 6-1.a. `μ_0 ~~ 1.256637 * 10^-6` H/m. See IEC 60050-121, item 121-11-14. + */ + attribute :>> num: Real; + attribute :>> mRef: MagneticConstantUnit[1]; + } + + attribute magneticConstant: MagneticConstantValue[*] nonunique :> scalarQuantities; + + attribute def MagneticConstantUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + alias PermeabilityOfVacuumUnit for MagneticConstantUnit; + alias PermeabilityOfVacuumValue for MagneticConstantValue; + alias permeabilityOfVacuum for magneticConstant; + + /* IEC-80000-6 item 6-26.2 permeability */ + attribute def PermeabilityValue :> ScalarQuantityValue { + doc + /* + * source: item 6-26.2 permeability + * symbol(s): `μ` + * application domain: generic + * name: Permeability + * quantity dimension: L^1*M^1*T^-2*I^-2 + * measurement unit(s): H/m + * tensor order: 0 + * definition: `vec(B) = μ vec(H)` where `vec(B)` is magnetic flux density (item 6-21) and `vec(H)` is magnetic field strength (item 6-25) + * remarks: This definition applies to an isotropic medium. For an anisotropic medium permeability is a second order tensor. See IEC 60050-121, item 121-12-28. + */ + attribute :>> num: Real; + attribute :>> mRef: PermeabilityUnit[1]; + } + + attribute permeability: PermeabilityValue[*] nonunique :> scalarQuantities; + + attribute def PermeabilityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-27 relative permeability */ + attribute def RelativePermeabilityValue :> DimensionOneValue { + doc + /* + * source: item 6-27 relative permeability + * symbol(s): `μ_r` + * application domain: generic + * name: RelativePermeability (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: `μ_r = μ / μ_0` where `μ` is permeability (item 6-24) and `μ_0` is the magnetic constant (item 6-26.1) + * remarks: See IEC 60050-121, item 121-12-29. + */ + } + attribute relativePermeability: RelativePermeabilityValue :> scalarQuantities; + + /* IEC-80000-6 item 6-28 magnetic susceptibility */ + attribute def MagneticSusceptibilityValue :> DimensionOneValue { + doc + /* + * source: item 6-28 magnetic susceptibility + * symbol(s): `κ`, `χ_m` + * application domain: generic + * name: MagneticSusceptibility (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: `vec(M) = κ vec(H)` where `vec(M)` is magnetization (item 6-24) and `vec(H)` is magnetic field strength (item 6-25) + * remarks: `κ = μ_r - 1` This definition applies to an isotropic medium. For an anisotropic medium magnetic susceptibility is a second order tensor. See IEC 60050-121, item 121-12-37. + */ + } + attribute magneticSusceptibility: MagneticSusceptibilityValue :> scalarQuantities; + + /* IEC-80000-6 item 6-29 magnetic polarization */ + attribute def MagneticPolarizationValue :> ScalarQuantityValue { + doc + /* + * source: item 6-29 magnetic polarization (magnitude) + * symbol(s): `J_m` + * application domain: generic + * name: MagneticPolarization + * quantity dimension: M^1*T^-2*I^-1 + * measurement unit(s): T + * tensor order: 0 + * definition: `vec(J_m) = μ_0 vec(M)` where `μ_0` is the magnetic constant (item 6-26.1), and `vec(M)` is magnetization (item 6-24) + * remarks: See IEC 60050-121, item 121-11-54. + */ + attribute :>> num: Real; + attribute :>> mRef: MagneticPolarizationUnit[1]; + } + + attribute magneticPolarization: MagneticPolarizationValue[*] nonunique :> scalarQuantities; + + attribute def MagneticPolarizationUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF, electricCurrentPF); } + } + + attribute def Cartesian3dMagneticPolarizationVector :> VectorQuantityValue { + doc + /* + * source: item 6-29 magnetic polarization (vector) + * symbol(s): `vec(J_m)` + * application domain: generic + * name: MagneticPolarization + * quantity dimension: M^1*T^-2*I^-1 + * measurement unit(s): T + * tensor order: 1 + * definition: `vec(J_m) = μ_0 vec(M)` where `μ_0` is the magnetic constant (item 6-26.1), and `vec(M)` is magnetization (item 6-24) + * remarks: See IEC 60050-121, item 121-11-54. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dMagneticPolarizationCoordinateFrame[1]; + } + + attribute magneticPolarizationVector: Cartesian3dMagneticPolarizationVector :> vectorQuantities; + + attribute def Cartesian3dMagneticPolarizationCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: MagneticPolarizationUnit[3]; + } + + /* IEC-80000-6 item 6-30 magnetic dipole moment */ + attribute def MagneticDipoleMomentValue :> ScalarQuantityValue { + doc + /* + * source: item 6-30 magnetic dipole moment (magnitude) + * symbol(s): `j_m`, `j` + * application domain: generic + * name: MagneticDipoleMoment + * quantity dimension: L^3*M^1*T^-2*I^-1 + * measurement unit(s): Wb*m + * tensor order: 0 + * definition: `vec(j_m) = μ_0 vec(m)` where `μ_0` is the magnetic constant (item 6-26.1), and `vec(m)` is magnetic moment (item 6-23) + * remarks: See IEC 60050-121, item 121-11-55. + */ + attribute :>> num: Real; + attribute :>> mRef: MagneticDipoleMomentUnit[1]; + } + + attribute magneticDipoleMoment: MagneticDipoleMomentValue[*] nonunique :> scalarQuantities; + + attribute def MagneticDipoleMomentUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 3; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + attribute def Cartesian3dMagneticDipoleMomentVector :> VectorQuantityValue { + doc + /* + * source: item 6-30 magnetic dipole moment (vector) + * symbol(s): `vec(j_m)`, `vec(j)` + * application domain: generic + * name: MagneticDipoleMoment + * quantity dimension: L^3*M^1*T^-2*I^-1 + * measurement unit(s): Wb*m + * tensor order: 1 + * definition: `vec(j_m) = μ_0 vec(m)` where `μ_0` is the magnetic constant (item 6-26.1), and `vec(m)` is magnetic moment (item 6-23) + * remarks: See IEC 60050-121, item 121-11-55. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dMagneticDipoleMomentCoordinateFrame[1]; + } + + attribute magneticDipoleMomentVector: Cartesian3dMagneticDipoleMomentVector :> vectorQuantities; + + attribute def Cartesian3dMagneticDipoleMomentCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: MagneticDipoleMomentUnit[3]; + } + + /* IEC-80000-6 item 6-31 coercivity */ + attribute def CoercivityValue :> ScalarQuantityValue { + doc + /* + * source: item 6-31 coercivity + * symbol(s): `H_(c,B)` + * application domain: generic + * name: Coercivity + * quantity dimension: L^-1*I^1 + * measurement unit(s): A/m + * tensor order: 0 + * definition: magnetic field strength (item 6-25) to be applied to bring the magnetic flux density (item 6-21) in a substance from its remaining magnetic flux density to zero + * remarks: See IEC 60050-121, item 121-12-69. Also called coercive field strength. + */ + attribute :>> num: Real; + attribute :>> mRef: CoercivityUnit[1]; + } + + attribute coercivity: CoercivityValue[*] nonunique :> scalarQuantities; + + attribute def CoercivityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-32 magnetic vector potential */ + attribute def MagneticVectorPotentialValue :> ScalarQuantityValue { + doc + /* + * source: item 6-32 magnetic vector potential (magnitude) + * symbol(s): `A` + * application domain: generic + * name: MagneticVectorPotential + * quantity dimension: L^1*M^1*T^-2*I^-1 + * measurement unit(s): Wb/m + * tensor order: 0 + * definition: `vec(B) = rot vec(A)` where `vec(B)` is magnetic flux density (item 6-21) + * remarks: The magnetic vector potential is not unique since any irrotational vector field can be added to it without changing its rotation. See IEC 60050-121, item 121-11-23. + */ + attribute :>> num: Real; + attribute :>> mRef: MagneticVectorPotentialUnit[1]; + } + + attribute magneticVectorPotential: MagneticVectorPotentialValue[*] nonunique :> scalarQuantities; + + attribute def MagneticVectorPotentialUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + attribute def Cartesian3dMagneticVectorPotentialVector :> VectorQuantityValue { + doc + /* + * source: item 6-32 magnetic vector potential (vector) + * symbol(s): `vec(A)` + * application domain: generic + * name: MagneticVectorPotential + * quantity dimension: L^1*M^1*T^-2*I^-1 + * measurement unit(s): Wb/m + * tensor order: 1 + * definition: `vec(B) = rot vec(A)` where `vec(B)` is magnetic flux density (item 6-21) + * remarks: The magnetic vector potential is not unique since any irrotational vector field can be added to it without changing its rotation. See IEC 60050-121, item 121-11-23. + */ + attribute :>> isBound = true; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dMagneticVectorPotentialCoordinateFrame[1]; + } + + attribute magneticVectorPotentialVector: Cartesian3dMagneticVectorPotentialVector :> vectorQuantities; + + attribute def Cartesian3dMagneticVectorPotentialCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = true; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: MagneticVectorPotentialUnit[3]; + } + + /* IEC-80000-6 item 6-33 electromagnetic energy density, volumic electromagnetic energy */ + attribute def ElectromagneticEnergyDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 6-33 electromagnetic energy density, volumic electromagnetic energy + * symbol(s): `w` + * application domain: generic + * name: ElectromagneticEnergyDensity + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): J/m^3 + * tensor order: 0 + * definition: `ω = 1/2*(vec(E)*vec(D) + vec(B) * vec(H))` where `vec(E)` is electric field strength (item 6-10), `vec(D)` is electric flux density (item 6-12), `vec(B)` is magnetic flux density (item 6-21), and `vec(H)` is magnetic field strength (item 6-25) + * remarks: See IEC 60050-121, item 121-11-65. + */ + attribute :>> num: Real; + attribute :>> mRef: ElectromagneticEnergyDensityUnit[1]; + } + + attribute electromagneticEnergyDensity: ElectromagneticEnergyDensityValue[*] nonunique :> scalarQuantities; + + attribute def ElectromagneticEnergyDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + alias VolumicElectromagneticEnergyUnit for ElectromagneticEnergyDensityUnit; + alias VolumicElectromagneticEnergyValue for ElectromagneticEnergyDensityValue; + alias volumicElectromagneticEnergy for electromagneticEnergyDensity; + + /* IEC-80000-6 item 6-34 Poynting vector */ + attribute def PoyntingVectorMagnitudeValue :> ScalarQuantityValue { + doc + /* + * source: item 6-34 Poynting vector (magnitude) + * symbol(s): `S` + * application domain: generic + * name: PoyntingVectorMagnitude + * quantity dimension: M^1*T^-3 + * measurement unit(s): W/m^2 + * tensor order: 0 + * definition: `vec(S) = vec(E) xx vec(H)` where `vec(E)` is electric field strength (item 6-10) and `vec(H)` is magnetic field strength (item 6-25) + * remarks: See IEC 60050-121, item 121-11-66. + */ + attribute :>> num: Real; + attribute :>> mRef: PoyntingVectorMagnitudeUnit[1]; + } + + attribute poyntingVectorMagnitude: PoyntingVectorMagnitudeValue[*] nonunique :> scalarQuantities; + + attribute def PoyntingVectorMagnitudeUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + attribute def Cartesian3dPoyntingVector :> VectorQuantityValue { + doc + /* + * source: item 6-34 Poynting vector + * symbol(s): `vec(S)` + * application domain: generic + * name: PoyntingVector + * quantity dimension: M^1*T^-3 + * measurement unit(s): W/m^2 + * tensor order: 1 + * definition: `vec(S) = vec(E) xx vec(H)` where `vec(E)` is electric field strength (item 6-10) and `vec(H)` is magnetic field strength (item 6-25) + * remarks: See IEC 60050-121, item 121-11-66. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dPoyntingCoordinateFrame[1]; + } + + attribute poyntingVector: Cartesian3dPoyntingVector :> vectorQuantities; + + attribute def Cartesian3dPoyntingCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: PoyntingVectorMagnitudeUnit[3]; + } + + /* IEC-80000-6 item 6-35.1 phase speed of electromagnetic waves */ + attribute def PhaseSpeedOfElectromagneticWavesValue :> ScalarQuantityValue { + doc + /* + * source: item 6-35.1 phase speed of electromagnetic waves + * symbol(s): `c` + * application domain: generic + * name: PhaseSpeedOfElectromagneticWaves + * quantity dimension: L^1*T^-1 + * measurement unit(s): m/s + * tensor order: 0 + * definition: `c = ω/k` where `ω` is angular frequency (ISO 80000-3, item 3-16) and `k` is angular wavenumber (ISO 80000-3, item 3-19) + * remarks: See ISO 80000-3, item 3-20.1. + */ + attribute :>> num: Real; + attribute :>> mRef: PhaseSpeedOfElectromagneticWavesUnit[1]; + } + + attribute phaseSpeedOfElectromagneticWaves: PhaseSpeedOfElectromagneticWavesValue[*] nonunique :> scalarQuantities; + + attribute def PhaseSpeedOfElectromagneticWavesUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* IEC-80000-6 item 6-35.2 speed of light, light speed */ + attribute def SpeedOfLightValue :> ScalarQuantityValue { + doc + /* + * source: item 6-35.2 speed of light, light speed + * symbol(s): `c_0` + * application domain: generic + * name: SpeedOfLight + * quantity dimension: L^1*T^-1 + * measurement unit(s): m/s + * tensor order: 0 + * definition: speed of electromagnetic waves in vacuum; `c_0 = 299792458` m/s + * remarks: For this value of `c_0` see ISO 80000-3, item 3-1.a. `c_0 = 1/sqrt(ε_0 μ_0)`. See IEC 60050-111, item 111-13-07. + */ + attribute :>> num: Real; + attribute :>> mRef: SpeedOfLightUnit[1]; + } + + attribute speedOfLight: SpeedOfLightValue[*] nonunique :> scalarQuantities; + + attribute def SpeedOfLightUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + alias LightSpeedUnit for SpeedOfLightUnit; + alias LightSpeedValue for SpeedOfLightValue; + alias lightSpeed for speedOfLight; + + /* IEC-80000-6 item 6-36 source voltage, source tension */ + attribute def SourceVoltageValue :> ScalarQuantityValue { + doc + /* + * source: item 6-36 source voltage, source tension + * symbol(s): `U_s` + * application domain: generic + * name: SourceVoltage + * quantity dimension: L^2*M^1*T^-3*I^-1 + * measurement unit(s): V + * tensor order: 0 + * definition: voltage (item 6-11.3) between the two terminals of a voltage source when there is no electric current (item 6-1) through the source + * remarks: The name "electromotive force" with the abbreviation EMF and the symbol `E` is deprecated. See IEC 60050-131, item 131-12-22. + */ + attribute :>> num: Real; + attribute :>> mRef: SourceVoltageUnit[1]; + } + + attribute sourceVoltage: SourceVoltageValue[*] nonunique :> scalarQuantities; + + attribute def SourceVoltageUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + alias SourceTensionUnit for SourceVoltageUnit; + alias SourceTensionValue for SourceVoltageValue; + alias sourceTension for sourceVoltage; + + /* IEC-80000-6 item 6-37.1 scalar magnetic potential */ + attribute scalarMagneticPotential: ElectricCurrentValue :> scalarQuantities { + doc + /* + * source: item 6-37.1 scalar magnetic potential + * symbol(s): `V_m`, `φ` + * application domain: generic + * name: ScalarMagneticPotential (specializes ElectricCurrent) + * quantity dimension: I^1 + * measurement unit(s): A + * tensor order: 0 + * definition: for an irrotational magnetic field strength `vec(H) = -nabla V_m` where `vec(H)` is magnetic field strength (item 6-25) + * remarks: The magnetic scalar potential is not unique since any constant scalar field can be added to it without changing its gradient. See IEC 60050-121, item 121-11-58. + */ + } + + /* IEC-80000-6 item 6-37.2 magnetic tension */ + attribute magneticTension: ElectricCurrentValue :> scalarQuantities { + doc + /* + * source: item 6-37.2 magnetic tension + * symbol(s): `U_m` + * application domain: generic + * name: MagneticTension (specializes ElectricCurrent) + * quantity dimension: I^1 + * measurement unit(s): A + * tensor order: 0 + * definition: `U_m = int_(vec(r_a) (C))^(vec(r_b)) vec(H) * d(vec(r))` where `vec(H)` is magnetic field strength (item 6-25) and `vec(r)` is position vector (ISO 80000-3, item 3-1.11) along a given curve `C` from point `a` to point `b` + * remarks: For an irrotational magnetic field strength this quantity is equal to the magnetic potential difference. See IEC 60050-121, item121-11-57. + */ + } + + /* IEC-80000-6 item 6-37.3 magnetomotive force */ + attribute def MagnetomotiveForceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-37.3 magnetomotive force + * symbol(s): `F_m` + * application domain: generic + * name: MagnetomotiveForce + * quantity dimension: I^1 + * measurement unit(s): A + * tensor order: 0 + * definition: `F_m = oint_C vec(H) * d vec(r)` where `vec(H)` is magnetic field strength (item 6-25) and `vec(r)` is position vector (ISO 80000-3, item 3-1 .11) along a closed curve `C` + * remarks: This quantity name is under consideration . Compare remark to item 6-36. See IEC 60050-121, item 121-11-60. + */ + attribute :>> num: Real; + attribute :>> mRef: MagnetomotiveForceUnit[1]; + } + + attribute magnetomotiveForce: MagnetomotiveForceValue[*] nonunique :> scalarQuantities; + + attribute def MagnetomotiveForceUnit :> DerivedUnit { + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = electricCurrentPF; } + } + + /* IEC-80000-6 item 6-37.4 current linkage */ + attribute currentLinkage: ElectricCurrentValue :> scalarQuantities { + doc + /* + * source: item 6-37.4 current linkage + * symbol(s): `Θ` + * application domain: generic + * name: CurrentLinkage (specializes ElectricCurrent) + * quantity dimension: I^1 + * measurement unit(s): A + * tensor order: 0 + * definition: net electric current (item 6-1) through a surface delimited by a closed loop + * remarks: When `Θ` results from `N` (item 6-38) equal electric currents `I` (item 6-1 ), then `Θ = N I`. See IEC 60050-121 , item 121 -11-46. + */ + } + + /* IEC-80000-6 item 6-38 number of turns in a winding */ + attribute numberOfTurnsInAWinding: CountValue :> scalarQuantities { + doc + /* + * source: item 6-38 number of turns in a winding + * symbol(s): `N` + * application domain: generic + * name: NumberOfTurnsInAWinding (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: number of turns in a winding (same as the quantity name) + * remarks: N may be non-integer number, see ISO 80000-3, item 3-14. + */ + } + + /* IEC-80000-6 item 6-39 reluctance */ + attribute def ReluctanceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-39 reluctance + * symbol(s): `R_m`, `R` + * application domain: generic + * name: Reluctance + * quantity dimension: L^-2*M^-1*T^2*I^2 + * measurement unit(s): H^-1 + * tensor order: 0 + * definition: `R_m = U_m/Φ` where `U_m` is magnetic tension (item 6-37.2) and `Φ` is magnetic flux (item 6-22 .1) + * remarks: See IEC 60050-131 , item 131-12-28. + */ + attribute :>> num: Real; + attribute :>> mRef: ReluctanceUnit[1]; + } + + attribute reluctance: ReluctanceValue[*] nonunique :> scalarQuantities; + + attribute def ReluctanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-40 permeance */ + attribute def PermeanceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-40 permeance + * symbol(s): `Λ` + * application domain: generic + * name: Permeance + * quantity dimension: L^2*M^1*T^-2*I^-2 + * measurement unit(s): H + * tensor order: 0 + * definition: `Λ = 1/R_m` where `R_m` is reluctance (item 6-39) + * remarks: See IEC 60050-131 , item 131-12-29. + */ + attribute :>> num: Real; + attribute :>> mRef: PermeanceUnit[1]; + } + + attribute permeance: PermeanceValue[*] nonunique :> scalarQuantities; + + attribute def PermeanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-41.1 inductance, self inductance */ + attribute def InductanceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-41.1 inductance, self inductance + * symbol(s): `L`, `L_m` + * application domain: generic + * name: Inductance + * quantity dimension: L^2*M^1*T^-2*I^-2 + * measurement unit(s): H + * tensor order: 0 + * definition: `L = Ψ / I` where `I` is an electric current (item 6-1) in a thin conducting loop and `Ψ` is the linked flux (item 6-22.2) caused by that electric current + * remarks: The name "self inductance" is used for the quantity associated to mutual inductance when `n = m`. See IEC 60050-131 , items 131-12-19 and 131 -12-35. + */ + attribute :>> num: Real; + attribute :>> mRef: InductanceUnit[1]; + } + + attribute inductance: InductanceValue[*] nonunique :> scalarQuantities; + + attribute def InductanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + alias SelfInductanceUnit for InductanceUnit; + alias SelfInductanceValue for InductanceValue; + alias selfInductance for inductance; + + /* IEC-80000-6 item 6-41.2 mutual inductance */ + attribute mutualInductance: InductanceValue :> scalarQuantities { + doc + /* + * source: item 6-41.2 mutual inductance + * symbol(s): `L_(mn)` + * application domain: generic + * name: MutualInductance (specializes Inductance) + * quantity dimension: L^2*M^1*T^-2*I^-2 + * measurement unit(s): H + * tensor order: 0 + * definition: `L_(mn) = Ψ_m / I_n` where `I_n` is an electric current (item 6-1) in a thin conducting loop `n` and `Ψ_m` is the linked flux (item 6-22.2) caused by that electric current in another loop `m` + * remarks: `L_(mn) = L_(nm)`. For two loops , the symbol `M` is used for `L_(12)`. See IEC 60050-131, items 131-12-36. + */ + } + + /* IEC-80000-6 item 6-42.1 coupling factor */ + attribute def CouplingFactorValue :> DimensionOneValue { + doc + /* + * source: item 6-42.1 coupling factor + * symbol(s): `k` + * application domain: generic + * name: CouplingFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for inductive coupling between two inductive elements `k = |L_(mn)| / sqrt(L_m L_n)` where `L_m` and `L_n` are their self inductances (item 6-41 .1 ), and `L_(mn)` is their mutual inductance (item 6-41.2) + * remarks: See IEC 60050-131 , item 131-12-41. + */ + } + attribute couplingFactor: CouplingFactorValue :> scalarQuantities; + + /* IEC-80000-6 item 6-42.2 leakage factor */ + attribute def LeakageFactorValue :> DimensionOneValue { + doc + /* + * source: item 6-42.2 leakage factor + * symbol(s): `σ` + * application domain: generic + * name: LeakageFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: `σ = 1 - k^2` where `k` is the coupling factor (item 6-42 .1) + * remarks: See IEC 60050-131 , item 131-12-42. + */ + } + attribute leakageFactor: LeakageFactorValue :> scalarQuantities; + + /* IEC-80000-6 item 6-43 conductivity */ + attribute def ConductivityValue :> ScalarQuantityValue { + doc + /* + * source: item 6-43 conductivity + * symbol(s): `σ`, `γ` + * application domain: generic + * name: Conductivity + * quantity dimension: L^-3*M^-1*T^3*I^2 + * measurement unit(s): S/m + * tensor order: 0 + * definition: `vec(J) = σ vec(E)` where `vec(J)` is electric current density (item 6-8) and `vec(E)` is electric field strength (item 6-10) + * remarks: This definition applies to an isotropic medium. For an anisotropic medium `σ` is a second order tensor. `κ` is used in electrochemistry. See IEC 60050-121 , item 121-12-03. + */ + attribute :>> num: Real; + attribute :>> mRef: ConductivityUnit[1]; + } + + attribute conductivity: ConductivityValue[*] nonunique :> scalarQuantities; + + attribute def ConductivityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-44 resistivity */ + attribute def ResistivityValue :> ScalarQuantityValue { + doc + /* + * source: item 6-44 resistivity + * symbol(s): `ρ` + * application domain: generic + * name: Resistivity + * quantity dimension: L^3*M^1*T^-3*I^-2 + * measurement unit(s): Ω*m + * tensor order: 0 + * definition: `ρ = 1/σ` if is exists, where `σ` is conductivity (item 6-43) + * remarks: See IEC 60050-121, item 121-12-04. + */ + attribute :>> num: Real; + attribute :>> mRef: ResistivityUnit[1]; + } + + attribute resistivity: ResistivityValue[*] nonunique :> scalarQuantities; + + attribute def ResistivityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 3; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-45 electric power, instantaneous power */ + attribute electricPower: PowerValue :> scalarQuantities { + doc + /* + * source: item 6-45 electric power, instantaneous power + * symbol(s): `p` + * application domain: generic + * name: ElectricPower (specializes Power) + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): W + * tensor order: 0 + * definition: `p = ui` where `u` is instantaneous voltage (item 6-11 .3) and `i` is instantaneous electric current (item 6-1) + * remarks: See IEC 60050-131 , item 131-11-30. + */ + } + + alias instantaneousPower for electricPower; + + /* IEC-80000-6 item 6-46 resistance */ + attribute def ResistanceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-46 resistance + * symbol(s): `R` + * application domain: generic + * name: Resistance + * quantity dimension: L^2*M^1*T^-3*I^-2 + * measurement unit(s): Ω + * tensor order: 0 + * definition: for resistive component `R = u i` where `u` is instantaneous voltage (item 6-11.3) and `i` is instantaneous electric current (item 6-1) + * remarks: For alternating current, see item 6-51.2. See IEC 60050-131, item 131-12-04. + */ + attribute :>> num: Real; + attribute :>> mRef: ResistanceUnit[1]; + } + + attribute resistance: ResistanceValue[*] nonunique :> scalarQuantities; + + attribute def ResistanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-47 conductance */ + attribute def ConductanceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-47 conductance + * symbol(s): `G` + * application domain: generic + * name: Conductance + * quantity dimension: L^-2*M^-1*T^3*I^2 + * measurement unit(s): S + * tensor order: 0 + * definition: for resistive component `G = 1/R` where `R` is resistance (item 6-46) + * remarks: For alternating current, see item 6-52.2. See IEC 60050-131, item 131-12-06. + */ + attribute :>> num: Real; + attribute :>> mRef: ConductanceUnit[1]; + } + + attribute conductance: ConductanceValue[*] nonunique :> scalarQuantities; + + attribute def ConductanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-48 phase difference */ + attribute def PhaseDifferenceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-48 phase difference + * symbol(s): `φ` + * application domain: generic + * name: PhaseDifference + * quantity dimension: 1 + * measurement unit(s): rad + * tensor order: 0 + * definition: `φ = φ_u - φ_i` where `φ_u` is the initial phase of the voltage (item 6-11 .3) and `φ_i` is the initial phase of the electric current (item 6-1) + * remarks: When `u = hat(U) cos(ωt - φ_u)`, `i = hat(I) cos(ωt - φ_i)` where `u` is the voltage (item 6-11 . 3) and `i` is the electric current (item 6-1 ), `ω` is angular frequency (ISO 80000-3, item 3-16) and `t` is time (ISO 80000-3, item 3-7), then `φ` is phase difference. For phase angle, see items 6-49 and 6-50. + */ + attribute :>> num: Real; + attribute :>> mRef: PhaseDifferenceUnit[1]; + } + + attribute phaseDifference: PhaseDifferenceValue[*] nonunique :> scalarQuantities; + + attribute def PhaseDifferenceUnit :> DimensionOneUnit { + } + + /* IEC-80000-6 item 6-49 electric current phasor */ + attribute electricCurrentPhasor: ElectricCurrentValue :> scalarQuantities { + doc + /* + * source: item 6-49 electric current phasor + * symbol(s): `underline(I)` + * application domain: generic + * name: ElectricCurrentPhasor (specializes ElectricCurrent) + * quantity dimension: I^1 + * measurement unit(s): A + * tensor order: 0 + * definition: when `i = hat(I) cos(ωt + α)`, where `i` is the electric current (item 6-1 ), `ω` is angular frequency (ISO 80000-3, item 3-16), `t` is time (ISO 80000-3, item 3-7), and `α` is initial phase (ISO 80000-3, item 3-5), then `underline(l) = I e^(jα)` + * remarks: `underline(l)` is the complex representation of the electric current `i = hat(I) cos(ωt + α)`. `j` is the imaginary unit. + */ + } + + /* IEC-80000-6 item 6-50 voltage phasor */ + attribute voltagePhasor: ElectricPotentialDifferenceValue :> scalarQuantities { + doc + /* + * source: item 6-50 voltage phasor + * symbol(s): `underline(U)` + * application domain: generic + * name: VoltagePhasor (specializes ElectricPotentialDifference) + * quantity dimension: L^2*M^1*T^-3*I^-1 + * measurement unit(s): V + * tensor order: 0 + * definition: when `u = hat(U) cos(ωt + α)`, where `u` is the voltage (item 6-11.3 ), `ω` is angular frequency (ISO 80000-3, item 3-16), `t` is time (ISO 80000-3, item 3-7), and `α` is initial phase (ISO 80000-3, item 3-5), then `underline(U) = U e^(jα)` + * remarks: `underline(U)` is the complex representation of the voltage `u = hat(U) cos(ωt + α)`. `j` is the imaginary unit. + */ + } + + /* IEC-80000-6 item 6-51.1 impedance, complex impedance */ + attribute def ImpedanceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-51.1 impedance, complex impedance + * symbol(s): `underline(Z)` + * application domain: generic + * name: Impedance + * quantity dimension: L^2*M^1*T^-3*I^-2 + * measurement unit(s): Ω + * tensor order: 0 + * definition: `underline(Z) = underline(U)/underline(I)` where `underline(U)` is the voltage phasor (item 6-50), and `underline(I)` is the electric current phasor (item 6-49) + * remarks: `underline(Z) = R + jX`, where `R` is resistance (item 6-51.2) and `X` is reactance (item 6-51 .3). `j` is the imaginary unit. `underline(Z) = |underline(Z)| e^(jφ)`. See IEC 60050-131 , item 131-12-43. + */ + attribute :>> num: Real; + attribute :>> mRef: ImpedanceUnit[1]; + } + + attribute impedance: ImpedanceValue[*] nonunique :> scalarQuantities; + + attribute def ImpedanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + alias ComplexImpedanceUnit for ImpedanceUnit; + alias ComplexImpedanceValue for ImpedanceValue; + alias complexImpedance for impedance; + + /* IEC-80000-6 item 6-51.2 resistance to alternating current */ + attribute def ResistanceToAlternatingCurrentValue :> ScalarQuantityValue { + doc + /* + * source: item 6-51.2 resistance to alternating current + * symbol(s): `R` + * application domain: generic + * name: ResistanceToAlternatingCurrent + * quantity dimension: L^2*M^1*T^-3*I^-2 + * measurement unit(s): Ω + * tensor order: 0 + * definition: `R = "Re" underline(Z)` where `underline(Z)`, is impedance (item 6-5.1) and `"Re"` denotes the real part + * remarks: See IEC 60050-131, item 131-12-45. + */ + attribute :>> num: Real; + attribute :>> mRef: ResistanceToAlternatingCurrentUnit[1]; + } + + attribute resistanceToAlternatingCurrent: ResistanceToAlternatingCurrentValue[*] nonunique :> scalarQuantities; + + attribute def ResistanceToAlternatingCurrentUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-51.3 reactance */ + attribute def ReactanceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-51.3 reactance + * symbol(s): `X` + * application domain: generic + * name: Reactance + * quantity dimension: L^2*M^1*T^-3*I^-2 + * measurement unit(s): Ω + * tensor order: 0 + * definition: `X = "Im" underline(Z)` where `underline(Z)`, is impedance (item 6-5.1) and `"Im"` denotes the imaginary part + * remarks: `X = ωL - 1/(ωC)`. See IEC 60050-131 , item 131-12-46. + */ + attribute :>> num: Real; + attribute :>> mRef: ReactanceUnit[1]; + } + + attribute reactance: ReactanceValue[*] nonunique :> scalarQuantities; + + attribute def ReactanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-51.4 modulus of impedance */ + attribute def ModulusOfImpedanceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-51.4 modulus of impedance + * symbol(s): `Z` + * application domain: generic + * name: ModulusOfImpedance + * quantity dimension: L^2*M^1*T^-3*I^-2 + * measurement unit(s): Ω + * tensor order: 0 + * definition: `Z = |underline(Z)|` where `underline(Z)` is impedance (item 6-51.1) + * remarks: See IEC 60050-131 , item 131-12-44. Apparent impedance is defined more generally as the quotient of rms voltage and rms electric current; it is often denoted by `Z`. + */ + attribute :>> num: Real; + attribute :>> mRef: ModulusOfImpedanceUnit[1]; + } + + attribute modulusOfImpedance: ModulusOfImpedanceValue[*] nonunique :> scalarQuantities; + + attribute def ModulusOfImpedanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-52.1 admittance, complex admittance */ + attribute def AdmittanceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-52.1 admittance, complex admittance + * symbol(s): `underline(Y)` + * application domain: generic + * name: Admittance + * quantity dimension: L^-2*M^-1*T^3*I^2 + * measurement unit(s): S + * tensor order: 0 + * definition: `underline(Y) = 1/underline(Z)` where `underline(Z)` is impedance (item 6-51.1) + * remarks: `underline(Y) = G + jB`, where `G` is conductance (item 6-52 .2) and `B` is susceptance (item 6-52 .3). `j` is the imaginary unit. `underline(Y) = |underline(Y)| e^-(jφ)`. See IEC 60050-131, item 131 -12-51. + */ + attribute :>> num: Real; + attribute :>> mRef: AdmittanceUnit[1]; + } + + attribute admittance: AdmittanceValue[*] nonunique :> scalarQuantities; + + attribute def AdmittanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + alias ComplexAdmittanceUnit for AdmittanceUnit; + alias ComplexAdmittanceValue for AdmittanceValue; + alias complexAdmittance for admittance; + + /* IEC-80000-6 item 6-52.2 conductance for alternating current */ + attribute conductanceForAlternatingCurrent: ConductanceValue :> scalarQuantities { + doc + /* + * source: item 6-52.2 conductance for alternating current + * symbol(s): `G` + * application domain: generic + * name: ConductanceForAlternatingCurrent (specializes Conductance) + * quantity dimension: L^-2*M^-1*T^3*I^2 + * measurement unit(s): S + * tensor order: 0 + * definition: `G = "Re" underline(Y)` where I is admittance (item 6-52.1) + * remarks: See IEC 60050-131, item 131-12-53. + */ + } + + /* IEC-80000-6 item 6-52.3 susceptance */ + attribute def SusceptanceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-52.3 susceptance + * symbol(s): `B` + * application domain: generic + * name: Susceptance + * quantity dimension: L^-2*M^-1*T^3*I^2 + * measurement unit(s): S + * tensor order: 0 + * definition: `B = "Im" underline(Y)` where `underline(Y)` is admittance (item 6-52.1) + * remarks: See IEC 60050-131, item 131-12-54. + */ + attribute :>> num: Real; + attribute :>> mRef: SusceptanceUnit[1]; + } + + attribute susceptance: SusceptanceValue[*] nonunique :> scalarQuantities; + + attribute def SusceptanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-52.4 modulus of admittance */ + attribute def ModulusOfAdmittanceValue :> ScalarQuantityValue { + doc + /* + * source: item 6-52.4 modulus of admittance + * symbol(s): `Y` + * application domain: generic + * name: ModulusOfAdmittance + * quantity dimension: L^-2*M^-1*T^3*I^2 + * measurement unit(s): S + * tensor order: 0 + * definition: `Y = |underline(Y)|` where `underline(Y)` is admittance (item 6-52.1) + * remarks: Apparent admittance is defined more generally as the quotient of rms electric current voltage and rms voltage; it is often denoted by `Y`. + */ + attribute :>> num: Real; + attribute :>> mRef: ModulusOfAdmittanceUnit[1]; + } + + attribute modulusOfAdmittance: ModulusOfAdmittanceValue[*] nonunique :> scalarQuantities; + + attribute def ModulusOfAdmittanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 3; } + private attribute electricCurrentPF: QuantityPowerFactor[1] { :>> quantity = isq.I; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, electricCurrentPF); } + } + + /* IEC-80000-6 item 6-53 quality factor */ + attribute def QualityFactorValue :> DimensionOneValue { + doc + /* + * source: item 6-53 quality factor + * symbol(s): `Q` + * application domain: generic + * name: QualityFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: for non-radiating systems, if `underline(Z) = R + jX`, then `Q = |X|/R` where `underline(Z)` is impedance (item 6-51. 1), `R` is resistance (item 6-51 .2), and `X` is reactance (item 6-51.3) + * remarks: None. + */ + } + attribute qualityFactor: QualityFactorValue :> scalarQuantities; + + /* IEC-80000-6 item 6-54 loss factor */ + attribute def LossFactorValue :> DimensionOneValue { + doc + /* + * source: item 6-54 loss factor + * symbol(s): `d` + * application domain: generic + * name: LossFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: `d = 1/Q` where `Q` quality factor (item 6-53) + * remarks: It is also named dissipation factor. + */ + } + attribute lossFactor: LossFactorValue :> scalarQuantities; + + /* IEC-80000-6 item 6-55 loss angle */ + attribute lossAngle: AngularMeasureValue :> scalarQuantities { + doc + /* + * source: item 6-55 loss angle + * symbol(s): `δ` + * application domain: generic + * name: LossAngle (specializes AngularMeasure) + * quantity dimension: 1 + * measurement unit(s): rad + * tensor order: 0 + * definition: `δ = arctan d` where `d` is loss factor (item 6-54) + * remarks: See IEC 60050-131 , item 131-12-49. + */ + } + + /* IEC-80000-6 item 6-56 active power */ + attribute activePower: PowerValue :> scalarQuantities { + doc + /* + * source: item 6-56 active power + * symbol(s): `P` + * application domain: generic + * name: ActivePower (specializes Power) + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): W + * tensor order: 0 + * definition: `P = 1/T int_0^T p dt` where `T` is the period (ISO 80000-3, item 3-12) and `p` is instantaneous power (item 6-45) + * remarks: In complex notation, `P = "Re" underline(S)` where `underline(S)` is complex power (item 6-59). + */ + } + + /* IEC-80000-6 item 6-57 apparent power */ + attribute apparentPower: PowerValue :> scalarQuantities { + doc + /* + * source: item 6-57 apparent power + * symbol(s): ``, `underline(S)`, `` + * application domain: generic + * name: ApparentPower (specializes Power) + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): V*A + * tensor order: 0 + * definition: `|underline(S)| = U I` where `U` is rms value of voltage (item 6-11.3 and `I` is rms value of electric current (item 6-1) + * remarks: `U = sqrt(1/T int_0^T u^2 dt)` and `I = sqrt(1/T int_0^T i^2 dt)`. When `u = sqrt 2 U cos(ωt)` and `i = sqrt 2 I cos(ωt - φ)`, then `P = U I cos(φ)`, `Q = U I sin(φ)` and `λ = cos(φ)` . See IEC 60050-131, item 131-11-41 . + */ + } + + /* IEC-80000-6 item 6-58 power factor */ + attribute def PowerFactorValue :> DimensionOneValue { + doc + /* + * source: item 6-58 power factor + * symbol(s): `λ` + * application domain: generic + * name: PowerFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: `λ = |P|/|S|` where `P` is active power (item 6-56) and `S` is apparent power (item 6-57) + * remarks: See I EC 60050-131, item 131-11-46. + */ + } + attribute powerFactor: PowerFactorValue :> scalarQuantities; + + /* IEC-80000-6 item 6-59 complex power */ + attribute complexPower: PowerValue :> scalarQuantities { + doc + /* + * source: item 6-59 complex power + * symbol(s): `underline(S)` + * application domain: generic + * name: ComplexPower (specializes Power) + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): V*A + * tensor order: 0 + * definition: `underline(S) = underline(U) * underline(I)^"*"` where `underline(U)` is voltage phasor (item 6-50) and `underline(I)^"*"` is the complex conjugate of the current phasor (item 6-49) + * remarks: `underline(S) = P + jQ` where `P` is active power (item 6-56) and `Q` is reactive power (item 6-60). See IEC 60050-131, item 131-11-39. + */ + } + + /* IEC-80000-6 item 6-60 reactive power */ + attribute reactivePower: PowerValue :> scalarQuantities { + doc + /* + * source: item 6-60 reactive power + * symbol(s): `Q` + * application domain: generic + * name: ReactivePower (specializes Power) + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): V*A, var + * tensor order: 0 + * definition: `Q = "Im" underline(S)` where `underline(S)` is complex power (item 6-59) + * remarks: See IEC 60050-131, item 131-11-44. + */ + } + + /* IEC-80000-6 item 6-61 non-active power */ + attribute nonActivePower: PowerValue :> scalarQuantities { + doc + /* + * source: item 6-61 non-active power + * symbol(s): `Q'` + * application domain: generic + * name: NonActivePower (specializes Power) + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): V*A + * tensor order: 0 + * definition: `Q' = sqrt(|underline(S)|^2 - P^2)` where `|underline(S)|` is apparent power (item 6-57) and `P` is active power (item 6-56) + * remarks: See IEC 60050-131, item 131-11-43. + */ + } + + /* IEC-80000-6 item 6-62 active energy */ + attribute activeEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 6-62 active energy + * symbol(s): `W` + * application domain: generic + * name: ActiveEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, W*h + * tensor order: 0 + * definition: `W = int_(t_1)^(t_2) p dt` where `p` is instantaneous power (item 6-45), and the integral interval is the time interval from `t_1` to `t_2` + * remarks: None. + */ + } + +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml new file mode 100644 index 0000000000000000000000000000000000000000..bda0a7444b0ba8a59f57f8bfeffbd82a441b6cfb --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml @@ -0,0 +1,958 @@ +standard library package ISQInformation { + doc + /* + * International System of Quantities and Units + * Generated on 2022-08-07T14:44:27Z from standard IEC-80000-13:2008 "Information science and technology" + * see also https://www.iso.org/obp/ui/#iso:std:iec:80000:-13:ed-1:v1:en + * + * Note 1: In documentation comments, AsciiMath notation (see http://asciimath.org/) is used for mathematical concepts, + * with Greek letters in Unicode encoding. In running text, AsciiMath is placed between backticks. + * Note 2: For vector and tensor quantities currently the unit and quantity value type for their (scalar) magnitude is + * defined, as well as their typical Cartesian 3d VectorMeasurementReference (i.e. coordinate system) + * or TensorMeasurementReference. + */ + + private import ScalarValues::Real; + private import Quantities::*; + private import MeasurementReferences::*; + private import ISQBase::*; + + /* Quantity definitions referenced from other ISQ packages */ + private import ISQMechanics::PowerValue; + private import ISQSpaceTime::FrequencyValue; + private import ISQThermodynamics::EnergyValue; + + /* IEC-80000-13 item 13-1 traffic intensity */ + attribute def TrafficIntensityValue :> ScalarQuantityValue { + doc + /* + * source: item 13-1 traffic intensity + * symbol(s): `A` + * application domain: generic + * name: TrafficIntensity + * quantity dimension: 1 + * measurement unit(s): E + * tensor order: 0 + * definition: number of simultaneously busy resources in a particular pool of resources + * remarks: See IEC 60050-715, item 715-05-02. The name "erlang" was given to the traffic intensity unit in 1946 by the CCIF, in honour of the Danish mathematician, A. K. Erlang (1878-1929), who was the founder of traffic theory in telephony. + */ + attribute :>> num: Real; + attribute :>> mRef: TrafficIntensityUnit[1]; + } + + attribute trafficIntensity: TrafficIntensityValue[*] nonunique :> scalarQuantities; + + attribute def TrafficIntensityUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-2 traffic offered intensity */ + attribute def TrafficOfferedIntensityValue :> ScalarQuantityValue { + doc + /* + * source: item 13-2 traffic offered intensity + * symbol(s): `A_o` + * application domain: generic + * name: TrafficOfferedIntensity + * quantity dimension: 1 + * measurement unit(s): E + * tensor order: 0 + * definition: traffic intensity (item 13-1) of the traffic that would have been generated by the users of a pool of resources if their use had not been limited by the size of the pool + * remarks: See IEC 60050-715, item 715-05-05. See 13-1 for unit E. + */ + attribute :>> num: Real; + attribute :>> mRef: TrafficOfferedIntensityUnit[1]; + } + + attribute trafficOfferedIntensity: TrafficOfferedIntensityValue[*] nonunique :> scalarQuantities; + + attribute def TrafficOfferedIntensityUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-3 traffic carried intensity, traffic load */ + attribute def TrafficCarriedIntensityValue :> ScalarQuantityValue { + doc + /* + * source: item 13-3 traffic carried intensity, traffic load + * symbol(s): `Y` + * application domain: generic + * name: TrafficCarriedIntensity + * quantity dimension: 1 + * measurement unit(s): E + * tensor order: 0 + * definition: traffic intensity (item 13-1) of the traffic served by a particular pool of resources + * remarks: General practice is to estimate the traffic intensity as an average over a specified time interval, e.g. the busy hour. See IEC 60050-715, item 715-05-04. See 13-1 for unit E. + */ + attribute :>> num: Real; + attribute :>> mRef: TrafficCarriedIntensityUnit[1]; + } + + attribute trafficCarriedIntensity: TrafficCarriedIntensityValue[*] nonunique :> scalarQuantities; + + attribute def TrafficCarriedIntensityUnit :> DimensionOneUnit { + } + + alias TrafficLoadUnit for TrafficCarriedIntensityUnit; + alias TrafficLoadValue for TrafficCarriedIntensityValue; + alias trafficLoad for trafficCarriedIntensity; + + /* IEC-80000-13 item 13-4 mean queue length */ + attribute def MeanQueueLengthValue :> DimensionOneValue { + doc + /* + * source: item 13-4 mean queue length + * symbol(s): `L`, `(Ω)` + * application domain: generic + * name: MeanQueueLength (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: time average of queue length + * remarks: None. + */ + } + attribute meanQueueLength: MeanQueueLengthValue :> scalarQuantities; + + /* IEC-80000-13 item 13-5 loss probability */ + attribute def LossProbabilityValue :> DimensionOneValue { + doc + /* + * source: item 13-5 loss probability + * symbol(s): `B` + * application domain: generic + * name: LossProbability (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: probability for losing a call attempt + * remarks: None. + */ + } + attribute lossProbability: LossProbabilityValue :> scalarQuantities; + + /* IEC-80000-13 item 13-6 waiting probability */ + attribute def WaitingProbabilityValue :> DimensionOneValue { + doc + /* + * source: item 13-6 waiting probability + * symbol(s): `W` + * application domain: generic + * name: WaitingProbability (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: probability for waiting for a resource + * remarks: None. + */ + } + attribute waitingProbability: WaitingProbabilityValue :> scalarQuantities; + + /* IEC-80000-13 item 13-7 call intensity, calling rate */ + attribute def CallIntensityValue :> ScalarQuantityValue { + doc + /* + * source: item 13-7 call intensity, calling rate + * symbol(s): `λ` + * application domain: generic + * name: CallIntensity + * quantity dimension: T^-1 + * measurement unit(s): s^-1 + * tensor order: 0 + * definition: number of call attempts over a specified time interval divided by the duration (ISO 80000-3, item 3-7) of this interval + * remarks: See IEC 60050-715, item 715-03-13. + */ + attribute :>> num: Real; + attribute :>> mRef: CallIntensityUnit[1]; + } + + attribute callIntensity: CallIntensityValue[*] nonunique :> scalarQuantities; + + attribute def CallIntensityUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + alias CallingRateUnit for CallIntensityUnit; + alias CallingRateValue for CallIntensityValue; + alias callingRate for callIntensity; + + /* IEC-80000-13 item 13-8 completed call intensity */ + attribute def CompletedCallIntensityValue :> ScalarQuantityValue { + doc + /* + * source: item 13-8 completed call intensity + * symbol(s): `μ` + * application domain: generic + * name: CompletedCallIntensity + * quantity dimension: T^-1 + * measurement unit(s): s^-1 + * tensor order: 0 + * definition: call intensity (item 13-7) for the call attempts that result in the transmission of an answer signal + * remarks: For a definition of the complete call attempt, see IEC 60050-715, item 715-03-11. + */ + attribute :>> num: Real; + attribute :>> mRef: CompletedCallIntensityUnit[1]; + } + + attribute completedCallIntensity: CompletedCallIntensityValue[*] nonunique :> scalarQuantities; + + attribute def CompletedCallIntensityUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + /* IEC-80000-13 item 13-9 storage capacity, storage size */ + attribute def StorageCapacityValue :> ScalarQuantityValue { + doc + /* + * source: item 13-9 storage capacity, storage size + * symbol(s): `M` + * application domain: generic + * name: StorageCapacity + * quantity dimension: 1 + * measurement unit(s): bit, o, B, 1 + * tensor order: 0 + * definition: amount of data that can be contained in a storage device, expressed as a number of specified data elements + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: StorageCapacityUnit[1]; + } + + attribute storageCapacity: StorageCapacityValue[*] nonunique :> scalarQuantities; + + attribute def StorageCapacityUnit :> DimensionOneUnit { + } + + alias StorageSizeUnit for StorageCapacityUnit; + alias StorageSizeValue for StorageCapacityValue; + alias storageSize for storageCapacity; + + /* IEC-80000-13 item 13-10 equivalent binary storage capacity */ + attribute def EquivalentBinaryStorageCapacityValue :> ScalarQuantityValue { + doc + /* + * source: item 13-10 equivalent binary storage capacity + * symbol(s): `M_e` + * application domain: generic + * name: EquivalentBinaryStorageCapacity + * quantity dimension: 1 + * measurement unit(s): bit, 1 + * tensor order: 0 + * definition: `M_e = log_2 n` where `n` is the number of possible states of the given device + * remarks: The minimum storage capacity of a bit-organized storage device which would contain the amount of data in the given storage device is equal to the smallest integer greater than or equal to the equivalent binary storage capacity. + */ + attribute :>> num: Real; + attribute :>> mRef: EquivalentBinaryStorageCapacityUnit[1]; + } + + attribute equivalentBinaryStorageCapacity: EquivalentBinaryStorageCapacityValue[*] nonunique :> scalarQuantities; + + attribute def EquivalentBinaryStorageCapacityUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-11 transfer rate */ + attribute def TransferRateValue :> ScalarQuantityValue { + doc + /* + * source: item 13-11 transfer rate + * symbol(s): `r`, `(ν)` + * application domain: generic + * name: TransferRate + * quantity dimension: T^-1 + * measurement unit(s): o/s, B/s, s^-1 + * tensor order: 0 + * definition: quotient of the number of specified data elements transferred in a time interval by the duration of this interval + * remarks: The symbol `ν` is the Greek letter nu. A subscript referring to a specified data element can be added to the symbol. EXAMPLES: digit rate, `r_d` or `ν_d` (see IEC 60050-702 and 60050-704, items 702-05-23 and 704-16-06); transfer rate for octets (or bytes), `r_o`, `r_B`, `ν_o`, or `ν_B`; binary digit rate or bit rate (item 13-13). + */ + attribute :>> num: Real; + attribute :>> mRef: TransferRateUnit[1]; + } + + attribute transferRate: TransferRateValue[*] nonunique :> scalarQuantities; + + attribute def TransferRateUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + /* IEC-80000-13 item 13-12 period of data elements */ + attribute periodOfDataElements: DurationValue :> scalarQuantities { + doc + /* + * source: item 13-12 period of data elements + * symbol(s): `T` + * application domain: generic + * name: PeriodOfDataElements (specializes Duration) + * quantity dimension: T^1 + * measurement unit(s): s + * tensor order: 0 + * definition: `T = 1/r`, where `r` is transfer rate (item 13-11) when the data elements are transmitted in series + * remarks: A subscript referring to a specified data element can be added to the symbol. EXAMPLES: period of digits, `T_d`; period of octets (or bytes), `T_o` or `T_B`. + */ + } + + /* IEC-80000-13 item 13-13 binary digit rate, bit rate */ + attribute def BinaryDigitRateValue :> ScalarQuantityValue { + doc + /* + * source: item 13-13 binary digit rate, bit rate + * symbol(s): `r_b`, `r_"bit"`, `(ν_b)`, `(ν_"bit")` + * application domain: generic + * name: BinaryDigitRate + * quantity dimension: T^-1 + * measurement unit(s): bit/s, s^-1 + * tensor order: 0 + * definition: transfer rate (item 13-11) where the data elements are binary digits + * remarks: In English, the systematic name would be "transfer rate for binary digits". See IEC 60050-704, item 704-16-07. The bit per second may be combined with prefixes, for example megabit per second, symbol Mbit/s. + */ + attribute :>> num: Real; + attribute :>> mRef: BinaryDigitRateUnit[1]; + } + + attribute binaryDigitRate: BinaryDigitRateValue[*] nonunique :> scalarQuantities; + + attribute def BinaryDigitRateUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + alias BitRateUnit for BinaryDigitRateUnit; + alias BitRateValue for BinaryDigitRateValue; + alias bitRate for binaryDigitRate; + + /* IEC-80000-13 item 13-14 period of binary digits, bit period */ + attribute periodOfBinaryDigits: DurationValue :> scalarQuantities { + doc + /* + * source: item 13-14 period of binary digits, bit period + * symbol(s): `T_b`, `T_"bit"` + * application domain: generic + * name: PeriodOfBinaryDigits (specializes Duration) + * quantity dimension: T^1 + * measurement unit(s): s + * tensor order: 0 + * definition: `T_b = 1/r_b`, where `r_b` is the binary digit rate (item 13-13) when the binary digits are transmitted in series + * remarks: None. + */ + } + + alias bitPeriod for periodOfBinaryDigits; + + /* IEC-80000-13 item 13-15 equivalent binary digit rate, equivalent bit rate */ + attribute def EquivalentBinaryDigitRateValue :> ScalarQuantityValue { + doc + /* + * source: item 13-15 equivalent binary digit rate, equivalent bit rate + * symbol(s): `r_e`, `(ν_e)` + * application domain: generic + * name: EquivalentBinaryDigitRate + * quantity dimension: T^-1 + * measurement unit(s): bit/s, s^-1 + * tensor order: 0 + * definition: binary digit rate (item 13-13) equivalent to a transfer rate (item 13-11) for specified data elements + * remarks: In English, the systematic name would be "equivalent binary transfer rate". See IEC 60050-704, item 704-17-05. + */ + attribute :>> num: Real; + attribute :>> mRef: EquivalentBinaryDigitRateUnit[1]; + } + + attribute equivalentBinaryDigitRate: EquivalentBinaryDigitRateValue[*] nonunique :> scalarQuantities; + + attribute def EquivalentBinaryDigitRateUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + alias EquivalentBitRateUnit for EquivalentBinaryDigitRateUnit; + alias EquivalentBitRateValue for EquivalentBinaryDigitRateValue; + alias equivalentBitRate for equivalentBinaryDigitRate; + + /* IEC-80000-13 item 13-16 modulation rate, line digit rate */ + attribute def ModulationRateValue :> ScalarQuantityValue { + doc + /* + * source: item 13-16 modulation rate, line digit rate + * symbol(s): `r_m`, `u` + * application domain: generic + * name: ModulationRate + * quantity dimension: T^-1 + * measurement unit(s): Bd, s^-1 + * tensor order: 0 + * definition: inverse of the shortest duration of a signal element + * remarks: The term “modulation rate” is used in conventional telegraphy and data transmission. In isochronous digital transmission, the term "line digit rate" is generally used. See IEC 60050-704, item 704-17-03. Baud is a special name for the second to the power minus one for this quantity. The baud may be combined with prefixes, for example kilobaud, symbol kBd, megabaud, symbol MBd. + */ + attribute :>> num: Real; + attribute :>> mRef: ModulationRateUnit[1]; + } + + attribute modulationRate: ModulationRateValue[*] nonunique :> scalarQuantities; + + attribute def ModulationRateUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + alias LineDigitRateUnit for ModulationRateUnit; + alias LineDigitRateValue for ModulationRateValue; + alias lineDigitRate for modulationRate; + + /* IEC-80000-13 item 13-17 quantizing distortion rate */ + attribute quantizingDistortionRate: PowerValue :> scalarQuantities { + doc + /* + * source: item 13-17 quantizing distortion rate + * symbol(s): `T_Q` + * application domain: generic + * name: QuantizingDistortionRate (specializes Power) + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): W + * tensor order: 0 + * definition: distortion of a signal resulting from the process of quantizing an original signal when the values to be quantized are within the working range of the quantizer + * remarks: See IEC 60050-704, item 704-24-13. + */ + } + + /* IEC-80000-13 item 13-18 carrier power */ + attribute carrierPower: PowerValue :> scalarQuantities { + doc + /* + * source: item 13-18 carrier power + * symbol(s): `P_c`, `C` + * application domain: generic + * name: CarrierPower (specializes Power) + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): W + * tensor order: 0 + * definition: power supplied to the antenna feed line by a radio transmitter taken under the condition of no modulation + * remarks: See IEC 60050-713, item 713-09-20. + */ + } + + /* IEC-80000-13 item 13-19 signal energy per binary digit */ + attribute signalEnergyPerBinaryDigit: EnergyValue :> scalarQuantities { + doc + /* + * source: item 13-19 signal energy per binary digit + * symbol(s): `E_b`, `E_"bit"` + * application domain: generic + * name: SignalEnergyPerBinaryDigit (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J + * tensor order: 0 + * definition: `E_b = P_c*T_b`, where `P_c` is carrier power (item 13-18) and `T_b` is period of binary digits (item 13-14) + * remarks: None. + */ + } + + /* IEC-80000-13 item 13-20 error probability */ + attribute def ErrorProbabilityValue :> DimensionOneValue { + doc + /* + * source: item 13-20 error probability + * symbol(s): `P` + * application domain: generic + * name: ErrorProbability (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: probability that a data element be incorrectly received + * remarks: A subscript referring to a specified data element can be added to the symbol. EXAMPLES: error probability for binary digits or bit error probability, `P_b` or `P_bit`; block error probability, `P_bl`. The measured value is designated as "error ratio", whereas "error rate" is deprecated, for example, bit error ratio (BER), block error ratio. See IEC 60050-704 and IEC 60050-721. + */ + } + attribute errorProbability: ErrorProbabilityValue :> scalarQuantities; + + /* IEC-80000-13 item 13-21 Hamming distance */ + attribute hammingDistance: CountValue :> scalarQuantities { + doc + /* + * source: item 13-21 Hamming distance + * symbol(s): `d_n` + * application domain: generic + * name: HammingDistance (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: number of digit positions in which the corresponding digits of two words of the same length are different + * remarks: See IEC 60050-721, item 721-08-25. + */ + } + + /* IEC-80000-13 item 13-22 clock frequency, clock rate */ + attribute clockFrequency: FrequencyValue :> scalarQuantities { + doc + /* + * source: item 13-22 clock frequency, clock rate + * symbol(s): `f_"cl"` + * application domain: generic + * name: ClockFrequency (specializes Frequency) + * quantity dimension: T^-1 + * measurement unit(s): Hz + * tensor order: 0 + * definition: frequency at which a clock oscillates + * remarks: None. + */ + } + + alias clockRate for clockFrequency; + + /* IEC-80000-13 item 13-23 decision content */ + attribute def DecisionContentValue :> DimensionOneValue { + doc + /* + * source: item 13-23 decision content + * symbol(s): `D_a` + * application domain: generic + * name: DecisionContent (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: `D_a` = `log_a n`, where `a` is the number of possibilities at each decision and `n` the number of events + * remarks: See ISO/IEC 2382-16, item 16.03.01. See also IEC 60027-3. When the same base is used for the same number of events then `D_a = H_0` , where `H_0` is maximum entropy (item 13-28). + */ + } + attribute decisionContent: DecisionContentValue :> scalarQuantities; + + /* IEC-80000-13 item 13-24 information content */ + attribute def InformationContentValue :> ScalarQuantityValue { + doc + /* + * source: item 13-24 information content + * symbol(s): `I(x)` + * application domain: generic + * name: InformationContent + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: `I(x) = log_2(1/(p(x)))` Sh `= log(1/(p(x)))` Hart `= ln(1/(p(x)))` nat, where `p(x)` is the probability of event `x` + * remarks: See ISO/IEC 2382-16, item 16.03.02. See also IEC 60027-3. + */ + attribute :>> num: Real; + attribute :>> mRef: InformationContentUnit[1]; + } + + attribute informationContent: InformationContentValue[*] nonunique :> scalarQuantities; + + attribute def InformationContentUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-25 entropy */ + attribute def EntropyForInformationScienceValue :> ScalarQuantityValue { + doc + /* + * source: item 13-25 entropy + * symbol(s): `H` + * application domain: information science + * name: Entropy + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: `H(X) = sum_(i=1)^n p(x_i) I(x_i)` for the set `X = {x_1, ..., x_n}`, where `p(x_i)` is the probability and `I(x_i)` is the information content of event `x_i` + * remarks: See ISO/IEC 2382-16, item 16.03.02. See also IEC 60027-3. + */ + attribute :>> num: Real; + attribute :>> mRef: EntropyForInformationScienceUnit[1]; + } + + attribute entropyForInformationScience: EntropyForInformationScienceValue[*] nonunique :> scalarQuantities; + + attribute def EntropyForInformationScienceUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-26 maximum entropy */ + attribute def MaximumEntropyValue :> ScalarQuantityValue { + doc + /* + * source: item 13-26 maximum entropy + * symbol(s): `H_0`, `H_"max"` + * application domain: information science + * name: MaximumEntropy + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: maximum entropy occurs when `p(x_i) = 1/n` for `i = 1, ..., n` + * remarks: The maximum entropy is sometimes called "decision content" because the value is the same when the base is an integer, for the same number of events. See item 13-23. + */ + attribute :>> num: Real; + attribute :>> mRef: MaximumEntropyUnit[1]; + } + + attribute maximumEntropy: MaximumEntropyValue[*] nonunique :> scalarQuantities; + + attribute def MaximumEntropyUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-27 relative entropy */ + attribute def RelativeEntropyValue :> DimensionOneValue { + doc + /* + * source: item 13-27 relative entropy + * symbol(s): `H_r` + * application domain: information science + * name: RelativeEntropy (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: `H_r = H / H_0`, where `H` is entropy (item 13-25) and `H_0` is maximum entropy (item 13-26) + * remarks: See ISO/IEC 2382-16, item 16.03.04. + */ + } + attribute relativeEntropy: RelativeEntropyValue :> scalarQuantities; + + /* IEC-80000-13 item 13-28 redundancy */ + attribute def RedundancyValue :> ScalarQuantityValue { + doc + /* + * source: item 13-28 redundancy + * symbol(s): `R` + * application domain: information science + * name: Redundancy + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: `R = H_0 − H`, where `H` is entropy (item 13-25) and `H_0` is maximum entropy (item 13-26) + * remarks: See ISO/IEC 2382-16, item 16.03.05. + */ + attribute :>> num: Real; + attribute :>> mRef: RedundancyUnit[1]; + } + + attribute redundancy: RedundancyValue[*] nonunique :> scalarQuantities; + + attribute def RedundancyUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-29 relative redundancy */ + attribute def RelativeRedundancyValue :> DimensionOneValue { + doc + /* + * source: item 13-29 relative redundancy + * symbol(s): `r` + * application domain: information science + * name: RelativeRedundancy (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: `r = R / H_0`, where `R` is redundancy (item 13-28) and `H_0` is maximum entropy (item 13-26) + * remarks: See ISO/IEC 2382-16, item 16.04.01. + */ + } + attribute relativeRedundancy: RelativeRedundancyValue :> scalarQuantities; + + /* IEC-80000-13 item 13-30 joint information content */ + attribute def JointInformationContentValue :> ScalarQuantityValue { + doc + /* + * source: item 13-30 joint information content + * symbol(s): `I(x,y)` + * application domain: generic + * name: JointInformationContent + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: `I(x,y) = log_2(1/(p(x,y)))` Sh `= log(1/(p(x,y)))` Hart `= ln(1/(p(x,y)))` nat, where `p(x,y)` is the joint probability of events `x` and `y` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: JointInformationContentUnit[1]; + } + + attribute jointInformationContent: JointInformationContentValue[*] nonunique :> scalarQuantities; + + attribute def JointInformationContentUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-31 conditional information content */ + attribute def ConditionalInformationContentValue :> ScalarQuantityValue { + doc + /* + * source: item 13-31 conditional information content + * symbol(s): `I(x|y)` + * application domain: generic + * name: ConditionalInformationContent + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: information content (item 13-2) of event `x` under the condition that `y` has occurred: `I(x|y) = I(x,y) − I( y)` + * remarks: See ISO/IEC 2382-16, item 16.04.02. + */ + attribute :>> num: Real; + attribute :>> mRef: ConditionalInformationContentUnit[1]; + } + + attribute conditionalInformationContent: ConditionalInformationContentValue[*] nonunique :> scalarQuantities; + + attribute def ConditionalInformationContentUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-32 conditional entropy, mean conditional information content, average conditional information content */ + attribute def ConditionalEntropyValue :> ScalarQuantityValue { + doc + /* + * source: item 13-32 conditional entropy, mean conditional information content, average conditional information content + * symbol(s): `H(X|Y)` + * application domain: generic + * name: ConditionalEntropy + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: `H(X|Y) = sum_(i=1)^n sum_(j=1)^m p(x_i,y_j) I(x_i,y_j)` where `p(x_i,y_j)` is the joint probability of events `x_i` and `y_j`, and `I(x_i,y_j)` is conditional information content (item 13-31) + * remarks: See ISO/IEC 2382-16, item 16.04.04. + */ + attribute :>> num: Real; + attribute :>> mRef: ConditionalEntropyUnit[1]; + } + + attribute conditionalEntropy: ConditionalEntropyValue[*] nonunique :> scalarQuantities; + + attribute def ConditionalEntropyUnit :> DimensionOneUnit { + } + + alias MeanConditionalInformationContentUnit for ConditionalEntropyUnit; + alias MeanConditionalInformationContentValue for ConditionalEntropyValue; + alias meanConditionalInformationContent for conditionalEntropy; + + alias AverageConditionalInformationContentUnit for ConditionalEntropyUnit; + alias AverageConditionalInformationContentValue for ConditionalEntropyValue; + alias averageConditionalInformationContent for conditionalEntropy; + + /* IEC-80000-13 item 13-33 equivocation */ + attribute def EquivocationValue :> ScalarQuantityValue { + doc + /* + * source: item 13-33 equivocation + * symbol(s): `H(X|Y)` + * application domain: generic + * name: Equivocation + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: conditional entropy (item 13-32) of a set X of emitted characters given the set Y of received characters + * remarks: Equivocation is a quantitative measure of the loss of information due to noise. See ISO/IEC 2382-16, item 16.04.05. + */ + attribute :>> num: Real; + attribute :>> mRef: EquivocationUnit[1]; + } + + attribute equivocation: EquivocationValue[*] nonunique :> scalarQuantities; + + attribute def EquivocationUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-34 irrelevance */ + attribute def IrrelevanceValue :> ScalarQuantityValue { + doc + /* + * source: item 13-34 irrelevance + * symbol(s): `H(Y|X)` + * application domain: generic + * name: Irrelevance + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: conditional entropy (item 13-32) of a set `Y` of received characters given the set `X` of emitted characters: `H(Y|X) = H(X|Y) + H(Y) − H(X)`, where `H(X|Y)` is equivocation (item 13-33) and `H` is entropy (item 13-25) + * remarks: Irrelevance is a quantitative measure of the information added to the emitted information due to distortion. See ISO/IEC 2382 16, item 16.04.06. + */ + attribute :>> num: Real; + attribute :>> mRef: IrrelevanceUnit[1]; + } + + attribute irrelevance: IrrelevanceValue[*] nonunique :> scalarQuantities; + + attribute def IrrelevanceUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-35 transinformation content */ + attribute def TransinformationContentValue :> ScalarQuantityValue { + doc + /* + * source: item 13-35 transinformation content + * symbol(s): `T(x,y)` + * application domain: generic + * name: TransinformationContent + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: `T(x,y) = I(x) + I(y) − I(x,y)`, where `I(x)` and `I(y)` are the information contents (13-24) of events `x` and `y`, respectively, and `I(x,y)` is their joint information content (13-30) + * remarks: See ISO/IEC 2382-16, item 16.04.07. + */ + attribute :>> num: Real; + attribute :>> mRef: TransinformationContentUnit[1]; + } + + attribute transinformationContent: TransinformationContentValue[*] nonunique :> scalarQuantities; + + attribute def TransinformationContentUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-36 mean transinformation content */ + attribute def MeanTransinformationContentValue :> ScalarQuantityValue { + doc + /* + * source: item 13-36 mean transinformation content + * symbol(s): `T` + * application domain: generic + * name: MeanTransinformationContent + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: `T(X,Y) = sum_(i=1)^n sum_(j=1)^m p(x_i,y_j) T(x_i,y_j)` for the sets `X = {x_1, ..., x_n}`, `Y = {y_1, ..., y_m}`, where `p(x_i,y_j)` is the joint probability of events `x_i` and `y_j`, and `T(x_i,y_j)` is their transinformation content (item 13-35) + * remarks: See ISO/IEC 2382-16, item 16.04.08. In practice, the unit "shannon per character" is generally used, and sometimes the units "hartley per character" and "natural unit per character". + */ + attribute :>> num: Real; + attribute :>> mRef: MeanTransinformationContentUnit[1]; + } + + attribute meanTransinformationContent: MeanTransinformationContentValue[*] nonunique :> scalarQuantities; + + attribute def MeanTransinformationContentUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-37 character mean entropy */ + attribute def CharacterMeanEntropyValue :> ScalarQuantityValue { + doc + /* + * source: item 13-37 character mean entropy + * symbol(s): `H'` + * application domain: generic + * name: CharacterMeanEntropy + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: `H' = lim_(m->∞) H_m/m` where `H_m` is the entropy (item 13-3) of the set of all sequences of `m` characters + * remarks: See ISO/IEC 2382-16, item 16.04.09. + */ + attribute :>> num: Real; + attribute :>> mRef: CharacterMeanEntropyUnit[1]; + } + + attribute characterMeanEntropy: CharacterMeanEntropyValue[*] nonunique :> scalarQuantities; + + attribute def CharacterMeanEntropyUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-38 average information rate */ + attribute def AverageInformationRateValue :> ScalarQuantityValue { + doc + /* + * source: item 13-38 average information rate + * symbol(s): `H^"*"` + * application domain: generic + * name: AverageInformationRate + * quantity dimension: T^-1 + * measurement unit(s): Sh/s, Hart/s, nat/s + * tensor order: 0 + * definition: `H^"*" = (H')/(t(X))`, where `H'` is character mean entropy (item 13-37) and `t(X)` is the mean value of the duration of a character in the set `X` + * remarks: See ISO/IEC 2382-16, item 16.04.10. + */ + attribute :>> num: Real; + attribute :>> mRef: AverageInformationRateUnit[1]; + } + + attribute averageInformationRate: AverageInformationRateValue[*] nonunique :> scalarQuantities; + + attribute def AverageInformationRateUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + /* IEC-80000-13 item 13-39 character mean transinformation content */ + attribute def CharacterMeanTransinformationContentValue :> ScalarQuantityValue { + doc + /* + * source: item 13-39 character mean transinformation content + * symbol(s): `T'` + * application domain: generic + * name: CharacterMeanTransinformationContent + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: `T' = lim_(m->∞) T_m/m` where `T_m` is the mean transinformation content (item 13-36) for all pairs of input and output sequences of `m` characters + * remarks: See ISO/IEC 2382-16, item 16.04.11. In practice, the unit "shannon per character" is generally used, and sometimes the units "hartley per character" and "natural unit per character". + */ + attribute :>> num: Real; + attribute :>> mRef: CharacterMeanTransinformationContentUnit[1]; + } + + attribute characterMeanTransinformationContent: CharacterMeanTransinformationContentValue[*] nonunique :> scalarQuantities; + + attribute def CharacterMeanTransinformationContentUnit :> DimensionOneUnit { + } + + /* IEC-80000-13 item 13-40 average transinformation rate */ + attribute def AverageTransinformationRateValue :> ScalarQuantityValue { + doc + /* + * source: item 13-40 average transinformation rate + * symbol(s): `T^"*"` + * application domain: generic + * name: AverageTransinformationRate + * quantity dimension: T^-1 + * measurement unit(s): Sh/s, Hart/s, nat/s + * tensor order: 0 + * definition: `T^"*" = (T')/(sum_(i=1)^n sum_(j=1)^m p(x_i,y_j) t(x_i,y_j) )`, where `T'` is character mean transinformation content (item 13-39) and `t(x_i,y_j)` is the mean duration of the pair of characters `(x_i,y_j)` with joint probability `p(x_i,y_j)` + * remarks: See ISO/IEC 2382-16, item 16.04.12. + */ + attribute :>> num: Real; + attribute :>> mRef: AverageTransinformationRateUnit[1]; + } + + attribute averageTransinformationRate: AverageTransinformationRateValue[*] nonunique :> scalarQuantities; + + attribute def AverageTransinformationRateUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + /* IEC-80000-13 item 13-41 channel capacity per character, channel capacity */ + attribute def ChannelCapacityPerCharacterValue :> ScalarQuantityValue { + doc + /* + * source: item 13-41 channel capacity per character, channel capacity + * symbol(s): `C'` + * application domain: generic + * name: ChannelCapacityPerCharacter + * quantity dimension: 1 + * measurement unit(s): Sh, Hart, nat + * tensor order: 0 + * definition: `C' = max T'`, where `T'` is character mean transinformation content (item 13-39) + * remarks: See ISO/IEC 2382-16, item 16.04.13. In practice, the unit "shannon per character" is generally used, and sometimes the units "hartley per character" and "natural unit per character". + */ + attribute :>> num: Real; + attribute :>> mRef: ChannelCapacityPerCharacterUnit[1]; + } + + attribute channelCapacityPerCharacter: ChannelCapacityPerCharacterValue[*] nonunique :> scalarQuantities; + + attribute def ChannelCapacityPerCharacterUnit :> DimensionOneUnit { + } + + alias ChannelCapacityUnit for ChannelCapacityPerCharacterUnit; + alias ChannelCapacityValue for ChannelCapacityPerCharacterValue; + alias channelCapacity for channelCapacityPerCharacter; + + /* IEC-80000-13 item 13-42 channel time capacity */ + attribute def ChannelTimeCapacityValue :> ScalarQuantityValue { + doc + /* + * source: item 13-42 channel time capacity + * symbol(s): `C^"*"` + * application domain: generic + * name: ChannelTimeCapacity + * quantity dimension: T^-1 + * measurement unit(s): Sh/s, Hart/s, nat/s + * tensor order: 0 + * definition: `C^"*" = max T^"*"`, where `T^"*"` is average transinformation rate (item 13-40) + * remarks: See ISO/IEC 2382-16, item 16.04.13. Note for SysML ISQ: Alias "channel capacity", that was present in IEC 80000-12:2008, has been removed as it duplicates the alias of channel capacity per character (item 13-41). + */ + attribute :>> num: Real; + attribute :>> mRef: ChannelTimeCapacityUnit[1]; + } + + attribute channelTimeCapacity: ChannelTimeCapacityValue[*] nonunique :> scalarQuantities; + + attribute def ChannelTimeCapacityUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml new file mode 100644 index 0000000000000000000000000000000000000000..1e5d8e8f1ccb07e9e69ab7d9d43c60adf17f9f74 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml @@ -0,0 +1,1537 @@ +standard library package ISQLight { + doc + /* + * International System of Quantities and Units + * Generated on 2022-08-07T14:44:27Z from standard ISO-80000-7:2019 "Light" + * see also https://www.iso.org/obp/ui/#iso:std:iso:80000:-7:ed-2:v1:en + * + * Note 1: In documentation comments, AsciiMath notation (see http://asciimath.org/) is used for mathematical concepts, + * with Greek letters in Unicode encoding. In running text, AsciiMath is placed between backticks. + * Note 2: For vector and tensor quantities currently the unit and quantity value type for their (scalar) magnitude is + * defined, as well as their typical Cartesian 3d VectorMeasurementReference (i.e. coordinate system) + * or TensorMeasurementReference. + */ + + private import ScalarValues::Real; + private import Quantities::*; + private import MeasurementReferences::*; + private import ISQBase::*; + + /* Quantity definitions referenced from other ISQ packages */ + private import ISQThermodynamics::EnergyValue; + + /* ISO-80000-7 item 7-1.1 speed of light in a medium */ + attribute def SpeedOfLightInAMediumValue :> ScalarQuantityValue { + doc + /* + * source: item 7-1.1 speed of light in a medium + * symbol(s): `c` + * application domain: generic + * name: SpeedOfLightInAMedium + * quantity dimension: L^1*T^-1 + * measurement unit(s): m*s^-1 + * tensor order: 0 + * definition: phase speed of an electromagnetic wave at a given point in a medium + * remarks: See also ISO 80000-3. The value of the speed of light in a medium can depend on the frequency, polarization, and direction. For the definition of the speed of electromagnetic waves in vacuum, `c_0`, see ISO 80000-1. + */ + attribute :>> num: Real; + attribute :>> mRef: SpeedOfLightInAMediumUnit[1]; + } + + attribute speedOfLightInAMedium: SpeedOfLightInAMediumValue[*] nonunique :> scalarQuantities; + + attribute def SpeedOfLightInAMediumUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-7 item 7-1.2 refractive index */ + attribute def RefractiveIndexValue :> DimensionOneValue { + doc + /* + * source: item 7-1.2 refractive index + * symbol(s): `n` + * application domain: generic + * name: RefractiveIndex (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of speed of light in vacuum (ISO 80000-1) and speed of light in a medium (item 7-1.1) + * remarks: The value of the refractive index can depend on the frequency, polarization, and direction. The refractive index is expressed by n = c_0/c, where c_()_0 is the speed of light in vacuum and c is the speed of light in the medium. For a medium with absorption, the complex refractive index n is defined by n = n + ik where k is spectral absorption index (IEC 60050-845) and i is imaginary unit. The refractivity is expressed by n -1, where n is refractive index. + */ + } + attribute refractiveIndex: RefractiveIndexValue :> scalarQuantities; + + /* ISO-80000-7 item 7-2.1 radiant energy */ + attribute radiantEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 7-2.1 radiant energy + * symbol(s): `Q_e`, `W`, `U`, `(Q)` + * application domain: electromagnetism + * name: RadiantEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: energy (ISO 80000-5) emitted, transferred or received in form of electromagnetic waves + * remarks: Radiant energy can be expressed by the time integral of radiant flux (item 7-4.1), `Φ_e`, over a given duration (ISO 80000-3), `Δt`: `Q_e = int_(Δ t) Φ_e dt`. Radiant energy is expressed either as a function of wavelength (ISO 80000-3), `λ`, as a function of frequency (ISO 80000-3), `ν`, or as a function of wavenumber, `σ`. (See also 0.1.) The corresponding photometric quantity is "luminous energy" (item 7-12). The corresponding quantity for photons is "photon energy" (item 7-19.2). + */ + } + + /* ISO-80000-7 item 7-2.2 spectral radiant energy */ + attribute def SpectralRadiantEnergyValue :> ScalarQuantityValue { + doc + /* + * source: item 7-2.2 spectral radiant energy + * symbol(s): `Q_(e,λ)`, `W_λ`, `U_λ`, `(Q_λ)` + * application domain: generic + * name: SpectralRadiantEnergy + * quantity dimension: L^1*M^1*T^-2 + * measurement unit(s): J/nm, kg*m*s^-2 + * tensor order: 0 + * definition: spectral density of radiant energy, expressed by `Q_(e,λ) = (dQ_e) / (dλ)`, where `Q_e` is radiant energy (item 7-2.1) in terms of wavelength `λ` (ISO 80000-3) + * remarks: The integral of (total) radiant energy is determined by the wavelength interval `(λ_1, λ_2)` under consideration: `Q_e = int_(λ_1)^(λ_2) Q_(e,λ) dλ` + */ + attribute :>> num: Real; + attribute :>> mRef: SpectralRadiantEnergyUnit[1]; + } + + attribute spectralRadiantEnergy: SpectralRadiantEnergyValue[*] nonunique :> scalarQuantities; + + attribute def SpectralRadiantEnergyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-7 item 7-3.1 radiant energy density */ + attribute def RadiantEnergyDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 7-3.1 radiant energy density + * symbol(s): `w`, `(ρ_e)` + * application domain: generic + * name: RadiantEnergyDensity + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): J/m^3, kg*m^-1*s^-2 + * tensor order: 0 + * definition: volumetric density of radiant energy, expressed by `w = (dQ_e)/(dV)`, where `Q_e` is radiant energy (item 7-2.1) in an elementary three-dimensional domain and `V` is the volume (ISO 80000-3) of that domain + * remarks: Radiant energy density within a Planckian radiator is given by `w = (4 σ)/(c_0) T^4` where `σ` is the Stefan-Boltzmann constant (ISO 80000-1), `c_0` is speed of light in vacuum (ISO 80000-1) and `T` is thermodynamic temperature (ISO 80000-5). + */ + attribute :>> num: Real; + attribute :>> mRef: RadiantEnergyDensityUnit[1]; + } + + attribute radiantEnergyDensity: RadiantEnergyDensityValue[*] nonunique :> scalarQuantities; + + attribute def RadiantEnergyDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-7 item 7-3.2 spectral radiant energy density in terms of wavelength */ + attribute def SpectralRadiantEnergyDensityInTermsOfWavelengthValue :> ScalarQuantityValue { + doc + /* + * source: item 7-3.2 spectral radiant energy density in terms of wavelength + * symbol(s): `w_λ` + * application domain: generic + * name: SpectralRadiantEnergyDensityInTermsOfWavelength + * quantity dimension: L^-2*M^1*T^-2 + * measurement unit(s): J/(m^3*nm), kg*m^-2*s^-2 + * tensor order: 0 + * definition: change of radiant energy density with wavelength, expressed by `w_λ = (dw)/(dλ)`, where `w` is radiant energy density (item 7-3.1) as a function of wavelength `λ` (ISO 80000-3) + * remarks: Spectral radiant energy density within a Planckian radiator is given by `w_λ = 8πhc_0*f(λ, T)`, where `h` is the Planck constant (ISO 80000-1), `c_0` is speed of light in vacuum (ISO 80000-1), `T` is thermodynamic temperature (ISO 80000-5) and `f(λ,T) = (λ^-5)/(exp(c_2 λ^-1 T^-1) - 1)`. For the radiation constant `c_2` in `f(λ,T)`, see ISO 80000-1. + */ + attribute :>> num: Real; + attribute :>> mRef: SpectralRadiantEnergyDensityInTermsOfWavelengthUnit[1]; + } + + attribute spectralRadiantEnergyDensityInTermsOfWavelength: SpectralRadiantEnergyDensityInTermsOfWavelengthValue[*] nonunique :> scalarQuantities; + + attribute def SpectralRadiantEnergyDensityInTermsOfWavelengthUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-7 item 7-3.3 spectral radiant energy density in terms of wavenumber */ + attribute def SpectralRadiantEnergyDensityInTermsOfWavenumberValue :> ScalarQuantityValue { + doc + /* + * source: item 7-3.3 spectral radiant energy density in terms of wavenumber + * symbol(s): `w_ṽ`, `ρ_ṽ` + * application domain: generic + * name: SpectralRadiantEnergyDensityInTermsOfWavenumber + * quantity dimension: M^1*T^-2 + * measurement unit(s): J/m^2, kg*s^-2 + * tensor order: 0 + * definition: change of radiant energy density with wavenumber, expressed by `w_ṽ = (dw)/(dṽ)`, where `w` is radiant energy density (item 7-3.1) as a function of wavenumber `ṽ` (ISO 80000-3) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: SpectralRadiantEnergyDensityInTermsOfWavenumberUnit[1]; + } + + attribute spectralRadiantEnergyDensityInTermsOfWavenumber: SpectralRadiantEnergyDensityInTermsOfWavenumberValue[*] nonunique :> scalarQuantities; + + attribute def SpectralRadiantEnergyDensityInTermsOfWavenumberUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + /* ISO-80000-7 item 7-4.1 radiant flux, radiant power */ + attribute def RadiantFluxValue :> ScalarQuantityValue { + doc + /* + * source: item 7-4.1 radiant flux, radiant power + * symbol(s): `Φ_e`, `P_e`, `Φ`, `P` + * application domain: generic + * name: RadiantFlux + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): W, kg*m^2*s^-3 + * tensor order: 0 + * definition: change in radiant energy with time, expressed by `Φ_e = (dQ_e)/(dt)`, where `Q_e` is the radiant energy (item 7-2.1) emitted, transferred or received and `t` is time (ISO 80000-3) + * remarks: The corresponding photometric quantity is "luminous flux" (item 7-13). The corresponding quantity for photons is "photon flux" (item 7-20). + */ + attribute :>> num: Real; + attribute :>> mRef: RadiantFluxUnit[1]; + } + + attribute radiantFlux: RadiantFluxValue[*] nonunique :> scalarQuantities; + + attribute def RadiantFluxUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + alias RadiantPowerUnit for RadiantFluxUnit; + alias RadiantPowerValue for RadiantFluxValue; + alias radiantPower for radiantFlux; + + /* ISO-80000-7 item 7-4.2 spectral radiant flux, spectral radiant power */ + attribute def SpectralRadiantFluxValue :> ScalarQuantityValue { + doc + /* + * source: item 7-4.2 spectral radiant flux, spectral radiant power + * symbol(s): `Φ_(e,λ)`, `P_(e,λ)`, `(Φ_λ)`, `(P_λ)` + * application domain: generic + * name: SpectralRadiantFlux + * quantity dimension: L^1*M^1*T^-3 + * measurement unit(s): W/nm, kg*m*s^-3 + * tensor order: 0 + * definition: spectral density of radiant flux, expressed by `Φ_(e,λ) = (dQ_e)/(dλ)`, where `Φ_e` is radiant flux (item 7-4.1) in terms of wavelength `λ` (ISO 80000-3) + * remarks: The integral of (total) radiant flux is determined by the wavelength interval `(λ_1, λ_2)` under consideration: `Φ_e = int_(λ_1)^(λ_2) Φ_(e,λ) dλ` . + */ + attribute :>> num: Real; + attribute :>> mRef: SpectralRadiantFluxUnit[1]; + } + + attribute spectralRadiantFlux: SpectralRadiantFluxValue[*] nonunique :> scalarQuantities; + + attribute def SpectralRadiantFluxUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + alias SpectralRadiantPowerUnit for SpectralRadiantFluxUnit; + alias SpectralRadiantPowerValue for SpectralRadiantFluxValue; + alias spectralRadiantPower for spectralRadiantFlux; + + /* ISO-80000-7 item 7-5.1 radiant intensity */ + attribute def RadiantIntensityValue :> ScalarQuantityValue { + doc + /* + * source: item 7-5.1 radiant intensity + * symbol(s): `I_e`, `(I)` + * application domain: generic + * name: RadiantIntensity + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): W/sr, kg*m^2*s^-3*sr^-1 + * tensor order: 0 + * definition: density of radiant flux with respect to solid angle in a specified direction, expressed by `I_e = (dΦ_e)/(dΩ)`, where `Φ_e` is the radiant flux (item 7-4.1) emitted in a specified direction, and `Ω` is the solid angle (ISO 80000-3) containing that direction + * remarks: The definition holds strictly only for a point source. The distribution of the radiant intensities as a function of the direction of emission, e.g. given by the polar angles `(θ,φ)`, is used to determine the radiant flux (item 7-4.1) within a certain solid angle (ISO 80000-3), `Ω`, of a source: `Φ_e = int int_Ω I_e(θ, φ) sin(θ) dφ dθ`. The corresponding photometric quantity is "luminous intensity" (item 7-14). The corresponding quantity for photons is "photon intensity" (item 7-21). + */ + attribute :>> num: Real; + attribute :>> mRef: RadiantIntensityUnit[1]; + } + + attribute radiantIntensity: RadiantIntensityValue[*] nonunique :> scalarQuantities; + + attribute def RadiantIntensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-7 item 7-5.2 spectral radiant intensity */ + attribute def SpectralRadiantIntensityValue :> ScalarQuantityValue { + doc + /* + * source: item 7-5.2 spectral radiant intensity + * symbol(s): `I_(e,λ)`, `(I_λ)` + * application domain: generic + * name: SpectralRadiantIntensity + * quantity dimension: L^1*M^1*T^-3 + * measurement unit(s): W/(sr*nm), kg*m*s^-3*sr^-1 + * tensor order: 0 + * definition: spectral density of radiant intensity, expressed by `I_(e, λ) = (d I_e)/(dλ)`, where `I_e` is radiant intensity (item 7-5.1) in terms of wavelength `λ` (ISO 80000-3) + * remarks: The integral of (total) radiant intensity is determined by the wavelength interval `(λ_1, λ_2)` under consideration: `I_e = int_(λ_1)^(λ_2) I_(e,λ) dλ` . + */ + attribute :>> num: Real; + attribute :>> mRef: SpectralRadiantIntensityUnit[1]; + } + + attribute spectralRadiantIntensity: SpectralRadiantIntensityValue[*] nonunique :> scalarQuantities; + + attribute def SpectralRadiantIntensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-7 item 7-6.1 radiance */ + attribute def RadianceValue :> ScalarQuantityValue { + doc + /* + * source: item 7-6.1 radiance + * symbol(s): `L_e`, `(L)` + * application domain: generic + * name: Radiance + * quantity dimension: M^1*T^-3 + * measurement unit(s): W/(sr*m^2), kg*s^-3*sr^-1 + * tensor order: 0 + * definition: density of radiant intensity with respect to projected area in a specified direction at a specified point on a real or imaginary surface, expressed by `L_e = (d I_e)/(dA) * 1/cos(α)`, where `I_e` is radiant intensity (item 7-5.1), `A` is area (ISO 80000-3), and `α` is the angle between the normal to the surface at the specified point and the specified direction + * remarks: See also 0.1. For Planckian radiation, `L_e = σ/π T^4` where `T` is thermodynamic temperature (ISO 80000-5) and `σ` is the Stefan-Boltzmann constant (ISO 80000-1). The corresponding photometric quantity is "luminance" (item 7-15). The corresponding quantity for photons is "photon radiance" (item 7-22). + */ + attribute :>> num: Real; + attribute :>> mRef: RadianceUnit[1]; + } + + attribute radiance: RadianceValue[*] nonunique :> scalarQuantities; + + attribute def RadianceUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + /* ISO-80000-7 item 7-6.2 spectral radiance */ + attribute def SpectralRadianceValue :> ScalarQuantityValue { + doc + /* + * source: item 7-6.2 spectral radiance + * symbol(s): `L_(e,λ)`, `(L_λ)` + * application domain: generic + * name: SpectralRadiance + * quantity dimension: L^-1*M^1*T^-3 + * measurement unit(s): W/(sr*m^2*nm), kg*m^-1*s^-3*sr^-1 + * tensor order: 0 + * definition: density of radiance with respect to wavelength, expressed by `L_(e, λ) = (d L_e)/(d λ)` where `L_e` is radiance (item 7-6.1) in terms of wavelength λ(ISO 80000-3) + * remarks: For Planckian radiation, `L_(e, λ)(λ) = (c(λ))/(4 π) ω_λ(λ) = h c_0^2 * f(λ,T)`, where `c(λ)` is phase speed (ISO 80000-3) of electromagnetic radiation of a wavelength (ISO 80000-3) `λ` in a given medium, `ω_λ(λ)` is spectral radiant energy density in terms of wavelength, `c_0` is speed of light in vacuum (ISO 80000-1), `h` is the Planck constant (ISO 80000-1), and `f(λ,T) = λ^-5/(exp(c_2 λ^-1 T^-1) - 1)`, where the radiation constant `c_2 = (hc)/k`. The integral of (total) radiance is determined by the wavelength interval `(λ_1, λ_2)` under consideration: `L_e = int_(λ_1)^(λ_2) L_(e,λ) dλ` . + */ + attribute :>> num: Real; + attribute :>> mRef: SpectralRadianceUnit[1]; + } + + attribute spectralRadiance: SpectralRadianceValue[*] nonunique :> scalarQuantities; + + attribute def SpectralRadianceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-7 item 7-7.1 irradiance */ + attribute def IrradianceValue :> ScalarQuantityValue { + doc + /* + * source: item 7-7.1 irradiance + * symbol(s): `E_e`, `(E)` + * application domain: generic + * name: Irradiance + * quantity dimension: M^1*T^-3 + * measurement unit(s): W/m^2, kg*s^-3 + * tensor order: 0 + * definition: density of incident radiant flux with respect to area at a point on a real or imaginary surface, expressed by `E_e = (d Φ_e)/(d A)`, where `Φ_e` is radiant flux (item 7-4.1) and `A` is the area (ISO 80000-3) on which the radiant flux is incident + * remarks: The corresponding photometric quantity is "illuminance" (item 7-16). The corresponding quantity for photons is "photon irradiance" (item 7-23). The quantity "spherical irradiance" is defined by the mean value of irradiance on the outer curved surface of a very small (real or imaginary) sphere at a point in space. It can be expressed by `E_(e,0) = int_(4 π) L_e d Ω` where `Ω` is solid angle (ISO 80000-3) and `L_e` is radiance (item 7-6.1). (See CIE DIS 017/E:2016, term 17-21-054.) It can be expressed by the quotient of the radiant flux (item 7-4.1) of all the radiation incident on the outer surface of an infinitely small sphere centred at the specified point and the area (ISO 80000-3) of the diametrical cross-section of that sphere. Spherical irradiance is also called "fluence rate" or "radiant fluence rate". The corresponding photometric quantity to spherical irradiance is called "spherical illuminance". + */ + attribute :>> num: Real; + attribute :>> mRef: IrradianceUnit[1]; + } + + attribute irradiance: IrradianceValue[*] nonunique :> scalarQuantities; + + attribute def IrradianceUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + /* ISO-80000-7 item 7-7.2 spectral irradiance */ + attribute def SpectralIrradianceValue :> ScalarQuantityValue { + doc + /* + * source: item 7-7.2 spectral irradiance + * symbol(s): `E_(e,λ)`, `(E_λ)` + * application domain: generic + * name: SpectralIrradiance + * quantity dimension: L^-1*M^1*T^-3 + * measurement unit(s): W/(m^2*nm), kg*m^-1*s^-3 + * tensor order: 0 + * definition: density of irradiance with respect to wavelength, expressed by `E_(e,λ) = (d E_e)/(dλ)`, where `E_e` is irradiance (item 7-7.1) in terms of wavelength `λ` (ISO 80000-3) + * remarks: The integral of (total) irradiance is determined by the wavelength interval `(λ_1, λ_2)` under consideration: `E_e = int_(λ_1)^(λ_2) E_(e,λ) d λ` . + */ + attribute :>> num: Real; + attribute :>> mRef: SpectralIrradianceUnit[1]; + } + + attribute spectralIrradiance: SpectralIrradianceValue[*] nonunique :> scalarQuantities; + + attribute def SpectralIrradianceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-7 item 7-8.1 radiant exitance , radiant emittance */ + attribute def RadiantExitanceValue :> ScalarQuantityValue { + doc + /* + * source: item 7-8.1 radiant exitance , radiant emittance + * symbol(s): `M_e`, `(M)` + * application domain: generic + * name: RadiantExitance + * quantity dimension: M^1*T^-3 + * measurement unit(s): W/m^2, kg*s^-3 + * tensor order: 0 + * definition: density of exiting radiant flux with respect to area at a point on a real or imaginary surface, expressed by `M_e = (d Φ_e)/(dA)`, where `Φ_e` is radiant flux (item 7-4.1) and `A` is the area (ISO 80000-3) from which the radiant flux leaves + * remarks: For Planckian radiation, `M_e = σT^4`, where `T` is thermodynamic temperature (ISO 80000-5) and `σ` is the Stefan-Boltzmann constant (ISO 80000-1). The corresponding photometric quantity is "luminous exitance" (item 7-17). The corresponding quantity for photons is "photon exitance" (item 7-24). + */ + attribute :>> num: Real; + attribute :>> mRef: RadiantExitanceUnit[1]; + } + + attribute radiantExitance: RadiantExitanceValue[*] nonunique :> scalarQuantities; + + attribute def RadiantExitanceUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + alias RadiantEmittanceUnit for RadiantExitanceUnit; + alias RadiantEmittanceValue for RadiantExitanceValue; + alias radiantEmittance for radiantExitance; + + /* ISO-80000-7 item 7-8.2 spectral radiant exitance */ + attribute def SpectralRadiantExitanceValue :> ScalarQuantityValue { + doc + /* + * source: item 7-8.2 spectral radiant exitance + * symbol(s): `M_(e,λ)`, `(M_λ)` + * application domain: generic + * name: SpectralRadiantExitance + * quantity dimension: L^-1*M^1*T^-3 + * measurement unit(s): W/(m^2*nm), kg*m^-1*s^-3 + * tensor order: 0 + * definition: density of radiant exitance with respect to wavelength, expressed by `M_(e,λ) = (d M_e)/(dλ)`, where `M_e` is radiant exitance (item 7-8.1) in terms of wavelength `λ` (ISO 80000-3) + * remarks: The integral of (total) radiant exitance is determined by the wavelength interval `(λ_1, λ_2)` under consideration: `M_e = int_(λ_1)^(λ_2) M_(e,λ) d λ` . + */ + attribute :>> num: Real; + attribute :>> mRef: SpectralRadiantExitanceUnit[1]; + } + + attribute spectralRadiantExitance: SpectralRadiantExitanceValue[*] nonunique :> scalarQuantities; + + attribute def SpectralRadiantExitanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-7 item 7-9.1 radiant exposure */ + attribute def RadiantExposureValue :> ScalarQuantityValue { + doc + /* + * source: item 7-9.1 radiant exposure + * symbol(s): `H_e`, `(H)` + * application domain: generic + * name: RadiantExposure + * quantity dimension: M^1*T^-2 + * measurement unit(s): J/m^2, kg*s^-2 + * tensor order: 0 + * definition: density of incident radiant energy with respect to area at a point on a real or imaginary surface, expressed by `H_e = (d Q_e)/(dA)`, where `Q_e` is radiant energy (item 7-2.1) and `A` is the area on which the radiant energy is incident (ISO 80000-3) + * remarks: The corresponding photometric quantity is "luminous exposure" (item 7-18). The corresponding quantity for photons is "photon exposure" (item 7-25). + */ + attribute :>> num: Real; + attribute :>> mRef: RadiantExposureUnit[1]; + } + + attribute radiantExposure: RadiantExposureValue[*] nonunique :> scalarQuantities; + + attribute def RadiantExposureUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + /* ISO-80000-7 item 7-9.2 spectral radiant exposure */ + attribute def SpectralRadiantExposureValue :> ScalarQuantityValue { + doc + /* + * source: item 7-9.2 spectral radiant exposure + * symbol(s): `H_(e,λ)`, `(H_λ)` + * application domain: generic + * name: SpectralRadiantExposure + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): J/(m^2*nm), kg*m^-1*s^-2 + * tensor order: 0 + * definition: density of radiant exposure with respect to wavelength, expressed by `H_(e,λ) = (d H_e)/(dλ)`, where `H_e` is radiant exposure (item 7-9.1) in terms of wavelength `λ` (ISO 80000-3) + * remarks: The integral of (total) radiant exposure is determined by the wavelength interval `(λ_1, λ_2)` under consideration: `H_e = int_(λ_1)^(λ_2) H_(e,λ) d λ` . + */ + attribute :>> num: Real; + attribute :>> mRef: SpectralRadiantExposureUnit[1]; + } + + attribute spectralRadiantExposure: SpectralRadiantExposureValue[*] nonunique :> scalarQuantities; + + attribute def SpectralRadiantExposureUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-7 item 7-10.1 luminous efficiency */ + attribute def LuminousEfficiencyValue :> DimensionOneValue { + doc + /* + * source: item 7-10.1 luminous efficiency + * symbol(s): `V` + * application domain: specified photometric condition + * name: LuminousEfficiency (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of radiant flux (item 7-4.1) weighted by the spectral luminous efficiency (item 7-10.2) and the corresponding radiant flux for a specified photometric condition + * remarks: Luminous efficiency for photopic vision is expressed by `V = (int_0^∞ Φ_(e,λ)(λ) V(λ) d λ)/(int_0^∞ Φ_(e,λ)(λ) d λ) = K/K_m`, where `Φ_(e,λ)` is spectral radiant flux (item 7-4.2), `V(λ)` is spectral luminous efficiency, `λ` is wavelength, `K` is luminous efficacy of radiation (item 7-11.1), and `K_m` is maximum luminous efficacy (item 7-11.3). For scotopic and mesopic vision see 0.4 and 0.5. Symbols for different photometric conditions: `V` for photopic vision; `V'` for scotopic vision; `V_(mes;m)` for mesopic vision; `V_10` for the CIE 10° photopic photometric observer; `V_M` for the CIE 1988 modified 2° spectral luminous efficiency function for photopic vision. + */ + } + attribute luminousEfficiency: LuminousEfficiencyValue :> scalarQuantities; + + /* ISO-80000-7 item 7-10.2 spectral luminous efficiency */ + attribute def SpectralLuminousEfficiencyValue :> DimensionOneValue { + doc + /* + * source: item 7-10.2 spectral luminous efficiency + * symbol(s): `V(λ)` + * application domain: specified photometric condition + * name: SpectralLuminousEfficiency (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the radiant flux (item 7-4.1) at wavelength `λ_m` and that at wavelength `λ`, such that both produce equally intense luminous sensations for a specified photometric condition and `λ_m` is chosen so that the maximum value of this quotient is equal to 1 + * remarks: The spectral luminous efficiency of the human eye depends on a number of factors, particularly the state of visual adaptation and the size and position of the source in the visual field. The photometric condition should be specified (e.g. photopic, scotopic, mesopic). If it is not specified, photopic vision is assumed and the symbol `V(λ)` is used. For scotopic and mesopic vision see 0.4 and 0.5. Symbols for different photometric conditions: `V(λ)` for photopic vision; `V'(λ)` for scotopic vision; `V_(mes;m)(λ)` for mesopic vision; `V_10(λ)` for the CIE 10° photopic photometric observer; `V_M(λ)` for the CIE 1988 modified 2° spectral luminous efficiency function for photopic vision. + */ + } + attribute spectralLuminousEfficiency: SpectralLuminousEfficiencyValue :> scalarQuantities; + + /* ISO-80000-7 item 7-11.1 luminous efficacy of radiation */ + attribute def LuminousEfficacyOfRadiationValue :> ScalarQuantityValue { + doc + /* + * source: item 7-11.1 luminous efficacy of radiation + * symbol(s): `K` + * application domain: specified photometric condition + * name: LuminousEfficacyOfRadiation + * quantity dimension: L^-2*M^-1*T^3*J^1 + * measurement unit(s): lm/W, cd*sr*kg^-1*m^-2*s^3 + * tensor order: 0 + * definition: quotient of luminous flux (item 7-13) and the corresponding radiant flux (item 7-4.1) for a specified photometric condition + * remarks: Luminous efficacy of radiation for photopic vision is expressed by `K = Φ_V/Φ_e`, where `Φ_v` is luminous flux (item 7-13) and `Φ_e` is radiant flux (item 7-4.1). For scotopic and mesopic vision see 0.4 and 0.5. Symbols for different photometric conditions: `K` for photopic vision; `K'` for scotopic vision; `K_(mes;m)` for mesopic vision; `K_10` for the CIE 10° photopic photometric observer; `K_M` for the CIE 1988 modified 2° spectral luminous efficiency function for photopic vision. + */ + attribute :>> num: Real; + attribute :>> mRef: LuminousEfficacyOfRadiationUnit[1]; + } + + attribute luminousEfficacyOfRadiation: LuminousEfficacyOfRadiationValue[*] nonunique :> scalarQuantities; + + attribute def LuminousEfficacyOfRadiationUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 3; } + private attribute luminousIntensityPF: QuantityPowerFactor[1] { :>> quantity = isq.J; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, luminousIntensityPF); } + } + + /* ISO-80000-7 item 7-11.2 spectral luminous efficacy */ + attribute def SpectralLuminousEfficacyValue :> ScalarQuantityValue { + doc + /* + * source: item 7-11.2 spectral luminous efficacy + * symbol(s): `K(λ)` + * application domain: specified photometric condition + * name: SpectralLuminousEfficacy + * quantity dimension: L^-2*M^-1*T^3*J^1 + * measurement unit(s): lm/W, cd*sr*kg^-1*m^-2*s^3 + * tensor order: 0 + * definition: product of spectral luminous efficiency (item 7-10.2) and maximum luminous efficacy (item 7-11.3) for a specified photometric condition + * remarks: Spectral luminous efficacy for photopic vision is expressed by `K(λ) = K_m V(λ)`, where `K_m` is maximum luminous efficacy (item 7-11.3), `V(λ)` is spectral luminous efficiency (item 7-10.2) and `λ` is wavelength. For scotopic and mesopic vision see 0.4 and 0.5. Symbols for different photometric conditions: `K(λ)` for photopic vision>; `K'(λ)` for scotopic vision; `K_(mes;m)(λ)` for mesopic vision; `K_10(λ)` for the CIE 10° photopic photometric observer; `K_M(λ)` for the CIE 1988 modified 2° spectral luminous efficiency function for photopic vision. + */ + attribute :>> num: Real; + attribute :>> mRef: SpectralLuminousEfficacyUnit[1]; + } + + attribute spectralLuminousEfficacy: SpectralLuminousEfficacyValue[*] nonunique :> scalarQuantities; + + attribute def SpectralLuminousEfficacyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 3; } + private attribute luminousIntensityPF: QuantityPowerFactor[1] { :>> quantity = isq.J; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, luminousIntensityPF); } + } + + /* ISO-80000-7 item 7-11.3 maximum luminous efficacy */ + attribute def MaximumLuminousEfficacyValue :> ScalarQuantityValue { + doc + /* + * source: item 7-11.3 maximum luminous efficacy + * symbol(s): `K_m` + * application domain: specified photometric condition + * name: MaximumLuminousEfficacy + * quantity dimension: L^-2*M^-1*T^3*J^1 + * measurement unit(s): lm/W, cd*sr*kg^-1*m^-2*s^3 + * tensor order: 0 + * definition: maximum value of spectral luminous efficacy for a specified photometric condition + * remarks: See also 0.4 and 0.5. The value of maximum luminous efficacy for photopic vision is calculated by `K_m = 683 / (V(λ_(cd))) ["cd"*"sr"*"W"^-1] = 683 ["lm"*"W"^-1]` where `V(λ)` is the spectral luminous efficiency for photopic vision and `λ_(cd)` is the wavelength in air corresponding to the frequency `540*10^12 ["Hz"]` specified in the definition of the SI unit candela. Symbols for different photometric conditions: `K_m` for photopic vision; `K'_m` for scotopic vision; `K_(m,mes;m)` for mesopic vision; `K_(m,10)` for the CIE 10° photopic photometric observer; `K_(m,M)` for the CIE 1988 modified 2° spectral luminous efficiency function for photopic vision. + */ + attribute :>> num: Real; + attribute :>> mRef: MaximumLuminousEfficacyUnit[1]; + } + + attribute maximumLuminousEfficacy: MaximumLuminousEfficacyValue[*] nonunique :> scalarQuantities; + + attribute def MaximumLuminousEfficacyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 3; } + private attribute luminousIntensityPF: QuantityPowerFactor[1] { :>> quantity = isq.J; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, luminousIntensityPF); } + } + + /* ISO-80000-7 item 7-11.4 luminous efficacy of a source */ + attribute def LuminousEfficacyOfASourceValue :> ScalarQuantityValue { + doc + /* + * source: item 7-11.4 luminous efficacy of a source + * symbol(s): `η_v`, `(η)` + * application domain: generic + * name: LuminousEfficacyOfASource + * quantity dimension: L^-2*M^-1*T^3*J^1 + * measurement unit(s): lm/W, cd*sr*kg^-1*m^-2*s^3 + * tensor order: 0 + * definition: quotient of the luminous flux emitted and the power consumed by the source, expressed by `η_v = Φ_v/P`, where `Φ_v` is luminous flux (item 7-13) and `P` is the power (ISO 80000-4) consumed by the source + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: LuminousEfficacyOfASourceUnit[1]; + } + + attribute luminousEfficacyOfASource: LuminousEfficacyOfASourceValue[*] nonunique :> scalarQuantities; + + attribute def LuminousEfficacyOfASourceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 3; } + private attribute luminousIntensityPF: QuantityPowerFactor[1] { :>> quantity = isq.J; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, luminousIntensityPF); } + } + + /* ISO-80000-7 item 7-12 luminous energy, quantity of light */ + attribute def LuminousEnergyValue :> ScalarQuantityValue { + doc + /* + * source: item 7-12 luminous energy, quantity of light + * symbol(s): `Q_v`, `(Q)` + * application domain: generic + * name: LuminousEnergy + * quantity dimension: T^1*J^1 + * measurement unit(s): lm*s, cd*sr*s + * tensor order: 0 + * definition: energy of electromagnetic waves weighted by the spectral luminous efficiency (item 7-10.2) multiplied by maximum luminous efficacy (item 7-11.3) of a specified photometric condition + * remarks: Luminous energy for photopic vision is expressed by `Q_v = K_m int_0^∞ Q_(e,λ)(λ) V(λ) dλ`, where `Q_(e,λ)(λ)` is the spectral radiant energy (item 7-2.2) at wavelength `λ` (ISO 80000-3), `V(λ)` is spectral luminous efficiency (item 7-10.2), and `K_m` is maximum luminous efficacy (7-11.3). Luminous energy can be emitted, transferred or received. Luminous energy can be expressed by the time integral of the luminous flux (item 7-13), `Φ_v`, over a given duration (ISO 80000-3), `Δt`: `Q_v = int_(Δt) Φ_v dt` . The corresponding radiometric quantity is "radiant energy" (item 7-2.1). The corresponding quantity for photons is "photon energy" (item 7-19.2). + */ + attribute :>> num: Real; + attribute :>> mRef: LuminousEnergyUnit[1]; + } + + attribute luminousEnergy: LuminousEnergyValue[*] nonunique :> scalarQuantities; + + attribute def LuminousEnergyUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + private attribute luminousIntensityPF: QuantityPowerFactor[1] { :>> quantity = isq.J; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (durationPF, luminousIntensityPF); } + } + + alias QuantityOfLightUnit for LuminousEnergyUnit; + alias QuantityOfLightValue for LuminousEnergyValue; + alias quantityOfLight for luminousEnergy; + + /* ISO-80000-7 item 7-13 luminous flux */ + attribute def LuminousFluxValue :> ScalarQuantityValue { + doc + /* + * source: item 7-13 luminous flux + * symbol(s): `Φ_v`, `(Φ)` + * application domain: generic + * name: LuminousFlux + * quantity dimension: J^1 + * measurement unit(s): lm, cd*sr + * tensor order: 0 + * definition: change in luminous energy with time, expressed by `Φ_v = (d Q_v)/(dt)`, where `Q_v` is the luminous energy (item 7-12) emitted, transferred or received and `t` is time (ISO 80000-3) + * remarks: Luminous flux is a quantity derived from the radiant flux (item 7-4.1), `Φ_e`, by evaluating the radiation according to its action upon the CIE standard photometric observer. (See CIE S 017/E:2011, term 17-738.) Luminous flux can be derived from the spectral radiant flux distribution by `Φ_v = K_m int_0^oo Φ_(e,λ)(λ) V(λ) dλ`, where `K_m` is maximum luminous efficacy (item 7-11.3), `Φ_(e,λ)(λ)` is spectral radiant flux (item 7-4.2), `V(λ)` is spectral luminous efficiency (item 7-10.2) and `λ` is wavelength (ISO 80000-3). The corresponding radiometric quantity is "radiant flux" (item 7-4.1). The corresponding quantity for photons is "photon flux" (item 7-20). + */ + attribute :>> num: Real; + attribute :>> mRef: LuminousFluxUnit[1]; + } + + attribute luminousFlux: LuminousFluxValue[*] nonunique :> scalarQuantities; + + attribute def LuminousFluxUnit :> DerivedUnit { + private attribute luminousIntensityPF: QuantityPowerFactor[1] { :>> quantity = isq.J; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = luminousIntensityPF; } + } + + /* ISO-80000-7 item 7-14 luminous intensity */ + /* See package ISQBase for the declarations of LuminousIntensityValue and LuminousIntensityUnit */ + + /* ISO-80000-7 item 7-15 luminance */ + attribute def LuminanceValue :> ScalarQuantityValue { + doc + /* + * source: item 7-15 luminance + * symbol(s): `L_v`, `(L)` + * application domain: generic + * name: Luminance + * quantity dimension: L^-2*J^1 + * measurement unit(s): cd*m^-2 + * tensor order: 0 + * definition: density of luminous intensity with respect to projected area in a specified direction at a specified point on a real or imaginary surface, expressed by `L_v = (dI_v)/(dA) 1/cos(α)`, where `I_v` is luminous intensity (item 7-14), `A` is area (ISO 80000-3) and `α` is the angle between the normal to the surface at the specified point and the specified direction + * remarks: Luminance can be derived from the spectral radiance distribution by `L_v = K_m int_0^∞ L_(e,λ)(λ) V(λ) dλ`, where `K_m` is maximum luminous efficacy (item 7-11.3), `L_(e,λ)(λ)` is the spectral radiance (item 7-6.2) at wavelength `λ` (ISO 80000-3), and `V(λ)` is spectral luminous efficiency (item 7-10.2). See also 0.1. Integral limits can be confined depending on the spectral sensitivity of the detectors used as a sensor. The corresponding radiometric quantity is "radiance" (item 7-6.1). The corresponding quantity for photons is "photon radiance" (item 7-22). + */ + attribute :>> num: Real; + attribute :>> mRef: LuminanceUnit[1]; + } + + attribute luminance: LuminanceValue[*] nonunique :> scalarQuantities; + + attribute def LuminanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute luminousIntensityPF: QuantityPowerFactor[1] { :>> quantity = isq.J; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, luminousIntensityPF); } + } + + /* ISO-80000-7 item 7-16 illuminance */ + attribute def IlluminanceValue :> ScalarQuantityValue { + doc + /* + * source: item 7-16 illuminance + * symbol(s): `E_v`, `(E)` + * application domain: generic + * name: Illuminance + * quantity dimension: L^-2*J^1 + * measurement unit(s): lx, cd*sr*m^-2 + * tensor order: 0 + * definition: density of incident luminous flux with respect to area at a point on a real or imaginary surface, expressed by `E_v = (dΦ_v)/(dA)`, where `Φ_v` is luminous flux (item 7-13) and `A` is the area (ISO 80000-3) on which the luminous flux is incident + * remarks: Illuminance can be derived from the spectral irradiance distribution by `E_v = K_m int_0^∞ E_(e,λ)(λ) V(λ) dλ`, where `K_m` is maximum luminous efficacy (item 7-11.3), `E_(e,λ)(λ)` is the spectral irradiance (item 7-7.2) at wavelength `λ` (ISO 80000-3), and `V(λ)` is spectral luminous efficiency (item 7-10.2). Integral limits can be confined depending on the spectral sensitivity of the detectors used as a sensor. The corresponding radiometric quantity is "irradiance" (item 7-7.1). The corresponding quantity for photons is "photon irradiance" (item 7-23). The quantity "spherical illuminance" is defined by the mean value of illuminance on the outer curved surface of a very small (real or imaginary) sphere at a point in space. It can be expressed by `E_(v,0) = int_(4π) L_v dΩ`, where `Ω` is solid angle (ISO 80000-3) and `L_v` is luminance (item 7-15). It can be expressed by the quotient of the luminous flux (item 7-13) of all the light incident on the outer surface of an infinitely small sphere centred at the given point, and the area (ISO 80000-3) of the diametrical cross-section of that sphere. + */ + attribute :>> num: Real; + attribute :>> mRef: IlluminanceUnit[1]; + } + + attribute illuminance: IlluminanceValue[*] nonunique :> scalarQuantities; + + attribute def IlluminanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute luminousIntensityPF: QuantityPowerFactor[1] { :>> quantity = isq.J; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, luminousIntensityPF); } + } + + /* ISO-80000-7 item 7-17 luminous exitance */ + attribute def LuminousExitanceValue :> ScalarQuantityValue { + doc + /* + * source: item 7-17 luminous exitance + * symbol(s): `M_v`, `(M)` + * application domain: generic + * name: LuminousExitance + * quantity dimension: L^-2*J^1 + * measurement unit(s): lm/m^2, cd*sr*m^-2 + * tensor order: 0 + * definition: density of exiting luminous flux with respect to area at a point on a real or imaginary surface, expressed by `M_v = (dΦ_v)/(dA)`, where `Φ_v` is luminous flux (item 7-13) and `A` is the area (ISO 80000-3) from which the luminous flux leaves + * remarks: Luminous exitance can be derived from the spectral radiant exitance distribution by `M_v = K_m int_0^∞ M_(e,λ)(λ) V(λ) dλ`, where `K_m` is maximum luminous efficacy (item 7-11.3), `M_(e_λ)(λ)` is the spectral radiant exitance (item 7-8.2) at wavelength λ(ISO 80000-3), and `V(λ)` is spectral luminous efficiency (item 7-10.2). Integral limits can be confined depending on the spectral sensitivity of the detectors used as a sensor. The corresponding radiometric quantity is "radiant exitance" (item 7-8.1). The corresponding quantity for photons is "photon exitance" (item 7-24). + */ + attribute :>> num: Real; + attribute :>> mRef: LuminousExitanceUnit[1]; + } + + attribute luminousExitance: LuminousExitanceValue[*] nonunique :> scalarQuantities; + + attribute def LuminousExitanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute luminousIntensityPF: QuantityPowerFactor[1] { :>> quantity = isq.J; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, luminousIntensityPF); } + } + + /* ISO-80000-7 item 7-18 luminous exposure, quantity of illumination, light exposure */ + attribute def LuminousExposureValue :> ScalarQuantityValue { + doc + /* + * source: item 7-18 luminous exposure, quantity of illumination, light exposure + * symbol(s): `H_v`, `(H)` + * application domain: generic + * name: LuminousExposure + * quantity dimension: L^-2*T^1*J^1 + * measurement unit(s): lx*s, cd*sr*m^-2*s + * tensor order: 0 + * definition: density of incident luminous energy with respect to area at a point on a real or imaginary surface, expressed by `H_v = (dQ_v)/(dA)`, where `Q_v` is luminous energy (item 7-12) and `A` is the area on which the luminous energy is incident (ISO 80000-3) + * remarks: Luminous exposure can be derived from the spectral radiant exposure distribution by `H_v = K_m int_0^∞ H_(e,λ)(λ) V(λ) dλ`, where `K_m` is maximum luminous efficacy (item 7-11.3), `H_(e_λ)(λ)` is the spectral radiant exposure (item 7-9.2) at wavelength λ(ISO 80000-3), and `V(λ)` is spectral luminous efficiency (item 7-10.2). Integral limits can be confined depending on the spectral sensitivity of the detectors used as a sensor. The corresponding radiometric quantity is "radiant exposure" (item 7-9.1). The corresponding quantity for photons is "photon exposure" (item 7-25). + */ + attribute :>> num: Real; + attribute :>> mRef: LuminousExposureUnit[1]; + } + + attribute luminousExposure: LuminousExposureValue[*] nonunique :> scalarQuantities; + + attribute def LuminousExposureUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 1; } + private attribute luminousIntensityPF: QuantityPowerFactor[1] { :>> quantity = isq.J; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF, luminousIntensityPF); } + } + + alias QuantityOfIlluminationUnit for LuminousExposureUnit; + alias QuantityOfIlluminationValue for LuminousExposureValue; + alias quantityOfIllumination for luminousExposure; + + alias LightExposureUnit for LuminousExposureUnit; + alias LightExposureValue for LuminousExposureValue; + alias lightExposure for luminousExposure; + + /* ISO-80000-7 item 7-19.1 photon number, number of photons */ + attribute def PhotonNumberValue :> DimensionOneValue { + doc + /* + * source: item 7-19.1 photon number, number of photons + * symbol(s): `N_p` + * application domain: generic + * name: PhotonNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of radiant energy and photon energy, expressed by `N_p = Q_e/(h ν)`, where `Q_e` is radiant energy (item 7-2.1), `h` is the Planck constant (ISO 80000-1), and `ν` is the frequency (ISO 80000-3) of the corresponding electromagnetic wave + * remarks: Photon number can also be expressed by the time integral of the photon flux (item 7-20), `Φ_p`, over a given duration, `Δt`, `N_p = int_(Δt) Φ_p dt` + */ + } + attribute photonNumber: PhotonNumberValue :> scalarQuantities; + + alias numberOfPhotons for photonNumber; + + /* ISO-80000-7 item 7-19.2 photon energy */ + attribute photonEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 7-19.2 photon energy + * symbol(s): `Q_p`, `(Q)` + * application domain: generic + * name: PhotonEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: product of the Planck constant and frequency, expressed by `Q_p = h ν` where `h` is the Planck constant (ISO 80000-1) and `ν` is the frequency (ISO 80000-3) of the corresponding electromagnetic wave + * remarks: Photon energy can be emitted, transferred or received. For monochromatic radiation, photon energy may be expressed by photon number (item 7-19.1). The corresponding radiometric quantity is "radiant energy" (item 7-2.1). The corresponding photometric quantity is "luminous energy" (item 7-12). + */ + } + + /* ISO-80000-7 item 7-20 photon flux */ + attribute def PhotonFluxValue :> ScalarQuantityValue { + doc + /* + * source: item 7-20 photon flux + * symbol(s): `Φ_p`, `(Φ)` + * application domain: generic + * name: PhotonFlux + * quantity dimension: T^-1 + * measurement unit(s): s^-1 + * tensor order: 0 + * definition: rate of photon number per time interval, expressed by `Φ_p = (d N_p)/(dt)`, where `N_p` is photon number (e.g. given by item 7-19.1), transmitted or received, and `t` is time (ISO 80000-3) + * remarks: Photon flux `Φ_p` is related to radiant flux (item 7-4.1), `Φ_e`, of monochromatic radiation, by `Φ_p = Φ_e/(h ν)` where `h` is the Planck constant (ISO 80000-1), and `ν` is the frequency (ISO 80000-3) of the corresponding electromagnetic wave. The corresponding radiometric quantity is "radiant flux" (item 7-4.1). The corresponding photometric quantity is "luminous flux" (item 7-13). + */ + attribute :>> num: Real; + attribute :>> mRef: PhotonFluxUnit[1]; + } + + attribute photonFlux: PhotonFluxValue[*] nonunique :> scalarQuantities; + + attribute def PhotonFluxUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + /* ISO-80000-7 item 7-21 photon intensity */ + attribute def PhotonIntensityValue :> ScalarQuantityValue { + doc + /* + * source: item 7-21 photon intensity + * symbol(s): `I_p`, `(I)` + * application domain: generic + * name: PhotonIntensity + * quantity dimension: T^-1 + * measurement unit(s): s^-1*sr^-1 + * tensor order: 0 + * definition: density of photon flux with respect to solid angle in a specified direction, expressed by `I_p = (dΦ_p)/(dΩ)`, where `Φ_p` is the photon flux (item 7-20) emitted in the given direction, and `Ω` is the solid angle (ISO 80000-3) containing that direction + * remarks: The distribution of the photon intensities as a function of the direction of emission, e.g. given by the polar angles `(θ,ϕ)` , is used to determine the photon flux (item 7-20) within a certain solid angle (ISO 80000-3) `Ω` of a source: `Φ_p = int int_Ω I_v(θ,ϕ) sin(θ) dϕ dθ`. The corresponding radiometric quantity is "radiant intensity" (item 7-5.1). The corresponding photometric quantity is "luminous intensity" (item 7-14). + */ + attribute :>> num: Real; + attribute :>> mRef: PhotonIntensityUnit[1]; + } + + attribute photonIntensity: PhotonIntensityValue[*] nonunique :> scalarQuantities; + + attribute def PhotonIntensityUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + /* ISO-80000-7 item 7-22 photon radiance */ + attribute def PhotonRadianceValue :> ScalarQuantityValue { + doc + /* + * source: item 7-22 photon radiance + * symbol(s): `L_p`, `(L)` + * application domain: generic + * name: PhotonRadiance + * quantity dimension: L^-2*T^-1 + * measurement unit(s): m^-2*s^-1*sr^-1 + * tensor order: 0 + * definition: density of photon intensity with respect to projected area in a specified direction at a specified point on a real or imaginary surface, expressed by `L_p = (dI_p)/(dA) 1/cos(α)`, where `I_p` is photon intensity (item 7-21), `A` is area (ISO 80000-3) and `α` the angle between the normal to the surface at the specified point and the specified direction + * remarks: The corresponding radiometric quantity is "radiance" (item 7-6.1). The corresponding photometric quantity is "luminance" (item 7-15). + */ + attribute :>> num: Real; + attribute :>> mRef: PhotonRadianceUnit[1]; + } + + attribute photonRadiance: PhotonRadianceValue[*] nonunique :> scalarQuantities; + + attribute def PhotonRadianceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-7 item 7-23 photon irradiance */ + attribute def PhotonIrradianceValue :> ScalarQuantityValue { + doc + /* + * source: item 7-23 photon irradiance + * symbol(s): `E_p`, `(E)` + * application domain: generic + * name: PhotonIrradiance + * quantity dimension: L^-2*T^-1 + * measurement unit(s): m^-2*s^-1 + * tensor order: 0 + * definition: density of incident photon flux with respect to area at a point on a real or imaginary surface, expressed by `E_p = (dΦ_p)/(dA)`, where `Φ_p` is photon flux (item 7-20) and `A` is the area (ISO 80000-3) on which the photon flux is incident + * remarks: The corresponding radiometric quantity is "irradiance" (item 7-7.1). The corresponding photometric quantity is "illuminance" (item 7-16). + */ + attribute :>> num: Real; + attribute :>> mRef: PhotonIrradianceUnit[1]; + } + + attribute photonIrradiance: PhotonIrradianceValue[*] nonunique :> scalarQuantities; + + attribute def PhotonIrradianceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-7 item 7-24 photon exitance */ + attribute def PhotonExitanceValue :> ScalarQuantityValue { + doc + /* + * source: item 7-24 photon exitance + * symbol(s): `M_p`, `(M)` + * application domain: generic + * name: PhotonExitance + * quantity dimension: L^-2*T^-1 + * measurement unit(s): m^-2*s^-1 + * tensor order: 0 + * definition: density of exiting photon flux with respect to area at a point on a real or imaginary surface, expressed by `M_p = (dΦ_p)/(dA)`, where `Φ_p` is photon flux (item 7-20) and `A` is the area (ISO 80000-3) from which the photon flux leaves + * remarks: The corresponding radiometric quantity is "radiant exitance" (item 7-8.1). The corresponding photometric quantity is "luminous exitance" (item 7-17). + */ + attribute :>> num: Real; + attribute :>> mRef: PhotonExitanceUnit[1]; + } + + attribute photonExitance: PhotonExitanceValue[*] nonunique :> scalarQuantities; + + attribute def PhotonExitanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-7 item 7-25 photon exposure */ + attribute def PhotonExposureValue :> ScalarQuantityValue { + doc + /* + * source: item 7-25 photon exposure + * symbol(s): `H_p`, `(H)` + * application domain: generic + * name: PhotonExposure + * quantity dimension: L^-2 + * measurement unit(s): m^-2 + * tensor order: 0 + * definition: density of incident photon number with respect to area at a point on a real or imaginary surface, expressed by `H_p = (dN_p)/(dA)`, where `N_p` is photon number (item 7-19.1) and `A` is the area (ISO 80000-3) on which the photons are incident + * remarks: The corresponding radiometric quantity is "radiant exposure" (item 7-9.1). The corresponding photometric quantity is "luminous exposure" (item 7-18). + */ + attribute :>> num: Real; + attribute :>> mRef: PhotonExposureUnit[1]; + } + + attribute photonExposure: PhotonExposureValue[*] nonunique :> scalarQuantities; + + attribute def PhotonExposureUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-7 item 7-26.1 tristimulus values for the CIE 1931 standard colorimetric observer */ + attribute def TristimulusValuesForTheCie1931StandardColorimetricObserverValue :> ScalarQuantityValue { + doc + /* + * source: item 7-26.1 tristimulus values for the CIE 1931 standard colorimetric observer + * symbol(s): `X,Y,Z` + * application domain: generic + * name: TristimulusValuesForTheCie1931StandardColorimetricObserver + * quantity dimension: L^-2*J^1 + * measurement unit(s): cd*m^-2 + * tensor order: 0 + * definition: amounts of the three reference colour stimuli in the CIE 1931 standard colorimetric system, required to match the colour of the stimulus considered + * remarks: For a given colour stimulus described by the colour stimulus function `φ_λ(λ)` of a radiometric quantity, `X = k int_0^∞ φ_λ(λ) overline x(λ) dλ`, `Y = k int_0^∞ φ_λ(λ) overline y(λ) dλ`, `Z = k int_0^∞ φ_λ(λ) overline z(λ) dλ`, where `overline x(λ)`, `overline y(λ)`, `overline z(λ)` are the CIE colour-matching functions for the CIE 1931 standard colorimetric observer (2° observer) (item 7-27.1). For sources, `k` may be chosen as `k = K_m` where `K_m` is the maximum luminous efficacy (item 7-11.3) so that `Y = L_v` (item 7-15) and the unit of `X`, `Y`, `Z` is `[cd*m^-2]`. For object colours, `φ_λ(λ)` is given by one of the three products `φ_λ(λ) = S_λ(λ) * {(ρ(λ)), (τ(λ)), (β(λ)):}` where `S_λ(λ)` is the relative spectral distribution of a quantity characterizing the source illuminating the object, `ρ(λ)` is the spectral reflectance, `τ(λ)` is the spectral transmittance, `β(λ)` is the spectral radiance factor, and `k` is chosen to be `k = 100 // int_0^∞ S_λ(λ) overline y(λ) dλ`. Integral limits can be confined depending on the spectral sensitivity of the detectors used as a sensor. In this case, the unit of `X`, `Y`, `Z` is `[1]`. + */ + attribute :>> num: Real; + attribute :>> mRef: TristimulusValuesForTheCie1931StandardColorimetricObserverUnit[1]; + } + + attribute tristimulusValuesForTheCie1931StandardColorimetricObserver: TristimulusValuesForTheCie1931StandardColorimetricObserverValue[*] nonunique :> scalarQuantities; + + attribute def TristimulusValuesForTheCie1931StandardColorimetricObserverUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute luminousIntensityPF: QuantityPowerFactor[1] { :>> quantity = isq.J; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, luminousIntensityPF); } + } + + /* ISO-80000-7 item 7-26.2 tristimulus values for the CIE 1964 standard colorimetric observer */ + attribute def TristimulusValuesForTheCie1964StandardColorimetricObserverValue :> ScalarQuantityValue { + doc + /* + * source: item 7-26.2 tristimulus values for the CIE 1964 standard colorimetric observer + * symbol(s): `X_10,Y_10,Z_10` + * application domain: generic + * name: TristimulusValuesForTheCie1964StandardColorimetricObserver + * quantity dimension: L^-2*J^1 + * measurement unit(s): cd*m^-2 + * tensor order: 0 + * definition: amounts of the three reference colour stimuli in the CIE 1964 standard colorimetric system, required to match the colour of the stimulus considered + * remarks: For a given colour stimulus described by the colour stimulus function `φ_λ(λ)` of a radiometric quantity, `X = k int_0^∞ φ_λ(λ) overline x(λ) dλ`, `Y = k int_0^∞ φ_λ(λ) overline y(λ) dλ`, `Z = k int_0^∞ φ_λ(λ) overline z(λ) dλ`, where `overline x(λ)`, `overline y(λ)`, `overline z(λ)` are the CIE colour-matching functions for the CIE 1931 standard colorimetric observer (2° observer) (item 7-27.1). For sources, `k` may be chosen as `k = K_m` where `K_m` is the maximum luminous efficacy (item 7-11.3) so that `Y = L_v` (item 7-15) and the unit of `X`, `Y`, `Z` is `["cd"*"m"^-2]`. For object colours, `φ_λ(λ)` is given by one of the three products `φ_λ(λ) = S_λ(λ) * {(ρ(λ)), (τ(λ)), (β(λ)):}` where `S_λ(λ)` is the relative spectral distribution of a quantity characterizing the source illuminating the object, `ρ(λ)` is the spectral reflectance, `τ(λ)` is the spectral transmittance, `β(λ)` is the spectral radiance factor, and `k` is chosen to be `k = 100 /( int_0^∞ S_λ(λ) overline y(λ) dλ)`. Integral limits can be confined depending on the spectral sensitivity of the detectors used as a sensor. In this case, the unit of `X`, `Y`, `Z` is `[1]`. + */ + attribute :>> num: Real; + attribute :>> mRef: TristimulusValuesForTheCie1964StandardColorimetricObserverUnit[1]; + } + + attribute tristimulusValuesForTheCie1964StandardColorimetricObserver: TristimulusValuesForTheCie1964StandardColorimetricObserverValue[*] nonunique :> scalarQuantities; + + attribute def TristimulusValuesForTheCie1964StandardColorimetricObserverUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute luminousIntensityPF: QuantityPowerFactor[1] { :>> quantity = isq.J; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, luminousIntensityPF); } + } + + /* ISO-80000-7 item 7-27.1 CIE colour-matching functions for the CIE 1931 standard colorimetric observer */ + attribute def CieColourMatchingFunctionsForTheCie1931StandardColorimetricObserverValue :> DimensionOneValue { + doc + /* + * source: item 7-27.1 CIE colour-matching functions for the CIE 1931 standard colorimetric observer + * symbol(s): `overline x(λ)`, `overline y(λ)`, `overline z(λ)` + * application domain: generic + * name: CieColourMatchingFunctionsForTheCie1931StandardColorimetricObserver (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: functions `overline x(λ)` , `overline y(λ)` , `overline z(λ)` in the CIE 1931 standard colorimetric system + * remarks: Values of `overline x(λ)` , `overline y(λ)` and `overline z(λ)` are defined in the CIE 1931 standard colorimetric system (2° observer) — applicable to fields of observation of angular opening from 1° to 4°. + */ + } + attribute cieColourMatchingFunctionsForTheCie1931StandardColorimetricObserver: CieColourMatchingFunctionsForTheCie1931StandardColorimetricObserverValue :> scalarQuantities; + + /* ISO-80000-7 item 7-27.2 CIE colour-matching functions for the CIE 1964 standard colorimetric observer */ + attribute def CieColourMatchingFunctionsForTheCie1964StandardColorimetricObserverValue :> DimensionOneValue { + doc + /* + * source: item 7-27.2 CIE colour-matching functions for the CIE 1964 standard colorimetric observer + * symbol(s): `overline x_10(λ)`, `overline y_10(λ)`, `overline z_10(λ)` + * application domain: generic + * name: CieColourMatchingFunctionsForTheCie1964StandardColorimetricObserver (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: functions `overline x_10(λ)` , `overline y_10(λ)` , `overline z_10(λ)` in the CIE 1964 standard colorimetric system + * remarks: Values of `overline x_10(λ)` , `overline y_10(λ)` and `overline z_10(λ)` are defined in the CIE 1964 standard colorimetric system (10° observer) — applicable to fields of observation with angles greater than 4°. + */ + } + attribute cieColourMatchingFunctionsForTheCie1964StandardColorimetricObserver: CieColourMatchingFunctionsForTheCie1964StandardColorimetricObserverValue :> scalarQuantities; + + /* ISO-80000-7 item 7-28.1 chromaticity coordinates in the CIE 1931 standard colorimetric system */ + attribute def ChromaticityCoordinatesInTheCie1931StandardColorimetricSystemValue :> DimensionOneValue { + doc + /* + * source: item 7-28.1 chromaticity coordinates in the CIE 1931 standard colorimetric system + * symbol(s): `x,y,z` + * application domain: generic + * name: ChromaticityCoordinatesInTheCie1931StandardColorimetricSystem (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: coordinates expressing the quotients of each of a set of three tristimulus values for the CIE 1931 standard colorimetric observer (item 7-26.1) and their sum, expressed by `x = X / (X+Y+Z)` , `y = Y / (X+Y+Z)` , `z = Z / (X+Y+Z)` + * remarks: Since `x + y + z = 1`, two variables are sufficient to express chromaticity. + */ + } + attribute chromaticityCoordinatesInTheCie1931StandardColorimetricSystem: ChromaticityCoordinatesInTheCie1931StandardColorimetricSystemValue :> scalarQuantities; + + /* ISO-80000-7 item 7-28.2 chromaticity coordinates in the CIE 1964 standard colorimetric system */ + attribute def ChromaticityCoordinatesInTheCie1964StandardColorimetricSystemValue :> DimensionOneValue { + doc + /* + * source: item 7-28.2 chromaticity coordinates in the CIE 1964 standard colorimetric system + * symbol(s): `x_10,y_10,z_10` + * application domain: generic + * name: ChromaticityCoordinatesInTheCie1964StandardColorimetricSystem (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: coordinates expressing the quotients of each of a set of three tristimulus values for the CIE 1964 standard colorimetric observer (item 7-26.2) and their sum, expressed by `x_10 = X_10 / (X_10+Y_10+Z_10)`, `y_10 = Y_10 / (X_10+Y_10+Z_10)`, `z_10 = Z_10 / (X_10+Y_10+Z_10)` + * remarks: Since `x_10 + y_10 + z_10 = 1`, two variables are sufficient to express chromaticity. + */ + } + attribute chromaticityCoordinatesInTheCie1964StandardColorimetricSystem: ChromaticityCoordinatesInTheCie1964StandardColorimetricSystemValue :> scalarQuantities; + + /* ISO-80000-7 item 7-29.1 colour temperature */ + attribute colourTemperature: ThermodynamicTemperatureValue :> scalarQuantities { + doc + /* + * source: item 7-29.1 colour temperature + * symbol(s): `T_c` + * application domain: generic + * name: ColourTemperature (specializes ThermodynamicTemperature) + * quantity dimension: Θ^1 + * measurement unit(s): K + * tensor order: 0 + * definition: temperature of a Planckian radiator whose radiation has the same chromaticity as that of a given stimulus + * remarks: None. + */ + } + + /* ISO-80000-7 item 7-29.2 correlated colour temperature */ + attribute correlatedColourTemperature: ThermodynamicTemperatureValue :> scalarQuantities { + doc + /* + * source: item 7-29.2 correlated colour temperature + * symbol(s): `T_"cp"` + * application domain: generic + * name: CorrelatedColourTemperature (specializes ThermodynamicTemperature) + * quantity dimension: Θ^1 + * measurement unit(s): K + * tensor order: 0 + * definition: temperature of a Planckian radiator having the chromaticity nearest the chromaticity associated with the given spectral distribution on a modified 1976 CIE Uniform Chromaticity Scale (UCS) diagram where `u',2/3 v'` are the coordinates of the Planckian locus and the test stimulus + * remarks: None. + */ + } + + /* ISO-80000-7 item 7-30.1 emissivity */ + attribute def EmissivityValue :> DimensionOneValue { + doc + /* + * source: item 7-30.1 emissivity + * symbol(s): `ε`, `ε_T` + * application domain: generic + * name: Emissivity (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the radiant exitance of a radiator and the radiant exitance of a Planckian radiator at the same temperature, expressed by `ε = M/M_b`, where `M` is the radiant exitance (item 7-8.1) of a thermal radiator and `M_b` is the radiant exitance of a Planckian radiator at the same temperature (ISO 80000-5) + * remarks: None. + */ + } + attribute emissivity: EmissivityValue :> scalarQuantities; + + /* ISO-80000-7 item 7-30.2 emissivity at a specified wavelength */ + attribute def EmissivityAtASpecifiedWavelengthValue :> DimensionOneValue { + doc + /* + * source: item 7-30.2 emissivity at a specified wavelength + * symbol(s): `ε(λ)` + * application domain: generic + * name: EmissivityAtASpecifiedWavelength (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the radiant exitance of a radiator at a specified wavelength and the radiant exitance of a Planckian radiator at the same temperature and at the same wavelength, expressed by `ε(λ) = M(λ) / M_b(λ)`, where `M(λ)` is the radiant exitance (item 7-8.1) of a thermal radiator at a specified wavelength and `M_b(λ)` is the radiant exitance of a Planckian radiator at the same temperature at a specified wavelength (ISO 80000-3) + * remarks: None. + */ + } + attribute emissivityAtASpecifiedWavelength: EmissivityAtASpecifiedWavelengthValue :> scalarQuantities; + + /* ISO-80000-7 item 7-31.1 absorptance */ + attribute def AbsorptanceValue :> DimensionOneValue { + doc + /* + * source: item 7-31.1 absorptance + * symbol(s): `α`, `a` + * application domain: generic + * name: Absorptance (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of absorbed radiant flux and incident radiant flux, expressed by `α = Φ_a/Φ_m`, where `Φ_a` is absorbed radiant flux (item 7-4.1) and `Φ_m` is incident radiant flux + * remarks: This quantity is also defined spectrally in terms of wavelength, in which case "spectral" is added before the quantity name. Due to energy conservation, `α + ρ + τ = 1` except when polarized radiation is observed, where `ρ` is reflectance (item 7-31.3) and `τ` is transmittance (item 7-31.5). + */ + } + attribute absorptance: AbsorptanceValue :> scalarQuantities; + + /* ISO-80000-7 item 7-31.2 luminous absorptance */ + attribute def LuminousAbsorptanceValue :> DimensionOneValue { + doc + /* + * source: item 7-31.2 luminous absorptance + * symbol(s): `α_v` + * application domain: generic + * name: LuminousAbsorptance (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of absorbed luminous flux and incident luminous flux, expressed by `α_v = Φ_(v,a)/Φ_(v,m)`, where `Φ_(v,a)` is absorbed luminous flux (item 7-13) and `Φ_(v,m)` is incident luminous flux + * remarks: From spectral absorptance, `α(λ)`, luminous absorptance can be calculated by `α_v = (int_0^∞ α(λ) Φ_(e,λ)(λ) V(λ) dλ)/(int_0^∞ Φ_(e,λ)(λ) V(λ) dλ)`, where `Φ_(e,λ)(λ)` is spectral radiant flux (or relative spectral distribution) of the source, and `V(λ)` is spectral luminous efficiency (item 7-10.2). See also item 7-31.1. + */ + } + attribute luminousAbsorptance: LuminousAbsorptanceValue :> scalarQuantities; + + /* ISO-80000-7 item 7-31.3 reflectance */ + attribute def ReflectanceValue :> DimensionOneValue { + doc + /* + * source: item 7-31.3 reflectance + * symbol(s): `ρ` + * application domain: generic + * name: Reflectance (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of reflected radiant flux and incident radiant flux, expressed by `ρ = Φ_r/Φ_m`, where `Φ_r` is reflected radiant flux (item 7-4.1) and `Φ_m` is incident radiant flux + * remarks: This quantity is also defined spectrally in terms of wavelength, in which case, "spectral" is added before the quantity name. Due to energy conservation, `α + ρ + τ = 1` except when polarized radiation is observed, where `α` is absorptance (item 7-31.1) and `τ` is transmittance (item 7-31.5). + */ + } + attribute reflectance: ReflectanceValue :> scalarQuantities; + + /* ISO-80000-7 item 7-31.4 luminous reflectance */ + attribute def LuminousReflectanceValue :> DimensionOneValue { + doc + /* + * source: item 7-31.4 luminous reflectance + * symbol(s): `ρ_v` + * application domain: generic + * name: LuminousReflectance (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of reflected luminous flux and incident luminous flux, is expressed by `ρ_v = Φ_(v,r)/Φ_(v,m)`, where `Φ_(v,r)` is reflected luminous flux (item 7-13) and `Φ_(v,m)` is incident luminous flux + * remarks: From spectral reflectance, `ρ(λ)`, luminous reflectance can be calculated by `ρ_v = (int_0^∞ ρ(λ) Φ_(e,λ)(λ) V(λ) dλ)/(int_0^∞ Φ_(e,λ)(λ) V(λ) dλ)`, where `Φ_(e,λ)(λ)` is spectral radiant flux (or relative spectral distribution) of the source, and `V(λ)` is spectral luminous efficiency (item 7-10.2). See also item 7-31.3. + */ + } + attribute luminousReflectance: LuminousReflectanceValue :> scalarQuantities; + + /* ISO-80000-7 item 7-31.5 transmittance */ + attribute def TransmittanceValue :> DimensionOneValue { + doc + /* + * source: item 7-31.5 transmittance + * symbol(s): `τ`, `T` + * application domain: generic + * name: Transmittance (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of transmitted radiant flux and incident radiant flux, expressed by `τ = Φ_t/Φ_m`, where `Φ_t` is transmitted radiant flux (item 7-4.1) and `Φ_m` is incident radiant flux + * remarks: This quantity is also defined spectrally in terms of wavelength, in which case, "spectral" is added before the quantity name. Due to energy conservation, `α + ρ + τ = 1` except when polarized radiation is observed, where `α` is absorptance (item 7-31.1) and `ρ` is reflectance (item 7-31.3). + */ + } + attribute transmittance: TransmittanceValue :> scalarQuantities; + + /* ISO-80000-7 item 7-31.6 luminous transmittance */ + attribute def LuminousTransmittanceValue :> DimensionOneValue { + doc + /* + * source: item 7-31.6 luminous transmittance + * symbol(s): `τ_v` + * application domain: generic + * name: LuminousTransmittance (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of transmitted luminous flux and incident luminous flux, expressed by `τ_v = Φ_(v,t)/Φ_(v,m)`, where `Φ_(v,t)` is transmitted luminous flux (item 7-13) and `Φ_(v,m)` is luminous flux of the incident radiation + * remarks: From the spectral transmittance `τ(λ)`, luminous transmittance can be calculated by `τ_v = (int_0^∞ τ(λ) Φ_(e,λ)(λ) V(λ) dλ)/(int_0^∞ Φ_(e,λ)(λ) V(λ) dλ)`, where `Φ_(e,λ)(λ)` is the spectral radiant flux (or relative spectral distribution) of the source, and `V(λ)` is the spectral luminous efficiency (item 7-10.2). See also item 7-31.5. + */ + } + attribute luminousTransmittance: LuminousTransmittanceValue :> scalarQuantities; + + /* ISO-80000-7 item 7-32.1 transmittance optical density, optical density, transmittance density, decadic absorbance */ + attribute def TransmittanceOpticalDensityValue :> DimensionOneValue { + doc + /* + * source: item 7-32.1 transmittance optical density, optical density, transmittance density, decadic absorbance + * symbol(s): `D`, `A_10`, `D_τ` + * application domain: generic + * name: TransmittanceOpticalDensity (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: logarithm to base 10 of the reciprocal of the transmittance, `τ` (item 7-31.5) + * remarks: If defined in terms of wavelength, the optical density can be expressed by `A_10(λ) = -log(τ(λ))`, where `τ(λ)` is the transmittance (item 7-31.5) in terms of wavelength. In spectroscopy, the name "absorbance" `A_10` is generally used. + */ + } + attribute transmittanceOpticalDensity: TransmittanceOpticalDensityValue :> scalarQuantities; + + alias opticalDensity for transmittanceOpticalDensity; + + alias transmittanceDensity for transmittanceOpticalDensity; + + alias decadicAbsorbance for transmittanceOpticalDensity; + + /* ISO-80000-7 item 7-32.2 Napierian absorbance */ + attribute def NapierianAbsorbanceValue :> DimensionOneValue { + doc + /* + * source: item 7-32.2 Napierian absorbance + * symbol(s): `A_n`, `B` + * application domain: generic + * name: NapierianAbsorbance (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: natural (Napierian) logarithm of the reciprocal of the transmittance, `τ` (item 7-31.5) + * remarks: If defined in terms of wavelength, the Napierian absorbance can be expressed by `A_n(λ) = B(λ) = -log(τ(λ))`. It can also be expressed as `A_n(λ) = l*α(λ)`, where `α` is linear absorption coefficient (item 7-35.2) and `l` is length (ISO 80000-3) traversed. + */ + } + attribute napierianAbsorbance: NapierianAbsorbanceValue :> scalarQuantities; + + /* ISO-80000-7 item 7-33.1 radiance factor */ + attribute def RadianceFactorValue :> DimensionOneValue { + doc + /* + * source: item 7-33.1 radiance factor + * symbol(s): `β_e`, `(β)` + * application domain: generic + * name: RadianceFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the radiance of a surface element in a specified direction and the radiance of the perfect reflecting diffuser or perfect transmitting diffuser identically irradiated and viewed, expressed by `β_e = L_(e,n)/L_(e,d)`, where `L_(e,n)` is the radiance (item 7-6.1) of a surface element in a given direction and `L_(e,d)` is the radiance of the perfect reflecting or transmitting diffuser identically irradiated and viewed + * remarks: The definition holds for a surface element of a non-self-radiating medium, in a given direction and under specified conditions of irradiation. Radiance factor is equivalent to reflectance factor (item 7-34) or luminance factor (item 7-33.2) when the cone angle is infinitely small, and is equivalent to reflectance (item 7-31.3) when the cone angle is `2π ["sr"]`. These quantities are also defined spectrally and called spectral radiance factor `β(λ)` and spectral reflectance factor `R(λ)`. The ideal isotropic (Lambertian) diffuser with reflectance (item 7-31.3) or transmittance (item 7-31.5) equal to 1 is called "perfect diffuser". + */ + } + attribute radianceFactor: RadianceFactorValue :> scalarQuantities; + + /* ISO-80000-7 item 7-33.2 luminance factor */ + attribute def LuminanceFactorValue :> DimensionOneValue { + doc + /* + * source: item 7-33.2 luminance factor + * symbol(s): `β_v`, `(β)` + * application domain: generic + * name: LuminanceFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the luminance of a surface element in a specified direction and the luminance of the perfect reflecting diffuser or perfect transmitting diffuser identically illuminated and viewed, expressed by `β_v = L_(v,n)/L_(v,d)`, where `L_(v,n)` is the luminance (item 7-15) of a surface element in a given direction and `L_(v,d)` is the luminance of the perfect reflecting or transmitting diffuser identically illuminated and viewed + * remarks: The definition holds for a surface element of a non-luminous medium, in a given direction and under specified conditions of irradiation. This quantity is also defined spectrally and is called "spectral luminance factor". For the analogous radiant quantity "radiance factor", see item 7-33.1. + */ + } + attribute luminanceFactor: LuminanceFactorValue :> scalarQuantities; + + /* ISO-80000-7 item 7-34 reflectance factor */ + attribute def ReflectanceFactorValue :> DimensionOneValue { + doc + /* + * source: item 7-34 reflectance factor + * symbol(s): `R` + * application domain: generic + * name: ReflectanceFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of the flux reflected in the directions delimited by a given cone with apex at a surface element and the flux reflected in the same directions by a perfect reflecting diffuser identically irradiated or illuminated, expressed by `R = Φ_n/Φ_d`, where `Φ_n` is the flux reflected in the directions delimited by a given cone and `Φ_d` is the flux reflected in the same directions by an identically irradiated diffuser of reflectance (item 7-31.3) equal to 1 + * remarks: The flux can be a radiant flux (item 7‐4.1) or a luminous flux (item 7‐13). The definition holds for a surface element, for the part of the reflected radiation contained in a given cone with apex at the surface element, and for incident radiation of given spectral composition, polarization and geometric distribution. Reflectance factor is equivalent to radiance factor (item 7-33.1) or luminance factor (item 7-33.2) when the cone angle is infinitely small, and is equivalent to reflectance (item 7-31.3) when the cone angle is 2π sr. These quantities are also defined spectrally and called spectral radiance factor `β(λ)` and spectral reflectance factor `R(λ)`. The ideal isotropic (Lambertian) diffuser with reflectance (item 7-31.3) or transmittance (item 7-31.5) equal to 1 is called a perfect diffuser. + */ + } + attribute reflectanceFactor: ReflectanceFactorValue :> scalarQuantities; + + /* ISO-80000-7 item 7-35.1 linear attenuation coefficient, linear extinction coefficient */ + attribute def LinearAttenuationCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 7-35.1 linear attenuation coefficient, linear extinction coefficient + * symbol(s): `μ`, `μ_l` + * application domain: radiometry + * name: LinearAttenuationCoefficient + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: relative decrease in radiant flux caused by absorption and scattering + * remarks: This quantity is also defined spectrally in terms of wavelength, in which case, "spectral" is added before this quantity name. The spectral linear attenuation coefficient can be expressed by the relative decrease in the spectral radiant flux, `Φ_(e,λ)(λ)`, with respect to propagation length, `l`, of a collimated beam at a point in an absorbing and scattering medium `μ(λ) = 1/(Φ_(e,λ)(λ)) (d Φ_(e,λ)(λ))/(dl)`. Similarly, luminous and photon quantities can be defined. + */ + attribute :>> num: Real; + attribute :>> mRef: LinearAttenuationCoefficientUnit[1]; + } + + attribute linearAttenuationCoefficient: LinearAttenuationCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def LinearAttenuationCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + alias LinearExtinctionCoefficientUnit for LinearAttenuationCoefficientUnit; + alias LinearExtinctionCoefficientValue for LinearAttenuationCoefficientValue; + alias linearExtinctionCoefficient for linearAttenuationCoefficient; + + /* ISO-80000-7 item 7-35.2 linear absorption coefficient */ + attribute def LinearAbsorptionCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 7-35.2 linear absorption coefficient + * symbol(s): `α_l`, `a_l`, `α` + * application domain: radiometry + * name: LinearAbsorptionCoefficient + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: relative decrease in radiant flux (item 7-4.1) caused by absorption + * remarks: This quantity is also defined spectrally in terms of wavelength, in which case, "spectral" is added before this quantity name. The spectral linear absorption coefficient can be expressed by the relative decrease in the spectral radiant flux, `Φ_(e,λ)(λ)`, with respect to propagation length, `l`, of a collimated beam at a point in an absorbing medium `α_l(λ) = 1/(Φ_(e,λ)(λ)) (d Φ_(e,λ)(λ))/(dl)`. It can also be expressed as a function of transmittance (item 7-31.5). `α_l = -ln(τ)/l = A_n/l`. The linear absorption coefficient is that part of the linear attenuation coefficient (item 7-35.1) that is due to absorption. Scattering might also contribute. Similarly, luminous and photon quantities can be defined. + */ + attribute :>> num: Real; + attribute :>> mRef: LinearAbsorptionCoefficientUnit[1]; + } + + attribute linearAbsorptionCoefficient: LinearAbsorptionCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def LinearAbsorptionCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-7 item 7-36.1 mass attenuation coefficient */ + attribute def MassAttenuationCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 7-36.1 mass attenuation coefficient + * symbol(s): `μ_m` + * application domain: radiometry + * name: MassAttenuationCoefficient + * quantity dimension: L^2*M^-1 + * measurement unit(s): kg^-1*m^2 + * tensor order: 0 + * definition: quotient of the linear attenuation coefficient (item 7-35.1), `μ`, and the mass density (ISO 80000-4), `ρ`, of the medium + * remarks: This quantity is also defined spectrally in terms of wavelength, in which case, "spectral" is added before this quantity name, which can be expressed by `μ_m(λ) = (μ(λ))/ρ_m`. Similarly, luminous and photon quantities can be defined. + */ + attribute :>> num: Real; + attribute :>> mRef: MassAttenuationCoefficientUnit[1]; + } + + attribute massAttenuationCoefficient: MassAttenuationCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def MassAttenuationCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + + /* ISO-80000-7 item 7-36.2 mass absorption coefficient */ + attribute def MassAbsorptionCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 7-36.2 mass absorption coefficient + * symbol(s): `α_m` + * application domain: radiometry + * name: MassAbsorptionCoefficient + * quantity dimension: L^2*M^-1 + * measurement unit(s): kg^-1*m^2 + * tensor order: 0 + * definition: quotient of the linear absorption coefficient (item 7-35.2), `α`, and the mass density (ISO 80000-4), `ρ`, of the medium + * remarks: This quantity is also defined spectrally in terms of wavelength, in which case, "spectral" is added before this quantity name, which can be expressed by `α_m(λ) = (α(λ))/ρ_m`. Similarly, luminous and photon quantities can be defined. + */ + attribute :>> num: Real; + attribute :>> mRef: MassAbsorptionCoefficientUnit[1]; + } + + attribute massAbsorptionCoefficient: MassAbsorptionCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def MassAbsorptionCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + + /* ISO-80000-7 item 7-37 molar absorption coefficient */ + attribute def MolarAbsorptionCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 7-37 molar absorption coefficient + * symbol(s): `χ` + * application domain: radiometry + * name: MolarAbsorptionCoefficient + * quantity dimension: L^2*N^-1 + * measurement unit(s): m^2*mol^-1 + * tensor order: 0 + * definition: product of linear absorption coefficient and molar volume, expressed by `χ = α V_m`, where `α` is linear absorption coefficient (item 7-35.2) and `V_m` is molar volume (ISO 80000-9) + * remarks: The molar absorption coefficient can also be expressed by `χ = α c` where `c` is amount-of-substance concentration (ISO 80000-9). Similarly, luminous and photon quantities can be defined. + */ + attribute :>> num: Real; + attribute :>> mRef: MolarAbsorptionCoefficientUnit[1]; + } + + attribute molarAbsorptionCoefficient: MolarAbsorptionCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def MolarAbsorptionCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute amountOfSubstancePF: QuantityPowerFactor[1] { :>> quantity = isq.N; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, amountOfSubstancePF); } + } + +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml new file mode 100644 index 0000000000000000000000000000000000000000..fd1b1bbc70cbb932e47df46a605607d0eda6a3b3 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml @@ -0,0 +1,1583 @@ +standard library package ISQMechanics { + doc + /* + * International System of Quantities and Units + * Generated on 2022-08-07T14:44:27Z from standard ISO-80000-4:2019 "Mechanics" + * see also https://www.iso.org/obp/ui/#iso:std:iso:80000:-4:ed-2:v1:en + * + * Note 1: In documentation comments, AsciiMath notation (see http://asciimath.org/) is used for mathematical concepts, + * with Greek letters in Unicode encoding. In running text, AsciiMath is placed between backticks. + * Note 2: For vector and tensor quantities currently the unit and quantity value type for their (scalar) magnitude is + * defined, as well as their typical Cartesian 3d VectorMeasurementReference (i.e. coordinate system) + * or TensorMeasurementReference. + */ + + private import ScalarValues::Real; + private import Quantities::*; + private import MeasurementReferences::*; + private import ISQBase::*; + + /* Quantity definitions referenced from other ISQ packages */ + private import ISQThermodynamics::EnergyValue; + + /* ISO-80000-4 item 4-1 mass */ + /* See package ISQBase for the declarations of MassValue and MassUnit */ + + /* ISO-80000-4 item 4-2 mass density, density */ + attribute def MassDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 4-2 mass density, density + * symbol(s): `ρ`, `ρ_m` + * application domain: generic + * name: MassDensity + * quantity dimension: L^-3*M^1 + * measurement unit(s): kg*m^-3 + * tensor order: 0 + * definition: quantity representing the spatial distribution of mass of a continuous material: `ρ(vec(r)) = (dm)/(dV)` where `m` is mass of the material contained in an infinitesimal domain at point `vec(r)` and `V` is volume of this domain + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MassDensityUnit[1]; + } + + attribute massDensity: MassDensityValue[*] nonunique :> scalarQuantities; + + attribute def MassDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + + alias DensityUnit for MassDensityUnit; + alias DensityValue for MassDensityValue; + alias density for massDensity; + + /* ISO-80000-4 item 4-3 specific volume */ + attribute def SpecificVolumeValue :> ScalarQuantityValue { + doc + /* + * source: item 4-3 specific volume + * symbol(s): `v` + * application domain: generic + * name: SpecificVolume + * quantity dimension: L^3*M^-1 + * measurement unit(s): kg^-1*m^3 + * tensor order: 0 + * definition: reciprocal of mass density `ρ` (item 4-2): `v = 1/ρ` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: SpecificVolumeUnit[1]; + } + + attribute specificVolume: SpecificVolumeValue[*] nonunique :> scalarQuantities; + + attribute def SpecificVolumeUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 3; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + + /* ISO-80000-4 item 4-4 relative mass density, relative density */ + attribute def RelativeMassDensityValue :> DimensionOneValue { + doc + /* + * source: item 4-4 relative mass density, relative density + * symbol(s): `d` + * application domain: generic + * name: RelativeMassDensity (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of mass density of a substance `ρ` and mass density of a reference substance `ρ_0` : `d = ρ/ρ_0` + * remarks: Conditions and material should be specified for the reference substance. + */ + } + attribute relativeMassDensity: RelativeMassDensityValue :> scalarQuantities; + + alias relativeDensity for relativeMassDensity; + + /* ISO-80000-4 item 4-5 surface mass density, surface density */ + attribute def SurfaceMassDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 4-5 surface mass density, surface density + * symbol(s): `ρ_A` + * application domain: generic + * name: SurfaceMassDensity + * quantity dimension: L^-2*M^1 + * measurement unit(s): kg*m^-2 + * tensor order: 0 + * definition: quantity representing the areal distribution of mass of a continuous material: `ρ_A(vec(r)) = (dm)/(dA)` where `m` is the mass of the material at position `vec(r)` and `A` is area + * remarks: The name "grammage" should not be used for this quantity. + */ + attribute :>> num: Real; + attribute :>> mRef: SurfaceMassDensityUnit[1]; + } + + attribute surfaceMassDensity: SurfaceMassDensityValue[*] nonunique :> scalarQuantities; + + attribute def SurfaceMassDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + + alias SurfaceDensityUnit for SurfaceMassDensityUnit; + alias SurfaceDensityValue for SurfaceMassDensityValue; + alias surfaceDensity for surfaceMassDensity; + + /* ISO-80000-4 item 4-6 linear mass density, linear density */ + attribute def LinearMassDensityValue :> ScalarQuantityValue { + doc + /* + * source: item 4-6 linear mass density, linear density + * symbol(s): `ρ_I` + * application domain: generic + * name: LinearMassDensity + * quantity dimension: L^-1*M^1 + * measurement unit(s): kg*m^-1 + * tensor order: 0 + * definition: quantity representing the linear distribution of mass of a continuous material: `ρ_I(vec(r)) = (dm)/(dI)` where `m` is the mass of the material at position `vec(r)` and `l` is length + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: LinearMassDensityUnit[1]; + } + + attribute linearMassDensity: LinearMassDensityValue[*] nonunique :> scalarQuantities; + + attribute def LinearMassDensityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + + alias LinearDensityUnit for LinearMassDensityUnit; + alias LinearDensityValue for LinearMassDensityValue; + alias linearDensity for linearMassDensity; + + /* ISO-80000-4 item 4-7 moment of inertia */ + attribute def MomentOfInertiaValue :> ScalarQuantityValue { + doc + /* + * source: item 4-7 moment of inertia (magnitude) + * symbol(s): `J` + * application domain: generic + * name: MomentOfInertia + * quantity dimension: L^2*M^1 + * measurement unit(s): kg*m^2 + * tensor order: 0 + * definition: tensor (ISO 80000-2) quantity representing rotational inertia of a rigid body relative to a fixed centre of rotation expressed by the tensor product: `vec(L) = vec(vec(J)) vec(ω)` where `vec(L)` is angular momentum (item 4-11) of the body relative to the reference point and `vec(ω)` is its angular velocity (ISO 80000-3) + * remarks: The calculation of the value requires an integration. + */ + attribute :>> num: Real; + attribute :>> mRef: MomentOfInertiaUnit[1]; + } + + attribute momentOfInertia: MomentOfInertiaValue[*] nonunique :> scalarQuantities; + + attribute def MomentOfInertiaUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + + attribute def Cartesian3dMomentOfInertiaTensor :> TensorQuantityValue { + doc + /* + * source: item 4-7 moment of inertia (tensor) + * symbol(s): `vec(vec(J))` + * application domain: generic + * name: MomentOfInertia + * quantity dimension: L^2*M^1 + * measurement unit(s): kg*m^2 + * tensor order: 2 + * definition: tensor (ISO 80000-2) quantity representing rotational inertia of a rigid body relative to a fixed centre of rotation expressed by the tensor product: `vec(L) = vec(vec(J)) vec(ω)` where `vec(L)` is angular momentum (item 4-11) of the body relative to the reference point and `vec(ω)` is its angular velocity (ISO 80000-3) + * remarks: The calculation of the value requires an integration. + */ + attribute :>> isBound = false; + attribute :>> num: Real[9]; + attribute :>> mRef: Cartesian3dMomentOfInertiaMeasurementReference[1]; + } + + attribute momentOfInertiaTensor: Cartesian3dMomentOfInertiaTensor :> tensorQuantities; + + attribute def Cartesian3dMomentOfInertiaMeasurementReference :> TensorMeasurementReference { + attribute :>> dimensions = (3, 3); + attribute :>> isBound = false; + attribute :>> mRefs: MomentOfInertiaUnit[9]; + } + + /* ISO-80000-4 item 4-8 momentum */ + attribute def MomentumValue :> ScalarQuantityValue { + doc + /* + * source: item 4-8 momentum (magnitude) + * symbol(s): `p` + * application domain: generic + * name: Momentum + * quantity dimension: L^1*M^1*T^-1 + * measurement unit(s): kg*m*s^-1 + * tensor order: 0 + * definition: product of mass `m` (item 4-1) of a body and velocity `vec(v)` (ISO 80000-3) of its centre of mass: `vec(p) = m vec(v)` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MomentumUnit[1]; + } + + attribute momentum: MomentumValue[*] nonunique :> scalarQuantities; + + attribute def MomentumUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + attribute def Cartesian3dMomentumVector :> VectorQuantityValue { + doc + /* + * source: item 4-8 momentum (vector) + * symbol(s): `vec(p)` + * application domain: generic + * name: Momentum + * quantity dimension: L^1*M^1*T^-1 + * measurement unit(s): kg*m*s^-1 + * tensor order: 1 + * definition: product of mass `m` (item 4-1) of a body and velocity `vec(v)` (ISO 80000-3) of its centre of mass: `vec(p) = m vec(v)` + * remarks: None. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dMomentumCoordinateFrame[1]; + } + + attribute momentumVector: Cartesian3dMomentumVector :> vectorQuantities; + + attribute def Cartesian3dMomentumCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: MomentumUnit[3]; + } + + /* ISO-80000-4 item 4-9.1 force */ + attribute def ForceValue :> ScalarQuantityValue { + doc + /* + * source: item 4-9.1 force (magnitude) + * symbol(s): `F` + * application domain: generic + * name: Force + * quantity dimension: L^1*M^1*T^-2 + * measurement unit(s): N, kg*m*s^-2 + * tensor order: 0 + * definition: vector (ISO 80000-2) quantity describing interaction between bodies or particles + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: ForceUnit[1]; + } + + attribute force: ForceValue[*] nonunique :> scalarQuantities; + + attribute def ForceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + attribute def Cartesian3dForceVector :> VectorQuantityValue { + doc + /* + * source: item 4-9.1 force (vector) + * symbol(s): `vec(F)` + * application domain: generic + * name: Force + * quantity dimension: L^1*M^1*T^-2 + * measurement unit(s): N, kg*m*s^-2 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity describing interaction between bodies or particles + * remarks: None. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dForceCoordinateFrame[1]; + } + + attribute forceVector: Cartesian3dForceVector :> vectorQuantities; + + attribute def Cartesian3dForceCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: ForceUnit[3]; + } + + /* ISO-80000-4 item 4-9.2 weight */ + attribute def Cartesian3dWeightVector :> VectorQuantityValue { + doc + /* + * source: item 4-9.2 weight + * symbol(s): `vec(F_g)` + * application domain: generic + * name: Weight (specializes Force) + * quantity dimension: L^1*M^1*T^-2 + * measurement unit(s): N, kg*m*s^-2 + * tensor order: 1 + * definition: force (item 4-9.1) acting on a body in the gravitational field of Earth: `vec(F_g) = m vec(g)` where `m` (item 4-1) is the mass of the body and `vec(g)` is the local acceleration of free fall (ISO 80000-3) + * remarks: In colloquial language, the name "weight" continues to be used where "mass" is meant. This practice should be avoided. Weight is an example of a gravitational force. Weight comprises not only the local gravitational force but also the local centrifugal force due to the rotation of the Earth. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dForceCoordinateFrame[1]; + } + + attribute weightVector: Cartesian3dWeightVector :> vectorQuantities; + + /* ISO-80000-4 item 4-9.3 static friction force, static friction */ + attribute def Cartesian3dStaticFrictionForceVector :> VectorQuantityValue { + doc + /* + * source: item 4-9.3 static friction force, static friction + * symbol(s): `vec(F_s)` + * application domain: generic + * name: StaticFrictionForce (specializes Force) + * quantity dimension: L^1*M^1*T^-2 + * measurement unit(s): N, kg*m*s^-2 + * tensor order: 1 + * definition: force (item 4-9.1) resisting the motion before a body starts to slide on a surface + * remarks: For the static friction coefficient, see item 4-23.1. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dForceCoordinateFrame[1]; + } + + attribute staticFrictionForceVector: Cartesian3dStaticFrictionForceVector :> vectorQuantities; + + alias staticFrictionVector for staticFrictionForceVector; + + /* ISO-80000-4 item 4-9.4 kinetic friction force, dynamic friction force */ + attribute def Cartesian3dKineticFrictionForceVector :> VectorQuantityValue { + doc + /* + * source: item 4-9.4 kinetic friction force, dynamic friction force + * symbol(s): `vec(F_μ)` + * application domain: generic + * name: KineticFrictionForce (specializes Force) + * quantity dimension: L^1*M^1*T^-2 + * measurement unit(s): N, kg*m*s^-2 + * tensor order: 1 + * definition: force (item 4-9.1) resisting the motion when a body slides on a surface + * remarks: For the kinetic friction factor, see item 4-23.2. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dForceCoordinateFrame[1]; + } + + attribute kineticFrictionForceVector: Cartesian3dKineticFrictionForceVector :> vectorQuantities; + + alias dynamicFrictionForceVector for kineticFrictionForceVector; + + /* ISO-80000-4 item 4-9.5 rolling resistance, rolling drag, rolling friction force */ + attribute def Cartesian3dRollingResistanceVector :> VectorQuantityValue { + doc + /* + * source: item 4-9.5 rolling resistance, rolling drag, rolling friction force + * symbol(s): `vec(F_"rr")` + * application domain: generic + * name: RollingResistance (specializes Force) + * quantity dimension: L^1*M^1*T^-2 + * measurement unit(s): N, kg*m*s^-2 + * tensor order: 1 + * definition: force (item 4-9.1) resisting the motion when a body rolls on a surface + * remarks: For the rolling resistance factor, see item 4-23.3. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dForceCoordinateFrame[1]; + } + + attribute rollingResistanceVector: Cartesian3dRollingResistanceVector :> vectorQuantities; + + alias rollingDragVector for rollingResistanceVector; + + alias rollingFrictionForceVector for rollingResistanceVector; + + /* ISO-80000-4 item 4-9.6 drag force */ + attribute def Cartesian3dDragForceVector :> VectorQuantityValue { + doc + /* + * source: item 4-9.6 drag force + * symbol(s): `vec(F_D)` + * application domain: generic + * name: DragForce (specializes Force) + * quantity dimension: L^1*M^1*T^-2 + * measurement unit(s): N, kg*m*s^-2 + * tensor order: 1 + * definition: force (item 4-9.1) resisting the motion of a body in a fluid + * remarks: For the drag coefficient, see item 4-23.4. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dForceCoordinateFrame[1]; + } + + attribute dragForceVector: Cartesian3dDragForceVector :> vectorQuantities; + + /* ISO-80000-4 item 4-10 impulse */ + attribute def ImpulseValue :> ScalarQuantityValue { + doc + /* + * source: item 4-10 impulse (magnitude) + * symbol(s): `I` + * application domain: generic + * name: Impulse + * quantity dimension: L^1*M^1*T^-1 + * measurement unit(s): N*s, kg*m*s^-1 + * tensor order: 0 + * definition: vector (ISO 80000-2) quantity describing the effect of force acting during a time interval: `vec(I) = int_(t_1)^(t_2) vec(F)*dt` where `vec(F)` is force (item 4-9.1), `t` is time (ISO 80000-3) and `[t_1, t_2]` is considered time interval + * remarks: For a time interval `[t_1, t_2]`, `vec(I)(t_1, t_2) = vec(p)(t_1) - vec(p)(t_2) = vec(Δp)` where `vec(p)` is momentum (item 4-8). + */ + attribute :>> num: Real; + attribute :>> mRef: ImpulseUnit[1]; + } + + attribute impulse: ImpulseValue[*] nonunique :> scalarQuantities; + + attribute def ImpulseUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + attribute def Cartesian3dImpulseVector :> VectorQuantityValue { + doc + /* + * source: item 4-10 impulse (vector) + * symbol(s): `vec(I)` + * application domain: generic + * name: Impulse + * quantity dimension: L^1*M^1*T^-1 + * measurement unit(s): N*s, kg*m*s^-1 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity describing the effect of force acting during a time interval: `vec(I) = int_(t_1)^(t_2) vec(F)*dt` where `vec(F)` is force (item 4-9.1), `t` is time (ISO 80000-3) and `[t_1, t_2]` is considered time interval + * remarks: For a time interval `[t_1, t_2]`, `vec(I)(t_1, t_2) = vec(p)(t_1) - vec(p)(t_2) = vec(Δp)` where `vec(p)` is momentum (item 4-8). + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dImpulseCoordinateFrame[1]; + } + + attribute impulseVector: Cartesian3dImpulseVector :> vectorQuantities; + + attribute def Cartesian3dImpulseCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: ImpulseUnit[3]; + } + + /* ISO-80000-4 item 4-11 angular momentum */ + attribute def AngularMomentumValue :> ScalarQuantityValue { + doc + /* + * source: item 4-11 angular momentum (magnitude) + * symbol(s): `L` + * application domain: generic + * name: AngularMomentum + * quantity dimension: L^2*M^1*T^-1 + * measurement unit(s): kg*m^2*s^-1 + * tensor order: 0 + * definition: vector (ISO 80000-2) quantity described by the vector product: `vec(L) = vec(r) xx vec(p)` where `vec(r)` is position vector (ISO 80000-3) with respect to the axis of rotation and `vec(p)` is momentum (item 4-8) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: AngularMomentumUnit[1]; + } + + attribute angularMomentum: AngularMomentumValue[*] nonunique :> scalarQuantities; + + attribute def AngularMomentumUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + attribute def Cartesian3dAngularMomentumVector :> VectorQuantityValue { + doc + /* + * source: item 4-11 angular momentum (vector) + * symbol(s): `vec(L)` + * application domain: generic + * name: AngularMomentum + * quantity dimension: L^2*M^1*T^-1 + * measurement unit(s): kg*m^2*s^-1 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity described by the vector product: `vec(L) = vec(r) xx vec(p)` where `vec(r)` is position vector (ISO 80000-3) with respect to the axis of rotation and `vec(p)` is momentum (item 4-8) + * remarks: None. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dAngularMomentumCoordinateFrame[1]; + } + + attribute angularMomentumVector: Cartesian3dAngularMomentumVector :> vectorQuantities; + + attribute def Cartesian3dAngularMomentumCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: AngularMomentumUnit[3]; + } + + /* ISO-80000-4 item 4-12.1 moment of force */ + attribute def MomentOfForceValue :> ScalarQuantityValue { + doc + /* + * source: item 4-12.1 moment of force (magnitude) + * symbol(s): `M` + * application domain: generic + * name: MomentOfForce + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): N*m, kg*m^2*s^-2 + * tensor order: 0 + * definition: vector (ISO 80000-2) quantity described by the vector product: `vec(M) = vec(r) xx vec(F)` where `vec(r)` is position vector (ISO 80000-3) with respect to the axis of rotation and `vec(F)` is force (item 4-9.1) + * remarks: The bending moment of force is denoted by `vec(M)_b`. + */ + attribute :>> num: Real; + attribute :>> mRef: MomentOfForceUnit[1]; + } + + attribute momentOfForce: MomentOfForceValue[*] nonunique :> scalarQuantities; + + attribute def MomentOfForceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + attribute def Cartesian3dMomentOfForceVector :> VectorQuantityValue { + doc + /* + * source: item 4-12.1 moment of force (vector) + * symbol(s): `vec(M)` + * application domain: generic + * name: MomentOfForce + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): N*m, kg*m^2*s^-2 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity described by the vector product: `vec(M) = vec(r) xx vec(F)` where `vec(r)` is position vector (ISO 80000-3) with respect to the axis of rotation and `vec(F)` is force (item 4-9.1) + * remarks: The bending moment of force is denoted by `vec(M)_b`. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dMomentOfForceCoordinateFrame[1]; + } + + attribute momentOfForceVector: Cartesian3dMomentOfForceVector :> vectorQuantities; + + attribute def Cartesian3dMomentOfForceCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: MomentOfForceUnit[3]; + } + + /* ISO-80000-4 item 4-12.2 torque */ + attribute def TorqueValue :> ScalarQuantityValue { + doc + /* + * source: item 4-12.2 torque + * symbol(s): `T`, `M_Q` + * application domain: generic + * name: Torque + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): N*m, kg*m^2*s^-2 + * tensor order: 0 + * definition: quantity described by the scalar product: `T = vec(M)*vec(e_Q)` where `vec(M)` is moment of force (item 4-12.1) and `vec(e_Q)` is unit vector of direction with respect to which the torque is considered + * remarks: For example, torque is the twisting moment of force with respect to the longitudinal axis of a beam or shaft. + */ + attribute :>> num: Real; + attribute :>> mRef: TorqueUnit[1]; + } + + attribute torque: TorqueValue[*] nonunique :> scalarQuantities; + + attribute def TorqueUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-4 item 4-13 angular impulse */ + attribute def AngularImpulseValue :> ScalarQuantityValue { + doc + /* + * source: item 4-13 angular impulse (magnitude) + * symbol(s): `H` + * application domain: generic + * name: AngularImpulse + * quantity dimension: L^2*M^1*T^-1 + * measurement unit(s): N*m*s, kg*m^2*s^-1 + * tensor order: 0 + * definition: vector (ISO 80000-2) quantity describing the effect of moment of force during a time interval: `vec(H)(t_1; t_2) = int_(t_1)^(t_2) vec(M) dt` where `vec(M)` is moment of force (item 4-12.1), `t` is time (ISO 80000-3) and `[t_1, t_2]` is considered time interval + * remarks: For a time interval `[t_1, t_2]`, `vec(H)(t_1, t_2) = vec(L)(t_1) - vec(L)(t_2) = vec(ΔL)` where `vec(L)` is angular momentum. + */ + attribute :>> num: Real; + attribute :>> mRef: AngularImpulseUnit[1]; + } + + attribute angularImpulse: AngularImpulseValue[*] nonunique :> scalarQuantities; + + attribute def AngularImpulseUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + attribute def Cartesian3dAngularImpulseVector :> VectorQuantityValue { + doc + /* + * source: item 4-13 angular impulse (vector) + * symbol(s): `vec(H)` + * application domain: generic + * name: AngularImpulse + * quantity dimension: L^2*M^1*T^-1 + * measurement unit(s): N*m*s, kg*m^2*s^-1 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity describing the effect of moment of force during a time interval: `vec(H)(t_1; t_2) = int_(t_1)^(t_2) vec(M) dt` where `vec(M)` is moment of force (item 4-12.1), `t` is time (ISO 80000-3) and `[t_1, t_2]` is considered time interval + * remarks: For a time interval `[t_1, t_2]`, `vec(H)(t_1, t_2) = vec(L)(t_1) - vec(L)(t_2) = vec(ΔL)` where `vec(L)` is angular momentum. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dAngularImpulseCoordinateFrame[1]; + } + + attribute angularImpulseVector: Cartesian3dAngularImpulseVector :> vectorQuantities; + + attribute def Cartesian3dAngularImpulseCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: AngularImpulseUnit[3]; + } + + /* ISO-80000-4 item 4-14.1 pressure */ + attribute def PressureValue :> ScalarQuantityValue { + doc + /* + * source: item 4-14.1 pressure + * symbol(s): `p` + * application domain: generic + * name: Pressure + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, N*m^-2, kg*m^-1*s^-2 + * tensor order: 0 + * definition: quotient of the component of a force normal to a surface and its area: `p = (vec(e_n) * vec(F)) / A` where `vec(e_n)` is unit vector of the surface normal, `vec(F)` is force (item 4-9.1) and `A` is area (ISO 80000-3) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: PressureUnit[1]; + } + + attribute pressure: PressureValue[*] nonunique :> scalarQuantities; + + attribute def PressureUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-4 item 4-14.2 gauge pressure */ + attribute gaugePressure: PressureValue :> scalarQuantities { + doc + /* + * source: item 4-14.2 gauge pressure + * symbol(s): `p_e` + * application domain: generic + * name: GaugePressure (specializes Pressure) + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, N*m^-2, kg*m^-1*s^-2 + * tensor order: 0 + * definition: pressure `p` (item 4-14.1) decremented by ambient pressure `p_amb` : `p_e = p - p_amb` + * remarks: Often, `p_amb` is chosen as a standard pressure. Gauge pressure is positive or negative. + */ + } + + /* ISO-80000-4 item 4-15 stress */ + attribute def StressValue :> ScalarQuantityValue { + doc + /* + * source: item 4-15 stress (magnitude) + * symbol(s): `σ` + * application domain: generic + * name: Stress + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, N*m^-2, kg*m^-1*s^-2 + * tensor order: 0 + * definition: tensor (ISO 80000-2) quantity representing state of tension of matter + * remarks: Stress tensor is symmetric and has three normal-stress and three shear-stress (Cartesian) components. + */ + attribute :>> num: Real; + attribute :>> mRef: StressUnit[1]; + } + + attribute stress: StressValue[*] nonunique :> scalarQuantities; + + attribute def StressUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + attribute def Cartesian3dStressTensor :> TensorQuantityValue { + doc + /* + * source: item 4-15 stress (tensor) + * symbol(s): `vec(vec(σ))` + * application domain: generic + * name: Stress + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, N*m^-2, kg*m^-1*s^-2 + * tensor order: 2 + * definition: tensor (ISO 80000-2) quantity representing state of tension of matter + * remarks: Stress tensor is symmetric and has three normal-stress and three shear-stress (Cartesian) components. + */ + attribute :>> isBound = false; + attribute :>> num: Real[9]; + attribute :>> mRef: Cartesian3dStressMeasurementReference[1]; + } + + attribute stressTensor: Cartesian3dStressTensor :> tensorQuantities; + + attribute def Cartesian3dStressMeasurementReference :> TensorMeasurementReference { + attribute :>> dimensions = (3, 3); + attribute :>> isBound = false; + attribute :>> mRefs: StressUnit[9]; + } + + /* ISO-80000-4 item 4-16.1 normal stress */ + attribute def NormalStressValue :> ScalarQuantityValue { + doc + /* + * source: item 4-16.1 normal stress + * symbol(s): `σ_n`, `σ` + * application domain: generic + * name: NormalStress + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, N*m^-2, kg*m^-1*s^-2 + * tensor order: 0 + * definition: scalar (ISO 80000-2) quantity describing surface action of a force into a body equal to: `σ_n = (d F_n)/(dA)` where `F_n` is the normal component of force (item 4-9.1) and `A` is the area (ISO 80000-3) of the surface element + * remarks: A couple of mutually opposite forces of magnitude `F` acting on the opposite surfaces of a slice (layer) of homogenous solid matter normal to it, and evenly distributed, cause a constant normal stress `σ_n = F A` in the slice (layer). + */ + attribute :>> num: Real; + attribute :>> mRef: NormalStressUnit[1]; + } + + attribute normalStress: NormalStressValue[*] nonunique :> scalarQuantities; + + attribute def NormalStressUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-4 item 4-16.2 shear stress */ + attribute def ShearStressValue :> ScalarQuantityValue { + doc + /* + * source: item 4-16.2 shear stress + * symbol(s): `τ_s`, `τ` + * application domain: generic + * name: ShearStress + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, N*m^-2, kg*m^-1*s^-2 + * tensor order: 0 + * definition: scalar (ISO 80000-2) quantity describing surface action of a force into a body equal to: `τ_s = (d F_t)/(dA)` where `F_t` is the tangential component of force (item 4-9.1) and `A` is the area (ISO 80000-3) of the surface element + * remarks: A couple of mutually opposite forces of magnitude `F` acting on the opposite surfaces of a slice (layer) of homogenous solid matter parallel to it, and evenly distributed, cause a constant shear stress `τ = F/A` in the slice (layer). + */ + attribute :>> num: Real; + attribute :>> mRef: ShearStressUnit[1]; + } + + attribute shearStress: ShearStressValue[*] nonunique :> scalarQuantities; + + attribute def ShearStressUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-4 item 4-17.1 strain */ + attribute def StrainValue :> ScalarQuantityValue { + doc + /* + * source: item 4-17.1 strain (magnitude) + * symbol(s): `ε` + * application domain: generic + * name: Strain + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: tensor (ISO 80000-2) quantity representing the deformation of matter caused by stress + * remarks: Strain tensor is symmetric and has three linear-strain and three shear strain (Cartesian) components. + */ + attribute :>> num: Real; + attribute :>> mRef: StrainUnit[1]; + } + + attribute strain: StrainValue[*] nonunique :> scalarQuantities; + + attribute def StrainUnit :> DimensionOneUnit { + } + + attribute def Cartesian3dStrainTensor :> TensorQuantityValue { + doc + /* + * source: item 4-17.1 strain (tensor) + * symbol(s): `vec(vec(ε))` + * application domain: generic + * name: Strain + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 2 + * definition: tensor (ISO 80000-2) quantity representing the deformation of matter caused by stress + * remarks: Strain tensor is symmetric and has three linear-strain and three shear strain (Cartesian) components. + */ + attribute :>> isBound = false; + attribute :>> num: Real[9]; + attribute :>> mRef: Cartesian3dStrainMeasurementReference[1]; + } + + attribute strainTensor: Cartesian3dStrainTensor :> tensorQuantities; + + attribute def Cartesian3dStrainMeasurementReference :> TensorMeasurementReference { + attribute :>> dimensions = (3, 3); + attribute :>> isBound = false; + attribute :>> mRefs: StrainUnit[9]; + } + + /* ISO-80000-4 item 4-17.2 relative linear strain */ + attribute def RelativeLinearStrainValue :> DimensionOneValue { + doc + /* + * source: item 4-17.2 relative linear strain + * symbol(s): `ε`, `(e)` + * application domain: generic + * name: RelativeLinearStrain (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of change in length `Δl` (ISO 80000-3) of an object and its length `l` (ISO 80000-3): `ε = (Δl)/l` + * remarks: None. + */ + } + attribute relativeLinearStrain: RelativeLinearStrainValue :> scalarQuantities; + + /* ISO-80000-4 item 4-17.3 shear strain */ + attribute def ShearStrainValue :> DimensionOneValue { + doc + /* + * source: item 4-17.3 shear strain + * symbol(s): `γ` + * application domain: generic + * name: ShearStrain (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of parallel displacement `Δx` (ISO 80000-3) of two surfaces of a layer and the thickness `d` (ISO 80000-3) of the layer: `γ = (Δx)/d` + * remarks: None. + */ + } + attribute shearStrain: ShearStrainValue :> scalarQuantities; + + /* ISO-80000-4 item 4-17.4 relative volume strain */ + attribute def RelativeVolumeStrainValue :> DimensionOneValue { + doc + /* + * source: item 4-17.4 relative volume strain + * symbol(s): `θ` + * application domain: generic + * name: RelativeVolumeStrain (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of change in volume `ΔV` (ISO 80000-3) of an object and its volume `V_0` (ISO 80000-3): `θ = (ΔV)/V_0` + * remarks: None. + */ + } + attribute relativeVolumeStrain: RelativeVolumeStrainValue :> scalarQuantities; + + /* ISO-80000-4 item 4-18 Poisson number */ + attribute def PoissonNumberValue :> DimensionOneValue { + doc + /* + * source: item 4-18 Poisson number + * symbol(s): `μ`, `(v)` + * application domain: generic + * name: PoissonNumber (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of change in width `Δb` (width is defined in ISO 80000-3) and change in length `Δl` (length is defined in ISO 80000-3) of an object: `μ = (Δb)/(Δl)` + * remarks: None. + */ + } + attribute poissonNumber: PoissonNumberValue :> scalarQuantities; + + /* ISO-80000-4 item 4-19.1 modulus of elasticity, Young modulus */ + attribute def ModulusOfElasticityValue :> ScalarQuantityValue { + doc + /* + * source: item 4-19.1 modulus of elasticity, Young modulus + * symbol(s): `E`, `E_m`, `Y` + * application domain: generic + * name: ModulusOfElasticity + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, N*m^-2, kg*m^-1*s^-2 + * tensor order: 0 + * definition: quotient of normal stress `σ` (item 4-16.1) and relative linear strain `ε` (item 4-17.2): `E = σ/ε` + * remarks: Conditions should be specified (e.g. adiabatic or isothermal process). + */ + attribute :>> num: Real; + attribute :>> mRef: ModulusOfElasticityUnit[1]; + } + + attribute modulusOfElasticity: ModulusOfElasticityValue[*] nonunique :> scalarQuantities; + + attribute def ModulusOfElasticityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + alias YoungModulusUnit for ModulusOfElasticityUnit; + alias YoungModulusValue for ModulusOfElasticityValue; + alias youngModulus for modulusOfElasticity; + + /* ISO-80000-4 item 4-19.2 modulus of rigidity, shear modulus */ + attribute def ModulusOfRigidityValue :> ScalarQuantityValue { + doc + /* + * source: item 4-19.2 modulus of rigidity, shear modulus + * symbol(s): `G` + * application domain: generic + * name: ModulusOfRigidity + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, N*m^-2, kg*m^-1*s^-2 + * tensor order: 0 + * definition: quotient of shear stress `τ` (item 4-16.2) and shear strain `γ` (item 4-17.3): `G = τ/γ` + * remarks: Conditions should be specified (e.g. isentropic or isothermal process). + */ + attribute :>> num: Real; + attribute :>> mRef: ModulusOfRigidityUnit[1]; + } + + attribute modulusOfRigidity: ModulusOfRigidityValue[*] nonunique :> scalarQuantities; + + attribute def ModulusOfRigidityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + alias ShearModulusUnit for ModulusOfRigidityUnit; + alias ShearModulusValue for ModulusOfRigidityValue; + alias shearModulus for modulusOfRigidity; + + /* ISO-80000-4 item 4-19.3 modulus of compression, bulk modulus */ + attribute def ModulusOfCompressionValue :> ScalarQuantityValue { + doc + /* + * source: item 4-19.3 modulus of compression, bulk modulus + * symbol(s): `K`, `K_m`, `B` + * application domain: generic + * name: ModulusOfCompression + * quantity dimension: L^-1*M^1*T^-2 + * measurement unit(s): Pa, N*m^-2, kg*m^-1*s^-2 + * tensor order: 0 + * definition: negative of the quotient of pressure `p` (item 4-14.1) and relative volume strain `θ` (item 4-17.4): `K = -(p/θ)` + * remarks: Conditions should be specified (e.g. isentropic or isothermal process). + */ + attribute :>> num: Real; + attribute :>> mRef: ModulusOfCompressionUnit[1]; + } + + attribute modulusOfCompression: ModulusOfCompressionValue[*] nonunique :> scalarQuantities; + + attribute def ModulusOfCompressionUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + alias BulkModulusUnit for ModulusOfCompressionUnit; + alias BulkModulusValue for ModulusOfCompressionValue; + alias bulkModulus for modulusOfCompression; + + /* ISO-80000-4 item 4-20 compressibility */ + attribute def CompressibilityValue :> ScalarQuantityValue { + doc + /* + * source: item 4-20 compressibility + * symbol(s): `ϰ` + * application domain: generic + * name: Compressibility + * quantity dimension: L^1*M^-1*T^2 + * measurement unit(s): Pa^-1, kg^-1*m*s^2 + * tensor order: 0 + * definition: negative relative change of volume `V` (ISO 80000-3) of an object under pressure `p` (item 4-14.1) expressed by: `ϰ = -(1/V)(dV)/(dp)` + * remarks: Conditions should be specified (e.g. isentropic or isothermal process). See also ISO 80000-5. + */ + attribute :>> num: Real; + attribute :>> mRef: CompressibilityUnit[1]; + } + + attribute compressibility: CompressibilityValue[*] nonunique :> scalarQuantities; + + attribute def CompressibilityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-4 item 4-21.1 second axial moment of area */ + attribute def SecondAxialMomentOfAreaValue :> ScalarQuantityValue { + doc + /* + * source: item 4-21.1 second axial moment of area + * symbol(s): `I_a` + * application domain: generic + * name: SecondAxialMomentOfArea + * quantity dimension: L^4 + * measurement unit(s): m^4 + * tensor order: 0 + * definition: geometrical characteristic of a shape of a body equal to: `I_a = int int_M r_Q^2 dA` where `M` is the two-dimensional domain of the cross-section of a plane and considered body, `r_Q` is radial distance (ISO 80000-3) from a Q-axis in the plane of the surface considered and `A` is area (ISO 80000-3) + * remarks: This quantity is often referred to wrongly as "moment of inertia" (item 4-7). The subscript, `a`, may be omitted when there is no risk of confusion. + */ + attribute :>> num: Real; + attribute :>> mRef: SecondAxialMomentOfAreaUnit[1]; + } + + attribute secondAxialMomentOfArea: SecondAxialMomentOfAreaValue[*] nonunique :> scalarQuantities; + + attribute def SecondAxialMomentOfAreaUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 4; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-4 item 4-21.2 second polar moment of area */ + attribute def SecondPolarMomentOfAreaValue :> ScalarQuantityValue { + doc + /* + * source: item 4-21.2 second polar moment of area + * symbol(s): `I_p` + * application domain: generic + * name: SecondPolarMomentOfArea + * quantity dimension: L^4 + * measurement unit(s): m^4 + * tensor order: 0 + * definition: geometrical characteristic of a shape of a body equal to: `I_p = int int_M r_Q^2 * dA` where `M` is the two-dimensional domain of the cross-section of a plane and considered body, `r_Q` is radial distance (ISO 80000-3) from a Q-axis perpendicular to the plane of the surface considered and `A` is area (ISO 80000-3) + * remarks: This quantity is often referred to wrongly as "moment of inertia" (item 4-7). The subscript, `p`, may be omitted when there is no risk of confusion. + */ + attribute :>> num: Real; + attribute :>> mRef: SecondPolarMomentOfAreaUnit[1]; + } + + attribute secondPolarMomentOfArea: SecondPolarMomentOfAreaValue[*] nonunique :> scalarQuantities; + + attribute def SecondPolarMomentOfAreaUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 4; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-4 item 4-22 section modulus */ + attribute def SectionModulusValue :> ScalarQuantityValue { + doc + /* + * source: item 4-22 section modulus + * symbol(s): `Z`, `(W)` + * application domain: generic + * name: SectionModulus + * quantity dimension: L^3 + * measurement unit(s): m^3 + * tensor order: 0 + * definition: geometrical characteristic of a shape of a body equal to: `Z = I_a/r_(Q_max)` where `I_a` is the second axial moment of area (item 4-21.1) and `r_(Q,max)` is the maximum radial distance (ISO 80000-3) of any point in the surface considered from the Q-axis with respect to which `I_a` is defined + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: SectionModulusUnit[1]; + } + + attribute sectionModulus: SectionModulusValue[*] nonunique :> scalarQuantities; + + attribute def SectionModulusUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-4 item 4-23.1 static friction coefficient, static friction factor, coefficient of static friction */ + attribute def StaticFrictionCoefficientValue :> DimensionOneValue { + doc + /* + * source: item 4-23.1 static friction coefficient, static friction factor, coefficient of static friction + * symbol(s): `μ_s`, `(f_s)` + * application domain: generic + * name: StaticFrictionCoefficient (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: proportionality factor between the maximum magnitude of the tangential component `F_max` of the static friction force (item 4-9.3) and the magnitude of the normal component `N` of the contact force (item 4-9.1) between two bodies at relative rest with respect to each other: `F_max = μ_s * N` + * remarks: When it is not necessary to distinguish between dynamic friction factor and static friction factor, the name friction factor may be used for both. + */ + } + attribute staticFrictionCoefficient: StaticFrictionCoefficientValue :> scalarQuantities; + + alias staticFrictionFactor for staticFrictionCoefficient; + + alias coefficientOfStaticFriction for staticFrictionCoefficient; + + /* ISO-80000-4 item 4-23.2 kinetic friction factor, dynamic friction factor */ + attribute def KineticFrictionFactorValue :> DimensionOneValue { + doc + /* + * source: item 4-23.2 kinetic friction factor, dynamic friction factor + * symbol(s): `μ`, `(f)` + * application domain: generic + * name: KineticFrictionFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: proportionality factor between the magnitudes of the kinetic friction force, `F_μ` (item 4-9.4) and the normal component `N` of the contact force (item 4-9.1): `F_μ = μ * N` + * remarks: When it is not necessary to distinguish between dynamic friction factor and static friction factor, the name friction factor may be used for both. The dynamic friction factor `µ` is independent in first approximation of the contact surface. + */ + } + attribute kineticFrictionFactor: KineticFrictionFactorValue :> scalarQuantities; + + alias dynamicFrictionFactor for kineticFrictionFactor; + + /* ISO-80000-4 item 4-23.3 rolling resistance factor */ + attribute def RollingResistanceFactorValue :> DimensionOneValue { + doc + /* + * source: item 4-23.3 rolling resistance factor + * symbol(s): `C_"rr"` + * application domain: generic + * name: RollingResistanceFactor (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: proportionality factor between the magnitude of the tangential component `F` and the magnitude of the normal component `N` of the force applied to a body rolling on a surface at constant speed: `F = C_(rr)*N` + * remarks: Also known as rolling resistance coefficient, RRC. + */ + } + attribute rollingResistanceFactor: RollingResistanceFactorValue :> scalarQuantities; + + /* ISO-80000-4 item 4-23.4 drag coefficient, drag factor */ + attribute def DragCoefficientValue :> DimensionOneValue { + doc + /* + * source: item 4-23.4 drag coefficient, drag factor + * symbol(s): `C_D` + * application domain: generic + * name: DragCoefficient (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: factor proportional to magnitude `F_D` of the drag force (item 4-9.6) of a body moving in a fluid, dependent on the shape and speed `v` (ISO 80000-3) of a body: `F_D = 1/2 * C_D * ρ * v^2 * A` where `ρ` is mass density (item 4-2) of the fluid and `A` is cross-section area (ISO 80000-3) of the body + * remarks: None. + */ + } + attribute dragCoefficient: DragCoefficientValue :> scalarQuantities; + + alias dragFactor for dragCoefficient; + + /* ISO-80000-4 item 4-24 dynamic viscosity, viscosity */ + attribute def DynamicViscosityValue :> ScalarQuantityValue { + doc + /* + * source: item 4-24 dynamic viscosity, viscosity + * symbol(s): `η` + * application domain: generic + * name: DynamicViscosity + * quantity dimension: L^-1*M^1*T^-1 + * measurement unit(s): Pa*s, kg*m^-1*s^-1 + * tensor order: 0 + * definition: for laminar flows, proportionality constant between shear stress `τ_(xz)` (item 4-16.2) in a fluid moving with a velocity `v_x` (ISO 80000-3) and gradient `(d v_x)/dz` perpendicular to the plane of shear: `τ_(xz) = η (d v_x)/(dz)` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: DynamicViscosityUnit[1]; + } + + attribute dynamicViscosity: DynamicViscosityValue[*] nonunique :> scalarQuantities; + + attribute def DynamicViscosityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + alias ViscosityUnit for DynamicViscosityUnit; + alias ViscosityValue for DynamicViscosityValue; + alias viscosity for dynamicViscosity; + + /* ISO-80000-4 item 4-25 kinematic viscosity */ + attribute def KinematicViscosityValue :> ScalarQuantityValue { + doc + /* + * source: item 4-25 kinematic viscosity + * symbol(s): `v` + * application domain: generic + * name: KinematicViscosity + * quantity dimension: L^2*T^-1 + * measurement unit(s): m^2*s^-1 + * tensor order: 0 + * definition: quotient of dynamic viscosity `η` (item 4-24) and mass density `ρ` (item 4-2) of a fluid: `v = η/ρ` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: KinematicViscosityUnit[1]; + } + + attribute kinematicViscosity: KinematicViscosityValue[*] nonunique :> scalarQuantities; + + attribute def KinematicViscosityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-4 item 4-26 surface tension */ + attribute def SurfaceTensionValue :> ScalarQuantityValue { + doc + /* + * source: item 4-26 surface tension + * symbol(s): `γ`, `σ` + * application domain: generic + * name: SurfaceTension + * quantity dimension: M^1*T^-2 + * measurement unit(s): N*m^-1, kg*s^-2 + * tensor order: 0 + * definition: magnitude of a force acting against the enlargement of area portion of a surface separating a liquid from its surrounding + * remarks: The concept of surface energy is closely related to surface tension and has the same dimension. + */ + attribute :>> num: Real; + attribute :>> mRef: SurfaceTensionUnit[1]; + } + + attribute surfaceTension: SurfaceTensionValue[*] nonunique :> scalarQuantities; + + attribute def SurfaceTensionUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + /* ISO-80000-4 item 4-27.1 power */ + attribute def PowerValue :> ScalarQuantityValue { + doc + /* + * source: item 4-27.1 power + * symbol(s): `P` + * application domain: generic + * name: Power + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): W, J*s^-1, kg*m^2*s^-3 + * tensor order: 0 + * definition: quotient of energy (ISO 80000-5) and duration (ISO 80000-3) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: PowerUnit[1]; + } + + attribute power: PowerValue[*] nonunique :> scalarQuantities; + + attribute def PowerUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-4 item 4-27 mechanical power */ + attribute mechanicalPower: PowerValue :> scalarQuantities { + doc + /* + * source: item 4-27 mechanical power + * symbol(s): `P` + * application domain: mechanics + * name: MechanicalPower (specializes Power) + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): W, N*m*s^-1, kg*m^2*s^-3 + * tensor order: 0 + * definition: scalar product of force `vec(F)` (item 4-9.1) acting to a body and its velocity `vec(v)` (ISO 80000-3): `P = vec(F) * vec(v)` + * remarks: None. + */ + } + + /* ISO-80000-4 item 4-28.1 potential energy */ + attribute potentialEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 4-28.1 potential energy + * symbol(s): `V`, `E_p` + * application domain: generic + * name: PotentialEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: for conservative force `vec(F)`, scalar additive quantity obeying condition `vec(F) = -nabla F`, if it exists + * remarks: For the definition of energy, see ISO 80000-5. A force is conservative when the force field is irrotational, i.e. `rot(F) = 0` , or `vec(F)` is perpendicular to the speed of the body to ensure `vec(F) * d vec(r) = 0` . + */ + } + + /* ISO-80000-4 item 4-28.2 kinetic energy */ + attribute kineticEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 4-28.2 kinetic energy + * symbol(s): `T`, `E_k` + * application domain: generic + * name: KineticEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: scalar (ISO 80000-2) quantity characterizing a moving body expressed by: `T = 1/2 m v^2` where `m` is mass (item 4-1) of the body and `v` is its speed (ISO 80000-3) + * remarks: For the definition of energy, see ISO 80000-5. + */ + } + + /* ISO-80000-4 item 4-28.3 mechanical energy */ + attribute mechanicalEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 4-28.3 mechanical energy + * symbol(s): `E`, `W` + * application domain: generic + * name: MechanicalEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: sum of kinetic energy `T` (item 4-28.2) and potential energy `V` (item 4-28.1): `E = T+V` + * remarks: The symbols `E` and `W` are also used for other kinds of energy. This definition is understood in a classical way and it does not include thermal motion. + */ + } + + /* ISO-80000-4 item 4-28.4 mechanical work, work */ + attribute mechanicalWork: EnergyValue :> scalarQuantities { + doc + /* + * source: item 4-28.4 mechanical work, work + * symbol(s): `A`, `W` + * application domain: generic + * name: MechanicalWork (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: process quantity describing the total action of a force `vec(F)` (item 4-9.1) along a continuous curve `Γ` in three-dimensional space with infinitesimal displacement (ISO 80000-3) `dvec(r)`, as a line integral of their scalar product: `A = int_Γ vec(F) * d vec(r)` + * remarks: The definition covers the case `A = -int_Γ p*dV` where `Γ` is a curve in the phase space and implies that work generally depends upon `Γ`, and that type of process must be defined (e.g. isentropic or isothermic). + */ + } + + alias work for mechanicalWork; + + /* ISO-80000-4 item 4-29 mechanical efficiency */ + attribute def MechanicalEfficiencyValue :> DimensionOneValue { + doc + /* + * source: item 4-29 mechanical efficiency + * symbol(s): `η` + * application domain: mechanics + * name: MechanicalEfficiency (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of output power `P_"out"` (item 4-27) from a system and input power `P_"in"` (item 4-27) to this system: `η = P_"out"/P_"in"` + * remarks: The system must be specified. This quantity is often expressed by the unit percent, symbol %. + */ + } + attribute mechanicalEfficiency: MechanicalEfficiencyValue :> scalarQuantities; + + /* ISO-80000-4 item 4-30.1 mass flow */ + attribute def MassFlowValue :> ScalarQuantityValue { + doc + /* + * source: item 4-30.1 mass flow (magnitude) + * symbol(s): `j_m` + * application domain: generic + * name: MassFlow + * quantity dimension: L^-2*M^1*T^-1 + * measurement unit(s): kg*m^-2*s^-1 + * tensor order: 0 + * definition: vector (ISO 80000-2) quantity characterizing a flowing fluid by the product of its local mass density `ρ` (item 4-2) and local velocity `vec(v)` (ISO 80000-3): `vec(j_m) = ρ vec(v)` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MassFlowUnit[1]; + } + + attribute massFlow: MassFlowValue[*] nonunique :> scalarQuantities; + + attribute def MassFlowUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + attribute def Cartesian3dMassFlowVector :> VectorQuantityValue { + doc + /* + * source: item 4-30.1 mass flow (vector) + * symbol(s): `vec(j_m)` + * application domain: generic + * name: MassFlow + * quantity dimension: L^-2*M^1*T^-1 + * measurement unit(s): kg*m^-2*s^-1 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity characterizing a flowing fluid by the product of its local mass density `ρ` (item 4-2) and local velocity `vec(v)` (ISO 80000-3): `vec(j_m) = ρ vec(v)` + * remarks: None. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dMassFlowCoordinateFrame[1]; + } + + attribute massFlowVector: Cartesian3dMassFlowVector :> vectorQuantities; + + attribute def Cartesian3dMassFlowCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: MassFlowUnit[3]; + } + + /* ISO-80000-4 item 4-30.2 mass flow rate */ + attribute def MassFlowRateValue :> ScalarQuantityValue { + doc + /* + * source: item 4-30.2 mass flow rate + * symbol(s): `q_m` + * application domain: generic + * name: MassFlowRate + * quantity dimension: M^1*T^-1 + * measurement unit(s): kg*s^-1 + * tensor order: 0 + * definition: scalar (ISO 80000-2) quantity characterizing the total flow through the two-dimensional domain `A` with normal vector `vec(e)_n` of a flowing fluid with mass flow `vec(j)_m` (item 4-30.1) as an integral: `q_m = int int_A vec(j)_m * vec(e)_n dA` where `dA` is the area (ISO 80000-3) of an element of the two-dimensional domain `A` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MassFlowRateUnit[1]; + } + + attribute massFlowRate: MassFlowRateValue[*] nonunique :> scalarQuantities; + + attribute def MassFlowRateUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + /* ISO-80000-4 item 4-30.3 mass change rate */ + attribute def MassChangeRateValue :> ScalarQuantityValue { + doc + /* + * source: item 4-30.3 mass change rate + * symbol(s): `q_m` + * application domain: generic + * name: MassChangeRate + * quantity dimension: M^1*T^-1 + * measurement unit(s): kg*s^-1 + * tensor order: 0 + * definition: rate of increment of mass `m` (item 4-1): `q_m = (dm)/(dt)` where `dm` is the infinitesimal mass (item 4-1) increment and `dt` is the infinitesimal duration (ISO 80000-3) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MassChangeRateUnit[1]; + } + + attribute massChangeRate: MassChangeRateValue[*] nonunique :> scalarQuantities; + + attribute def MassChangeRateUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + /* ISO-80000-4 item 4-31 volume flow rate */ + attribute def VolumeFlowRateValue :> ScalarQuantityValue { + doc + /* + * source: item 4-31 volume flow rate + * symbol(s): `q_v` + * application domain: generic + * name: VolumeFlowRate + * quantity dimension: L^3*T^-1 + * measurement unit(s): m^3*s^-1 + * tensor order: 0 + * definition: scalar (ISO 80000-2) quantity characterizing the total flow through the two-dimensional domain `A` with the normal vector `vec(e)_n` of a flowing fluid with velocity `vec(v)` (ISO 80000-3) as an integral: `q_v = int int_A vec(v) * vec(e)_n dA` where `dA` is the area (ISO 80000-3) of an element of the two-dimensional domain `A` + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: VolumeFlowRateUnit[1]; + } + + attribute volumeFlowRate: VolumeFlowRateValue[*] nonunique :> scalarQuantities; + + attribute def VolumeFlowRateUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 3; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-4 item 4-32 action quantity */ + attribute def ActionQuantityValue :> ScalarQuantityValue { + doc + /* + * source: item 4-32 action quantity + * symbol(s): `S` + * application domain: generic + * name: ActionQuantity + * quantity dimension: L^2*M^1*T^-1 + * measurement unit(s): J*s, kg*m^2*s^-1 + * tensor order: 0 + * definition: time integral of energy `E` over a time interval `(t_1, t_2)`: `S = int_(t_1)^(t_2) E dt` + * remarks: The energy may be expressed by a Lagrangian or Hamiltonian function. + */ + attribute :>> num: Real; + attribute :>> mRef: ActionQuantityUnit[1]; + } + + attribute actionQuantity: ActionQuantityValue[*] nonunique :> scalarQuantities; + + attribute def ActionQuantityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f01fa779e0679a4db8f5c420acdf683744f9f4d0 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml @@ -0,0 +1,1171 @@ +standard library package ISQSpaceTime { + doc + /* + * International System of Quantities and Units + * Generated on 2022-08-07T14:44:27Z from standard ISO-80000-3:2019 "Space and Time" + * see also https://www.iso.org/obp/ui/#iso:std:iso:80000:-3:ed-2:v1:en + * + * Note 1: In documentation comments, AsciiMath notation (see http://asciimath.org/) is used for mathematical concepts, + * with Greek letters in Unicode encoding. In running text, AsciiMath is placed between backticks. + * Note 2: For vector and tensor quantities currently the unit and quantity value type for their (scalar) magnitude is + * defined, as well as their typical Cartesian 3d VectorMeasurementReference (i.e. coordinate system) + * or TensorMeasurementReference. + */ + + private import ScalarValues::Real; + private import ScalarValues::String; + private import Quantities::*; + private import MeasurementReferences::*; + private import ISQBase::*; + + /* ISO-80000-3 item 3-1.1 length */ + /* See package ISQBase for the declarations of LengthValue and LengthUnit */ + + /* ISO-80000-3 item 3-1.2 width, breadth */ + attribute width: LengthValue :> scalarQuantities { + doc + /* + * source: item 3-1.2 width, breadth + * symbol(s): `b`, `B` + * application domain: generic + * name: Width (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: minimum length of a straight line segment between two parallel straight lines (in two dimensions) or planes (in three dimensions) that enclose a given geometrical shape + * remarks: This quantity is non-negative. + */ + } + + alias breadth for width; + + /* ISO-80000-3 item 3-1.3 height, depth, altitude */ + attribute height: LengthValue :> scalarQuantities { + doc + /* + * source: item 3-1.3 height, depth, altitude + * symbol(s): `h`, `H` + * application domain: generic + * name: Height (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: minimum length of a straight line segment between a point and a reference line or reference surface + * remarks: This quantity is usually signed. The sign expresses the position of the particular point with respect to the reference line or surface and is chosen by convention. The symbol `H` is often used to denote altitude, i.e. height above sea level. + */ + } + + alias depth for height; + + alias altitude for height; + + /* ISO-80000-3 item 3-1.4 thickness */ + attribute thickness: LengthValue :> scalarQuantities { + doc + /* + * source: item 3-1.4 thickness + * symbol(s): `d`, `δ` + * application domain: generic + * name: Thickness (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: width (item 3-1.2) + * remarks: This quantity is non-negative. + */ + } + + /* ISO-80000-3 item 3-1.5 diameter */ + attribute diameter: LengthValue :> scalarQuantities { + doc + /* + * source: item 3-1.5 diameter + * symbol(s): `d`, `D` + * application domain: generic + * name: Diameter (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: width (item 3-1.2) of a circle, cylinder or sphere + * remarks: This quantity is non-negative. + */ + } + + /* ISO-80000-3 item 3-1.6 radius */ + attribute radius: LengthValue :> scalarQuantities { + doc + /* + * source: item 3-1.6 radius + * symbol(s): `r`, `R` + * application domain: generic + * name: Radius (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: half of a diameter (item 3-1.5) + * remarks: This quantity is non-negative. + */ + } + + /* ISO-80000-3 item 3-1.7 path length, arc length */ + attribute pathLength: LengthValue :> scalarQuantities { + doc + /* + * source: item 3-1.7 path length, arc length + * symbol(s): `s` + * application domain: generic + * name: PathLength (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: length of a rectifiable curve between two of its points + * remarks: The differential path length at a given point of a curve is: `ds = sqrt(dx^2 + dy^2 + dz^2)` where `x`, `y`, and `z` denote the Cartesian coordinates (ISO 80000-2) of the particular point. There are curves which are not rectifiable, for example fractal curves. + */ + } + + alias arcLength for pathLength; + + /* ISO-80000-3 item 3-1.8 distance */ + attribute distance: LengthValue :> scalarQuantities { + doc + /* + * source: item 3-1.8 distance + * symbol(s): `d`, `r` + * application domain: generic + * name: Distance (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: shortest path length (item 3-1.7) between two points in a metric space + * remarks: A metric space might be curved. An example of a curved metric space is the surface of the Earth. In this case, distances are measured along great circles. A metric is not necessarily Euclidean. + */ + } + + /* ISO-80000-3 item 3-1.9 radial distance */ + attribute radialDistance: LengthValue :> scalarQuantities { + doc + /* + * source: item 3-1.9 radial distance + * symbol(s): `r_Q`, `ρ` + * application domain: generic + * name: RadialDistance (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: distance (item 3-1.8), where one point is located on an axis or within a closed non self-intersecting curve or surface + * remarks: The subscript Q denotes the point from which the radial distance is measured. Examples of closed non self-intersecting curves are circles or ellipses. Examples of closed non self-intersecting surfaces are surfaces of spheres or egg-shaped objects. + */ + } + + attribute def Spatial3dCoordinateFrame :> '3dCoordinateFrame' { + doc + /* + * Most general spatial 3D coordinate frame + */ + attribute :>> isBound = true; + } + + attribute def CartesianSpatial3dCoordinateFrame :> Spatial3dCoordinateFrame { + doc + /* + * Cartesian spatial 3D coordinate frame + * + * source: ISO 80000-2 item 2-17.1 Cartesian coordinates + * + * The components of a vector expressed on a Cartesian spatial coordinate frame are all LengthValues, and denoted with symbols `x`, `y`, `z`. + * + * Note 1: The Cartesian basis vectors `vec(e_x)`, `vec(e_y)` and `vec(e_z)` form an orthonormal right-handed coordinate frame. + * Note 2: The measurement units for the 3 dimensions are typically the same, but may be different. + */ + attribute xUnit : LengthUnit = mRefs#(1); + attribute yUnit : LengthUnit = mRefs#(2); + attribute zUnit : LengthUnit = mRefs#(3); + attribute :>> mRefs : LengthUnit[3]; + attribute :>> isOrthogonal = true; + } + + readonly attribute universalCartesianSpatial3dCoordinateFrame : CartesianSpatial3dCoordinateFrame[1] { + doc + /* + * A singleton CartesianSpatial3dCoordinateFrame that can be used as a default universal Cartesian 3D coordinate frame. + */ + + attribute :>> mRefs default (SI::m, SI::m, SI::m) { + doc /* + * By default, the universalCartesianSpatial3dCoordinateFrame uses meters as the units on all three axes. + */ + } + + attribute :>> transformation[0..0] { + doc /* + * The universalCartesianSpatial3dCoordinateFrame is the "top-level" coordinate frame, not nested in any other frame. + */ + } + + } + + attribute def CylindricalSpatial3dCoordinateFrame :> Spatial3dCoordinateFrame { + doc + /* + * Cylindrical spatial 3D coordinate frame + * + * source: ISO 80000-2 item 2-17.2 cylindrical coordinates + * + * The components of a (position) vector to a point P in a cylindrical coordinate frame are: + * - radialDistance (symbol `ρ`) defined by LengthValue, that is the radial distance from the cylinder axis to P + * - azimuth (symbol `φ`) defined by AngularMeasure, that is the angle between the azimuth reference direction and the line segment + * from the cylinder axis, in the plane that is orthogonal to the cylinder axis and intersects P + * - z coordinate (symbol `z`) defined by LengthValue, the coordinate along the clyinder axis. + * + * Note 1: The basis vectors `vec(e_ρ)(φ)`, `vec(e_φ)(φ)` and `vec(e_z)` form an orthonormal right-handed coordinate frame, where + * `vec(e_φ)` is tangent to the circular arc in the `φ` direction. + * Note 2: In order to enable transformation to and from a CartesianSpatial3dCoordinateFrame the `vec(e_x)` Cartesian basis vector is aligned + * with the `φ=0` direction in the cylindrical frame, and the `vec(e_z)` Cartesian basis vector is aligned with + * the `vec(e_z)` cylindrical basis vector. + * Note 3: If `z = 0`, then `ρ` and `φ` are polar coordinates in the XY-plane. + * Note 4: See also https://en.wikipedia.org/wiki/Cylindrical_coordinate_system . + */ + attribute radialDistanceUnit : LengthUnit; + attribute azimuthUnit : AngularMeasureUnit; + attribute zUnit : LengthUnit; + attribute :>> mRefs = (radialDistanceUnit, azimuthUnit, zUnit); + attribute :>> isOrthogonal = true; + } + + attribute def SphericalSpatial3dCoordinateFrame :> Spatial3dCoordinateFrame { + doc + /* + * Spherical spatial 3D coordinate frame + * + * source: ISO 80000-2 item 2-17.3 spherical coordinates + * + * The components of a (position) vector to a point P specified in a spherical coordinate frame are: + * - radialDistance (symbol `r`) defined by LengthValue, that is the distance from the origin to P + * - inclination (symbol `θ`) defined by AngularMeasure, that is the angle between the zenith direction and the line segment from origin to P + * - azimuth (symbol `φ`) defined by AngularMeasure, that is the angle between the azimuth reference direction and the line segment + * from the origin to the orthogonal projection of P on the reference plane, normal to the zenith direction. + * + * Note 1: The basis vectors `vec(e_r)(θ,φ)`, `vec(e_θ)(θ,φ)` and `vec(e_φ)(φ)` form an orthonormal right-handed frame, where + * `vec(e_θ)` and `vec(e_φ)` are tangent to the respective circular arcs in the `θ` and `φ` directions. + * Note 2: In order to transform to and from a CartesianSpatial3dCoordinateFrame the `vec(e_x)` Cartesian basis vector is aligned + * with the `θ=π/4` and `φ=0` direction in the spherical frame, and the `vec(e_z)` Cartesian basis vector is aligned + * with the `θ=0` zenith direction in the spherical frame. + * Note 3: If `θ = π/4`, then `ρ` and `φ` are polar coordinates in the XY-plane. + * Note 4: See also https://en.wikipedia.org/wiki/Spherical_coordinate_system . + */ + attribute radialDistanceUnit : LengthUnit; + attribute inclinationUnit : AngularMeasureUnit; + attribute azimuthUnit : AngularMeasureUnit; + attribute :>> mRefs = (radialDistanceUnit, inclinationUnit, azimuthUnit); + attribute :>> isOrthogonal = true; + } + + attribute def PlanetarySpatial3dCoordinateFrame :> Spatial3dCoordinateFrame { + doc + /* + * Planetary spatial 3D coordinate frame + * + * A planetary spatial 3D coordinate frame is a generalization for any planet of the geographic coordinate frame and geocentric coordinate + * for Earth. In such coordinate frames, typically the origin is located at the planet's centre of gravity, and the surface of the planet + * is approximated by a reference ellipsoid centred on the origin, with its major axes oriented along the south to north pole vector and + * the equatorial plane. + * + * The components of a (position) vector to a point P specified in a planetary coordinate frame are: + * - latitude (symbol `lat` or `φ`) defined by AngularMeasure, that is the angle between the equatorial plane and the vector from + * the origin to P, similar to the inclination in a spherical spatial coordinate frame. Typically, the zero reference latitude is chosen + * for positions in the equatorial plane, with positive latitude for positions in the northern hemisphere and negative latitude for positions + * in the southern hemisphere. + * - longitude (symbol `long` or `λ`) defined by AngularMeasure, that is the angle between a reference meridian and the meridian + * passing through P, similar to the azimuth of a spherical spatial coordinate frame. The convention is to connotate positive longitude + * with eastward direction and negative longitude with westward direction. The reference meridian for `long=0` is chosen to pass + * through a particular feature of the planet, e.g., for Earth typically the position of the British Royal Observatory in Greenwich, UK. + * - altitude (symbol `h`) defined by LengthValue, that is the distance between P and the reference ellipsoid + * in the normal direction to the ellipsoid. Positive altitude specifies a position above the reference ellipsoid surface, + * while a negative value specifies a position below. + * + * Note 1: The reference meridian is also called prime meridian. + * Note 2: The basis vectors `vec(e_φ)(φ)`, `vec(e_λ)(λ)` and `vec(e_h)(φ,λ)` form an orthonormal right-handed frame, where + * `vec(e_φ)` and `vec(e_λ)` are tangent to the reference ellipsoid in the respective latitude and longitude directions, + * and `vec(e_h)` is normal to the reference ellipsoid. + * Note 3: In order to transform to and from a CartesianSpatial3dCoordinateFrame the `vec(e_x)` Cartesian basis vector is aligned + * with the `φ=0` and `λ=0` direction in the planetary frame, and the `vec(e_z)` Cartesian basis vector is aligned + * with the `λ=π/2` (north pole) direction in the planetary frame. + * Note 4: See also https://en.wikipedia.org/wiki/Planetary_coordinate_system . + */ + attribute latitudeUnit : AngularMeasureUnit; + attribute longitudeUnit : AngularMeasureUnit; + attribute altitudeUnit : LengthUnit; + attribute :>> mRefs = (longitudeUnit, latitudeUnit, altitudeUnit); + attribute :>> isOrthogonal = true; + } + + attribute def Position3dVector :> '3dVectorQuantityValue' { + doc + /* + * source: item 3-1.10 position vector + * symbol(s): `vec(r)` + * application domain: generic + * name: PositionVector + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity from the origin of a coordinate system to a point in space + * remarks: Position vectors are so-called bounded vectors, i.e. their magnitude (ISO 80000-2) and direction depend on the particular coordinate system used. + */ + attribute :>> isBound = true; + attribute :>> mRef: Spatial3dCoordinateFrame[1]; + } + attribute position3dVector: Position3dVector :> vectorQuantities; + + attribute def CartesianPosition3dVector :> Position3dVector { + attribute x : LengthValue = num#(1) [mRef.mRefs#(1)]; + attribute y : LengthValue = num#(2) [mRef.mRefs#(2)]; + attribute z : LengthValue = num#(3) [mRef.mRefs#(3)]; + attribute :>> mRef : CartesianSpatial3dCoordinateFrame[1]; + } + attribute cartesianPosition3dVector : CartesianPosition3dVector :> position3dVector; + + attribute def CylindricalPosition3dVector :> Position3dVector { + attribute <'ρ'> radialDistance : LengthValue = num#(1) [mRef.mRefs#(1)]; + attribute <'φ'> azimuth : AngularMeasureUnit = num#(2) [mRef.mRefs#(2)]; + attribute height : LengthValue = num#(3) [mRef.mRefs#(3)]; + attribute :>> mRef : CylindricalSpatial3dCoordinateFrame[1]; + } + attribute cylindricalPosition3dVector : CylindricalPosition3dVector :> position3dVector; + + attribute def SphericalPosition3dVector :> Position3dVector { + attribute radialDistance : LengthValue = num#(1) [mRef.mRefs#(1)]; + attribute <'θ'> inclination : AngularMeasureUnit = num#(2) [mRef.mRefs#(2)]; + attribute <'φ'> azimuth : AngularMeasureUnit = num#(3) [mRef.mRefs#(3)]; + attribute :>> mRef : SphericalSpatial3dCoordinateFrame[1]; + } + attribute sphericalPosition3dVector : SphericalPosition3dVector :> position3dVector; + + attribute def PlanetaryPosition3dVector :> Position3dVector { + attribute latitude : AngularMeasureUnit = num#(1) [mRef.mRefs#(1)]; + attribute longitude : AngularMeasureUnit = num#(2) [mRef.mRefs#(2)]; + attribute altitude : LengthValue = num#(3) [mRef.mRefs#(3)]; + attribute :>> mRef : PlanetarySpatial3dCoordinateFrame[1]; + } + attribute planetaryPosition3dVector : PlanetaryPosition3dVector :> position3dVector; + + /* ISO-80000-3 item 3-1.11 displacement */ + abstract attribute def Displacement3dVector :> '3dVectorQuantityValue' { + doc + /* + * source: item 3-1.11 displacement + * symbol(s): `vec(Δr)` + * application domain: generic + * name: Displacement + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity between any two points in space + * remarks: Displacement vectors are so-called free vectors, i.e. their magnitude (ISO 80000-2) and direction do not depend on a particular coordinate system. The magnitude of this vector is also called displacement. + */ + attribute :>> isBound = false; + attribute :>> mRef: Spatial3dCoordinateFrame[1]; + } + attribute displacement3dVector: Displacement3dVector :> vectorQuantities; + + attribute def CartesianDisplacement3dVector :> Displacement3dVector { + attribute x : LengthValue = num#(1) [mRef.mRefs#(1)]; + attribute y : LengthValue = num#(2) [mRef.mRefs#(2)]; + attribute z : LengthValue = num#(3) [mRef.mRefs#(3)]; + attribute :>> mRef: CartesianSpatial3dCoordinateFrame[1]; + } + attribute cartesianDisplacement3dVector: CartesianDisplacement3dVector :> displacement3dVector; + + attribute def CylindricalDisplacement3dVector :> Displacement3dVector { + attribute <'ρ'> radialDistance : LengthValue = num#(1) [mRef.mRefs#(1)]; + attribute <'φ'> azimuth : AngularMeasureUnit = num#(2) [mRef.mRefs#(2)]; + attribute height : LengthValue = num#(3) [mRef.mRefs#(3)]; + attribute :>> mRef: CylindricalSpatial3dCoordinateFrame[1]; + } + attribute cylindricalDisplacement3dVector: CylindricalDisplacement3dVector :> displacement3dVector; + + attribute def SphericalDisplacement3dVector :> Displacement3dVector { + attribute radialDistance : LengthValue = num#(1) [mRef.mRefs#(1)]; + attribute <'θ'> inclination : AngularMeasureUnit = num#(2) [mRef.mRefs#(2)]; + attribute <'φ'> azimuth : AngularMeasureUnit = num#(3) [mRef.mRefs#(3)]; + attribute :>> mRef: SphericalSpatial3dCoordinateFrame[1]; + } + attribute sphericalDisplacement3dVector: SphericalDisplacement3dVector :> displacement3dVector; + + /* ISO-80000-3 item 3-1.12 radius of curvature */ + attribute radiusOfCurvature: LengthValue :> scalarQuantities { + doc + /* + * source: item 3-1.12 radius of curvature + * symbol(s): `ρ` + * application domain: generic + * name: RadiusOfCurvature (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: radius (item 3-1.6) of the osculating circle of a planar curve at a particular point of the curve + * remarks: The radius of curvature is only defined for curves which are at least twice continuously differentiable. + */ + } + + /* ISO-80000-3 item 3-2 curvature */ + attribute def CurvatureValue :> ScalarQuantityValue { + doc + /* + * source: item 3-2 curvature + * symbol(s): `κ` + * application domain: generic + * name: Curvature + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: inverse of the radius of curvature (item 3-1.12) + * remarks: The curvature is given by: `κ = 1/ρ` where `ρ` denotes the radius of curvature (item 3-1.12). + */ + attribute :>> num: Real; + attribute :>> mRef: CurvatureUnit[1]; + } + + attribute curvature: CurvatureValue[*] nonunique :> scalarQuantities; + + attribute def CurvatureUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-3 item 3-3 area */ + attribute def AreaValue :> ScalarQuantityValue { + doc + /* + * source: item 3-3 area + * symbol(s): `A`, `S` + * application domain: generic + * name: Area + * quantity dimension: L^2 + * measurement unit(s): m^2 + * tensor order: 0 + * definition: extent of a two-dimensional geometrical shape + * remarks: The surface element at a given point of a surface is given by: `dA = g du dv` where `u` and `v` denote the Gaussian surface coordinates and `g` denotes the determinant of the metric tensor (ISO 80000-2) at the particular point. The symbol `dσ` is also used for the surface element. + */ + attribute :>> num: Real; + attribute :>> mRef: AreaUnit[1]; + } + + attribute area: AreaValue[*] nonunique :> scalarQuantities; + + attribute def AreaUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-3 item 3-4 volume */ + attribute def VolumeValue :> ScalarQuantityValue { + doc + /* + * source: item 3-4 volume + * symbol(s): `V`, `(S)` + * application domain: generic + * name: Volume + * quantity dimension: L^3 + * measurement unit(s): m^3 + * tensor order: 0 + * definition: extent of a three-dimensional geometrical shape + * remarks: The volume element in Euclidean space is given by: `dV = dx dy dz` where `dx`, `dy`, and `dz` denote the differentials of the Cartesian coordinates (ISO 80000-2). The symbol `dτ` is also used for the volume element. + */ + attribute :>> num: Real; + attribute :>> mRef: VolumeUnit[1]; + } + + attribute volume: VolumeValue[*] nonunique :> scalarQuantities; + + attribute def VolumeUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-3 item 3-5 angular measure, plane angle */ + attribute def AngularMeasureValue :> ScalarQuantityValue { + doc + /* + * source: item 3-5 angular measure, plane angle + * symbol(s): `α`, `β`, `γ` + * application domain: generic + * name: AngularMeasure + * quantity dimension: 1 + * measurement unit(s): rad, 1 + * tensor order: 0 + * definition: measure of a geometric figure, called plane angle, formed by two rays, called the sides of the plane angle, emanating from a common point, called the vertex of the plane angle + * remarks: The angular measure is given by: `α = s/r` where `s` denotes the arc length (item 3-1.7) of the included arc of a circle, centred at the vertex of the plane angle, and `r` the radius (item 3-1.6) of that circle. Other symbols are also used. + */ + attribute :>> num: Real; + attribute :>> mRef: AngularMeasureUnit[1]; + } + + attribute angularMeasure: AngularMeasureValue[*] nonunique :> scalarQuantities; + + attribute def AngularMeasureUnit :> DimensionOneUnit { + } + + alias PlaneAngleUnit for AngularMeasureUnit; + alias PlaneAngleValue for AngularMeasureValue; + alias planeAngle for angularMeasure; + + /* ISO-80000-3 item 3-6 rotational displacement, angular displacement */ + attribute rotationalDisplacement: AngularMeasureValue :> scalarQuantities { + doc + /* + * source: item 3-6 rotational displacement, angular displacement + * symbol(s): `ϑ`, `φ` + * application domain: generic + * name: RotationalDisplacement (specializes AngularMeasure) + * quantity dimension: 1 + * measurement unit(s): rad, 1 + * tensor order: 0 + * definition: quotient of the traversed circular path length (item 3-1.7) of a point in space during a rotation and its distance (item 3-1.8) from the axis or centre of rotation + * remarks: The rotational displacement is given by: `φ = s/r` where `s` denotes the traversed path length (item 3-1.7) along the periphery of a circle, centred at the vertex of the plane angle, and `r` the radius (item 3-1.6) of that circle. The rotational displacement is signed. The sign denotes the direction of rotation and is chosen by convention. Other symbols are also used. + */ + } + + alias angularDisplacement for rotationalDisplacement; + + /* ISO-80000-3 item 3-7 phase angle */ + attribute phaseAngle: AngularMeasureValue :> scalarQuantities { + doc + /* + * source: item 3-7 phase angle + * symbol(s): `φ`, `ϕ` + * application domain: generic + * name: PhaseAngle (specializes AngularMeasure) + * quantity dimension: 1 + * measurement unit(s): rad, 1 + * tensor order: 0 + * definition: angular measure (item 3-5) between the positive real axis and the radius of the polar representation of the complex number in the complex plane + * remarks: The phase angle (often imprecisely referred to as the "phase") is the argument of a complex number. Other symbols are also used. + */ + } + + /* ISO-80000-3 item 3-8 solid angular measure */ + attribute def SolidAngularMeasureValue :> ScalarQuantityValue { + doc + /* + * source: item 3-8 solid angular measure + * symbol(s): `Ω` + * application domain: generic + * name: SolidAngularMeasure + * quantity dimension: 1 + * measurement unit(s): sr, 1 + * tensor order: 0 + * definition: measure of a conical geometric figure, called solid angle, formed by all rays, originating from a common point, called the vertex of the solid angle, and passing through the points of a closed, non-self-intersecting curve in space considered as the border of a surface + * remarks: The differential solid angular measure expressed in spherical coordinates (ISO 80000-2) is given by: `dΩ = A/r^2 * sin(θ * dθ * dφ)` where `A` is area, `r` is radius, `θ` and `φ` are spherical coordinates. + */ + attribute :>> num: Real; + attribute :>> mRef: SolidAngularMeasureUnit[1]; + } + + attribute solidAngularMeasure: SolidAngularMeasureValue[*] nonunique :> scalarQuantities; + + attribute def SolidAngularMeasureUnit :> DimensionOneUnit { + } + + /* ISO-80000-3 item 3-9 duration, time */ + /* See package ISQBase for the declarations of DurationValue and DurationUnit */ + + alias TimeUnit for DurationUnit; + alias TimeValue for DurationValue; + alias time for duration; + + /* ISO-80000-3 item 3-10.1 velocity */ + attribute def CartesianVelocity3dVector :> '3dVectorQuantityValue' { + doc + /* + * source: item 3-10.1 velocity + * symbol(s): `vec(v)`, `u,v,w` + * application domain: generic + * name: Velocity + * quantity dimension: L^1*T^-1 + * measurement unit(s): m/s, m*s^-1 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity giving the rate of change of a position vector (item 3-1.10) + * remarks: The velocity vector is given by: `vec(v) = (d vec(r)) / (dt)` where `vec(r)` denotes the position vector (item 3-1.10) and `t` the duration (item 3-9). When the general symbol `vec(v)` is not used for the velocity, the symbols `u`, `v`, `w` may be used for the components (ISO 80000-2) of the velocity. + */ + attribute :>> isBound = false; + attribute :>> mRef: CartesianVelocity3dCoordinateFrame[1]; + } + attribute cartesianVelocity3dVector: CartesianVelocity3dVector :> vectorQuantities; + + attribute def CartesianVelocity3dCoordinateFrame :> '3dCoordinateFrame' { + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: SpeedUnit[3]; + } + + /* ISO-80000-3 item 3-10.2 speed */ + attribute def SpeedValue :> ScalarQuantityValue { + doc + /* + * source: item 3-10.2 speed + * symbol(s): `v` + * application domain: generic + * name: Speed + * quantity dimension: L^1*T^-1 + * measurement unit(s): m/s, m*s^-1 + * tensor order: 0 + * definition: magnitude (ISO 80000-2) of the velocity (item 3-10.1) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: SpeedUnit[1]; + } + + attribute speed: SpeedValue[*] nonunique :> scalarQuantities; + + attribute def SpeedUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-3 item 3-11 acceleration */ + attribute def AccelerationValue :> ScalarQuantityValue { + doc + /* + * source: item 3-11 acceleration (magnitude) + * symbol(s): `a` + * application domain: generic + * name: Acceleration + * quantity dimension: L^1*T^-2 + * measurement unit(s): m*s^-2 + * tensor order: 0 + * definition: vector (ISO 80000-2) quantity giving the rate of change of velocity (item 3-10) + * remarks: The acceleration vector is given by: `vec(a) = (d vec(v))/(dt)` where `vec(v)` denotes the velocity (item 3-10.1) and `t` the duration (item 3-9). The magnitude (ISO 80000-2) of the acceleration of free fall is usually denoted by `g`. + */ + attribute :>> num: Real; + attribute :>> mRef: AccelerationUnit[1]; + } + + attribute acceleration: AccelerationValue[*] nonunique :> scalarQuantities; + + attribute def AccelerationUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + attribute def CartesianAcceleration3dVector :> '3dVectorQuantityValue' { + doc + /* + * source: item 3-11 acceleration (vector) + * symbol(s): `vec(a)` + * application domain: generic + * name: Acceleration + * quantity dimension: L^1*T^-2 + * measurement unit(s): m*s^-2 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity giving the rate of change of velocity (item 3-10) + * remarks: The acceleration vector is given by: `vec(a) = (d vec(v))/(dt)` where `vec(v)` denotes the velocity (item 3-10.1) and `t` the duration (item 3-9). The magnitude (ISO 80000-2) of the acceleration of free fall is usually denoted by `g`. + */ + attribute :>> isBound = false; + attribute :>> mRef: CartesianAcceleration3dCoordinateFrame[1]; + } + + attribute cartesianAcceleration3dVector: CartesianAcceleration3dVector :> vectorQuantities; + + attribute def CartesianAcceleration3dCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: AccelerationUnit[3]; + } + + /* ISO-80000-3 item 3-12 angular velocity */ + attribute def AngularVelocityValue :> ScalarQuantityValue { + doc + /* + * source: item 3-12 angular velocity (magnitude) + * symbol(s): `ω` + * application domain: generic + * name: AngularVelocity + * quantity dimension: T^-1 + * measurement unit(s): rad*s^-1, s^-1 + * tensor order: 0 + * definition: vector (ISO 80000-2) quantity giving the rate of change of the rotational displacement (item 3-6) as its magnitude (ISO 80000-2) and with a direction equal to the direction of the axis of rotation + * remarks: The angular velocity vector is given by: `vec(ω) = (d φ) / (dt) vec(u)` where `φ` denotes the angular displacement (item 3-6), `t` the duration (item 3-9), and `vec(u)` the unit vector (ISO 80000-2) along the axis of rotation in the direction for which the rotation corresponds to a right-hand spiral. + */ + attribute :>> num: Real; + attribute :>> mRef: AngularVelocityUnit[1]; + } + + attribute angularVelocity: AngularVelocityValue[*] nonunique :> scalarQuantities; + + attribute def AngularVelocityUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + attribute def Cartesian3dAngularVelocityVector :> VectorQuantityValue { + doc + /* + * source: item 3-12 angular velocity (vector) + * symbol(s): `vec(ω)` + * application domain: generic + * name: AngularVelocity + * quantity dimension: T^-1 + * measurement unit(s): rad*s^-1, s^-1 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity giving the rate of change of the rotational displacement (item 3-6) as its magnitude (ISO 80000-2) and with a direction equal to the direction of the axis of rotation + * remarks: The angular velocity vector is given by: `vec(ω) = (d φ) / (dt) vec(u)` where `φ` denotes the angular displacement (item 3-6), `t` the duration (item 3-9), and `vec(u)` the unit vector (ISO 80000-2) along the axis of rotation in the direction for which the rotation corresponds to a right-hand spiral. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dAngularVelocityCoordinateFrame[1]; + } + + attribute angularVelocityVector: Cartesian3dAngularVelocityVector :> vectorQuantities; + + attribute def Cartesian3dAngularVelocityCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: AngularVelocityUnit[3]; + } + + /* ISO-80000-3 item 3-13 angular acceleration */ + attribute def AngularAccelerationValue :> ScalarQuantityValue { + doc + /* + * source: item 3-13 angular acceleration (magnitude) + * symbol(s): `α` + * application domain: generic + * name: AngularAcceleration + * quantity dimension: T^-2 + * measurement unit(s): rad*s^-2, s^-2 + * tensor order: 0 + * definition: vector (ISO 80000-2) quantity giving the rate of change of angular velocity (item 3-12) + * remarks: The angular acceleration vector is given by: `vec α = (d vec(ω))/(dt)` Where `vec(ω)` denotes the angular velocity (item 3-12) and `t` the duration (item 3-9). + */ + attribute :>> num: Real; + attribute :>> mRef: AngularAccelerationUnit[1]; + } + + attribute angularAcceleration: AngularAccelerationValue[*] nonunique :> scalarQuantities; + + attribute def AngularAccelerationUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + attribute def Cartesian3dAngularAccelerationVector :> VectorQuantityValue { + doc + /* + * source: item 3-13 angular acceleration (vector) + * symbol(s): `vec(α)` + * application domain: generic + * name: AngularAcceleration + * quantity dimension: T^-2 + * measurement unit(s): rad*s^-2, s^-2 + * tensor order: 1 + * definition: vector (ISO 80000-2) quantity giving the rate of change of angular velocity (item 3-12) + * remarks: The angular acceleration vector is given by: `vec α = (d vec(ω))/(dt)` Where `vec(ω)` denotes the angular velocity (item 3-12) and `t` the duration (item 3-9). + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dAngularAccelerationCoordinateFrame[1]; + } + + attribute angularAccelerationVector: Cartesian3dAngularAccelerationVector :> vectorQuantities; + + attribute def Cartesian3dAngularAccelerationCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: AngularAccelerationUnit[3]; + } + + /* ISO-80000-3 item 3-14 period duration, period */ + attribute periodDuration: DurationValue :> scalarQuantities { + doc + /* + * source: item 3-14 period duration, period + * symbol(s): `T` + * application domain: generic + * name: PeriodDuration (specializes Duration) + * quantity dimension: T^1 + * measurement unit(s): s + * tensor order: 0 + * definition: duration (item 3-9) of one cycle of a periodic event + * remarks: A periodic event is an event that occurs regularly with a fixed time interval. + */ + } + + alias period for periodDuration; + + /* ISO-80000-3 item 3-15 time constant */ + attribute timeConstant: DurationValue :> scalarQuantities { + doc + /* + * source: item 3-15 time constant + * symbol(s): `τ`, `T` + * application domain: generic + * name: TimeConstant (specializes Duration) + * quantity dimension: T^1 + * measurement unit(s): s + * tensor order: 0 + * definition: parameter characterizing the response to a step input of a first-order, linear time-invariant system + * remarks: If a quantity is a function of the duration (item 3-9) expressed by: `F(t) prop e^(-t/τ)` where `t` denotes the duration (item 3-9), then `τ` denotes the time constant. Here the time constant `τ` applies to an exponentially decaying quantity. + */ + } + + /* ISO-80000-3 item 3-16 rotation */ + attribute rotation: CountValue :> scalarQuantities { + doc + /* + * source: item 3-16 rotation + * symbol(s): `N` + * application domain: generic + * name: Rotation (specializes Count) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: number of revolutions + * remarks: `N` is the number (not necessarily an integer) of revolutions, for example, of a rotating body about a given axis. Its value is given by: `N = φ/(2 π)` where `φ` denotes the measure of rotational displacement (item 3-6). + */ + } + + /* ISO-80000-3 item 3-17.1 frequency */ + attribute def FrequencyValue :> ScalarQuantityValue { + doc + /* + * source: item 3-17.1 frequency + * symbol(s): `f`, `ν` + * application domain: generic + * name: Frequency + * quantity dimension: T^-1 + * measurement unit(s): Hz, s^-1 + * tensor order: 0 + * definition: inverse of period duration (item 3-14) + * remarks: The frequency is given by: `f = 1/T` where `T` denotes the period duration (item 3-14). + */ + attribute :>> num: Real; + attribute :>> mRef: FrequencyUnit[1]; + } + + attribute frequency: FrequencyValue[*] nonunique :> scalarQuantities; + + attribute def FrequencyUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + /* ISO-80000-3 item 3-17.2 rotational frequency */ + attribute rotationalFrequency: FrequencyValue :> scalarQuantities { + doc + /* + * source: item 3-17.2 rotational frequency + * symbol(s): `n` + * application domain: generic + * name: RotationalFrequency (specializes Frequency) + * quantity dimension: T^-1 + * measurement unit(s): s^-1 + * tensor order: 0 + * definition: duration (item 3-9) of one cycle of a periodic event + * remarks: The rotational frequency is given by: `n = (dN) / (dt)` where `N` denotes the rotation (item 3-16) and `t` is the duration (item 3-9). + */ + } + + /* ISO-80000-3 item 3-18 angular frequency */ + attribute def AngularFrequencyValue :> ScalarQuantityValue { + doc + /* + * source: item 3-18 angular frequency + * symbol(s): `ω` + * application domain: generic + * name: AngularFrequency + * quantity dimension: T^-1 + * measurement unit(s): rad*s^-1, s^-1 + * tensor order: 0 + * definition: rate of change of the phase angle (item 3-7) + * remarks: The angular frequency is given by: `ω = 2 π f` where `f` denotes the frequency (item 3-17.1). + */ + attribute :>> num: Real; + attribute :>> mRef: AngularFrequencyUnit[1]; + } + + attribute angularFrequency: AngularFrequencyValue[*] nonunique :> scalarQuantities; + + attribute def AngularFrequencyUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + /* ISO-80000-3 item 3-19 wavelength */ + attribute wavelength: LengthValue :> scalarQuantities { + doc + /* + * source: item 3-19 wavelength + * symbol(s): `λ` + * application domain: generic + * name: Wavelength (specializes Length) + * quantity dimension: L^1 + * measurement unit(s): m + * tensor order: 0 + * definition: length (item 3-1.1) of the repetition interval of a wave + * remarks: None. + */ + } + + /* ISO-80000-3 item 3-20 repetency, wavenumber */ + attribute def RepetencyValue :> ScalarQuantityValue { + doc + /* + * source: item 3-20 repetency, wavenumber + * symbol(s): `σ`, `ṽ` + * application domain: generic + * name: Repetency + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: inverse of the wavelength (item 3-19) + * remarks: The repetency is given by: `σ = 1 / λ` where `λ` denotes the wavelength (item 3-19). + */ + attribute :>> num: Real; + attribute :>> mRef: RepetencyUnit[1]; + } + + attribute repetency: RepetencyValue[*] nonunique :> scalarQuantities; + + attribute def RepetencyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + alias WavenumberUnit for RepetencyUnit; + alias WavenumberValue for RepetencyValue; + alias wavenumber for repetency; + + /* ISO-80000-3 item 3-21 wave vector */ + attribute def Cartesian3dWaveVector :> VectorQuantityValue { + doc + /* + * source: item 3-21 wave vector + * symbol(s): `vec(k)` + * application domain: generic + * name: WaveVector + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 1 + * definition: vector normal to the surfaces of constant phase angle (item 3-7) of a wave, with the magnitude (ISO 80000-2) of repetency (item 3-20) + * remarks: None. + */ + attribute :>> isBound = false; + attribute :>> num: Real[3]; + attribute :>> mRef: Cartesian3dWaveCoordinateFrame[1]; + } + + attribute waveVector: Cartesian3dWaveVector :> vectorQuantities; + + attribute def Cartesian3dWaveCoordinateFrame :> VectorMeasurementReference { + attribute :>> dimensions = 3; + attribute :>> isBound = false; + attribute :>> isOrthogonal = true; + attribute :>> mRefs: RepetencyUnit[3]; + } + + /* ISO-80000-3 item 3-22 angular repetency, angular wavenumber */ + attribute def AngularRepetencyValue :> ScalarQuantityValue { + doc + /* + * source: item 3-22 angular repetency, angular wavenumber + * symbol(s): `k` + * application domain: generic + * name: AngularRepetency + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: magnitude (ISO 80000-2) of the wave vector (item 3-21) + * remarks: The angular repetency is given by: `κ = (2 π)/λ` where `λ` denotes the wavelength (item 3-19). + */ + attribute :>> num: Real; + attribute :>> mRef: AngularRepetencyUnit[1]; + } + + attribute angularRepetency: AngularRepetencyValue[*] nonunique :> scalarQuantities; + + attribute def AngularRepetencyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + alias AngularWavenumberUnit for AngularRepetencyUnit; + alias AngularWavenumberValue for AngularRepetencyValue; + alias angularWavenumber for angularRepetency; + + /* ISO-80000-3 item 3-23.1 phase velocity, phase speed */ + attribute def PhaseVelocityValue :> ScalarQuantityValue { + doc + /* + * source: item 3-23.1 phase velocity, phase speed + * symbol(s): `c`, `v`, `(ν)`, `c_φ`, `v_φ`, `(ν_φ)` + * application domain: generic + * name: PhaseVelocity + * quantity dimension: L^1*T^-1 + * measurement unit(s): m*s^-1 + * tensor order: 0 + * definition: speed with which the phase angle (item 3-7) of a wave propagates in space + * remarks: The phase velocity is given by: `c = ω/κ` where `ω` denotes the angular frequency (item 3-18) and `k` the angular repetency (item 3-22). If phase velocities of electromagnetic waves and other phase velocities are both involved, then `c` should be used for the former and `υ` for the latter. Phase velocity can also be written as `c = λ f`. + */ + attribute :>> num: Real; + attribute :>> mRef: PhaseVelocityUnit[1]; + } + + attribute phaseVelocity: PhaseVelocityValue[*] nonunique :> scalarQuantities; + + attribute def PhaseVelocityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + alias PhaseSpeedUnit for PhaseVelocityUnit; + alias PhaseSpeedValue for PhaseVelocityValue; + alias phaseSpeed for phaseVelocity; + + /* ISO-80000-3 item 3-23.2 group velocity, group speed */ + attribute groupVelocity: SpeedValue :> scalarQuantities { + doc + /* + * source: item 3-23.2 group velocity, group speed + * symbol(s): `c_g`, `v_g`, `(ν_g)` + * application domain: generic + * name: GroupVelocity (specializes Speed) + * quantity dimension: L^1*T^-1 + * measurement unit(s): m*s^-1 + * tensor order: 0 + * definition: speed with which the envelope of a wave propagates in space + * remarks: The group velocity is given by: `c_g = (d ω)/ (dk)` where `ω` denotes the angular frequency (item 3-18) and `k` the angular repetency (item 3-22). + */ + } + + alias groupSpeed for groupVelocity; + + /* ISO-80000-3 item 3-24 damping coefficient */ + attribute def DampingCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 3-24 damping coefficient + * symbol(s): `δ` + * application domain: generic + * name: DampingCoefficient + * quantity dimension: T^-1 + * measurement unit(s): s^-1 + * tensor order: 0 + * definition: inverse of the time constant (item 3-15) of an exponentially varying quantity + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: DampingCoefficientUnit[1]; + } + + attribute dampingCoefficient: DampingCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def DampingCoefficientUnit :> DerivedUnit { + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = durationPF; } + } + + /* ISO-80000-3 item 3-25 logarithmic decrement */ + attribute def LogarithmicDecrementValue :> DimensionOneValue { + doc + /* + * source: item 3-25 logarithmic decrement + * symbol(s): `Λ` + * application domain: generic + * name: LogarithmicDecrement (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: product of damping coefficient (item 3-24) and period duration (item 3-14) + * remarks: None. + */ + } + attribute logarithmicDecrement: LogarithmicDecrementValue :> scalarQuantities; + + /* ISO-80000-3 item 3-26.1 attenuation, extinction */ + attribute def AttenuationValue :> ScalarQuantityValue { + doc + /* + * source: item 3-26.1 attenuation, extinction + * symbol(s): `α` + * application domain: generic + * name: Attenuation + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: gradual decrease in magnitude (ISO 80000-2) of any kind of flux through a medium + * remarks: If a quantity is a function of distance (item 3-1.8) expressed by: `f(x) prop e^(-α x)` where `x` denotes distance (item 3-1.8), then `α` denotes attenuation. The inverse of attenuation is called attenuation length. + */ + attribute :>> num: Real; + attribute :>> mRef: AttenuationUnit[1]; + } + + attribute attenuation: AttenuationValue[*] nonunique :> scalarQuantities; + + attribute def AttenuationUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + alias ExtinctionUnit for AttenuationUnit; + alias ExtinctionValue for AttenuationValue; + alias extinction for attenuation; + + /* ISO-80000-3 item 3-26.2 phase coefficient */ + attribute def PhaseCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 3-26.2 phase coefficient + * symbol(s): `β` + * application domain: generic + * name: PhaseCoefficient + * quantity dimension: L^-1 + * measurement unit(s): rad/m, m^-1 + * tensor order: 0 + * definition: change of phase angle (item 3-7) with the length (item 3-1.1) along the path travelled by a plane wave + * remarks: If a quantity is a function of distance expressed by: `f(x) prop cos(β(x-x_0))` where `x` denotes distance (item 3-1.8), then `β` denotes the phase coefficient. + */ + attribute :>> num: Real; + attribute :>> mRef: PhaseCoefficientUnit[1]; + } + + attribute phaseCoefficient: PhaseCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def PhaseCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + + /* ISO-80000-3 item 3-26.3 propagation coefficient */ + attribute def PropagationCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 3-26.3 propagation coefficient + * symbol(s): `γ` + * application domain: generic + * name: PropagationCoefficient + * quantity dimension: L^-1 + * measurement unit(s): m^-1 + * tensor order: 0 + * definition: measure of the change of amplitude and phase angle (item 3-7) of a plane wave propagating in a given direction + * remarks: The propagation coefficient is given by: `γ = α + iβ` where `α` denotes attenuation (item 3-26.1) and `β` the phase coefficient (item 3-26.2) of a plane wave. + */ + attribute :>> num: Real; + attribute :>> mRef: PropagationCoefficientUnit[1]; + } + + attribute propagationCoefficient: PropagationCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def PropagationCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = lengthPF; } + } + +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml new file mode 100644 index 0000000000000000000000000000000000000000..9f52707b8f8036d7e1cc27fad45fb1a90ada61c7 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml @@ -0,0 +1,1256 @@ +standard library package ISQThermodynamics { + doc + /* + * International System of Quantities and Units + * Generated on 2022-08-07T14:44:27Z from standard ISO-80000-5:2019 "Thermodynamics" + * see also https://www.iso.org/obp/ui/#iso:std:iso:80000:-5:ed-2:v1:en + * + * Note 1: In documentation comments, AsciiMath notation (see http://asciimath.org/) is used for mathematical concepts, + * with Greek letters in Unicode encoding. In running text, AsciiMath is placed between backticks. + * Note 2: For vector and tensor quantities currently the unit and quantity value type for their (scalar) magnitude is + * defined, as well as their typical Cartesian 3d VectorMeasurementReference (i.e. coordinate system) + * or TensorMeasurementReference. + */ + + private import ScalarValues::Real; + private import Quantities::*; + private import MeasurementReferences::*; + private import ISQBase::*; + + /* Quantity definitions referenced from other ISQ packages */ + + + /* ISO-80000-5 item 5-1 thermodynamic temperature, temperature */ + /* See package ISQBase for the declarations of ThermodynamicTemperatureValue and ThermodynamicTemperatureUnit */ + + alias TemperatureUnit for ThermodynamicTemperatureUnit; + alias TemperatureValue for ThermodynamicTemperatureValue; + alias temperature for thermodynamicTemperature; + + /* ISO-80000-5 item 5-2 Celsius temperature */ + attribute def CelsiusTemperatureValue :> ScalarQuantityValue { + doc + /* + * source: item 5-2 Celsius temperature + * symbol(s): `t`, `θ` + * application domain: generic + * name: CelsiusTemperature + * quantity dimension: Θ^1 + * measurement unit(s): °C + * tensor order: 0 + * definition: temperature difference from the thermodynamic temperature of the ice point is called the Celsius temperature t, which is defined by the quantity equation: `t = T - T_0` where `T` is thermodynamic temperature (item 5-1) and `T_0 = 273,15 K` + * remarks: The unit degree Celsius is a special name for the kelvin for use in stating values of Celsius temperature. The unit degree Celsius is by definition equal in magnitude to the kelvin. A difference or interval of temperature may be expressed in kelvin or in degrees Celsius. The thermodynamic temperature `T_0` is 0,01 K below the thermodynamic temperature of the triple point of water. The symbol °C for the degree Celsius shall be preceded by a space (see ISO 80000-1). Prefixes are not allowed in combination with the unit °C. + */ + attribute :>> num: Real; + attribute :>> mRef: CelsiusTemperatureUnit[1]; + } + + attribute celsiusTemperature: CelsiusTemperatureValue[*] nonunique :> scalarQuantities; + + attribute def CelsiusTemperatureUnit :> DerivedUnit { + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = thermodynamicTemperaturePF; } + } + + /* ISO-80000-5 item 5-3.1 linear expansion coefficient */ + attribute def LinearExpansionCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 5-3.1 linear expansion coefficient + * symbol(s): `α_l` + * application domain: generic + * name: LinearExpansionCoefficient + * quantity dimension: Θ^-1 + * measurement unit(s): K^-1 + * tensor order: 0 + * definition: relative change of length with temperature: `α_l = 1/l * (dl)/(dT)` where l is length (ISO 80000-3) and `T` is thermodynamic temperature (item 5-1) + * remarks: The subscripts in the symbols may be omitted when there is no risk of confusion. + */ + attribute :>> num: Real; + attribute :>> mRef: LinearExpansionCoefficientUnit[1]; + } + + attribute linearExpansionCoefficient: LinearExpansionCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def LinearExpansionCoefficientUnit :> DerivedUnit { + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = thermodynamicTemperaturePF; } + } + + /* ISO-80000-5 item 5-3.2 cubic expansion coefficient */ + attribute def CubicExpansionCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 5-3.2 cubic expansion coefficient + * symbol(s): `α_V`, `γ` + * application domain: generic + * name: CubicExpansionCoefficient + * quantity dimension: Θ^-1 + * measurement unit(s): K^-1 + * tensor order: 0 + * definition: relative change of volume with temperature: `α_V = 1/V * (dV)/(dT)` where `V` is volume (ISO 80000-3) and `T` is thermodynamic temperature (item 5-1) + * remarks: Also called volumetric expansion coefficient. The subscripts in the symbols may be omitted when there is no risk of confusion. + */ + attribute :>> num: Real; + attribute :>> mRef: CubicExpansionCoefficientUnit[1]; + } + + attribute cubicExpansionCoefficient: CubicExpansionCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def CubicExpansionCoefficientUnit :> DerivedUnit { + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = thermodynamicTemperaturePF; } + } + + /* ISO-80000-5 item 5-3.3 relative pressure coefficient */ + attribute def RelativePressureCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 5-3.3 relative pressure coefficient + * symbol(s): `α_p` + * application domain: generic + * name: RelativePressureCoefficient + * quantity dimension: Θ^-1 + * measurement unit(s): K^-1 + * tensor order: 0 + * definition: relative change of pressure with temperature at constant volume: `α_p = 1/p * ((partial p)/(partial T))_V` where `p` is pressure (ISO 80000-4), `T` is thermodynamic temperature (item 5-1), and `V` is volume (ISO 80000-3) + * remarks: The subscripts in the symbols may be omitted when there is no risk of confusion. + */ + attribute :>> num: Real; + attribute :>> mRef: RelativePressureCoefficientUnit[1]; + } + + attribute relativePressureCoefficient: RelativePressureCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def RelativePressureCoefficientUnit :> DerivedUnit { + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = thermodynamicTemperaturePF; } + } + + /* ISO-80000-5 item 5-4 pressure coefficient */ + attribute def PressureCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 5-4 pressure coefficient + * symbol(s): `β` + * application domain: generic + * name: PressureCoefficient + * quantity dimension: L^-1*M^1*T^-2*Θ^-1 + * measurement unit(s): Pa/K, kg*m^-1*s^-2*K^-1 + * tensor order: 0 + * definition: change of pressure with temperature at constant volume: `β = ((partial p)/(partial T))_V` where `p` is pressure (ISO 80000-4), `T` is thermodynamic temperature (item 5-1), and `V` is volume (ISO 80000-3) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: PressureCoefficientUnit[1]; + } + + attribute pressureCoefficient: PressureCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def PressureCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-5.1 isothermal compressibility */ + attribute def IsothermalCompressibilityValue :> ScalarQuantityValue { + doc + /* + * source: item 5-5.1 isothermal compressibility + * symbol(s): `ϰ_T` + * application domain: generic + * name: IsothermalCompressibility + * quantity dimension: L^1*M^-1*T^2 + * measurement unit(s): Pa^-1, kg^-1*m*s^2 + * tensor order: 0 + * definition: negative relative change of volume with pressure at constant temperature: `ϰ_T = -1/V * ((partial V)/(partial p))_T` where `V` is volume (ISO 80000-3), `p` is pressure (ISO 80000-4), and `T` is thermodynamic temperature (item 5-1) + * remarks: The subscripts in the symbols may be omitted when there is no risk of confusion. + */ + attribute :>> num: Real; + attribute :>> mRef: IsothermalCompressibilityUnit[1]; + } + + attribute isothermalCompressibility: IsothermalCompressibilityValue[*] nonunique :> scalarQuantities; + + attribute def IsothermalCompressibilityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-5 item 5-5.2 isentropic compressibility */ + attribute def IsentropicCompressibilityValue :> ScalarQuantityValue { + doc + /* + * source: item 5-5.2 isentropic compressibility + * symbol(s): `ϰ_S` + * application domain: generic + * name: IsentropicCompressibility + * quantity dimension: L^1*M^-1*T^2 + * measurement unit(s): Pa^-1, kg^-1*m*s^2 + * tensor order: 0 + * definition: negative relative change of volume with pressure at constant entropy: `ϰ_S = -1/V * ((partial V)/(partial p))_S` where `V` is volume (ISO 80000-3), `p` is pressure (ISO 80000-4), and `S` is entropy (item 5-18) + * remarks: The subscripts in the symbols may be omitted when there is no risk of confusion. + */ + attribute :>> num: Real; + attribute :>> mRef: IsentropicCompressibilityUnit[1]; + } + + attribute isentropicCompressibility: IsentropicCompressibilityValue[*] nonunique :> scalarQuantities; + + attribute def IsentropicCompressibilityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-5 item 5-6.1 heat, amount of heat */ + attribute heat: EnergyValue :> scalarQuantities { + doc + /* + * source: item 5-6.1 heat, amount of heat + * symbol(s): `Q` + * application domain: generic + * name: Heat (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: difference between the increase in the internal energy (item 5-20.2) of a system and the work (ISO 80000-4) done on the system, provided that the amounts of substances within the system are not changed + * remarks: The heat transferred in an isothermal phase transformation should be expressed as the change in the appropriate state functions, e.g. `T ΔS`, where `T` is thermodynamic temperature (item 5-1) and `S` is entropy (item 5-18), or `ΔH`, where `H` is enthalpy (item 5-20.3). NOTE A supply of heat can correspond to an increase in thermodynamic temperature or to other effects, such as phase change or chemical processes; see item 5-6.2. + */ + } + + alias amountOfHeat for heat; + + /* ISO-80000-5 item 5-6.2 latent heat */ + attribute latentHeat: EnergyValue :> scalarQuantities { + doc + /* + * source: item 5-6.2 latent heat + * symbol(s): `Q` + * application domain: generic + * name: LatentHeat (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: energy released or absorbed by a system during a constant-temperature process + * remarks: Examples of latent heat are latent heat of fusion (melting) and latent heat of vaporization (boiling). + */ + } + + /* ISO-80000-5 item 5-7 heat flow rate */ + attribute def HeatFlowRateValue :> ScalarQuantityValue { + doc + /* + * source: item 5-7 heat flow rate + * symbol(s): `dot(Q)` + * application domain: generic + * name: HeatFlowRate + * quantity dimension: L^2*M^1*T^-3 + * measurement unit(s): W, J/s, kg*m^2*s^-3 + * tensor order: 0 + * definition: time rate at which heat (item 5-6.1) crosses a given surface + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: HeatFlowRateUnit[1]; + } + + attribute heatFlowRate: HeatFlowRateValue[*] nonunique :> scalarQuantities; + + attribute def HeatFlowRateUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-5 item 5-8 density of heat flow rate */ + attribute def DensityOfHeatFlowRateValue :> ScalarQuantityValue { + doc + /* + * source: item 5-8 density of heat flow rate + * symbol(s): `q`, `φ` + * application domain: generic + * name: DensityOfHeatFlowRate + * quantity dimension: M^1*T^-3 + * measurement unit(s): W/m^2, kg*s^-3 + * tensor order: 0 + * definition: quotient of heat flow rate and area: `q = dot Q / A` where `dot Q` is heat flow rate (item 5-7) and A is area (ISO 80000-3) of a given surface + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: DensityOfHeatFlowRateUnit[1]; + } + + attribute densityOfHeatFlowRate: DensityOfHeatFlowRateValue[*] nonunique :> scalarQuantities; + + attribute def DensityOfHeatFlowRateUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF); } + } + + /* ISO-80000-5 item 5-9 thermal conductivity */ + attribute def ThermalConductivityValue :> ScalarQuantityValue { + doc + /* + * source: item 5-9 thermal conductivity + * symbol(s): `λ_l`, `(ϰ)` + * application domain: generic + * name: ThermalConductivity + * quantity dimension: L^1*M^1*T^-3*Θ^-1 + * measurement unit(s): W/(m*K), kg*m*s^-3*K^-1 + * tensor order: 0 + * definition: quotient of density of heat flow rate (item 5-8) and thermodynamic temperature gradient that has the same direction as the heat flow + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: ThermalConductivityUnit[1]; + } + + attribute thermalConductivity: ThermalConductivityValue[*] nonunique :> scalarQuantities; + + attribute def ThermalConductivityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-10.1 coefficient of heat transfer */ + attribute def CoefficientOfHeatTransferValue :> ScalarQuantityValue { + doc + /* + * source: item 5-10.1 coefficient of heat transfer + * symbol(s): `K`, `(k)` + * application domain: generic + * name: CoefficientOfHeatTransfer + * quantity dimension: M^1*T^-3*Θ^-1 + * measurement unit(s): W/(m^2*K), kg*s^-3*K^-1 + * tensor order: 0 + * definition: quotient of density of heat flow rate (item 5-8) and thermodynamic temperature (item 5-1) difference + * remarks: In building technology, the coefficient of heat transfer is often called thermal transmittance, with the symbol U (no longer recommended). See remark to item 5-13. + */ + attribute :>> num: Real; + attribute :>> mRef: CoefficientOfHeatTransferUnit[1]; + } + + attribute coefficientOfHeatTransfer: CoefficientOfHeatTransferValue[*] nonunique :> scalarQuantities; + + attribute def CoefficientOfHeatTransferUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-10.2 surface coefficient of heat transfer */ + attribute def SurfaceCoefficientOfHeatTransferValue :> ScalarQuantityValue { + doc + /* + * source: item 5-10.2 surface coefficient of heat transfer + * symbol(s): `h`, `(α)` + * application domain: generic + * name: SurfaceCoefficientOfHeatTransfer + * quantity dimension: M^1*T^-3*Θ^-1 + * measurement unit(s): W/(m^2*K), kg*s^-3*K^-1 + * tensor order: 0 + * definition: quotient of density of heat flow rate and the difference of the temperature at the surface and a reference temperature: `h = q / (T_s - T_r)` where q is density of heat flow rate (item 5-8), `T_s` is the thermodynamic temperature (item 5-1) at the surface, and `T_r` is a reference thermodynamic temperature characterizing the adjacent surroundings + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: SurfaceCoefficientOfHeatTransferUnit[1]; + } + + attribute surfaceCoefficientOfHeatTransfer: SurfaceCoefficientOfHeatTransferValue[*] nonunique :> scalarQuantities; + + attribute def SurfaceCoefficientOfHeatTransferUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-11 thermal insulance, coefficient of thermal insulance */ + attribute def ThermalInsulanceValue :> ScalarQuantityValue { + doc + /* + * source: item 5-11 thermal insulance, coefficient of thermal insulance + * symbol(s): `M` + * application domain: generic + * name: ThermalInsulance + * quantity dimension: M^-1*T^3*Θ^1 + * measurement unit(s): m^2*K/W, kg^-1*s^3*K + * tensor order: 0 + * definition: inverse of coefficient of heat transfer `K`: `M = 1/K` where `K` is coefficient of heat transfer (item 5-10.1) + * remarks: In building technology, this quantity is often called thermal resistance, with the symbol R. + */ + attribute :>> num: Real; + attribute :>> mRef: ThermalInsulanceUnit[1]; + } + + attribute thermalInsulance: ThermalInsulanceValue[*] nonunique :> scalarQuantities; + + attribute def ThermalInsulanceUnit :> DerivedUnit { + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 3; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (massPF, durationPF, thermodynamicTemperaturePF); } + } + + alias CoefficientOfThermalInsulanceUnit for ThermalInsulanceUnit; + alias CoefficientOfThermalInsulanceValue for ThermalInsulanceValue; + alias coefficientOfThermalInsulance for thermalInsulance; + + /* ISO-80000-5 item 5-12 thermal resistance */ + attribute def ThermalResistanceValue :> ScalarQuantityValue { + doc + /* + * source: item 5-12 thermal resistance + * symbol(s): `R` + * application domain: generic + * name: ThermalResistance + * quantity dimension: L^-2*M^-1*T^3*Θ^1 + * measurement unit(s): K/W, kg^-1*m^-2*s^3*K + * tensor order: 0 + * definition: quotient of thermodynamic temperature (item 5-1) difference and heat flow rate (item 5-7) + * remarks: See remark to item 5-11. + */ + attribute :>> num: Real; + attribute :>> mRef: ThermalResistanceUnit[1]; + } + + attribute thermalResistance: ThermalResistanceValue[*] nonunique :> scalarQuantities; + + attribute def ThermalResistanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 3; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-13 thermal conductance */ + attribute def ThermalConductanceValue :> ScalarQuantityValue { + doc + /* + * source: item 5-13 thermal conductance + * symbol(s): `G`, `(H)` + * application domain: generic + * name: ThermalConductance + * quantity dimension: L^2*M^1*T^-3*Θ^-1 + * measurement unit(s): W/K, kg*m^2*s^-3*K^-1 + * tensor order: 0 + * definition: inverse of thermal resistance `R`: `G = 1/R` where `R` is thermal resistance (item 5-12) + * remarks: See remark to item 5-11. This quantity is also called heat transfer coefficient. See item 5-10.1. + */ + attribute :>> num: Real; + attribute :>> mRef: ThermalConductanceUnit[1]; + } + + attribute thermalConductance: ThermalConductanceValue[*] nonunique :> scalarQuantities; + + attribute def ThermalConductanceUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -3; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-14 thermal diffusivity */ + attribute def ThermalDiffusivityValue :> ScalarQuantityValue { + doc + /* + * source: item 5-14 thermal diffusivity + * symbol(s): `a` + * application domain: generic + * name: ThermalDiffusivity + * quantity dimension: L^2*T^-1 + * measurement unit(s): m^2*s^-1 + * tensor order: 0 + * definition: quotient of thermal conductivity and the product of mass density and specific heat capacity: `a = λ / (ρ C_p)` where `λ` is thermal conductivity (item 5-9), `ρ` is mass density (ISO 80000-4), and `c_p` is specific heat capacity at constant pressure (item 5-16.2) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: ThermalDiffusivityUnit[1]; + } + + attribute thermalDiffusivity: ThermalDiffusivityValue[*] nonunique :> scalarQuantities; + + attribute def ThermalDiffusivityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-5 item 5-15 heat capacity */ + attribute def HeatCapacityValue :> ScalarQuantityValue { + doc + /* + * source: item 5-15 heat capacity + * symbol(s): `C` + * application domain: generic + * name: HeatCapacity + * quantity dimension: L^2*M^1*T^-2*Θ^-1 + * measurement unit(s): J/K, kg*m^2*s^-2*K^-1 + * tensor order: 0 + * definition: derivative of added heat with respect to thermodynamic temperature of a system: `C = (dQ)/(dT)` where `Q` is amount of heat (item 5-6.1) and `T` is thermodynamic temperature (item 5-1) + * remarks: Heat capacity is not completely defined unless specified as seen in items 5-16.2, 5-16.3 and 5-16.4. + */ + attribute :>> num: Real; + attribute :>> mRef: HeatCapacityUnit[1]; + } + + attribute heatCapacity: HeatCapacityValue[*] nonunique :> scalarQuantities; + + attribute def HeatCapacityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-16.1 specific heat capacity */ + attribute def SpecificHeatCapacityValue :> ScalarQuantityValue { + doc + /* + * source: item 5-16.1 specific heat capacity + * symbol(s): `c` + * application domain: generic + * name: SpecificHeatCapacity + * quantity dimension: L^2*T^-2*Θ^-1 + * measurement unit(s): J/(kg*K), m^2*s^-2*K^-1 + * tensor order: 0 + * definition: quotient of heat capacity and mass: `c = C/m` where `C` is heat capacity (item 5-15) and `m` is mass (ISO 80000-4) + * remarks: For the corresponding quantities related to the amount of substance, see ISO 80000-9. + */ + attribute :>> num: Real; + attribute :>> mRef: SpecificHeatCapacityUnit[1]; + } + + attribute specificHeatCapacity: SpecificHeatCapacityValue[*] nonunique :> scalarQuantities; + + attribute def SpecificHeatCapacityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-16.2 specific heat capacity at constant pressure */ + attribute def SpecificHeatCapacityAtConstantPressureValue :> ScalarQuantityValue { + doc + /* + * source: item 5-16.2 specific heat capacity at constant pressure + * symbol(s): `c_p` + * application domain: generic + * name: SpecificHeatCapacityAtConstantPressure + * quantity dimension: L^2*T^-2*Θ^-1 + * measurement unit(s): J/(kg*K), m^2*s^-2*K^-1 + * tensor order: 0 + * definition: specific heat capacity (item 5-16.1) at constant pressure (ISO 80000-4) + * remarks: Also called specific isobaric heat capacity. + */ + attribute :>> num: Real; + attribute :>> mRef: SpecificHeatCapacityAtConstantPressureUnit[1]; + } + + attribute specificHeatCapacityAtConstantPressure: SpecificHeatCapacityAtConstantPressureValue[*] nonunique :> scalarQuantities; + + attribute def SpecificHeatCapacityAtConstantPressureUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-16.3 specific heat capacity at constant volume */ + attribute def SpecificHeatCapacityAtConstantVolumeValue :> ScalarQuantityValue { + doc + /* + * source: item 5-16.3 specific heat capacity at constant volume + * symbol(s): `c_V` + * application domain: generic + * name: SpecificHeatCapacityAtConstantVolume + * quantity dimension: L^2*T^-2*Θ^-1 + * measurement unit(s): J/(kg*K), m^2*s^-2*K^-1 + * tensor order: 0 + * definition: specific heat capacity (item 5-16.1) at constant volume (ISO 80000-3) + * remarks: Also called specific isochoric heat capacity. + */ + attribute :>> num: Real; + attribute :>> mRef: SpecificHeatCapacityAtConstantVolumeUnit[1]; + } + + attribute specificHeatCapacityAtConstantVolume: SpecificHeatCapacityAtConstantVolumeValue[*] nonunique :> scalarQuantities; + + attribute def SpecificHeatCapacityAtConstantVolumeUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-16.4 specific heat capacity at saturated vapour pressure */ + attribute def SpecificHeatCapacityAtSaturatedVapourPressureValue :> ScalarQuantityValue { + doc + /* + * source: item 5-16.4 specific heat capacity at saturated vapour pressure + * symbol(s): `c_"sat"` + * application domain: generic + * name: SpecificHeatCapacityAtSaturatedVapourPressure + * quantity dimension: L^2*T^-2*Θ^-1 + * measurement unit(s): J/(kg*K), m^2*s^-2*K^-1 + * tensor order: 0 + * definition: specific heat capacity (item 5-16.1) at saturated vapour pressure (ISO 80000-4) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: SpecificHeatCapacityAtSaturatedVapourPressureUnit[1]; + } + + attribute specificHeatCapacityAtSaturatedVapourPressure: SpecificHeatCapacityAtSaturatedVapourPressureValue[*] nonunique :> scalarQuantities; + + attribute def SpecificHeatCapacityAtSaturatedVapourPressureUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-17.1 ratio of specific heat capacities */ + attribute def RatioOfSpecificHeatCapacitiesValue :> DimensionOneValue { + doc + /* + * source: item 5-17.1 ratio of specific heat capacities + * symbol(s): `γ` + * application domain: generic + * name: RatioOfSpecificHeatCapacities (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of specific heat capacity at constant pressure and specific heat capacity at constant volume: `γ = c_p/c_V` where `c_p` is specific heat capacity at constant pressure (item 5-16.2) and `c_V` is specific heat capacity at constant volume (item 5-16.3) + * remarks: This quantity can also be expressed by `γ = C_p/C_V` where `C_p` is heat capacity at constant pressure and `C_V` is heat capacity at constant volume. + */ + } + attribute ratioOfSpecificHeatCapacities: RatioOfSpecificHeatCapacitiesValue :> scalarQuantities; + + /* ISO-80000-5 item 5-17.2 isentropic exponent, isentropic expansion factor */ + attribute def IsentropicExponentValue :> DimensionOneValue { + doc + /* + * source: item 5-17.2 isentropic exponent, isentropic expansion factor + * symbol(s): `ϰ` + * application domain: generic + * name: IsentropicExponent (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: the negative of relative pressure change, divided by relative volume change, at constant entropy: `ϰ = -V/p * ((partial p)/(partial V))_S` where `V` is volume (ISO 80000-3), `p` is pressure (ISO 80000-4), and `S` is entropy (item 5-18) + * remarks: For an ideal gas, `ϰ` is equal to `γ` (item 5-17.1). + */ + } + attribute isentropicExponent: IsentropicExponentValue :> scalarQuantities; + + alias isentropicExpansionFactor for isentropicExponent; + + /* ISO-80000-5 item 5-18 entropy */ + attribute def EntropyValue :> ScalarQuantityValue { + doc + /* + * source: item 5-18 entropy + * symbol(s): `S` + * application domain: generic + * name: Entropy + * quantity dimension: L^2*M^1*T^-2*Θ^-1 + * measurement unit(s): J/K, kg*m^2*s^-2*K^-1 + * tensor order: 0 + * definition: natural logarithm of number of equally probable microscopic configurations in a macroscopic system, multiplied by the Boltzmann constant: `S = k lnW` where `W` is number of configurations and `k` is the Boltzmann constant (ISO 80000-1) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: EntropyUnit[1]; + } + + attribute entropy: EntropyValue[*] nonunique :> scalarQuantities; + + attribute def EntropyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-19 specific entropy */ + attribute def SpecificEntropyValue :> ScalarQuantityValue { + doc + /* + * source: item 5-19 specific entropy + * symbol(s): `s` + * application domain: generic + * name: SpecificEntropy + * quantity dimension: L^2*T^-2*Θ^-1 + * measurement unit(s): J/(kg*K), m^2*s^-2*K^-1 + * tensor order: 0 + * definition: quotient of entropy and mass: `s = S/m` where `S` is entropy (item 5-18) and `m` is mass (ISO 80000-4) + * remarks: For the corresponding quantity related to amount of substance, see ISO 80000-9. + */ + attribute :>> num: Real; + attribute :>> mRef: SpecificEntropyUnit[1]; + } + + attribute specificEntropy: SpecificEntropyValue[*] nonunique :> scalarQuantities; + + attribute def SpecificEntropyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-20.1 energy */ + attribute def EnergyValue :> ScalarQuantityValue { + doc + /* + * source: item 5-20.1 energy + * symbol(s): `E` + * application domain: thermodynamics + * name: Energy + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: ability of a system to do work (ISO 80000-4) + * remarks: Energy exists in different forms that are mutually transformable into each other, either totally or partially. In contrast to internal energy (item 5-20.2), energy is not a state function. + */ + attribute :>> num: Real; + attribute :>> mRef: EnergyUnit[1]; + } + + attribute energy: EnergyValue[*] nonunique :> scalarQuantities; + + attribute def EnergyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + /* ISO-80000-5 item 5-20.2 internal energy, thermodynamic energy */ + attribute internalEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 5-20.2 internal energy, thermodynamic energy + * symbol(s): `U` + * application domain: generic + * name: InternalEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: energy of a system whose change is given by the amount of the heat (item 5-6.1) transferred to the system and the work (ISO 80000-4) done on the system, provided that the system is closed and no chemical reactions occur + * remarks: In thermodynamic text books, usually the formula `ΔU = Q + W` is used. Note that the zero of the energy is undefined. + */ + } + + alias thermodynamicEnergy for internalEnergy; + + /* ISO-80000-5 item 5-20.3 enthalpy */ + attribute enthalpy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 5-20.3 enthalpy + * symbol(s): `H` + * application domain: generic + * name: Enthalpy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: sum of internal energy of the system and the product of pressure and volume of the system: `H = U + p*V` where U is internal energy (item 5-20.2), `p` is pressure (ISO 80000-4), and `V` is volume (ISO 80000-3) + * remarks: None. + */ + } + + /* ISO-80000-5 item 5-20.4 Helmholtz energy, Helmholtz function */ + attribute helmholtzEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 5-20.4 Helmholtz energy, Helmholtz function + * symbol(s): `A`, `F` + * application domain: generic + * name: HelmholtzEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: difference of internal energy of the system and the product of thermodynamic temperature and entropy of the system: `A = U - TS` where `U` is internal energy (item 5-20.2), `T` is thermodynamic temperature (item 5-1), and `S` is entropy (item 5-18) + * remarks: The name Helmholtz free energy is also used. However, this term is not recommended. + */ + } + + alias helmholtzFunction for helmholtzEnergy; + + /* ISO-80000-5 item 5-20.5 Gibbs energy, Gibbs function */ + attribute gibbsEnergy: EnergyValue :> scalarQuantities { + doc + /* + * source: item 5-20.5 Gibbs energy, Gibbs function + * symbol(s): `G` + * application domain: generic + * name: GibbsEnergy (specializes Energy) + * quantity dimension: L^2*M^1*T^-2 + * measurement unit(s): J, kg*m^2*s^-2 + * tensor order: 0 + * definition: difference of the enthalpy and the product of thermodynamic temperature and entropy of the system: `G = H - T*S` where H is enthalpy (item 5-20.3), `T` is thermodynamic temperature (item 5-1), and `S` is entropy (item 5-18) + * remarks: The name Gibbs free energy is also used. However, this term is not recommended. + */ + } + + alias gibbsFunction for gibbsEnergy; + + /* ISO-80000-5 item 5-21.1 specific energy */ + attribute def SpecificEnergyValue :> ScalarQuantityValue { + doc + /* + * source: item 5-21.1 specific energy + * symbol(s): `e` + * application domain: generic + * name: SpecificEnergy + * quantity dimension: L^2*T^-2 + * measurement unit(s): J/kg, m^2*s^-2 + * tensor order: 0 + * definition: quotient of energy and mass: `e = E/m` where `E` is energy (item 5-20.1) and `m` is mass (ISO 80000-4) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: SpecificEnergyUnit[1]; + } + + attribute specificEnergy: SpecificEnergyValue[*] nonunique :> scalarQuantities; + + attribute def SpecificEnergyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-5 item 5-21.2 specific internal energy, specific thermodynamic energy */ + attribute specificInternalEnergy: SpecificEnergyValue :> scalarQuantities { + doc + /* + * source: item 5-21.2 specific internal energy, specific thermodynamic energy + * symbol(s): `u` + * application domain: generic + * name: SpecificInternalEnergy (specializes SpecificEnergy) + * quantity dimension: L^2*T^-2 + * measurement unit(s): J/kg, m^2*s^-2 + * tensor order: 0 + * definition: quotient of internal energy and mass: `u = U/m` where `U` is internal energy (item 5-20.2) and `m` is mass (ISO 80000-4) + * remarks: None. + */ + } + + alias specificThermodynamicEnergy for specificInternalEnergy; + + /* ISO-80000-5 item 5-21.3 specific enthalpy */ + attribute def SpecificEnthalpyValue :> ScalarQuantityValue { + doc + /* + * source: item 5-21.3 specific enthalpy + * symbol(s): `h` + * application domain: generic + * name: SpecificEnthalpy + * quantity dimension: L^2*T^-2 + * measurement unit(s): J/kg, m^2*s^-2 + * tensor order: 0 + * definition: quotient of enthalpy and mass: `h = H/m` where `H` is enthalpy (item 5-20.3) and `m` is mass (ISO 80000-4) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: SpecificEnthalpyUnit[1]; + } + + attribute specificEnthalpy: SpecificEnthalpyValue[*] nonunique :> scalarQuantities; + + attribute def SpecificEnthalpyUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF); } + } + + /* ISO-80000-5 item 5-21.4 specific Helmholtz energy, specific Helmholtz function */ + attribute specificHelmholtzEnergy: SpecificEnergyValue :> scalarQuantities { + doc + /* + * source: item 5-21.4 specific Helmholtz energy, specific Helmholtz function + * symbol(s): `a`, `f` + * application domain: generic + * name: SpecificHelmholtzEnergy (specializes SpecificEnergy) + * quantity dimension: L^2*T^-2 + * measurement unit(s): J/kg, m^2*s^-2 + * tensor order: 0 + * definition: quotient of Helmholtz energy and mass: `a = A/m` where A is Helmholtz energy (item 5-20.4) and m is mass (ISO 80000-4) + * remarks: The name specific Helmholtz free energy is also used. However, this term is not recommended. + */ + } + + alias specificHelmholtzFunction for specificHelmholtzEnergy; + + /* ISO-80000-5 item 5-21.5 specific Gibbs energy, specific Gibbs function */ + attribute specificGibbsEnergy: SpecificEnergyValue :> scalarQuantities { + doc + /* + * source: item 5-21.5 specific Gibbs energy, specific Gibbs function + * symbol(s): `g` + * application domain: generic + * name: SpecificGibbsEnergy (specializes SpecificEnergy) + * quantity dimension: L^2*T^-2 + * measurement unit(s): J/kg, m^2*s^-2 + * tensor order: 0 + * definition: quotient of Gibbs energy and mass: `g = G/m` where `G` is Gibbs energy (item 5-20.5) and `m` is mass (ISO 80000-4) + * remarks: The name specific Gibbs free energy is also used. However, this term is not recommended. + */ + } + + alias specificGibbsFunction for specificGibbsEnergy; + + /* ISO-80000-5 item 5-22 Massieu function */ + attribute def MassieuFunctionValue :> ScalarQuantityValue { + doc + /* + * source: item 5-22 Massieu function + * symbol(s): `J` + * application domain: generic + * name: MassieuFunction + * quantity dimension: L^2*M^1*T^-2*Θ^-1 + * measurement unit(s): J/K, kg*m^2*s^-2*K^-1 + * tensor order: 0 + * definition: quotient of the negative of Helmholtz energy and temperature: `J = -A/T` where `A` is Helmholtz energy (item 5-20.4) and `T` is thermodynamic temperature (item 5-1) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: MassieuFunctionUnit[1]; + } + + attribute massieuFunction: MassieuFunctionValue[*] nonunique :> scalarQuantities; + + attribute def MassieuFunctionUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-23 Planck function */ + attribute def PlanckFunctionValue :> ScalarQuantityValue { + doc + /* + * source: item 5-23 Planck function + * symbol(s): `Y` + * application domain: generic + * name: PlanckFunction + * quantity dimension: L^2*M^1*T^-2*Θ^-1 + * measurement unit(s): J/K, kg*m^2*s^-2*K^-1 + * tensor order: 0 + * definition: quotient of the negative of Gibbs energy and temperature: `Y = -G/T` where G is Gibbs energy (item 5-20.5) and `T` is thermodynamic temperature (item 5-1) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: PlanckFunctionUnit[1]; + } + + attribute planckFunction: PlanckFunctionValue[*] nonunique :> scalarQuantities; + + attribute def PlanckFunctionUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-24 Joule-Thomson coefficient */ + attribute def JouleThomsonCoefficientValue :> ScalarQuantityValue { + doc + /* + * source: item 5-24 Joule-Thomson coefficient + * symbol(s): `μ_"JT"` + * application domain: generic + * name: JouleThomsonCoefficient + * quantity dimension: L^1*M^-1*T^2*Θ^1 + * measurement unit(s): K/Pa, kg^-1*m*s^2*K + * tensor order: 0 + * definition: change of thermodynamic temperature with respect to pressure in a Joule-Thomson process at constant enthalpy: `μ_(JT) = ((partial T)/(partial p))_H` where `T` is thermodynamic temperature (item 5-1), `p` is pressure (ISO 80000-4) and H is enthalpy (item 5-20.3) + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: JouleThomsonCoefficientUnit[1]; + } + + attribute jouleThomsonCoefficient: JouleThomsonCoefficientValue[*] nonunique :> scalarQuantities; + + attribute def JouleThomsonCoefficientUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = -1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = 2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-25.1 thermal efficiency */ + attribute def ThermalEfficiencyValue :> DimensionOneValue { + doc + /* + * source: item 5-25.1 thermal efficiency + * symbol(s): `η` + * application domain: thermodynamics + * name: ThermalEfficiency (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of work (ISO 80000-4) delivered by a heat engine and supplied heat: `η = W/Q` where `W` is work (ISO 80000-4) and `Q` is heat (item 5-6.1) + * remarks: None. + */ + } + attribute thermalEfficiency: ThermalEfficiencyValue :> scalarQuantities; + + /* ISO-80000-5 item 5-25.2 maximum thermal efficiency */ + attribute def MaximumThermalEfficiencyValue :> DimensionOneValue { + doc + /* + * source: item 5-25.2 maximum thermal efficiency + * symbol(s): `η_"max"` + * application domain: generic + * name: MaximumThermalEfficiency (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: efficiency determined by the quotient of the temperatures of the hot source and the cold sink: `η_max = 1 - T_c/T_h` where `T_c` is the thermodynamic temperature (item 5-1) of the cold sink and `T_h` is the thermodynamic temperature (item 5-1) of the hot source + * remarks: An ideal heat engine operating according to the Carnot process is delivering the maximum efficiency. + */ + } + attribute maximumThermalEfficiency: MaximumThermalEfficiencyValue :> scalarQuantities; + + /* ISO-80000-5 item 5-26 specific gas constant */ + attribute def SpecificGasConstantValue :> ScalarQuantityValue { + doc + /* + * source: item 5-26 specific gas constant + * symbol(s): `R_s` + * application domain: generic + * name: SpecificGasConstant + * quantity dimension: L^2*T^-2*Θ^-1 + * measurement unit(s): J/(kg*K), m^2*s^-2*K^-1 + * tensor order: 0 + * definition: quotient of the Boltzmann constant `k` (ISO 80000-1) and the mass `m` (ISO 80000-4) of the gas particle + * remarks: None. + */ + attribute :>> num: Real; + attribute :>> mRef: SpecificGasConstantUnit[1]; + } + + attribute specificGasConstant: SpecificGasConstantValue[*] nonunique :> scalarQuantities; + + attribute def SpecificGasConstantUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 2; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + private attribute thermodynamicTemperaturePF: QuantityPowerFactor[1] { :>> quantity = isq.'Θ'; :>> exponent = -1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, durationPF, thermodynamicTemperaturePF); } + } + + /* ISO-80000-5 item 5-27 mass concentration of water */ + attribute def MassConcentrationOfWaterValue :> ScalarQuantityValue { + doc + /* + * source: item 5-27 mass concentration of water + * symbol(s): `w` + * application domain: generic + * name: MassConcentrationOfWater + * quantity dimension: L^-3*M^1 + * measurement unit(s): kg*m^-3 + * tensor order: 0 + * definition: quotient of mass of water and a specified volume: `w = m/V` where `m` is mass (ISO 80000-4) of water, irrespective of the form of aggregation state, and `V` is volume (ISO 80000-3) + * remarks: Mass concentration of water at saturation is denoted `w_"sat"`. + */ + attribute :>> num: Real; + attribute :>> mRef: MassConcentrationOfWaterUnit[1]; + } + + attribute massConcentrationOfWater: MassConcentrationOfWaterValue[*] nonunique :> scalarQuantities; + + attribute def MassConcentrationOfWaterUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + + /* ISO-80000-5 item 5-28 mass concentration of water vapour absolute humidity */ + attribute def MassConcentrationOfWaterVapourAbsoluteHumidityValue :> ScalarQuantityValue { + doc + /* + * source: item 5-28 mass concentration of water vapour absolute humidity + * symbol(s): `v` + * application domain: generic + * name: MassConcentrationOfWaterVapourAbsoluteHumidity + * quantity dimension: L^-3*M^1 + * measurement unit(s): kg*m^-3 + * tensor order: 0 + * definition: quotient of mass of water vapour and a specified volume: `v = m/V` where m is mass (ISO 80000-4) of water vapour and `V` is volume (ISO 80000-3) + * remarks: Mass concentration of water vapour at saturation is denoted `v_"sat"`. + */ + attribute :>> num: Real; + attribute :>> mRef: MassConcentrationOfWaterVapourAbsoluteHumidityUnit[1]; + } + + attribute massConcentrationOfWaterVapourAbsoluteHumidity: MassConcentrationOfWaterVapourAbsoluteHumidityValue[*] nonunique :> scalarQuantities; + + attribute def MassConcentrationOfWaterVapourAbsoluteHumidityUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF); } + } + + /* ISO-80000-5 item 5-29 mass ratio of water to dry matter */ + attribute def MassRatioOfWaterToDryMatterValue :> DimensionOneValue { + doc + /* + * source: item 5-29 mass ratio of water to dry matter + * symbol(s): `u` + * application domain: generic + * name: MassRatioOfWaterToDryMatter (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of mass of water and mass of dry matter: `u = m/m_d` where `m` is mass (ISO 80000-4) of water and `m_d` is mass of dry matter + * remarks: Mass ratio of water to dry matter at saturation is denoted `u_"sat"`. + */ + } + attribute massRatioOfWaterToDryMatter: MassRatioOfWaterToDryMatterValue :> scalarQuantities; + + /* ISO-80000-5 item 5-30 mass ratio of water vapour to dry gas */ + attribute def MassRatioOfWaterVapourToDryGasValue :> DimensionOneValue { + doc + /* + * source: item 5-30 mass ratio of water vapour to dry gas + * symbol(s): `r`, `(x)` + * application domain: generic + * name: MassRatioOfWaterVapourToDryGas (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of mass of water vapour and mass of dry gas: `r = m/m_d` where `m` is mass (ISO 80000-4) of water vapour and `m_d` is mass of dry gas + * remarks: Mass ratio of water vapour to dry gas at saturation is denoted `r_"sat"`. Mass ratio of water vapour to dry gas is also called mixing ratio. + */ + } + attribute massRatioOfWaterVapourToDryGas: MassRatioOfWaterVapourToDryGasValue :> scalarQuantities; + + /* ISO-80000-5 item 5-31 mass fraction of water */ + attribute def MassFractionOfWaterValue :> DimensionOneValue { + doc + /* + * source: item 5-31 mass fraction of water + * symbol(s): `w_(H_(2)O)` + * application domain: generic + * name: MassFractionOfWater (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quantity given by: `w_(H_(2)O) = u/(1+u)` where `u` is mass ratio of water to dry matter (item 5-29) + * remarks: None. + */ + } + attribute massFractionOfWater: MassFractionOfWaterValue :> scalarQuantities; + + /* ISO-80000-5 item 5-32 mass fraction of dry matter */ + attribute def MassFractionOfDryMatterValue :> DimensionOneValue { + doc + /* + * source: item 5-32 mass fraction of dry matter + * symbol(s): `w_d` + * application domain: generic + * name: MassFractionOfDryMatter (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quantity given by: `w_d = 1 - w_(H_(2)O)` where `w_(H_(2)O)` is mass fraction of water (item 5-31) + * remarks: None. + */ + } + attribute massFractionOfDryMatter: MassFractionOfDryMatterValue :> scalarQuantities; + + /* ISO-80000-5 item 5-33 relative humidity */ + attribute def RelativeHumidityValue :> DimensionOneValue { + doc + /* + * source: item 5-33 relative humidity + * symbol(s): `φ` + * application domain: generic + * name: RelativeHumidity (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of partial pressure of water vapour and partial pressure at its saturation: `φ = p/p_"sat"` where `p` is partial pressure (ISO 80000-4) of vapour and `p_"sat"` is its partial pressure at saturation at the same temperature + * remarks: Relative humidity is often referred to as RH and expressed in percent. See also remark in item 5-35. + */ + } + attribute relativeHumidity: RelativeHumidityValue :> scalarQuantities; + + /* ISO-80000-5 item 5-34 relative mass concentration of vapour */ + attribute def RelativeMassConcentrationOfVapourValue :> DimensionOneValue { + doc + /* + * source: item 5-34 relative mass concentration of vapour + * symbol(s): `φ` + * application domain: generic + * name: RelativeMassConcentrationOfVapour (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of mass concentration of water vapour and mass concentration at its saturation: `φ = v/v_"sat"` where `v` is mass concentration of water vapour (item 5-28) and `v_"sat"` is its mass concentration of water vapour at saturation of the same temperature + * remarks: For water vapour concentrations up to 1 kg/m^3, the relative humidity (item 5-33) is assumed to be equal to relative mass concentration of vapour. For details see Reference [8]. + */ + } + attribute relativeMassConcentrationOfVapour: RelativeMassConcentrationOfVapourValue :> scalarQuantities; + + /* ISO-80000-5 item 5-35 relative mass ratio of vapour */ + attribute def RelativeMassRatioOfVapourValue :> DimensionOneValue { + doc + /* + * source: item 5-35 relative mass ratio of vapour + * symbol(s): `ψ` + * application domain: generic + * name: RelativeMassRatioOfVapour (specializes DimensionOneQuantity) + * quantity dimension: 1 + * measurement unit(s): 1 + * tensor order: 0 + * definition: quotient of mass ratio of water vapour to dry gas and mass ratio of water vapour to dry gas at saturation: `ψ = r/r_"sat"` where `r` is mass ratio of water vapour to dry gas (item 5-30) and `r_"sat"` is its mass ratio of water vapour to dry gas at saturation of the same temperature + * remarks: This quantity is also used as an approximation of relative humidity (item 5-33). + */ + } + attribute relativeMassRatioOfVapour: RelativeMassRatioOfVapourValue :> scalarQuantities; + + /* ISO-80000-5 item 5-36 dew-point temperature */ + attribute dewPointTemperature: ThermodynamicTemperatureValue :> scalarQuantities { + doc + /* + * source: item 5-36 dew-point temperature + * symbol(s): `T_d` + * application domain: generic + * name: DewPointTemperature (specializes ThermodynamicTemperature) + * quantity dimension: Θ^1 + * measurement unit(s): K + * tensor order: 0 + * definition: temperature at which water vapour in the air reaches saturation under isobaric conditions + * remarks: The corresponding Celsius temperature, denoted `t_d`, is still called dew-point temperature. The unit for the corresponding Celsius temperature is degree Celsius, symbol °C. + */ + } + +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml new file mode 100644 index 0000000000000000000000000000000000000000..49b5d3a2790d95da6c92f5b71faa0b2cd25d6ab1 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml @@ -0,0 +1,30 @@ +standard library package MeasurementRefCalculations { + doc + /* + * This package package defines calculations on MeasurementUnits and CoordinateFrames. + */ + + private import ScalarValues::String; + private import ScalarValues::Real; + private import MeasurementReferences::MeasurementUnit; + private import MeasurementReferences::ScalarMeasurementReference; + private import MeasurementReferences::CoordinateFrame; + + /* MeasurementUnit operations */ + calc def '*' specializes DataFunctions::'*' { in x: MeasurementUnit[1]; in y: MeasurementUnit[1]; return : MeasurementUnit[1]; } + calc def '/' specializes DataFunctions::'/' { in x: MeasurementUnit[1]; in y: MeasurementUnit[1]; return : MeasurementUnit[1]; } + calc def '**' specializes DataFunctions::'**' { in x: MeasurementUnit[1]; in y: Real[1]; return : MeasurementUnit[1]; } + calc def '^' specializes DataFunctions::'^' { in x: MeasurementUnit[1]; in y: Real[1]; return : MeasurementUnit[1]; } + + /* CoordinateFrame and MeasurementUnit operations */ + calc def 'CoordinateFrame*' specializes DataFunctions::'*' { in x: CoordinateFrame[1]; in y: MeasurementUnit[1]; return : CoordinateFrame[1]; } + calc def 'CoordinateFrame/' specializes DataFunctions::'/' { in x: CoordinateFrame[1]; in y: MeasurementUnit[1]; return : CoordinateFrame[1]; } + + calc def ToString specializes BaseFunctions::ToString { + doc + /* + * Returns the Unicode string symbol representing a scalar measurement reference. + */ + in x: ScalarMeasurementReference[1]; return : String[1]; + } +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml new file mode 100644 index 0000000000000000000000000000000000000000..fa7092668947eb6dcfc4ac0e86fca028b89be6fe --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml @@ -0,0 +1,526 @@ +standard library package MeasurementReferences { + doc + /* + * This package defines the representations for measurement references. + */ + + private import Collections::Array; + private import Collections::List; + private import ScalarValues::*; + private import VectorValues::ThreeVectorValue; + + private import SequenceFunctions::size; + private import SequenceFunctions::equals; + private import ControlFunctions::forAll; + private import Quantities::QuantityDimension; + private import Quantities::VectorQuantityValue; + private import Quantities::scalarQuantities; + private import Quantities::ScalarQuantityValue; + private import Quantities::SystemOfQuantities; + private import ISQSpaceTime::angularMeasure; + + attribute def TensorMeasurementReference :> Array { + doc + /* + * TensorMeasurementReference is the most general AttributeDefinition to represent measurement references. + * + * The concept "measurement reference" is defined in [VIM] "quantity" NOTE 2 as "A reference can be a measurement unit, + * a measurement procedure, a reference material, or a combination of such.", see https://jcgm.bipm.org/vim/en/1.1.html . + * In addition [VIM] "quantity" NOTE 5 states that "A quantity as defined here is a scalar. However, a vector or a tensor, + * the components of which are quantities, is also considered to be a quantity". However, the rest of [VIM] does not explicitly + * define how tensor and vector quantities can be or should be supported. + * + * In this package, in line with TensorQuantityValue in package Quantities, the most general kind of measurement reference + * is TensorMeasurementReference that represents a measurement reference for any order of tensor quantity. Since the order can + * also be one or zero, this includes vector and scalar quantities. The specializations VectorMeasurementReference and + * ScalarMeasurementReference are defined to specifically represent measurement references for vector and scalar quantities. + * + * TensorMeasurementReference specializes Array, which provides its multi-dimensional structure. The order of a tensor is equivalent + * to the rank of an Array. + * + * Attribute isBound specifies whether the vector space product is bound (isBound is true) or free (isBound is false). + * + * Attribute mRefs specifies the scalar measurement references for all dimensions of a tensor quantity. + * + * The short name of a TensorMeasurementReference is the unique symbol by which the measurement reference is known. + * The name of a TensorMeasurementReference is spelled-out human readable name of the measurement reference. + * + * For example, typical measurement references for (scalar) quantity speed are declared with the following humanId and name: + * <'m/s'> and 'metre per second', + * <'km/h'> and 'kilometre per hour', + * <'mi/h'> and 'mile per hour'. + * + * A measurement reference can have zero or more definitionalQuantityValues that allow to specify + * quantity values that carry a particular meaning or relevance for the measurement reference. + */ + + attribute isBound: Boolean[1] default false; + attribute order :>> rank; + attribute mRefs: ScalarMeasurementReference[1..*] nonunique :>> elements; + attribute definitionalQuantityValues: DefinitionalQuantityValue[0..*]; + } + + attribute def VectorMeasurementReference :> TensorMeasurementReference { + doc + /* + * A VectorMeasurementReference is a specialization of TensorMeasurementReference for vector quantities that are + * typed by a VectorQuantityValue. Its order is one. Implicitly, it defines a vector space of dimension `n` = dimensions[1]. + * The magnitudes of the `n` basis unit vectors that span the vector space are defined by the mRefs which each are + * a ScalarMeasurementReference, typically a MeasurementUnit or an IntervalScale. + * + * Attribute isOrthogonal declares whether the basis vectors of the vector space are orthogonal, i.e., whether all + * inner products of any pair of basis vectors are equal to zero. + * + * A pair of a specialization of VectorQuantityValue and a specialization of VectorMeasurementReference can also be used to + * define a vector space for state vectors as used in state-space representation models. + */ + + attribute :>> dimensions: Positive[0..1]; + attribute isOrthogonal: Boolean[1] default true; + } + + abstract attribute def ScalarMeasurementReference :> VectorMeasurementReference { + doc + /* + * A ScalarMeasurementReference is a specialization of VectorMeasurementReference for scalar quantities + * that are typed by a ScalarQuantityValue and for components of tensor or vector quantities. + * Its order is zero. A ScalarMeasurementReference is also a generalization of MeasurementUnit and MeasurementScale. + * It establishes how to interpret the numerical value (num) of a ScalarQuantityValue or a component of + * a tensor or vector quantity value, and establishes its actual quantity dimension. + * + * Attribute mRefs is bound to self for a ScalarMeasurementReference, for consistency with tensor and vector measurement references, + * as the dimension or component of a scalar quantity is itself. + */ + + attribute :>> dimensions = (); + attribute :>> isOrthogonal = true; + attribute :>> mRefs = self; + attribute quantityDimension: QuantityDimension[1]; + } + + attribute def CoordinateFrame :> VectorMeasurementReference { + doc + /* + * CoordinateFrame is a VectorMeasurementReference with the specific purpose to quantify (i.e., coordinatize) a vector space, + * and locate and orient it with respect to another CoordinateFrame. + * + * Optional attribute transformation enables specification of the location and orientation of this CoordinateFrame as dependent + * and nested with respect to another (reference) coordinate frame. Typically the other CoordinateFrame is the frame of + * the next higher element (Object, Item or Part) in a composite structure. + */ + + attribute transformation: CoordinateTransformation[0..1] { + attribute :>> target = that; + } + } + + attribute def '3dCoordinateFrame' :> CoordinateFrame { + doc + /* + * Most general 3-dimensional coordinate frame + */ + attribute :>> dimensions = 3; + } + alias ThreeDCoordinateFrame for '3dCoordinateFrame'; + + abstract attribute def CoordinateTransformation { + doc + /* + * CoordinateTransformation is the most general representation of the transformation of a target VectorMeasurementReference + * with respect to a source VectorMeasurementReference. + */ + attribute source: VectorMeasurementReference[1]; + attribute target: VectorMeasurementReference[1]; + assert constraint validSourceTargetDimensions { source.dimensions == target.dimensions } + } + + attribute def CoordinateFramePlacement :> CoordinateTransformation { + doc + /* + * CoordinateFramePlacement is a CoordinateTransformation by placement of the target frame in the source frame. + * + * Attribute origin specifies the location of the origin of the target frame as a vector in the source frame. + * + * Attribute basisDirections specifies the orientation of the target frame by specifying the directions of + * the respective basis vectors of the target frame via direction vectors in the source frame. An empty sequence of + * basisDirections signifies no change of orientation of the target coordinate frame. + */ + + attribute origin : VectorQuantityValue[1]; + attribute basisDirections : VectorQuantityValue[0..*] ordered nonunique; + assert constraint validOriginDimensions { origin.dimensions == source.dimensions } + assert constraint { size(basisDirections) == 0 or size(basisDirections) == source.dimensions#(1)} + assert constraint validateBasisDirections { basisDirections->forAll { in basisDirection : VectorQuantityValue; + basisDirection.dimensions->equals(source.dimensions) } + } + } + + abstract attribute def TranslationOrRotation { + doc + /* + * TranslationOrRotation is an abstract union of Translation and Rotation + */ + } + + attribute def Translation :> TranslationOrRotation { + doc + /* + * Representation of a translation with respect to a coordinate frame + * + * Attribute translationVector specifies the displacement vector that constitutes the translation. + */ + + attribute translationVector : VectorQuantityValue[1]; + } + + attribute def Rotation :> TranslationOrRotation { + doc + /* + * Representation of a rotation about an axis over an angle + * + * Attribute axisDirection specifies the direction of the rotation axis. + * Attribute angle specifies the angle of rotation, where a positive value implies right-handed rotation. + * Attribute isIntrinsic asserts whether the intermediate coordinate frame moves with the rotation or not, + * i.e. whether an instrinsic or extrinsic rotation is specified. + * + * See https://en.wikipedia.org/wiki/Davenport_chained_rotations for details. + */ + + attribute axisDirection : VectorQuantityValue[1]; + attribute angle :>> angularMeasure; + attribute isIntrinsic : Boolean[1] default true; + } + + attribute def TranslationRotationSequence :> CoordinateTransformation, List { + doc + /* + * Coordinate frame transformation specified by a sequence of translations and/or rotations + * + * Note: This is a coordinate transformation that is convenient for interpretation by humans. + * In particular a sequence of rotations about the principal axes of a coordinate frame is much more easy understandable + * than a rotation about an arbitrary axis. + * Any sequence can be reduced to a single combination of a translation and a rotation about a particular axis, but in general + * the original sequence cannot be retrieved as there are infinitely many sequences representing the reduced transformation. + */ + + attribute :>> elements : TranslationOrRotation[1..*] ordered nonunique; + } + + attribute def AffineTransformationMatrix3d :> CoordinateTransformation, Array { + doc + /* + * AffineTransformationMatrix3d is a three dimensional CoordinateTransformation specified via an affine transformation matrix + * + * The interpretation of the matrix is as follows: + * - the upper left 3x3 matrix represents the rotation matrix + * - the uper right 3x1 column vector represents the translation vector + * - the bottom row must be the row vector (0, 0, 0, 1). + * + * I.e. the matrix has the following form: + * ( R, R, R, T, + * R, R, R, T, + * R, R, R, T, + * 0, 0, 0, 1 ) + * where the cells marked R form the rotation matrix and the cells marked T form the translation vector. + * + * Note: See https://en.wikipedia.org/wiki/Transformation_matrix, under affine transformations for a general explanation. + */ + + attribute rotationMatrix : Array { + attribute :>> elements : Real[9] ordered nonunique; + attribute :>> dimensions = (3, 3); + } + attribute translationVector : ThreeVectorValue[1] { :>> elements : Real[3]; } + attribute :>> dimensions = (4, 4); + attribute :>> elements : Real[16] ordered nonunique = ( + rotationMatrix.elements#(1), rotationMatrix.elements#(2), rotationMatrix.elements#(3), translationVector#(1), + rotationMatrix.elements#(4), rotationMatrix.elements#(5), rotationMatrix.elements#(6), translationVector#(2), + rotationMatrix.elements#(7), rotationMatrix.elements#(8), rotationMatrix.elements#(9), translationVector#(3), + 0, 0, 0, 1); + assert constraint validSourceDimensions { source.dimensions == 3 } + } + + attribute def NullTransformation :> AffineTransformationMatrix3d { + doc + /* + * NullTransformation is a three dimensional CoordinateTransformation that places the target CoordinateFrame at the + * same position and orientation as the source CoordinateFrame. + */ + attribute :>> rotationMatrix { + attribute :>> elements = (1, 0, 0, 0, 1, 0, 0, 0, 1); + } + attribute :>> translationVector { + attribute :>> elements = (0, 0, 0); + } + } + + attribute nullTransformation : NullTransformation [1]; + + abstract attribute def MeasurementUnit :> ScalarMeasurementReference { + doc + /* + * Representation of a measurement unit. + * + * Note: MeasurementUnit directly specializes ScalarMeasurementReference in order to allow for efficient and intuitive definition of a ratio scale. + * + * A MeasurementUnit can be used in two ways: + * 1. Directly as the mRef in a ScalarQuantityValue, which implies that the effective measurement reference is a ratio scale defined by the unit. + * 2. As the unit of a MeasurementScale. + * + * A MeasurementUnit specifies one or more UnitPowerFactors. + */ + + attribute :>> isBound = false; + attribute unitPowerFactors: UnitPowerFactor[0..*] ordered; + attribute unitConversion: UnitConversion[0..1]; + assert constraint hasValidUnitPowerFactors : VerifyUnitPowerFactors { + in unitPowerFactors = MeasurementUnit::unitPowerFactors; + in quantityDimension = MeasurementUnit::quantityDimension; + } + } + + + abstract attribute def SimpleUnit :> MeasurementUnit { + doc + /* + * Representation of a measurement unit that does not depend on any other measurement unit. + */ + + private attribute simpleUnitSelf: SimpleUnit = self; + attribute :>> unitPowerFactors: UnitPowerFactor[1] { + attribute unit :>> UnitPowerFactor::unit = simpleUnitSelf; + attribute exponent :>> UnitPowerFactor::exponent = 1; + } + } + + + abstract attribute def DerivedUnit :> MeasurementUnit { + doc + /* + * Representation of a derived measurement unit that depends on one or more powers of other measurement units. + * + * VIM defines "derived unit" as "measurement unit for a derived quantity", see https://jcgm.bipm.org/vim/en/1.11.html . + */ + } + + + attribute def UnitPowerFactor { + doc + /* + * Representation of a measurement unit power factor, which is a tuple + * of a referenced measurement unit and an exponent. + */ + + attribute unit: MeasurementUnit; + attribute exponent: Real; + } + + abstract attribute def UnitConversion { + doc + /* + * Representation of the linear conversion relationship between one measurement unit and another measurement unit, that acts as a reference. + * + * Attribute isExact asserts whether the conversionFactor is exact or not. By default it is set true. + */ + + attribute referenceUnit: MeasurementUnit; + attribute conversionFactor: Real; + attribute isExact: Boolean default true; + } + + attribute def ConversionByConvention :> UnitConversion { + doc + /* + * Representation of a UnitConversion that is defined according to some convention. + */ + } + + attribute def ConversionByPrefix :> UnitConversion { + doc + /* + * Representation of a UnitConversion that is defined through reference to a named unit prefix, + * that in turn represents a decimal or binary multiple or sub-multiple, as defined in ISO/IEC 80000-1. + * + * Note: The actual value of the conversion factor is derived from the definition of the unit prefix. + * + * Examples: kilometre for conversion factor 1000 with reference unit metre, nanofarad for 1E-9 farad. + */ + + attribute prefix: UnitPrefix[1]; + attribute conversionFactor redefines UnitConversion::conversionFactor = prefix.conversionFactor; + } + + attribute def UnitPrefix { + doc + /* + * Representation of a multiple or sub-multiple measurement unit prefix as defined in ISO/IEC 80000-1. + */ + + attribute longName: String; + attribute symbol: String; + attribute conversionFactor: Real; + } + + + abstract attribute def MeasurementScale :> ScalarMeasurementReference { + doc + /* + * Representation of a non-ratio measurement scale as opposed to a ratio measurement scale defined by a MeasurementUnit. + * + * Note: A ratio scale is implied by direct use of a MeasurementUnit as the mRef in a ScalarQuantityValue. + */ + + attribute unit: MeasurementUnit; + attribute quantityValueMapping: QuantityValueMapping[0..1]; + } + + attribute def OrdinalScale :> MeasurementScale { + doc + /* + * Representation of an ordinal measurement scale. + */ + } + + attribute def IntervalScale :> MeasurementScale, CoordinateFrame { + doc + /* + * Representation of an interval measurement scale. + * + * An IntervalScale is also a CoordinateFrame + * The offset of one interval measurement scale w.r.t. another interval or ratio scale is defined through a quantityValueMapping, see MeasurementReference. + */ + + attribute :>> isBound = true; + } + + attribute def CyclicRatioScale :> MeasurementScale { + doc + /* + * Representation of a ratio measurement scale with a periodic cycle. + * + * Note: The magnitude of the periodic cycle is defined by the modulus of the scale. + * Example: Planar angle with modulus 360 degrees, therefore on such a cyclic ratio scale, + * an angle of 450 degrees is equivalent to an angle of 90 degrees, and -60 degrees is equivalent to 300 degrees. + */ + + attribute modulus: Number; + } + + attribute def LogarithmicScale :> MeasurementScale { + doc + /* + * Representation of a logarithmic measurement scale + * + * The magnitude v of a ratio quantity value expressed on a logarithmic scale + * for a magnitude x of a quantity value expressed on a ratio scale is computed as follows: + * v = f * log_base( (x / x_ref )^a ) + * where: + * f is a multiplication factor, + * log_base is the log function for the given logarithm base, + * x is the actual quantity, + * x_ref is a reference quantity, + * a is an exponent. + */ + + attribute logarithmBase: Number; + attribute factor: Number; + attribute exponent: Number; + attribute referenceQuantity: ScalarQuantityValue[0..1]; + } + + attribute def QuantityValueMapping { + doc + /* + * Representation of the mapping of equivalent quantity values expressed on two different MeasurementReferences + * + * A QuantityValueMapping specifies a mapping from a given mappedQuantityValue owned by the MeasurementReference + * that owns the QuantityValueMapping to a referenceQuantityValue owned by another MeasurementReference. + * + * Example: The mapping between the temperature value of 0.01 degree Celsius on the celsius temperature scale + * to the equivalent temperature value of 273.16 K on the kelvin temperature scale, + * would specify a mappedQuantityValue referencing the + * the DefinitionalQuantityValue (0.01, "absolute thermodynamic temperature of the triple point of water") + * of the celsius interval scale, and a referenceQuantityValue referencing the + * DefinitionalQuantityValue (273.16, "absolute thermodynamic temperature of the triple point of water") + * of the kelvin ratio scale. + */ + + attribute mappedQuantityValue: DefinitionalQuantityValue; + attribute referenceQuantityValue: DefinitionalQuantityValue; + } + + attribute def DefinitionalQuantityValue { + doc + /* + * Representation of a particular quantity value that is used in the definition of a TensorMeasurementReference + * + * Typically such a particular value is defined by convention. It can be used to define a selected reference value, + * such as the meaning of zero on a measurement scale or the origin of a top-level coordinate frame. + * + * Example: The 'kelvin' MeasurementReference for thermodynamic temperature could have a + * DefinitionalQuantityValue { + * :>> num = 273.16; + * :>> definition = "thermodynamic temperature of the triple point of Vienna Standard Mean Ocean Water in kelvin"; + * } + * that is value of the definition of the scale. + */ + + attribute num: Number[1..*]; + attribute definition: String; + } + + attribute def DimensionOneUnit :> DerivedUnit { + doc + /* + * Explicit definition of "unit of dimension one", also known as "dimensionless unit". + */ + + attribute :>> unitPowerFactors = (); + } + attribute def DimensionOneValue :> ScalarQuantityValue { + doc + /* + * A ScalarQuantityValue with a DimensionOneUnit. + */ + attribute :>> num: Real; + attribute :>> mRef: DimensionOneUnit; + } + attribute dimensionOneQuantities : DimensionOneValue[*] nonunique :> scalarQuantities; + + attribute one : DimensionOneUnit[1] = DimensionOneUnit(); + + attribute def CountValue :> DimensionOneValue { + doc + /* + * Explicit definition of a generic "count" quantity as a DimensionOneValue. + */ + } + attribute countQuantities : CountValue[*] nonunique :> dimensionOneQuantities; + + attribute def SystemOfUnits { + doc + /* + * A SystemOfUnits represents the essentials of [VIM] concept "system of units" (https://jcgm.bipm.org/vim/en/1.13.html), defined as a + * "set of base units and derived units, together with their multiples and submultiples, defined in accordance with given rules, + * for a given system of quantities". + * The base units are a particular selection of measurement units for each of the base quantities of a system of quantities, + * that form the basis on top of which all other (derived) units are defined. + * + * Attribute systemOfQuantities speficies the associated SystemOfQuantities. + */ + + attribute longName: String[1]; + attribute systemOfQuantities : SystemOfQuantities[1]; + attribute baseUnits: SimpleUnit[1..*] ordered; + } + + constraint def VerifyUnitPowerFactors { + doc + /* + * Constraint definition to verify that the given unit power factors comply with the required quantity dimension + */ + + in unitPowerFactors: UnitPowerFactor[*] ordered; + in quantityDimension: QuantityDimension[1]; + } +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml new file mode 100644 index 0000000000000000000000000000000000000000..263e9ff90cf52578f7fbb5e5736f4494a78396f8 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml @@ -0,0 +1,107 @@ +standard library package Quantities { + doc + /* + * This package defines the root representations for quantities and their values. + */ + + private import Collections::*; + private import ScalarValues::NumericalValue; + private import ScalarValues::Number; + private import ScalarValues::Real; + private import ScalarValues::Natural; + private import ScalarValues::Boolean; + private import ScalarValues::String; + private import VectorValues::NumericalVectorValue; + private import VectorValues::ThreeVectorValue; + + abstract attribute def TensorQuantityValue :> Array { + doc + /* + * 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. + * The most general case is a multi-dimensional, tensor quantity of any order. In engineering, the majority of quantities used are + * scalar and vector quantities, that are tensor quantities of order 0 and 1 respectively. + * The measurement reference used to express a quantity value must have a type, dimensions and order that match the quantity, i.e., + * a TensorQuantityValue must use a TensorMeasurementReference, a VectorQuantityValue a VectorMeasurementReference, + * and a ScalarQuantityValue a ScalarMeasurementReference. See package MeasurementReferences for details. + */ + + attribute isBound: Boolean; + attribute num: Number[1..*] ordered nonunique :>> elements; + attribute mRef: MeasurementReferences::TensorMeasurementReference; + attribute :>> dimensions = mRef.dimensions; + attribute order :>> rank; + attribute contravariantOrder: Natural; + attribute covariantOrder: Natural; + + assert constraint orderSum { contravariantOrder + covariantOrder == order } + assert constraint boundMatch { (isBound == mRef.isBound) or (not isBound and mRef.isBound) } + } + + abstract attribute def VectorQuantityValue :> TensorQuantityValue, NumericalVectorValue { + attribute :>> mRef: MeasurementReferences::VectorMeasurementReference; + } + + abstract attribute def ScalarQuantityValue :> VectorQuantityValue, NumericalValue { + attribute :>> mRef: MeasurementReferences::ScalarMeasurementReference; + } + + abstract attribute tensorQuantities: TensorQuantityValue[*] nonunique { + doc + /* + * Quantities are defined as self-standing features that can be used to consistently specify quantities as + * features of occurrences. Each single quantity feature is subsetting the root feature tensorQuantities. + * In other words, the codomain of a quantity feature is a suitable specialization of TensorQuantityValue. + */ + } + abstract attribute vectorQuantities: VectorQuantityValue[*] nonunique :> tensorQuantities; + abstract attribute scalarQuantities: ScalarQuantityValue[*] nonunique :> vectorQuantities; + + abstract attribute def '3dVectorQuantityValue' :> VectorQuantityValue, ThreeVectorValue { + doc + /* + * Most general representation of real 3-vector quantities + */ + + attribute :>> num: Real[3]; + } + alias ThreeDVectorQuantityValue for '3dVectorQuantityValue'; + + /* + * Define generic aliases QuantityValue and quantities for the top level quantity attribute def and attribute. + */ + alias QuantityValue for TensorQuantityValue; + alias quantities for tensorQuantities; + + attribute def SystemOfQuantities { + doc + /* + * A SystemOfQuantities represents the essentials of [VIM] concept "system of quantities" (https://jcgm.bipm.org/vim/en/1.3.html), defined as a + * "set of quantities together with a set of noncontradictory equations relating those quantities". + * In order to establish such a set of noncontradictory equations a set of base quantities is selected. Subsequently the system of quantities is + * completed by adding derived quantities which are products of powers of the base quantities. + */ + + attribute baseQuantities: ScalarQuantityValue[*] ordered :> scalarQuantities; + } + + attribute def QuantityPowerFactor { + doc + /* + * Representation of a quantity power factor, being the combination of a quantity and an exponent. + * + * A sequence of QuantityPowerFactors for the baseQuantities of a SystemOfQuantities define the QuantityDimension of a scalar quantity. + */ + + attribute quantity: ScalarQuantityValue[1]; + attribute exponent: Real[1]; + } + + attribute def QuantityDimension { + doc + /* + * Representation of quantity dimension, which is the product of powers of the set of base quantities defined for a particular system of quantities, units and scales. + */ + + attribute quantityPowerFactors: QuantityPowerFactor[*] ordered; + } +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml new file mode 100644 index 0000000000000000000000000000000000000000..34f0566e4b8529744188433b43d3067cd4b792d8 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml @@ -0,0 +1,70 @@ +standard library package QuantityCalculations { + doc + /* + * This package package defines calculations for the construction of and computations on ScalarQuantityValues. + */ + + private import ScalarValues::*; + private import Quantities::ScalarQuantityValue; + private import MeasurementReferences::ScalarMeasurementReference; + private import MeasurementReferences::DimensionOneValue; + + calc def '[' specializes BaseFunctions::'[' { + in num: Number[1]; + in mRef: ScalarMeasurementReference[1]; + return quantity : ScalarQuantityValue[1]; + } + + calc def isZero specializes NumericalFunctions::isZero { + in x: ScalarQuantityValue[1]; + return : Boolean[1] = NumericalFunctions::isZero(x.num); + } + calc def isUnit specializes NumericalFunctions::isUnit { + in x: ScalarQuantityValue[1]; + return : Boolean[1] = NumericalFunctions::isUnit(x.num); + } + + calc def abs specializes NumericalFunctions::abs { in x: ScalarQuantityValue[1]; return : ScalarQuantityValue[1]; } + + calc def '+' specializes NumericalFunctions::'+' { in x: ScalarQuantityValue[1]; in y: ScalarQuantityValue[0..1]; return : ScalarQuantityValue; } + calc def '-' specializes NumericalFunctions::'-' { in x: ScalarQuantityValue; in y: ScalarQuantityValue[0..1]; return : ScalarQuantityValue[1]; } + calc def '*' specializes NumericalFunctions::'*' { in x: ScalarQuantityValue[1]; in y: ScalarQuantityValue[1]; return : ScalarQuantityValue[1]; } + calc def '/' specializes NumericalFunctions::'/' { in x: ScalarQuantityValue[1]; in y: ScalarQuantityValue[1]; return : ScalarQuantityValue[1]; } + calc def '**' specializes NumericalFunctions::'**' { in x: ScalarQuantityValue[1]; in y: Real[1]; return : ScalarQuantityValue[1]; } + calc def '^' specializes NumericalFunctions::'^' { in x: ScalarQuantityValue[1]; in y: Real[1]; return : ScalarQuantityValue[1]; } + + calc def '<' specializes NumericalFunctions::'<' { in x: ScalarQuantityValue[1]; in y: ScalarQuantityValue[1]; return : Boolean[1]; } + calc def '>' specializes NumericalFunctions::'>' { in x: ScalarQuantityValue[1]; in y: ScalarQuantityValue[1]; return : Boolean[1]; } + calc def '<=' specializes NumericalFunctions::'<=' { in x: ScalarQuantityValue[1]; in y: ScalarQuantityValue[1]; return : Boolean[1]; } + calc def '>=' specializes NumericalFunctions::'>=' { in x: ScalarQuantityValue[1]; in y: ScalarQuantityValue[1]; return : Boolean[1]; } + + calc def max specializes NumericalFunctions::max { in x: ScalarQuantityValue[1]; in y: ScalarQuantityValue[1]; return : ScalarQuantityValue[1]; } + calc def min specializes NumericalFunctions::min { in x: ScalarQuantityValue[1]; in y: ScalarQuantityValue[1]; return : ScalarQuantityValue[1]; } + + calc def '==' specializes DataFunctions::'==' { in x: ScalarQuantityValue[1]; in y: ScalarQuantityValue[1]; return : Boolean[1]; } + + calc def sqrt{ in x: ScalarQuantityValue[1]; return : ScalarQuantityValue[1]; } + + calc def floor { in x: ScalarQuantityValue[1]; return : ScalarQuantityValue[1]; } + calc def round { in x: ScalarQuantityValue[1]; return : ScalarQuantityValue[1]; } + + calc def ToString specializes BaseFunctions::ToString { in x: ScalarQuantityValue[1]; return : String; } + calc def ToInteger { in x: ScalarQuantityValue[1]; return : Integer[1]; } + calc def ToRational { in x: ScalarQuantityValue[1]; return : Rational[1]; } + calc def ToReal { in x: ScalarQuantityValue[1]; return : Real[1]; } + calc def ToDimensionOneValue { in x: Real[1]; return : DimensionOneValue[1]; } + + calc def sum specializes NumericalFunctions::sum { in collection: ScalarQuantityValue[0..*]; + private attribute zero : ScalarQuantityValue[1]; + assert constraint { isZero(zero) } + return : ScalarQuantityValue = NumericalFunctions::sum0(collection, zero); + } + + calc def product specializes NumericalFunctions::product { in collection: ScalarQuantityValue[0..*]; + private attribute one : ScalarQuantityValue[1]; + assert constraint { isUnit(one) } + return : ScalarQuantityValue = NumericalFunctions::product1(collection, one); + } + + calc def ConvertQuantity{ in x: ScalarQuantityValue[1]; in targetMRef: ScalarMeasurementReference[1]; return : ScalarQuantityValue[1]; } +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/SI.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/SI.sysml new file mode 100644 index 0000000000000000000000000000000000000000..0ce3dbdb58a16848f345aef7a42d42dd4e036f23 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/SI.sysml @@ -0,0 +1,367 @@ +standard library package SI { + doc + /* + * 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 names and definitions of the units. + * Note 2: This is a representative but not yet complete list of measurement units. + */ + + private import MeasurementReferences::*; + public import ISQ::*; + public import SIPrefixes::*; + + /* + * SI simple unit needed in support of creation of the base units + */ + attribute gram : MassUnit; + + /* + * SI base units + */ + attribute metre : LengthUnit; + attribute kilogram : MassUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = kilo; :>> referenceUnit = g; } } + attribute second : DurationUnit; + attribute ampere : ElectricCurrentUnit; + attribute kelvin : ThermodynamicTemperatureUnit, TemperatureDifferenceUnit { + attribute temperatureOfWaterAtTriplePointInK: DefinitionalQuantityValue { + :>> num = 27316/100; + :>> definition = "temperature in kelvin of pure water at the triple point"; + } + attribute :>> definitionalQuantityValues = temperatureOfWaterAtTriplePointInK; + } + attribute mole : AmountOfSubstanceUnit; + attribute candela : LuminousIntensityUnit; + + /* + * Declare the SI system of units with its explicit base units + * and its associated system of quantities, the ISQ. + */ + attribute 'ISO/IEC 80000 International System of Units' : SystemOfUnits { + :>> systemOfQuantities = isq; + :>> baseUnits = (m, kg, s, A, K, mol, cd); + } + + /* + * Units with special names + */ + attribute byte : StorageCapacityUnit = one; + attribute baud : ModulationRateUnit = s^-1; + attribute bit : StorageCapacityUnit = one; + attribute becquerel : NuclearActivityUnit = s^-1; + attribute coulomb : ElectricChargeUnit = A*s; + attribute decibel : SoundPressureLevelUnit = one; + attribute decade : LogarithmicFrequencyRangeUnit = one; + attribute erlang : TrafficIntensityUnit = one; + attribute farad : CapacitanceUnit = C/V; + attribute gray : AbsorbedDoseUnit = J/kg; + attribute henry : PermeanceUnit, InductanceUnit = Wb/A; + attribute hartley : InformationContentUnit = one; + attribute hertz : FrequencyUnit = s^-1; + attribute joule : EnergyUnit = N*m; + //attribute katal : CatalyticActivityUnit = mol/s; + attribute lumen : LuminousFluxUnit = cd*sr; + attribute lux : IlluminanceUnit = lm/m^2; + attribute newton : ForceUnit = kg*m/s^2; + attribute 'natural unit of information' : InformationContentUnit = one; + attribute octet : StorageCapacityUnit = one; + attribute octave : LogarithmicFrequencyRangeUnit = one; + attribute pascal : PressureUnit = N/m^2; + attribute radian : AngularMeasureUnit = m/m; + attribute siemens : ConductanceUnit = 'Ω'^-1; + attribute shannon : InformationContentUnit = one; + attribute steradian : SolidAngularMeasureUnit = m^2/m^2; + attribute sievert : DoseEquivalentUnit = J/kg; + attribute tesla : MagneticFluxDensityUnit = Wb/m^2; + attribute volt : ElectricPotentialUnit = W/A; + attribute watt : PowerUnit = J/s; + attribute weber : MagneticFluxUnit = V*s; + attribute <'Ω'> ohm : ResistanceUnit = V/A; + + /* + * Units recognized in SI as specified in ISO 80000-1:2009 + */ + attribute <'Å'> 'ångström' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 1.0e-10; } } + attribute barn : AreaUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = 'm²'; :>> conversionFactor = 1.0e-28; } } + attribute day: DurationUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = hour; :>> conversionFactor = 24; } } + attribute dalton : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg; :>> conversionFactor = 1.66053906660e-27; :>> isExact = false; } } + attribute electronvolt : EnergyUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = J; :>> conversionFactor = 1.602176487e-19; :>> isExact = false; } } + attribute hour: DurationUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = min; :>> conversionFactor = 60; } } + attribute minute : DurationUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = s; :>> conversionFactor = 60; } } + attribute 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 'atomic mass unit' : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = Da; :>> conversionFactor = 1.0; } } + attribute 'astronomical unit' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 149597870691e11; :>> isExact = false; } } + attribute 'volt ampere reactive' : PowerUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = V*A; :>> conversionFactor = 1.0; } } + 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 + */ + attribute <'A⋅m⁻²⋅K⁻²'> 'ampere metre to the power minus 2 kelvin to the power minus 2' : RichardsonConstantUnit = A*m^-2*K^-2; + attribute <'A⋅m²'> 'ampere metre squared' : MagneticMomentUnit = A*m^2; + attribute <'A⋅m²⋅J⁻¹⋅s⁻¹'> 'ampere metre squared joule to the power minus 1 second to the power minus 1' : GyromagneticRatioUnit = A*m^2*J^-1*s^-1; + attribute <'A⋅s/kg'> 'ampere second per kilogram' : GyromagneticRatioUnit = A*s/kg; + attribute <'A/m'> 'ampere per metre' : LinearElectricCurrentDensityUnit = A/m; + attribute <'A/m²'> 'ampere per square metre' : ElectricCurrentDensityUnit = A/m^2; + attribute <'B/s'> 'byte per second' : TransferRateUnit = B/s; + attribute <'bit/s'> 'bit per second' : BinaryDigitRateUnit = bit/s; + attribute <'Bq/kg'> 'becquerel per kilogram' : SpecificActivityUnit = Bq/kg; + attribute <'Bq/m²'> 'becquerel per square metre' : SurfaceActivityDensityUnit = Bq/m^2; + attribute <'Bq/m³'> 'becquerel per cubic metre' : ActivityDensityUnit = Bq/m^3; + attribute <'C⋅m'> 'coulomb metre' : ElectricDipoleMomentUnit = C*m; + attribute <'C/(kg⋅s)'> 'coulomb per kilogram second' : ExposureRateUnit = C/(kg*s); + attribute <'C/kg'> 'coulomb per kilogram' : ExposureUnit = C/kg; + attribute <'C/m'> 'coulomb per metre' : LinearDensityOfElectricChargeUnit = C/m; + attribute <'C/m²'> 'coulomb per square metre' : SurfaceDensityOfElectricChargeUnit = C/m^2; + attribute <'C/m³'> 'coulomb per cubic metre' : ElectricChargeDensityUnit = C/m^3; + attribute <'cd⋅m⁻²'> 'candela metre to the power minus 2' : LuminanceUnit = cd*m^-2; + attribute <'cd⋅sr'> 'candela steradian' : LuminousFluxUnit = cd*sr; + attribute <'cd⋅sr⋅kg⁻¹⋅m⁻²⋅s³'> 'candela steradian kilogram to the power minus 1 metre to the power minus 2 second to the power 3' : LuminousEfficacyOfRadiationUnit = cd*sr*kg^-1*m^-2*s^3; + attribute <'cd⋅sr⋅m⁻²'> 'candela steradian metre to the power minus 2' : IlluminanceUnit = cd*sr*m^-2; + attribute <'cd⋅sr⋅m⁻²⋅s'> 'candela steradian metre to the power minus 2 second' : LuminousExposureUnit = cd*sr*m^-2*s; + attribute <'cd⋅sr⋅s'> 'candela steradian second' : LuminousEnergyUnit = cd*sr*s; + attribute <'eV⋅J⋅kg⋅m²⋅s⁻²'> 'electronvolt joule kilogram metre squared second to the power minus 2' : HartreeEnergyUnit = eV*J*kg*m^2*s^-2; + attribute <'eV⋅m⁻²/kg'> 'electronvolt metre to the power minus 2 per kilogram' : TotalMassStoppingPowerUnit = eV*m^-2/kg; + attribute <'eV/m'> 'electronvolt per metre' : TotalLinearStoppingPowerUnit = eV/m; + attribute <'eV/m²'> 'electronvolt per square metre' : EnergyFluenceUnit = eV/m^2; + attribute <'F/m'> 'farad per metre' : ElectricConstantUnit = F/m; + attribute <'g/L'> 'g per l' : MassConcentrationUnit = g/L; + attribute <'g/mol'> 'g per mole' : MolarMassUnit = g/mol; + attribute <'Gy/s'> 'gray per second' : AbsorbedDoseRateUnit = Gy/s; + attribute <'H/m'> 'henry per metre' : MagneticConstantUnit = H/m; + attribute <'H⁻¹'> 'henry to the power minus 1' : ReluctanceUnit = H^-1; + attribute <'Hart/s'> 'hartley per second' : AverageInformationRateUnit = Hart/s; + attribute <'J⋅m²/kg'> 'joule metre squared per kilogram' : TotalMassStoppingPowerUnit = J*m^2/kg; + attribute <'J⋅s'> 'joule second' : ActionQuantityUnit = J*s; + attribute <'J⋅s⋅eV⋅s'> 'joule second electronvolt second' : TotalAngularMomentumUnit = J*s*eV*s; + attribute <'J⋅s⁻¹'> 'joule second to the power minus 1' : PowerUnit = J*s^-1; + attribute <'J/(kg⋅K)'> 'joule per kilogram kelvin' : SpecificHeatCapacityUnit = J/(kg*K); + attribute <'J/(m²⋅nm)'> 'joule per square metre nm' : SpectralRadiantExposureUnit = J/(m^2*nm); + attribute <'J/(m³⋅nm)'> 'joule per cubic metre nm' : SpectralRadiantEnergyDensityInTermsOfWavelengthUnit = J/(m^3*nm); + attribute <'J/(mol⋅K)'> 'joule per mole kelvin' : MolarHeatCapacityUnit = J/(mol*K); + attribute <'J/K'> 'joule per kelvin' : HeatCapacityUnit = J/K; + attribute <'J/kg'> 'joule per kilogram' : SpecificEnergyUnit = J/kg; + attribute <'J/m'> 'joule per metre' : TotalLinearStoppingPowerUnit = J/m; + attribute <'J/m²'> 'joule per square metre' : SpectralRadiantEnergyDensityInTermsOfWavenumberUnit = J/m^2; + attribute <'J/m³'> 'joule per cubic metre' : ElectromagneticEnergyDensityUnit = J/m^3; + attribute <'J/mol'> 'joule per mole' : MolarInternalEnergyUnit = J/mol; + attribute <'J/nm'> 'joule per nm' : SpectralRadiantEnergyUnit = J/nm; + attribute <'J/s'> 'joule per second' : HeatFlowRateUnit = J/s; + attribute <'J⁻¹⋅m⁻³⋅eV⁻¹⋅m⁻³'> 'joule to the power minus 1 metre to the power minus 3 electronvolt to the power minus 1 metre to the power minus 3' : EnergyDensityOfStatesUnit = J^-1*m^-3*eV^-1*m^-3; + attribute <'K/Pa'> 'kelvin per pascal' : JouleThomsonCoefficientUnit = K/Pa; + attribute <'K/W'> 'kelvin per watt' : ThermalResistanceUnit = K/W; + attribute <'K⁻¹'> 'kelvin to the power minus 1' : LinearExpansionCoefficientUnit = K^-1; + attribute <'kg⋅m⋅s⁻¹'> 'kilogram metre second to the power minus 1' : MomentumUnit = kg*m*s^-1; + attribute <'kg⋅m⋅s⁻²'> 'kilogram metre second to the power minus 2' : ForceUnit = kg*m*s^-2; + attribute <'kg⋅m⋅s⁻³'> 'kilogram metre second to the power minus 3' : SpectralRadiantFluxUnit = kg*m*s^-3; + attribute <'kg⋅m⋅s⁻³⋅K⁻¹'> 'kilogram metre second to the power minus 3 kelvin to the power minus 1' : ThermalConductivityUnit = kg*m*s^-3*K^-1; + attribute <'kg⋅m⋅s⁻³⋅sr⁻¹'> 'kilogram metre second to the power minus 3 steradian to the power minus 1' : SpectralRadiantIntensityUnit = kg*m*s^-3*sr^-1; + attribute <'kg⋅m⁻¹'> 'kilogram metre to the power minus 1' : LinearMassDensityUnit = kg*m^-1; + attribute <'kg⋅m⁻¹⋅s⁻¹'> 'kilogram metre to the power minus 1 second to the power minus 1' : DynamicViscosityUnit = kg*m^-1*s^-1; + attribute <'kg⋅m⁻¹⋅s⁻²'> 'kilogram metre to the power minus 1 second to the power minus 2' : PressureUnit = kg*m^-1*s^-2; + attribute <'kg⋅m⁻¹⋅s⁻²⋅K⁻¹'> 'kilogram metre to the power minus 1 second to the power minus 2 kelvin to the power minus 1' : PressureCoefficientUnit = kg*m^-1*s^-2*K^-1; + attribute <'kg⋅m⁻¹⋅s⁻³'> 'kilogram metre to the power minus 1 second to the power minus 3' : SpectralIrradianceUnit = kg*m^-1*s^-3; + attribute <'kg⋅m⁻¹⋅s⁻³⋅sr⁻¹'> 'kilogram metre to the power minus 1 second to the power minus 3 steradian to the power minus 1' : SpectralRadianceUnit = kg*m^-1*s^-3*sr^-1; + attribute <'kg⋅m⁻²'> 'kilogram metre to the power minus 2' : SurfaceMassDensityUnit = kg*m^-2; + attribute <'kg⋅m⁻²⋅s⁻¹'> 'kilogram metre to the power minus 2 second to the power minus 1' : MassFlowUnit = kg*m^-2*s^-1; + attribute <'kg⋅m⁻²⋅s⁻²'> 'kilogram metre to the power minus 2 second to the power minus 2' : SpectralRadiantEnergyDensityInTermsOfWavelengthUnit = kg*m^-2*s^-2; + attribute <'kg⋅m⁻³'> 'kilogram metre to the power minus 3' : MassDensityUnit = kg*m^-3; + attribute <'kg⋅m⁻⁴⋅s⁻¹'> 'kilogram metre to the power minus 4 second to the power minus 1' : AcousticImpedanceUnit = kg*m^-4*s^-1; + attribute <'kg⋅m²'> 'kilogram metre squared' : MomentOfInertiaUnit = kg*m^2; + attribute <'kg⋅m²⋅s⁻¹'> 'kilogram metre squared second to the power minus 1' : AngularMomentumUnit = kg*m^2*s^-1; + attribute <'kg⋅m²⋅s⁻²'> 'kilogram metre squared second to the power minus 2' : MomentOfForceUnit = kg*m^2*s^-2; + attribute <'kg⋅m²⋅s⁻²⋅K⁻¹'> 'kilogram metre squared second to the power minus 2 kelvin to the power minus 1' : HeatCapacityUnit = kg*m^2*s^-2*K^-1; + attribute <'kg⋅m²⋅s⁻²⋅K⁻¹⋅mol⁻¹'> 'kilogram metre squared second to the power minus 2 kelvin to the power minus 1 mole to the power minus 1' : MolarHeatCapacityUnit = kg*m^2*s^-2*K^-1*mol^-1; + attribute <'kg⋅m²⋅s⁻²⋅mol⁻¹'> 'kilogram metre squared second to the power minus 2 mole to the power minus 1' : MolarInternalEnergyUnit = kg*m^2*s^-2*mol^-1; + attribute <'kg⋅m²⋅s⁻³'> 'kilogram metre squared second to the power minus 3' : PowerUnit = kg*m^2*s^-3; + attribute <'kg⋅m²⋅s⁻³⋅A⁻¹'> 'kilogram metre squared second to the power minus 3 ampere to the power minus 1' : ElectricPotentialDifferenceUnit = kg*m^2*s^-3*A^-1; + attribute <'kg⋅m²⋅s⁻³⋅A⁻¹⋅K⁻¹'> 'kilogram metre squared second to the power minus 3 ampere to the power minus 1 kelvin to the power minus 1' : SeebeckCoefficientForSubstancesAAndBUnit = kg*m^2*s^-3*A^-1*K^-1; + attribute <'kg⋅m²⋅s⁻³⋅K⁻¹'> 'kilogram metre squared second to the power minus 3 kelvin to the power minus 1' : ThermalConductanceUnit = kg*m^2*s^-3*K^-1; + attribute <'kg⋅m²⋅s⁻³⋅sr⁻¹'> 'kilogram metre squared second to the power minus 3 steradian to the power minus 1' : RadiantIntensityUnit = kg*m^2*s^-3*sr^-1; + attribute <'kg⋅m³⋅s⁻³⋅A⁻²'> 'kilogram metre cubed second to the power minus 3 ampere to the power minus 2' : ResistivityUnit = kg*m^3*s^-3*A^-2; + attribute <'kg⋅mol⁻¹'> 'kilogram mole to the power minus 1' : MolarMassUnit = kg*mol^-1; + attribute <'kg⋅s⁻¹'> 'kilogram second to the power minus 1' : MassFlowRateUnit = kg*s^-1; + attribute <'kg⋅s⁻²'> 'kilogram second to the power minus 2' : SurfaceTensionUnit = kg*s^-2; + attribute <'kg⋅s⁻²⋅A⁻¹'> 'kilogram second to the power minus 2 ampere to the power minus 1' : MagneticFluxDensityUnit = kg*s^-2*A^-1; + attribute <'kg⋅s⁻³'> 'kilogram second to the power minus 3' : DensityOfHeatFlowRateUnit = kg*s^-3; + attribute <'kg⋅s⁻³⋅K⁻¹'> 'kilogram second to the power minus 3 kelvin to the power minus 1' : CoefficientOfHeatTransferUnit = kg*s^-3*K^-1; + attribute <'kg⋅s⁻³⋅sr⁻¹'> 'kilogram second to the power minus 3 steradian to the power minus 1' : RadianceUnit = kg*s^-3*sr^-1; + attribute <'kg⁻¹⋅A'> 'kilogram to the power minus 1 ampere' : ExposureRateUnit = kg^-1*A; + attribute <'kg⁻¹⋅m⋅s²'> 'kilogram to the power minus 1 metre second to the power 2' : CompressibilityUnit = kg^-1*m*s^2; + attribute <'kg⁻¹⋅m⋅s²⋅K'> 'kilogram to the power minus 1 metre second to the power 2 kelvin' : JouleThomsonCoefficientUnit = kg^-1*m*s^2*K; + attribute <'kg⁻¹⋅m⁻²⋅s³⋅K'> 'kilogram to the power minus 1 metre to the power minus 2 second to the power 3 kelvin' : ThermalResistanceUnit = kg^-1*m^-2*s^3*K; + attribute <'kg⁻¹⋅m⁻³⋅s³⋅A²'> 'kilogram to the power minus 1 metre to the power minus 3 second to the power 3 ampere to the power 2' : ElectrolyticConductivityUnit = kg^-1*m^-3*s^3*A^2; + attribute <'kg⁻¹⋅m⁻⁵⋅s²'> 'kilogram to the power minus 1 metre to the power minus 5 second to the power 2' : EnergyDensityOfStatesUnit = kg^-1*m^-5*s^2; + attribute <'kg⁻¹⋅m²'> 'kilogram to the power minus 1 metre squared' : MassAttenuationCoefficientUnit = kg^-1*m^2; + attribute <'kg⁻¹⋅m³'> 'kilogram to the power minus 1 metre cubed' : SpecificVolumeUnit = kg^-1*m^3; + attribute <'kg⁻¹⋅s⋅A'> 'kilogram to the power minus 1 second ampere' : GyromagneticRatioUnit = kg^-1*s*A; + attribute <'kg⁻¹⋅s⁻¹'> 'kilogram to the power minus 1 second to the power minus 1' : SpecificActivityUnit = kg^-1*s^-1; + attribute <'kg⁻¹⋅s²'> 'kilogram to the power minus 1 second to the power 2' : EnergyDistributionOfCrossSectionUnit = kg^-1*s^2; + attribute <'kg⁻¹⋅s²⋅A'> 'kilogram to the power minus 1 second to the power 2 ampere' : MobilityUnit = kg^-1*s^2*A; + attribute <'kg⁻¹⋅s³⋅A²⋅mol⁻¹'> 'kilogram to the power minus 1 second to the power 3 ampere to the power 2 mole to the power minus 1' : MolarConductivityUnit = kg^-1*s^3*A^2*mol^-1; + attribute <'kg⁻¹⋅s³⋅K'> 'kilogram to the power minus 1 second to the power 3 kelvin' : ThermalInsulanceUnit = kg^-1*s^3*K; + attribute <'kg²⋅m⁻²⋅s⁻³'> 'kilogram to the power 2 metre to the power minus 2 second to the power minus 3' : SoundExposureUnit = kg^2*m^-2*s^-3; + attribute <'kg²⋅m⁴⋅s⁻⁶⋅A⁻²⋅K⁻²'> 'kilogram to the power 2 metre to the power 4 second to the power minus 6 ampere to the power minus 2 kelvin to the power minus 2' : LorenzCoefficientUnit = kg^2*m^4*s^-6*A^-2*K^-2; + attribute <'lm⋅s'> 'lumen second' : LuminousEnergyUnit = lm*s; + attribute <'lm/m²'> 'lumen per square metre' : LuminousExitanceUnit = lm/m^2; + attribute <'lm/W'> 'lumen per watt' : LuminousEfficacyOfRadiationUnit = lm/W; + attribute <'lx⋅s'> 'lux second' : LuminousExposureUnit = lx*s; + attribute <'m⋅s⁻¹'> 'metre second to the power minus 1' : SpeedUnit = m*s^-1; + attribute <'m⋅s⁻²'> 'metre second to the power minus 2' : AccelerationUnit = m*s^-2; + attribute <'m/s'> 'metre per second' : SpeedUnit = m/s; + attribute <'m⁻¹'> 'metre to the power minus 1' : CurvatureUnit = m^-1; + attribute <'m⁻²'> 'metre to the power minus 2' : PhotonExposureUnit = m^-2; + attribute <'m⁻²⋅s⁻¹'> 'metre to the power minus 2 second to the power minus 1' : PhotonIrradianceUnit = m^-2*s^-1; + attribute <'m⁻²⋅s⁻¹⋅sr⁻¹'> 'metre to the power minus 2 second to the power minus 1 steradian to the power minus 1' : PhotonRadianceUnit = m^-2*s^-1*sr^-1; + attribute <'m⁻³'> 'metre to the power minus 3' : ParticleConcentrationUnit = m^-3; + attribute <'m⁻³⋅s'> 'metre to the power minus 3 second' : DensityOfVibrationalStatesUnit = m^-3*s; + attribute <'m⁻³⋅s⁻¹'> 'metre to the power minus 3 second to the power minus 1' : ActivityDensityUnit = m^-3*s^-1; + attribute <'m²'> 'metre squared' : AreaUnit = m^2; + attribute <'m²⋅A'> 'metre squared ampere' : MagneticDipoleMomentUnit = m^2*A; + attribute <'m²⋅K/W'> 'metre squared kelvin per watt' : ThermalInsulanceUnit = m^2*K/W; + attribute <'m²⋅mol⁻¹'> 'metre squared mole to the power minus 1' : MolarAbsorptionCoefficientUnit = m^2*mol^-1; + attribute <'m²⋅s⁻¹'> 'metre squared second to the power minus 1' : KinematicViscosityUnit = m^2*s^-1; + attribute <'m²⋅s⁻²'> 'metre squared second to the power minus 2' : SpecificEnergyUnit = m^2*s^-2; + attribute <'m²⋅s⁻²⋅K⁻¹'> 'metre squared second to the power minus 2 kelvin to the power minus 1' : SpecificHeatCapacityUnit = m^2*s^-2*K^-1; + attribute <'m²⋅s⁻³'> 'metre squared second to the power minus 3' : DoseEquivalentUnit = m^2*s^-3; + attribute <'m²⋅sr⁻¹'> 'metre squared steradian to the power minus 1' : DirectionDistributionOfCrossSectionUnit = m^2*sr^-1; + attribute <'m²/(J⋅sr)'> 'metre squared per joule steradian' : DirectionAndEnergyDistributionOfCrossSectionUnit = m^2/(J*sr); + attribute <'m²/(V⋅s)'> 'metre squared per volt second' : MobilityUnit = m^2/(V*s); + attribute <'m²/J'> 'metre squared per joule' : EnergyDistributionOfCrossSectionUnit = m^2/J; + attribute <'m³'> 'metre cubed' : VolumeUnit = m^3; + attribute <'m³⋅mol⁻¹'> 'metre cubed mole to the power minus 1' : MolarVolumeUnit = m^3*mol^-1; + attribute <'m³⋅s⁻¹'> 'metre cubed second to the power minus 1' : VolumeFlowRateUnit = m^3*s^-1; + attribute <'m³/C⋅m³⋅s⁻¹⋅A⁻¹'> 'metre cubed per coulomb cubic metre second to the power minus 1 ampere to the power minus 1' : HallCoefficientUnit = m^3/C*m^3*s^-1*A^-1; + attribute <'m⁴'> 'metre to the power 4' : SecondAxialMomentOfAreaUnit = m^4; + attribute <'m⁴⋅s⁻²'> 'metre to the power 4 second to the power minus 2' : TotalMassStoppingPowerUnit = m^4*s^-2; + attribute <'mL/L '> 'ml per l' : VolumeFractionUnit = mL/L; + attribute <'mol⋅kg⁻¹'> 'mole kilogram to the power minus 1' : IonicStrengthUnit = mol*kg^-1; + attribute <'mol⋅m⁻³'> 'mole metre to the power minus 3' : AmountOfSubstanceConcentrationUnit = mol*m^-3; + attribute <'mol/kg'> 'mole per kilogram' : MolalityUnit = mol/kg; + attribute <'mol/L'> 'mole per l' : AmountOfSubstanceConcentrationUnit = mol/L; + attribute <'mol/m³'> 'mole per cubic metre' : EquilibriumConstantOnConcentrationBasisUnit = mol/m^3; + attribute <'N⋅m'> 'newton metre' : MomentOfForceUnit, TorqueUnit = N*m; + attribute <'N⋅m⋅s'> 'newton metre second' : AngularImpulseUnit = N*m*s; + attribute <'N⋅m⋅s⁻¹'> 'newton metre second to the power minus 1' : PowerUnit = N*m*s^-1; + attribute <'N⋅m⁻¹'> 'newton metre to the power minus 1' : SurfaceTensionUnit = N*m^-1; + attribute <'N⋅m⁻²'> 'newton metre to the power minus 2' : PressureUnit = N*m^-2; + attribute <'N⋅s'> 'newton second' : ImpulseUnit = N*s; + attribute <'nat/s'> 'natural unit of information per second' : AverageInformationRateUnit = nat/s; + attribute <'o/s'> 'octet per second' : TransferRateUnit = o/s; + attribute <'Pa⋅s'> 'pascal second' : DynamicViscosityUnit = Pa*s; + attribute <'Pa⋅s/m'> 'pascal second per metre' : CharacteristicImpedanceOfAMediumForLongitudinalWavesUnit = Pa*s/m; + attribute <'Pa⋅s/m³'> 'pascal second per cubic metre' : AcousticImpedanceUnit = Pa*s/m^3; + attribute <'Pa/K'> 'pascal per kelvin' : PressureCoefficientUnit = Pa/K; + attribute <'Pa⁻¹'> 'pascal to the power minus 1' : CompressibilityUnit = Pa^-1; + attribute <'Pa²⋅s'> 'pascal to the power 2 second' : SoundExposureUnit = Pa^2*s; + attribute <'rad⋅m²/kg¹'> 'radian metre squared per kilogram to the power 1' : SpecificOpticalRotatoryPowerUnit = rad*m^2/kg^1; + attribute <'rad⋅m²/mol'> 'radian metre squared per mole' : MolarOpticalRotatoryPowerUnit = rad*m^2/mol; + attribute <'rad⋅s⁻¹'> 'radian second to the power minus 1' : AngularVelocityUnit = rad*s^-1; + attribute <'rad⋅s⁻²'> 'radian second to the power minus 2' : AngularAccelerationUnit = rad*s^-2; + attribute <'rad/m'> 'radian per metre' : PhaseCoefficientUnit = rad/m; + attribute <'s⋅A'> 'second ampere' : ElectricChargeUnit = s*A; + attribute <'S⋅m²/mol'> 'siemens metre squared per mole' : MolarConductivityUnit = S*m^2/mol; + attribute <'S/m'> 'siemens per metre' : ConductivityUnit = S/m; + attribute <'s⁻¹'> 'second to the power minus 1' : AngularVelocityUnit = s^-1; + attribute <'s⁻¹⋅sr⁻¹'> 'second to the power minus 1 steradian to the power minus 1' : PhotonIntensityUnit = s^-1*sr^-1; + attribute <'s⁻²'> 'second to the power minus 2' : AngularAccelerationUnit = s^-2; + attribute <'Sh/s'> 'shannon per second' : AverageInformationRateUnit = Sh/s; + attribute <'Sv/s'> 'sievert per second' : DoseEquivalentUnit = Sv/s; + attribute <'V⋅A'> 'volt ampere' : PowerUnit = V*A; + attribute <'V/K'> 'volt per kelvin' : SeebeckCoefficientForSubstancesAAndBUnit = V/K; + attribute <'V/m'> 'volt per metre' : ElectricFieldStrengthUnit = V/m; + attribute <'V²/K²'> 'volt to the power 2 per kelvin to the power 2' : LorenzCoefficientUnit = V^2/K^2; + attribute <'W⋅h'> 'watt hour' : EnergyUnit = W*h; + attribute <'W/(m⋅K)'> 'watt per metre kelvin' : ThermalConductivityUnit = W/(m*K); + attribute <'W/(m²⋅K)'> 'watt per square metre kelvin' : CoefficientOfHeatTransferUnit = W/(m^2*K); + attribute <'W/(m²⋅nm)'> 'watt per square metre nm' : SpectralIrradianceUnit = W/(m^2*nm); + attribute <'W/(sr⋅m²)'> 'watt per steradian square metre' : RadianceUnit = W/(sr*m^2); + attribute <'W/(sr⋅m²⋅nm)'> 'watt per steradian square metre nm' : SpectralRadianceUnit = W/(sr*m^2*nm); + attribute <'W/(sr⋅nm)'> 'watt per steradian nm' : SpectralRadiantIntensityUnit = W/(sr*nm); + attribute <'W/K'> 'watt per kelvin' : ThermalConductanceUnit = W/K; + attribute <'W/kg'> 'watt per kilogram' : DoseEquivalentUnit = W/kg; + attribute <'W/m²'> 'watt per square metre' : DensityOfHeatFlowRateUnit = W/m^2; + attribute <'W/nm'> 'watt per nm' : SpectralRadiantFluxUnit = W/nm; + attribute <'W/sr'> 'watt per steradian' : RadiantIntensityUnit = W/sr; + attribute <'Wb⋅m'> 'weber metre' : MagneticDipoleMomentUnit = Wb*m; + attribute <'Wb/m'> 'weber per metre' : MagneticVectorPotentialUnit = Wb/m; + attribute <'Ω⋅m'> 'ohm metre' : ResistivityUnit = 'Ω'*m; + + alias 'm/s²' for 'm⋅s⁻²'; + + /* + * Prefixed units + */ + + /* Length */ + attribute nanometre : LengthUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = nano; :>> referenceUnit = m; } } + attribute millimetre : LengthUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = milli; :>> referenceUnit = m; } } + attribute centimetre : LengthUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = centi; :>> referenceUnit = m; } } + attribute kilometre : LengthUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = kilo; :>> referenceUnit = m; } } + + /* Volume */ + attribute millilitre : VolumeUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = milli; :>> referenceUnit = L; } } + + /* Force */ + attribute millinewton : ForceUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = milli; :>> referenceUnit = N; } } + + /* Energy */ + attribute kilojoule : EnergyUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = kilo; :>> referenceUnit = J; } } + attribute megajoule : EnergyUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = mega; :>> referenceUnit = J; } } + attribute gigajoule : EnergyUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = giga; :>> referenceUnit = J; } } + + /* Power */ + attribute kilowatt : PowerUnit { :>> unitConversion: ConversionByPrefix { :>> prefix = kilo; :>> referenceUnit = W; } } + + /* Speed */ + attribute <'km/h'> 'kilometre per hour': SpeedUnit = km/h; + + /* + * Celsius units + */ + + attribute <'°C'> 'degree celsius (temperature difference)' : TemperatureDifferenceUnit { + doc + /* + * degree Celsius unit for temperature interval (i.e. temperature difference) quantities + */ + + attribute :>> unitConversion: ConversionByConvention { :>> referenceUnit = K; :>> conversionFactor = 1; } + } + + attribute <'°C_abs'> 'degree celsius (absolute temperature scale)' : IntervalScale { + doc + /* + * degree Celsius interval scale for absolute (thermodynamic) temperature quantities + * + * The interval scale is defined with an explicit transformation with respect to + * the kelvin thermodynamic temperature scale that specifies the zero shift. + */ + + attribute :>> unit = '°C'; + attribute temperatureWaterAtFreezingPointInC: DefinitionalQuantityValue { + :>> num = 0; :>> definition = "temperature in degree Celsius of pure water at freezing point"; + } + private attribute temperatureWaterAtTriplePointInC: DefinitionalQuantityValue { + :>> num = 1/100; :>> definition = "temperature in degree Celsius of pure water at the triple point"; + } + private attribute celsiusToKelvinScaleMapping: QuantityValueMapping { + :>> mappedQuantityValue = temperatureWaterAtTriplePointInC; + :>> referenceQuantityValue = K.temperatureOfWaterAtTriplePointInK; + } + attribute :>> definitionalQuantityValues = (temperatureWaterAtTriplePointInC, temperatureWaterAtFreezingPointInC); + attribute :>> quantityValueMapping = celsiusToKelvinScaleMapping; + + /* CoordinateFramePlacement (zero shift) w.r.t. the kelvin thermodynamic temperature scale */ + private attribute zeroDegreeCelsiusInKelvin: ThermodynamicTemperatureValue = 273.15 [K]; + attribute zeroDegreeCelsiusToKelvinShift : CoordinateFramePlacement :>> transformation { + :>> source = K; :>> origin = zeroDegreeCelsiusInKelvin; + } + } +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml new file mode 100644 index 0000000000000000000000000000000000000000..73069b0f19759ba51cb0b4858e25f444f6c4ad87 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml @@ -0,0 +1,48 @@ +standard library package SIPrefixes { + doc + /* + * Definition of SI unit prefixes as specified in ISO/IEC 80000-1 + */ + + private import MeasurementReferences::*; + + /* + * ISO/IEC 80000-1 prefixes for decimal multiples and sub-multiples + * + * See also https://en.wikipedia.org/wiki/Unit_prefix + */ + attribute yocto: UnitPrefix { :>> longName = "yocto"; :>> symbol = "y"; :>> conversionFactor = 1E-24; } + attribute zepto: UnitPrefix { :>> longName = "zepto"; :>> symbol = "z"; :>> conversionFactor = 1E-21; } + attribute atto: UnitPrefix { :>> longName = "atto"; :>> symbol = "a"; :>> conversionFactor = 1E-18; } + attribute femto: UnitPrefix { :>> longName = "femto"; :>> symbol = "f"; :>> conversionFactor = 1E-15; } + attribute pico: UnitPrefix { :>> longName = "pico"; :>> symbol = "p"; :>> conversionFactor = 1E-12; } + attribute nano: UnitPrefix { :>> longName = "nano"; :>> symbol = "n"; :>> conversionFactor = 1E-9; } + attribute micro: UnitPrefix { :>> longName = "micro"; :>> symbol = "μ"; :>> conversionFactor = 1E-6; } + attribute milli: UnitPrefix { :>> longName = "milli"; :>> symbol = "m"; :>> conversionFactor = 1E-3; } + attribute centi: UnitPrefix { :>> longName = "centi"; :>> symbol = "c"; :>> conversionFactor = 1E-2; } + attribute deci: UnitPrefix { :>> longName = "deci"; :>> symbol = "d"; :>> conversionFactor = 1E-1; } + attribute deca: UnitPrefix { :>> longName = "deca"; :>> symbol = "da"; :>> conversionFactor = 1E1; } + attribute hecto: UnitPrefix { :>> longName = "hecto"; :>> symbol = "h"; :>> conversionFactor = 1E2; } + attribute kilo: UnitPrefix { :>> longName = "kilo"; :>> symbol = "k"; :>> conversionFactor = 1E3; } + attribute mega: UnitPrefix { :>> longName = "mega"; :>> symbol = "M"; :>> conversionFactor = 1E6; } + attribute giga: UnitPrefix { :>> longName = "giga"; :>> symbol = "G"; :>> conversionFactor = 1E9; } + attribute tera: UnitPrefix { :>> longName = "tera"; :>> symbol = "T"; :>> conversionFactor = 1E12; } + attribute peta: UnitPrefix { :>> longName = "peta"; :>> symbol = "P"; :>> conversionFactor = 1E15; } + attribute exa: UnitPrefix { :>> longName = "exa"; :>> symbol = "E"; :>> conversionFactor = 1E18; } + attribute zetta: UnitPrefix { :>> longName = "zetta"; :>> symbol = "Z"; :>> conversionFactor = 1E21; } + attribute yotta: UnitPrefix { :>> longName = "yotta"; :>> symbol = "Y"; :>> conversionFactor = 1E24; } + + /* + * ISO/IEC 80000-1 prefixes for binary multiples, i.e. multiples of 1024 (= 2^10) + * + * See also https://en.wikipedia.org/wiki/Binary_prefix + */ + attribute kibi: UnitPrefix { :>> longName = "kibi"; :>> symbol = "Ki"; :>> conversionFactor = 1024; } + attribute mebi: UnitPrefix { :>> longName = "mebi"; :>> symbol = "Mi"; :>> conversionFactor = 1024^2; } + attribute gibi: UnitPrefix { :>> longName = "gibi"; :>> symbol = "Gi"; :>> conversionFactor = 1024^3; } + attribute tebi: UnitPrefix { :>> longName = "tebi"; :>> symbol = "Ti"; :>> conversionFactor = 1024^4; } + attribute pebi: UnitPrefix { :>> longName = "pebi"; :>> symbol = "Pi"; :>> conversionFactor = 1024^5; } + attribute exbi: UnitPrefix { :>> longName = "exbi"; :>> symbol = "Ei"; :>> conversionFactor = 1024^6; } + attribute zebi: UnitPrefix { :>> longName = "zebi"; :>> symbol = "Zi"; :>> conversionFactor = 1024^7; } + attribute yobi: UnitPrefix { :>> longName = "yobi"; :>> symbol = "Yi"; :>> conversionFactor = 1024^8; } +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4187ac31ac86bd7cb46ca2488119a17b7a84287d --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml @@ -0,0 +1,50 @@ +standard library package TensorCalculations { + doc + /* + * This package package defines calculations for the construction of and computations on TensorQuantityValues. + */ + + private import ScalarValues::Boolean; + private import ScalarValues::Number; + private import Quantities::ScalarQuantityValue; + private import Quantities::VectorQuantityValue; + private import Quantities::TensorQuantityValue; + private import MeasurementReferences::TensorMeasurementReference; + private import MeasurementReferences::CoordinateTransformation; + + calc def '[' specializes BaseFunctions::'[' { + in elements: Number[1..n] ordered; + in mRef: TensorMeasurementReference[1]; + return quantity: TensorQuantityValue[1]; + private attribute n = mRef.flattenedSize; + } + + calc def isZeroTensorQuantity { + in x : TensorQuantityValue[1]; + return : Boolean[1]; + } + calc def isUnitTensorQuantity { + in x : TensorQuantityValue[1]; + return : Boolean[1]; + } + + /* Addition and subtraction */ + calc def '+' :> DataFunctions::'+' { in : TensorQuantityValue[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; } + calc def '-' :> DataFunctions::'-' { in : TensorQuantityValue[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; } + + /* Multiplication and division */ + calc def scalarTensorMult { in : Number[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; } + calc def TensorScalarMult { in : TensorQuantityValue[1]; in : Number[1]; return : TensorQuantityValue[1]; } + calc def scalarQuantityTensorMult { in : ScalarQuantityValue[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; } + calc def TensorScalarQuantityMult { in : TensorQuantityValue[1]; in : ScalarQuantityValue[1]; return : TensorQuantityValue[1]; } + calc def tensorVectorMult { in : TensorQuantityValue[1]; in : VectorQuantityValue[1]; return : VectorQuantityValue[1]; } + calc def vectorTensorMult { in : VectorQuantityValue[1]; in : TensorQuantityValue[1]; return : VectorQuantityValue[1]; } + calc def tensorTensorMult { in : TensorQuantityValue[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; } + + /* Tensor transformation */ + calc def transform { + in transformation : CoordinateTransformation; + in sourceTensor : TensorQuantityValue; + return targetTensor : TensorQuantityValue; + } +} \ No newline at end of file diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/Time.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/Time.sysml new file mode 100644 index 0000000000000000000000000000000000000000..7af7feedbee6c17e30e674bbe3d920713ecb3ba1 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/Time.sysml @@ -0,0 +1,279 @@ +standard library package Time { + doc + /* + * This package specifies concepts to support time-related quantities and metrology, beyond + * the quantities duration and time as defined in [ISO 80000-3]. Representations of the + * Gregorian calendar date and time of day as specified by the [ISO 8601-1] standard are used. + */ + + private import Occurrences::Occurrence; + private import ScalarValues::Real; + private import ScalarValues::Integer; + private import ScalarValues::Natural; + private import ScalarValues::String; + private import Quantities::ScalarQuantityValue; + private import Quantities::scalarQuantities; + private import MeasurementReferences::*; + public import ISQBase::DurationValue; + public import ISQBase::DurationUnit; + public import ISQBase::duration; + public import ISQSpaceTime::TimeValue; + public import ISQSpaceTime::TimeUnit; + public import ISQSpaceTime::time; + + readonly part universalClock : Clock[1] :> Clocks::universalClock { + doc + /* + * universalClock is a single Clock that can be used as a default universal time reference. + */ + } + + part def Clock :> Clocks::Clock { + doc + /* + * A Clock provides a currentTime as a TimeInstantValue that advances montonically over its lifetime. + */ + + attribute :>> currentTime : TimeInstantValue; + } + + calc def TimeOf :> Clocks::TimeOf { + doc + /* + * TimeOf returns a TimeInstantValue for a given Occurrence relative to a given Clock. This TimeInstantValue is the + * time of the start of the Occurrence, which is considered to be synchronized with the snapshot of the Clock with a + * currentTime equal to the returned timeInstant. + */ + + in o : Occurrence[1]; + in clock : Clock[1] default localClock; + return timeInstant : TimeInstantValue[1]; + } + + calc def DurationOf :> Clocks::DurationOf { + doc + /* + * DurationOf returns the duration of a given Occurrence relative to a given Clock, which is equal to the TimeOf + * the end snapshot of the Occurrence minus the TimeOf its start snapshot. + */ + + in o : Occurrence[1]; + in clock : Clock[1] default localClock; + return duration : DurationValue; + } + + attribute def TimeScale :> IntervalScale { + doc + /* + * Generic time scale to express a time instant, including a textual definition of the meaning of zero time instant value + * + * Attribute definitionalEpoch captures the specification of the time instant with value zero, also known as the (reference) epoch. + */ + + attribute :>> unit: DurationUnit[1]; + attribute definitionalEpoch: DefinitionalQuantityValue[1]; + attribute :>> definitionalQuantityValues = definitionalEpoch; + } + + attribute def TimeInstantValue :> ScalarQuantityValue { + doc + /* + * Representation of a time instant quantity + * + * Also known as instant (of time), or, point in time. + */ + + attribute :>> num: Real[1]; + attribute :>> mRef: TimeScale[1]; + } + attribute timeInstant: TimeInstantValue :> scalarQuantities; + + abstract attribute def DateTime :> TimeInstantValue { + doc + /* + * Generic representation of a time instant as a calendar date and time of day + */ + } + + abstract attribute def Date :> TimeInstantValue { + doc + /* + * Generic representation of a time instant as a calendar date + */ + } + + abstract attribute def TimeOfDay :> TimeInstantValue { + doc + /* + * Generic representation of a time instant as a time of day + */ + } + + attribute 'Coordinated Universal Time' : TimeScale { + doc + /* + * Representation of the Coordinated Universal Time (UTC) time scale + * + * UTC is the primary time standard by which the world regulates clocks and time. It is within about 1 second of mean solar time + * at 0° longitude and is not adjusted for daylight saving time. + * UTC is obtained from International Atomic Time (TAI) by the insertion of leap seconds according to the advice of + * the International Earth Rotation and Reference Systems Service (IERS) to ensure approximate agreement + * with the time derived from the rotation of the Earth. + * + * References: + * ITU-R TF.460-6 (see https://www.itu.int/rec/R-REC-TF.460/en) + * BIPM technical services: Time Metrology (see https://www.bipm.org/en/time-metrology) + * + * Introductions: + * For UTC see https://en.wikipedia.org/wiki/Coordinated_Universal_Time + * For TAI see https://en.wikipedia.org/wiki/International_Atomic_Time + */ + + attribute :>> unit = SI::s; + attribute :>> definitionalEpoch: DefinitionalQuantityValue { :>> num = 0; :>> definition = "UTC epoch at 1 January 1958 at 0 hour 0 minute 0 second"; } + } + + attribute def UtcTimeInstantValue :> DateTime { + :>> mRef = UTC { + doc + /* + * Representation of a time instant expressed on the Coordinated Universal Time (UTC) time scale + */ + } + } + attribute utcTimeInstant: UtcTimeInstantValue :> timeInstant; + + /* + * Representations of a Gregorian calendar date and time of day as specified by the ISO 8601-1 standard. + * + * As explained in ISO 8601-1 clause 4.2.1: + * ISO 8601-1 uses the Gregorian calendar for the identification of calendar days. + * + * The Gregorian calendar provides a time scale consisting of a series of contiguous calendar years, + * each identified by a year number represented by an integer, greater than that of the + * immediately preceding calendar year by 1. ISO 8601-1 allows the identification of calendar years + * by their year number for years both before and after the introduction of the Gregorian calendar. + * + * The Gregorian calendar distinguishes common years of 365 consecutive calendar days and leap years + * of 366 consecutive calendar days. + * + * In the Gregorian calendar each calendar year is divided into 12 sequential calendar months, + * each consisting of a specific number of calendar days in the range 28 to 31. Usage of the Gregorian calendar + * for identifying dates preceding its introduction (15 October 1582) should only be by mutual agreement + * of the communicating partners. + * + * Reference: ISO 8601-1:2019 (First edition) + * "Date and time — Representations for information interchange — Part 1: Basic rules" + * (see https://www.iso.org/standard/70907.html) + */ + + attribute def Iso8601DateTimeEncoding :> String { + doc + /* + * Extended string encoding of an ISO 8601-1 date and time + * + * The format of the string must comply with the following EBNF production: + * ['+' | '-'] YYYY '-' MM '-' DD 'T' hh ':' mm ':' ss ['.' fff [fff]] ('Z' | timezoneOffset ) + * where: + * YYYY is 4-or-more-digit year number, which can be negative for years before 0000; + * MM is 2-digit month in year number, in which 01 is January, 02 is February, ..., 12 is December; + * DD is 2-digit day in month number in range 01 to 28, 29, 30, 31 depending on month and leap year; + * hh is 2-digit hour in day number in range 00 to 23; + * mm is 2-digit minute in hour in range 00 to 59; + * ss is 2-digit second in minute in range 00 to 60, in in case of leap second; + * ['.' fff [fff]] is an optional 3-digit millisecond or 6-digit microsecond fraction; + * timezoneOffset is ('+' | '-') hhOffset ':' mmOffset, denoting the local timezone hour and minute offset w.r.t. UTC, + * in which '+' specifies an offset ahead of UTC and '-' specifies an offset behind UTC; + * + * Note 1: All components are expressed with leading zeros. + * Note 2: 'Z' instead of timezoneOffset denotes a UTC time, i.e. zero time offset. + * Note 3: The ss value may only be 60 when a leap second is inserted. + * + * Examples of such a date and time value are: + * 2021-08-30T12:30:24Z (UTC date and time with second precision) + * 2018-01-23T23:14:44.304827Z (UTC date and time with microsecond precision) + * 1969-07-20T20:17:00Z (UTC date and time with second precision) + * 1969-07-20T15:17:00-05:00 (local date and time with second precision for a timezone 5 hour behind UTC) + * 1969-07-20T22:17:00+02:00 (local date and time with second precision for a timezone 2 hour ahead of UTC) + * + * TODO: Add constraint to verify ISO 8691 extended string encoding. + */ + } + + attribute def Iso8601DateTime :> UtcTimeInstantValue { + doc + /* + * Representation of an ISO 8601-1 date and time in extended string format + */ + + attribute val: Iso8601DateTimeEncoding; + attribute :>> num = getElapsedUtcTime(val); + private calc getElapsedUtcTime { + in iso8601DateTime: Iso8601DateTimeEncoding; + /* Return the number of seconds elapsed since the UTC epoch. + * Can be negative when the date and time is earlier than the epoch. + */ + return : Real; + } + } + + attribute def Iso8601DateTimeStructure :> UtcTimeInstantValue { + doc + /* + * Representation of an ISO 8601 date and time with explicit date and time component attributes + * + * TO DO: Specify restrictions for attributes month (1 to 12), day (1 to 31), hour (0 to 23), minute (0 to 59), second (0 to 60), + * microsecond (0 to 999999), hourOffset (-12 to +12), minuteOffset (-59 to +59) + * + * The total time offset is equal to the summation of hourOffset and minuteOffset. + */ + + attribute year: Integer; + attribute month: Natural; + attribute day: Natural; + attribute hour: Natural; + attribute minute: Natural; + attribute second: Natural; + attribute microsecond: Natural; + attribute hourOffset: Integer; + attribute minuteOffset: Integer; + attribute :>> num = getElapsedUtcTime(year, month, day, hour, minute, second, microsecond, hourOffset, minuteOffset); + private calc getElapsedUtcTime { + in year: Integer; + in month: Natural; + in day: Natural; + in hour: Natural; + in minute: Natural; + in second: Natural; + in microsecond: Natural; + in hourOffset: Integer; + in minuteOffest: Integer; + return : Real; + } + } + + calc convertIso8601DateTimeToStructure { + doc + /* + * Calculation to convert an ISO 8601 date and time instant from string to component structure representation + */ + + in iso8601DateTime: Iso8601DateTime; + /* Parse ISO 8601 string encoding to date and time components */ + return : Iso8601DateTimeStructure; + } + + calc convertIso8601StructureToDateTime { + doc + /* + * Calculation to convert an ISO 8601 date and time instant from component structure to string representation + */ + + in iso8601DateTimeStructure: Iso8601DateTimeStructure; + attribute x: Iso8601DateTime; + /* Concatenate ISO 8601 date and time components to string + * year-month-dayThour:minute:second±hourOffset:minuteOffset + */ + return : Iso8601DateTime; + } +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8955d51e814b89dc90ab0ff29f91e58903648b81 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml @@ -0,0 +1,255 @@ +standard library package USCustomaryUnits { + doc + /* + * Measurement unit declarations generated from NIST SP811 Appendix B + * + * See https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors/nist-guide-si-appendix-b8 + */ + + private import MeasurementReferences::*; + public import ISQ::*; + private import SI::*; + + attribute 'acre (based on US survey foot)' : AreaUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^2; :>> conversionFactor = 4.046873E+03; :>> isExact = false; } } + attribute 'acre foot (based on US survey foot)' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 1.233489E+03; :>> isExact = false; } } + attribute 'barrel (for petroleum, 42 gallons (US))' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 1.589873E-01; :>> isExact = false; } } + attribute 'British thermal unit (IT)' : EnergyUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = J; :>> conversionFactor = 1.055056E+03; :>> isExact = false; } } + alias Btu for Btu_IT; + attribute 'British thermal unit (th)' : EnergyUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = J; :>> conversionFactor = 1.054350E+03; :>> isExact = false; } } + attribute 'British thermal unit (mean)' : EnergyUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = J; :>> conversionFactor = 1.05587E+03; :>> isExact = false; } } + attribute <'Btu_39°F'> 'British thermal unit (39 °F)' : EnergyUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = J; :>> conversionFactor = 1.05967E+03; :>> isExact = false; } } + attribute <'Btu_59°F'> 'British thermal unit (59 °F)' : EnergyUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = J; :>> conversionFactor = 1.05480E+03; :>> isExact = false; } } + attribute <'Btu_60°F'> 'British thermal unit (60 °F)' : EnergyUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = J; :>> conversionFactor = 1.05468E+03; :>> isExact = false; } } + attribute <'Btu_IT⋅ft/(h⋅ft²⋅°F)'> 'British thermal unit (IT) foot per hour square foot degree Fahrenheit' : ThermalConductivityUnit = Btu_IT*ft/(h*ft^2*'°F'); + attribute <'Btu_th⋅ft/(h⋅ft²⋅°F)'> 'British thermal unit (th) foot per hour square foot degree Fahrenheit' : ThermalConductivityUnit = Btu_th*ft/(h*ft^2*'°F'); + attribute <'Btu_IT⋅in/(h⋅ft²⋅°F)'> 'British thermal unit (IT) inch per hour square foot degree Fahrenheit' : ThermalConductivityUnit = Btu_IT*'in'/(h*ft^2*'°F'); + attribute <'Btu_th⋅in/(h⋅ft²⋅°F)'> 'British thermal unit (th) inch per hour square foot degree Fahrenheit' : ThermalConductivityUnit = Btu_th*'in'/(h*ft^2*'°F'); + attribute <'Btu_IT⋅in/(s⋅ft²⋅°F)'> 'British thermal unit (IT) inch per second square foot degree Fahrenheit' : ThermalConductivityUnit = Btu_IT*'in'/(s*ft^2*'°F'); + attribute <'Btu_th⋅in/(s⋅ft²⋅°F)'> 'British thermal unit (th) inch per second square foot degree Fahrenheit' : ThermalConductivityUnit = Btu_th*'in'/(s*ft^2*'°F'); + //attribute <'Btu_IT/ft³'> 'British thermal unit (IT) per cubic foot' : EnergyDensityUnit = Btu_IT/ft^3; + //attribute <'Btu_th/ft³'> 'British thermal unit (th) per cubic foot' : EnergyDensityUnit = Btu_th/ft^3; + attribute <'Btu_IT/°F'> 'British thermal unit (IT) per degree Fahrenheit' : HeatCapacityUnit = Btu_IT/'°F'; + attribute <'Btu_th/°F'> 'British thermal unit (th) per degree Fahrenheit' : HeatCapacityUnit = Btu_th/'°F'; + attribute <'Btu_IT/°R'> 'British thermal unit (IT) per degree Rankine' : HeatCapacityUnit = Btu_IT/'°R'; + attribute <'Btu_th/°R'> 'British thermal unit (th) per degree Rankine' : HeatCapacityUnit = Btu_th/'°R'; + attribute <'Btu_IT/h'> 'British thermal unit (IT) per hour' : PowerUnit = Btu_IT/h; + attribute <'Btu_th/h'> 'British thermal unit (th) per hour' : PowerUnit = Btu_th/h; + attribute <'Btu_IT/(h⋅ft²⋅°F)'> 'British thermal unit (IT) per hour square foot degree Fahrenheit' : CoefficientOfHeatTransferUnit = Btu_IT/(h*ft^2*'°F'); + attribute <'Btu_th/(h⋅ft²⋅°F)'> 'British thermal unit (th) per hour square foot degree Fahrenheit' : CoefficientOfHeatTransferUnit = Btu_th/(h*ft^2*'°F'); + attribute <'Btu_th/min'> 'British thermal unit (th) per minute' : PowerUnit = Btu_th/min; + attribute <'Btu_IT/lb'> 'British thermal unit (IT) per pound' : SpecificEnergyUnit = Btu_IT/lb; + attribute <'Btu_th/lb'> 'British thermal unit (th) per pound' : SpecificEnergyUnit = Btu_th/lb; + attribute <'Btu_IT/(lb⋅°F)'> 'British thermal unit (IT) per pound degree Fahrenheit' : SpecificHeatCapacityUnit = Btu_IT/(lb*'°F'); + attribute <'Btu_th/(lb⋅°F)'> 'British thermal unit (th) per pound degree Fahrenheit' : SpecificHeatCapacityUnit = Btu_th/(lb*'°F'); + attribute <'Btu_IT/(lb⋅°R)'> 'British thermal unit (IT) per pound degree Rankine' : SpecificHeatCapacityUnit = Btu_IT/(lb*'°R'); + attribute <'Btu_th/(lb⋅°R)'> 'British thermal unit (th) per pound degree Rankine' : SpecificHeatCapacityUnit = Btu_th/(lb*'°R'); + attribute <'Btu_IT/s'> 'British thermal unit (IT) per second' : PowerUnit = Btu_IT/s; + attribute <'Btu_th/s'> 'British thermal unit (th) per second' : PowerUnit = Btu_th/s; + attribute <'Btu_IT/(s⋅ft²⋅°F)'> 'British thermal unit (IT) per second square foot degree Fahrenheit' : CoefficientOfHeatTransferUnit = Btu_IT/(s*ft^2*'°F'); + attribute <'Btu_th/(s⋅ft²⋅°F)'> 'British thermal unit (th) per second square foot degree Fahrenheit' : CoefficientOfHeatTransferUnit = Btu_th/(s*ft^2*'°F'); + //attribute <'Btu_IT/ft²'> 'British thermal unit (IT) per square foot' : SurfaceHeatDensityUnit = Btu_IT/ft^2; + //attribute <'Btu_th/ft²'> 'British thermal unit (th) per square foot' : SurfaceHeatDensityUnit = Btu_th/ft^2; + attribute <'Btu_IT/(ft²⋅h)'> 'British thermal unit (IT) per square foot hour' : DensityOfHeatFlowRateUnit = Btu_IT/(ft^2*h); + attribute <'Btu_th/(ft²⋅h)'> 'British thermal unit (th) per square foot hour' : DensityOfHeatFlowRateUnit = Btu_th/(ft^2*h); + attribute <'Btu_th/(ft²⋅min)'> 'British thermal unit (th) per square foot minute' : DensityOfHeatFlowRateUnit = Btu_th/(ft^2*min); + attribute <'Btu_IT/(ft²⋅s)'> 'British thermal unit (IT) per square foot second' : DensityOfHeatFlowRateUnit = Btu_IT/(ft^2*s); + attribute <'Btu_th/(ft²⋅s)'> 'British thermal unit (th) per square foot second' : DensityOfHeatFlowRateUnit = Btu_th/(ft^2*s); + attribute <'Btu_th/(in²⋅s)'> 'British thermal unit (th) per square inch second' : DensityOfHeatFlowRateUnit = Btu_th/('in'^2*s); + attribute 'bushel (US)' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 3.523907E-02; :>> isExact = false; } } + attribute <'cd/in²'> 'candela per square inch' : LuminanceUnit = cd/'in'^2; + attribute 'chain (based on US survey foot)' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 2.011684E+01; :>> isExact = false; } } + attribute 'circular mil' : AreaUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^2; :>> conversionFactor = 5.067075E-10; :>> isExact = false; } } + attribute 'clo' : ThermalInsulanceUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^2*K/W; :>> conversionFactor = 1.55E-01; :>> isExact = false; } } + attribute 'cord (128 ft^3)' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 3.624556E+00; :>> isExact = false; } } + attribute <'ft³'> 'cubic foot' : VolumeUnit = ft^3; + attribute <'ft³/min'> 'cubic foot per minute' : VolumeFlowRateUnit = ft^3/min; + attribute <'ft³/s'> 'cubic foot per second' : VolumeFlowRateUnit = ft^3/s; + attribute <'in³'> 'cubic inch' : VolumeUnit = 'in'^3; + attribute <'in³/min'> 'cubic inch per minute' : VolumeFlowRateUnit = 'in'^3/min; + attribute <'mi³'> 'cubic mile' : VolumeUnit = mi^3; + attribute <'yd³'> 'cubic yard' : VolumeUnit = yd^3; + attribute <'yd³/min'> 'cubic yard per minute' : VolumeFlowRateUnit = yd^3/min; + attribute 'cup (US)' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 2.365882E-04; :>> isExact = false; } } + attribute <'°F'> 'degree Fahrenheit (temperature difference)' : TemperatureDifferenceUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = K; :>> conversionFactor = 5/9; :>> isExact = true; } } + attribute <'°F⋅h/Btu_IT'> 'degree Fahrenheit hour per British thermal unit (IT)' : ThermalResistanceUnit = '°F'*h/Btu_IT; + attribute <'°F⋅h/Btu_th'> 'degree Fahrenheit hour per British thermal unit (th)' : ThermalResistanceUnit = '°F'*h/Btu_th; + attribute <'°F⋅h⋅ft²/Btu_IT'> 'degree Fahrenheit hour square foot per British thermal unit (IT)' : ThermalInsulanceUnit = '°F'*h*ft^2/Btu_IT; + attribute <'°F⋅h⋅ft²/Btu_th'> 'degree Fahrenheit hour square foot per British thermal unit (th)' : ThermalInsulanceUnit = '°F'*h*ft^2/Btu_th; + //attribute <'°F⋅h⋅ft²/(Btu_IT⋅in)'> 'degree Fahrenheit hour square foot per British thermal unit (IT) inch' : ThermalResistivityUnit = '°F'*h*ft^2/(Btu_IT*'in'); + //attribute <'°F⋅h⋅ft²/(Btu_th⋅in)'> 'degree Fahrenheit hour square foot per British thermal unit (th) inch' : ThermalResistivityUnit = '°F'*h*ft^2/(Btu_th*'in'); + attribute <'°F⋅s/Btu_IT'> 'degree Fahrenheit second per British thermal unit (IT)' : ThermalResistanceUnit = '°F'*s/Btu_IT; + attribute <'°F⋅s/Btu_th'> 'degree Fahrenheit second per British thermal unit (th)' : ThermalResistanceUnit = '°F'*s/Btu_th; + attribute <'°R'> 'degree Rankine' : ThermodynamicTemperatureUnit, TemperatureDifferenceUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = K; :>> conversionFactor = 5/9; :>> isExact = true; } } + attribute 'fathom (based on US survey foot)' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 1.828804E+00; :>> isExact = false; } } + attribute 'fluid ounce (US)' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 2.957353E-05; :>> isExact = false; } } + attribute 'foot' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 3.048E-01; } } + attribute 'foot (US survey)' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 3.048006E-01; :>> isExact = false; } } + attribute 'footcandle' : IlluminanceUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = lx; :>> conversionFactor = 1.076391E+01; :>> isExact = false; } } + attribute 'footlambert' : LuminanceUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = cd/m^2; :>> conversionFactor = 3.426259E+00; :>> isExact = false; } } + attribute 'foot of mercury, conventional' : PressureUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = Pa; :>> conversionFactor = 4.063666E+04; :>> isExact = false; } } + attribute 'foot of water (39.2 °F)' : PressureUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = Pa; :>> conversionFactor = 2.98898E+03; :>> isExact = false; } } + attribute 'foot of water, conventional' : PressureUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = Pa; :>> conversionFactor = 2.989067E+03; :>> isExact = false; } } + attribute <'ft/h'> 'foot per hour' : SpeedUnit = ft/h; + attribute <'ft/min'> 'foot per minute' : SpeedUnit = ft/min; + attribute <'ft/s'> 'foot per second' : SpeedUnit = ft/s; + attribute <'ft/s²'> 'foot per second squared' : AccelerationUnit = ft/s^2; + attribute 'foot poundal' : EnergyUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = J; :>> conversionFactor = 4.214011E-02; :>> isExact = false; } } + attribute <'ft⋅lbf'> 'foot pound-force' : EnergyUnit = ft*lbf; + attribute <'ft⋅lbf/h'> 'foot pound-force per hour' : PowerUnit = ft*lbf/h; + attribute <'ft⋅lbf/min'> 'foot pound-force per minute' : PowerUnit = ft*lbf/min; + attribute <'ft⋅lbf/s'> 'foot pound-force per second' : PowerUnit = ft*lbf/s; + attribute <'ft⁴'> 'foot to the fourth power' : SecondAxialMomentOfAreaUnit = ft^4; + attribute 'gallon (US)' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 3.785412E-03; :>> isExact = false; } } + attribute <'gal/d'> 'gallon (US) per day' : VolumeFlowRateUnit = gal/d; + //attribute <'gal/(hp⋅h)'> 'gallon (US) per horsepower hour' : EnergySpecificVolumeUnit = gal/(hp*h); + attribute <'gal/min'> 'gallon (US) per minute (gpm)' : VolumeFlowRateUnit = gal/min; + attribute 'gill (US)' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 1.182941E-04; :>> isExact = false; } } + attribute 'grain' : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg; :>> conversionFactor = 6.479891E-05; } } + attribute <'gr/gal'> 'grain per gallon (US)' : MassDensityUnit = gr/gal; + attribute 'horsepower (550 ft*lbf/s)' : PowerUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = W; :>> conversionFactor = 7.456999E+02; :>> isExact = false; } } + attribute 'horsepower (boiler)' : PowerUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = W; :>> conversionFactor = 9.80950E+03; :>> isExact = false; } } + attribute 'horsepower (electric)' : PowerUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = W; :>> conversionFactor = 7.46E+02; } } + attribute 'horsepower (water)' : PowerUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = W; :>> conversionFactor = 7.46043E+02; :>> isExact = false; } } + attribute 'hundredweight (long, 112 lb)' : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg; :>> conversionFactor = 5.080235E+01; :>> isExact = false; } } + attribute 'hundredweight (short, 100 lb)' : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg; :>> conversionFactor = 4.535924E+01; :>> isExact = false; } } + attribute <'in'> 'inch' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 2.54E-02; } } + attribute 'inch of mercury (32 °F)' : PressureUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = Pa; :>> conversionFactor = 3.38638E+03; :>> isExact = false; } } + attribute 'inch of mercury (60 °F)' : PressureUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = Pa; :>> conversionFactor = 3.37685E+03; :>> isExact = false; } } + attribute 'inch of mercury, conventional' : PressureUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = Pa; :>> conversionFactor = 3.386389E+03; :>> isExact = false; } } + attribute 'inch of water (39.2 °F)' : PressureUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = Pa; :>> conversionFactor = 2.49082E+02; :>> isExact = false; } } + attribute 'inch of water (60 °F)' : PressureUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = Pa; :>> conversionFactor = 2.4884E+02; :>> isExact = false; } } + attribute 'inch of water, conventional' : PressureUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = Pa; :>> conversionFactor = 2.490889E+02; :>> isExact = false; } } + attribute <'in/s'> 'inch per second' : SpeedUnit = 'in'/s; + attribute <'in/s²'> 'inch per second squared' : AccelerationUnit = 'in'/s^2; + attribute <'in⁴'> 'inch to the fourth power' : SecondAxialMomentOfAreaUnit = 'in'^4; + attribute 'kip (1 kip = 1000 lbf)' : ForceUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = N; :>> conversionFactor = 4.448222E+03; :>> isExact = false; } } + attribute <'kip/in²'> 'kip per square inch (ksi)' : PressureUnit = kip/'in'^2; + attribute 'knot (nautical mile per hour)' : SpeedUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m/s; :>> conversionFactor = 5.144444E-01; :>> isExact = false; } } + //attribute <'cal_th/cm²'> 'langley' : SurfaceHeatDensityUnit = cal_th/cm^2; + attribute <'lm/ft²'> 'lumen per square foot' : IlluminanceUnit = lm/ft^2; + attribute 'microinch' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 2.54E-08; } } + attribute 'mil (0.001 in)' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 2.54E-05; } } + attribute 'mile' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 1.609344E+03; } } + attribute 'mile (based on US survey foot)' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 1.609347E+03; :>> isExact = false; } } + attribute 'mile, nautical' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 1.852E+03; } } + alias NM for nmi; + //attribute <'mi/gal'> 'mile per gallon (US)' : FuelEconomyUnit = mi/gal; + //alias mpg for 'mi/gal'; + attribute <'mi/h'> 'mile per hour' : SpeedUnit = mi/h; + alias mph for 'mi/h'; + attribute <'mi/min'> 'mile per minute' : SpeedUnit = mi/min; + attribute <'mi/s'> 'mile per second' : SpeedUnit = mi/s; + attribute 'ohm circular-mil per foot' : ResistivityUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = 'Ω'*m; :>> conversionFactor = 1.662426E-09; :>> isExact = false; } } + attribute 'ounce (avoirdupois)' : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg; :>> conversionFactor = 2.834952E-02; :>> isExact = false; } } + attribute 'ounce (US fluid)' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 2.957353E-05; :>> isExact = false; } } + attribute 'ounce (avoirdupois)-force' : ForceUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = N; :>> conversionFactor = 2.780139E-01; :>> isExact = false; } } + attribute <'ozf⋅in'> 'ounce (avoirdupois)-force inch' : MomentOfForceUnit = ozf*'in'; + attribute <'oz/in³'> 'ounce (avoirdupois) per cubic inch' : MassDensityUnit = oz/'in'^3; + attribute <'oz/gal'> 'ounce (avoirdupois) per gallon (US)' : MassDensityUnit = oz/gal; + attribute <'oz/ft²'> 'ounce (avoirdupois) per square foot' : SurfaceMassDensityUnit = oz/ft^2; + attribute <'oz/in²'> 'ounce (avoirdupois) per square inch' : SurfaceMassDensityUnit = oz/'in'^2; + attribute <'oz/yd²'> 'ounce (avoirdupois) per square yard' : SurfaceMassDensityUnit = oz/yd^2; + attribute 'peck (US)' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 8.809768E-03; :>> isExact = false; } } + //attribute 'perm (0 °C)' : VapourTransmissionUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg/(Pa*s*m^2); :>> conversionFactor = 5.72135E-11; :>> isExact = false; } } + //attribute 'perm (23 °C)' : VapourTransmissionUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg/(Pa*s*m^2); :>> conversionFactor = 5.74525E-11; :>> isExact = false; } } + //attribute 'perm inch (0 °C)' : VapourTransmissionUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg/('Pa·s·m'); :>> conversionFactor = 1.45322E-12; :>> isExact = false; } } + //attribute 'perm inch (23 °C)' : VapourTransmissionUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg/('Pa·s·m'); :>> conversionFactor = 1.45929E-12; :>> isExact = false; } } + attribute 'pica (computer) (1/6 in)' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 4.233333E-03; :>> isExact = false; } } + attribute 'pica (printer′s)' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 4.217518E-03; :>> isExact = false; } } + attribute 'pint (US dry)' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 5.506105E-04; :>> isExact = false; } } + attribute 'pint (US liquid)' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 4.731765E-04; :>> isExact = false; } } + attribute 'point (computer) (1/72 in)' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 3.527778E-04; :>> isExact = false; } } + attribute 'point (printer′s)' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 3.514598E-04; :>> isExact = false; } } + attribute 'pound (avoirdupois)' : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg; :>> conversionFactor = 4.535924E-01; :>> isExact = false; } } + attribute <'lb⋅ft²'> 'pound foot squared' : MomentOfInertiaUnit = lb*ft^2; + attribute 'pound-force' : ForceUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = N; :>> conversionFactor = 4.448222E+00; :>> isExact = false; } } + attribute <'lbf⋅ft'> 'pound-force foot' : MomentOfForceUnit = lbf*ft; + attribute <'lbf⋅ft/in'> 'pound-force foot per inch' : ForceUnit = lbf*ft/'in'; + attribute <'lbf⋅in'> 'pound-force inch' : MomentOfForceUnit = lbf*'in'; + attribute <'lbf⋅in/in'> 'pound-force inch per inch' : ForceUnit = lbf*'in'/'in'; + attribute <'lbf/ft'> 'pound-force per foot' : SurfaceTensionUnit = lbf/ft; + attribute <'lbf/in'> 'pound-force per inch' : SurfaceTensionUnit = lbf/'in'; + //attribute 'pound-force per pound (lbf/lb) (thrust to mass ratio)' : ThrustToMassRatioUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = N/kg; :>> conversionFactor = 9.80665E+00; } } + attribute <'lbf/ft²'> 'pound-force per square foot' : PressureUnit = lbf/ft^2; + attribute <'lbf/in²'> 'pound-force per square inch' : PressureUnit = lbf/'in'^2; + alias psi for 'lbf/in²'; + attribute <'lbf⋅s/ft²'> 'pound-force second per square foot' : DynamicViscosityUnit = lbf*s/ft^2; + attribute <'lbf⋅s/in²'> 'pound-force second per square inch' : DynamicViscosityUnit = lbf*s/'in'^2; + attribute <'lb⋅in²'> 'pound inch squared' : MomentOfInertiaUnit = lb*'in'^2; + attribute <'lb/ft³'> 'pound per cubic foot' : MassDensityUnit = lb/ft^3; + attribute <'lb/in³'> 'pound per cubic inch' : MassDensityUnit = lb/'in'^3; + attribute <'lb/yd³'> 'pound per cubic yard' : MassDensityUnit = lb/yd^3; + attribute <'lb/ft'> 'pound per foot' : LinearMassDensityUnit = lb/ft; + attribute <'lb/(ft⋅h)'> 'pound per foot hour' : DynamicViscosityUnit = lb/(ft*h); + attribute <'lb/(ft⋅s)'> 'pound per foot second' : DynamicViscosityUnit = lb/(ft*s); + attribute <'lb/gal'> 'pound per gallon (US)' : MassDensityUnit = lb/gal; + //attribute <'lb/(hp⋅h)'> 'pound per horsepower hour' : FuelConsumptionUnit = lb/(hp*h); + attribute <'lb/h'> 'pound per hour' : MassFlowRateUnit = lb/h; + attribute <'lb/in'> 'pound per inch' : LinearMassDensityUnit = lb/'in'; + attribute <'lb/min'> 'pound per minute' : MassFlowRateUnit = lb/min; + attribute <'lb/s'> 'pound per second' : MassFlowRateUnit = lb/s; + attribute <'lb/ft²'> 'pound per square foot' : SurfaceMassDensityUnit = lb/ft^2; + attribute <'lb/in²'> 'pound per square inch (not pound-force)' : SurfaceMassDensityUnit = lb/'in'^2; + attribute <'lb/yd'> 'pound per yard' : LinearMassDensityUnit = lb/yd; + attribute 'pound-force per square inch (psi)' : PressureUnit = lbf/'in'^2; + attribute 'quad (10^15 Btu_IT)' : EnergyUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = J; :>> conversionFactor = 1.055056E+18; :>> isExact = false; } } + attribute 'quart (US dry)' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 1.101221E-03; :>> isExact = false; } } + attribute 'quart (US liquid)' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 9.463529E-04; :>> isExact = false; } } + attribute 'rod (based on US survey foot)' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 5.029210E+00; :>> isExact = false; } } + attribute 'slug' : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg; :>> conversionFactor = 1.459390E+01; :>> isExact = false; } } + attribute <'slug/ft³'> 'slug per cubic foot' : MassDensityUnit = slug/ft^3; + attribute <'slug/(ft⋅s)'> 'slug per foot second' : DynamicViscosityUnit = slug/(ft*s); + attribute <'ft²'> 'square foot' : AreaUnit = ft^2; + attribute <'ft²/h'> 'square foot per hour' : KinematicViscosityUnit = ft^2/h; + attribute <'ft²/s'> 'square foot per second' : KinematicViscosityUnit = ft^2/s; + attribute <'in²'> 'square inch' : AreaUnit = 'in'^2; + attribute <'mi²'> 'square mile' : AreaUnit = mi^2; + attribute 'square mile (based on US survey foot)' : AreaUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^2; :>> conversionFactor = 2.589998E+06; :>> isExact = false; } } + attribute <'yd²'> 'square yard' : AreaUnit = yd^2; + attribute 'tablespoon' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 1.478676E-05; :>> isExact = false; } } + attribute 'teaspoon' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 4.928922E-06; :>> isExact = false; } } + attribute 'therm (EC)' : EnergyUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = J; :>> conversionFactor = 1.05506E+08; } } + attribute 'therm (US)' : EnergyUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = J; :>> conversionFactor = 1.054804E+08; } } + attribute 'ton, assay' : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg; :>> conversionFactor = 2.916667E-02; :>> isExact = false; } } + attribute 'ton-force (2000 lbf)' : ForceUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = N; :>> conversionFactor = 8.896443E+03; :>> isExact = false; } } + attribute 'ton, long (2240 lb)' : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg; :>> conversionFactor = 1.016047E+03; :>> isExact = false; } } + attribute 'ton, long, per cubic yard' : MassDensityUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg/m^3; :>> conversionFactor = 1.328939E+03; :>> isExact = false; } } + attribute 'ton of refrigeration (12 000 Btu_IT/h)' : PowerUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = W; :>> conversionFactor = 3.516853E+03; :>> isExact = false; } } + attribute 'ton, register' : VolumeUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m^3; :>> conversionFactor = 2.831685E+00; :>> isExact = false; } } + attribute 'ton, short (2000 lb)' : MassUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg; :>> conversionFactor = 9.071847E+02; :>> isExact = false; } } + attribute 'ton, short, per cubic yard' : MassDensityUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg/m^3; :>> conversionFactor = 1.186553E+03; :>> isExact = false; } } + attribute 'ton, short, per hour' : MassFlowRateUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = kg/s; :>> conversionFactor = 2.519958E-01; :>> isExact = false; } } + attribute 'unit pole' : MagneticFluxUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = Wb; :>> conversionFactor = 1.256637E-07; :>> isExact = false; } } + attribute <'W/in²'> 'watt per square inch' : DensityOfHeatFlowRateUnit = W/'in'^2; + attribute 'yard' : LengthUnit { :>> unitConversion: ConversionByConvention { :>> referenceUnit = m; :>> conversionFactor = 9.144E-01; } } + + + attribute <'°F_abs'> 'degree fahrenheit (absolute temperature scale)' : IntervalScale { + doc + /* + * degree Fahrenheit interval scale for absolute (thermodynamic) temperature quantities + * + * The interval scale is defined with an explicit transformation with respect to + * the kelvin thermodynamic temperature scale that specifies the zero shift. + */ + + :>> unit = '°F'; + private attribute temperatureWaterAtFreezingPointInF: DefinitionalQuantityValue { + :>> num = 32.0; + :>> definition = "temperature in degree Fahrenheit of pure water at freezing point"; + } + private attribute fahrenheitToCelsiusScaleMapping: QuantityValueMapping { + :>> mappedQuantityValue = temperatureWaterAtFreezingPointInF; + :>> referenceQuantityValue = '°C_abs'.temperatureWaterAtFreezingPointInC; + + } + attribute :>> definitionalQuantityValues = temperatureWaterAtFreezingPointInF; + attribute :>> quantityValueMapping = fahrenheitToCelsiusScaleMapping; + + /* CoordinateFramePlacement (zero shift) w.r.t. the kelvin thermodynamic temperature scale */ + private attribute zeroDegreeFahrenheitInKelvin: ThermodynamicTemperatureValue = 229835/900 [K]; + attribute zeroDegreeFahrenheitToKelvinShift : CoordinateFramePlacement :>> transformation { + :>> source = K; :>> origin = zeroDegreeFahrenheitInKelvin; + } + } +} diff --git a/src/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml b/src/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml new file mode 100644 index 0000000000000000000000000000000000000000..16ed8b0c8389266d703140957482e4d732e63b2a --- /dev/null +++ b/src/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml @@ -0,0 +1,62 @@ +standard library package VectorCalculations { + doc + /* + * This package package defines calculations for the construction of and computations on VectorQuantityValues. + */ + + private import ScalarValues::Boolean; + private import ScalarValues::Number; + private import Quantities::ScalarQuantityValue; + private import Quantities::VectorQuantityValue; + private import MeasurementReferences::VectorMeasurementReference; + private import MeasurementReferences::CoordinateTransformation; + + calc def '[' :> BaseFunctions::'[' { + in elements: Number[1..n] ordered; + in mRef: VectorMeasurementReference[1]; + return quantity : VectorQuantityValue[1]; + private attribute n = mRef.flattenedSize; + } + + calc def isZeroVectorQuantity :> VectorFunctions::isZeroVector { + in : VectorQuantityValue[1]; + return : Boolean[1]; + } + calc def isUnitVectorQuantity { + in : VectorQuantityValue[1]; + return : Boolean[1]; + } + + /* Addition and subtraction */ + calc def '+' :> VectorFunctions::'+' { in : VectorQuantityValue[1]; in : VectorQuantityValue[1]; return : VectorQuantityValue[1]; } + calc def '-' :> VectorFunctions::'-' { in : VectorQuantityValue[1]; in : VectorQuantityValue[1]; return : VectorQuantityValue[1]; } + + /* Multiplication and division */ + calc def scalarVectorMult :> VectorFunctions::scalarVectorMult { in : Number[1]; in : VectorQuantityValue[1]; return : VectorQuantityValue[1]; } + calc def vectorScalarMult :> VectorFunctions::vectorScalarMult { in : VectorQuantityValue[1]; in : Number[1]; return : VectorQuantityValue[1]; } + calc def scalarQuantityVectorMult { in : ScalarQuantityValue[1]; in : VectorQuantityValue[1]; return : VectorQuantityValue[1]; } + calc def vectorScalarQuantityMult { in : VectorQuantityValue[1]; in : ScalarQuantityValue[1]; return : VectorQuantityValue[1]; } + calc def vectorScalarDiv :> VectorFunctions::vectorScalarDiv { in : VectorQuantityValue[1]; in : Number[1]; return : VectorQuantityValue[1]; } + calc def vectorScalarQuantityDiv { in : VectorQuantityValue[1]; in : ScalarQuantityValue[1]; return : VectorQuantityValue[1]; } + calc def inner :> VectorFunctions::inner { in : VectorQuantityValue[1]; in : VectorQuantityValue[1]; return : Number[1]; } + calc def outer { in : VectorQuantityValue[1]; in : VectorQuantityValue[1]; return : VectorQuantityValue[1]; } + + alias '*' for scalarVectorMult; + + /* Norm and angle */ + calc def norm :> VectorFunctions::norm { in : VectorQuantityValue[1]; return : Number[1]; } + calc def angle :> VectorFunctions::angle { in : VectorQuantityValue[1]; in : VectorQuantityValue[1]; return : Number[1]; } + + /* Coordinate transformation */ + calc def transform { + in transformation : CoordinateTransformation; + in sourceVector : VectorQuantityValue { + :>> mRef = transformation.source; + } + return targetVector : VectorQuantityValue { + :>> mRef = transformation.target { + :>> dimensions = sourceVector.mRef.dimensions; + } + } + } +} diff --git a/src/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml b/src/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml new file mode 100644 index 0000000000000000000000000000000000000000..2c279402bb5891047e03faa16c48c8201f3cb8b9 --- /dev/null +++ b/src/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml @@ -0,0 +1,61 @@ +standard library package DerivationConnections { + doc + /* + * This package provides a library model for derivation connections between requirements. + */ + + private import SequenceFunctions::excludes; + private import ControlFunctions::allTrue; + + requirement originalRequirements[*] { + doc /* originalRequirements are the original requirements in Derivation connections. */ + } + requirement derivedRequirements[*] { + doc /* derivedRequirements are the derived requirments in Derivation connections. */ + } + + abstract connection def Derivation { + doc + /* + * A Derivation connection asserts that one or more derivedRequirements are derived from + * a single originalRequirement. This means that any subject that satisfies the + * originalRequirement should, in itself or though other things related to it, satisfy + * each of the derivedRequirements. + * + * A connection usage typed by Derivation must have requirement usages for all its ends. + * The single end for the originalRequirement should subset originalRequirement, while + * the rest of the ends should subset derivedRequirements. + */ + + ref requirement :>> participant { + doc /* All the participants in a Derivation must be requirements. */ + } + + ref requirement originalRequirement[1] :>> originalRequirements :> participant { + doc /* The single original requirement. */ + } + ref requirement :>> derivedRequirements[1..*] :> participant { + doc /* The one or more requirements that are derived from the original requirement. */ + } + + private assert constraint originalNotDerived { + doc /* The original requirement must not be a derived requirement. */ + + derivedRequirements->excludes(originalRequirement) + } + + private assert constraint originalImpliesDerived { + doc + /* + * Whenever the originalRequirement is satisfied, all of the derivedRequirements must also + * be satisfied. + */ + + originalRequirement.result implies allTrue(derivedRequirements.result) + } + } + + abstract connection derivations : Derivation[*] { + doc /* derivations is the base feature for Derivation connection usages. */ + } +} \ No newline at end of file diff --git a/src/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml b/src/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml new file mode 100644 index 0000000000000000000000000000000000000000..51c76dc122effa7711384026a7a21d0fccf2108c --- /dev/null +++ b/src/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml @@ -0,0 +1,39 @@ +standard library package RequirementDerivation { + doc /* This package provides language-extension metadata for modeling requirement derivation. */ + + public import DerivationConnections::*; + private import Metaobjects::SemanticMetadata; + + metadata def OriginalRequirementMetadata :> SemanticMetadata { + doc + /* + * OriginalRequirementMetadata identifies a usage as an original requirement. + * It is intended to be used to tag the original requirement end of a Derivation. + */ + + :> annotatedElement : SysML::Usage; + :>> baseType = originalRequirements meta SysML::Usage; + } + + metadata def DerivedRequirementMetadata :> SemanticMetadata { + doc + /* + * DerivedRequirementMetadata identifies a usage as a derived requirement. + * It is intended to be used to tag the derived requirement ends of a Derivation. + */ + + :> annotatedElement : SysML::Usage; + :>> baseType = derivedRequirements meta SysML::Usage; + } + + metadata def DerivationMetadata :> SemanticMetadata { + doc + /* + * DerivationMetadata is SemanticMetadata for a Derivation connection. + */ + + :> annotatedElement : SysML::ConnectionDefinition; + :> annotatedElement : SysML::ConnectionUsage; + :>> baseType = derivations meta SysML::Usage; + } +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Actions.sysml b/src/sysml.library/Systems Library/Actions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..7bd025807054da14a6f65ba6b782b57d1ec03171 --- /dev/null +++ b/src/sysml.library/Systems Library/Actions.sysml @@ -0,0 +1,505 @@ +standard library package Actions { + doc + /* + * This package defines the base types for actions and related behavioral elements in the + * SysML language. + */ + + private import Base::Anything; + private import ScalarValues::Positive; + private import ScalarValues::Natural; + private import SequenceFunctions::size; + private import SequenceFunctions::isEmpty; + private import Occurrences::Occurrence; + private import Occurrences::HappensWhile; + private import Performances::Performance; + private import Performances::performances; + private import Transfers::SendPerformance; + private import Transfers::sendPerformances; + private import Transfers::AcceptPerformance; + private import Transfers::acceptPerformances; + private import FeatureReferencingPerformances::FeatureWritePerformance; + private import ControlPerformances::MergePerformance; + private import ControlPerformances::DecisionPerformance; + private import ControlPerformances::IfThenPerformance; + private import ControlPerformances::IfThenElsePerformance; + private import ControlPerformances::LoopPerformance; + private import TransitionPerformances::TransitionPerformance; + private import TransitionPerformances::NonStateTransitionPerformance; + private import Transfers::MessageTransfer; + private import Connections::MessageConnection; + + abstract action def Action :> Performance { + doc + /* + * Action is the most general class of Performances of ActionDefinitions in a system or + * part of a system. Action is the base class of all ActionDefinitions. + */ + + ref action self: Action :>> Performance::self; + ref action incomingTransfers :>> Performance::incomingTransfers; + + action start: Action :>> startShot { + doc + /* + * The starting snapshot of an Action. + */ + } + + action done: Action :>> endShot { + doc + /* + * The ending snapshot of an Action. + */ + } + + action subactions: Action[0..*] :> actions, subperformances { + doc + /* + * The subperformances of this Action that are Actions. + */ + + ref occurrence :>> this = (that as Action).this { + doc + /* + * The "this" reference of a subaction is always the same as that of + * its owning Action. + */ + } + } + + action sendSubactions: SendAction[0..*] :> subactions, sendActions { + doc + /* + * The subactions of this Action that are SendActions. + */ + } + + action acceptSubactions: AcceptAction[0..*] :> subactions, acceptActions { + doc + /* + * The subactions of this Action that are AcceptActions. + */ + } + + abstract action controls : ControlAction[0..*] :> subactions { + doc + /* + * The subactions of this Action that are ControlActions. + */ + } + + abstract action merges : MergeAction[0..*] :> controls { + doc + /* + * The controls of this Action that are MergeActions. + */ + } + + abstract action decisions : DecisionAction :> controls { + doc + /* + * The controls of this Action that are DecisionActions. + */ + } + + abstract action joins : JoinAction :> controls { + doc + /* + * The controls of this Action that are JoinActions. + */ + } + + abstract action forks : ForkAction :> controls { + doc + /* + * The controls of this Action that are ForkActions. + */ + } + + abstract action transitions : TransitionAction[0..*] :> subactions, transitionActions { + doc + /* + * The subactions of this Action that are TransitionActions. + */ + } + + abstract action decisionTransitions : DecisionTransitionAction[0..*] :> transitions { + doc + /* + * The subactions of this Action that are DecisionTransitionActions. + */ + } + + abstract action assignments : AssignmentAction[0..*] :> subactions, assignmentActions { + doc + /* + * The subactions of this Action that are AssignmentActions. + */ + } + + abstract action ifSubactions : IfThenAction[0..*] :> subactions, ifThenActions { + doc + /* + * The subactions of this Action that are IfThenActions (including IfThenElseActions). + */ + } + + abstract action loops : LoopAction[0..*] :> subactions, loopActions { + doc + /* + * The subactions of this Action that are LoopActions. + */ + } + + abstract action whileLoops : WhileLoopAction[0..*] :> loops, whileLoopActions { + doc + /* + * The loops of this Action that are WhileLoopActions. + */ + } + + abstract action forLoops : ForLoopAction[0..*] :> loops, forLoopActions { + doc + /* + * The loops of this Action that are ForLoopActions. + */ + } + } + + abstract action actions: Action[0..*] nonunique :> performances { + doc + /* + * actions is the base feature for all ActionUsages. + */ + } + + action def SendAction :> Action, SendPerformance { + doc + /* + * A SendAction is an Action used to type SendActionUsages. It initiates an outgoingTransferFromSelf + * from a designated sender Occurrence with a given payload, optionally to a designated receiver. + */ + + in payload :>> sentItem; + ref sentMessage :>> sentTransfer: MessageTransfer, MessageConnection; + } + + abstract action sendActions: SendAction[0..*] nonunique :> actions, sendPerformances { + doc + /* + * sendActions is the base feature for all SendActionUsages. + */ + } + + action def AcceptMessageAction :> Action, AcceptPerformance { + doc + /* + * An AcceptMessageAction is an Action that identifies an incomingTransferToSelf + * of a designated receiver Occurrence, providing its payload as output. + */ + inout payload :>> acceptedItem; + ref acceptedMessage :>> acceptedTransfer: MessageTransfer, MessageConnection; + } + + action def AcceptAction :> AcceptMessageAction { + doc + /* + * An AcceptAction is an AcceptMessageAction used to type AcceptActionUsages that are + * not accepters for TransitionActions. It waits for a payload or message of the specified + * kind to be accepted by a nested state transition. + */ + ref :>> acceptedMessage = aState.aTransition.accepter.acceptedMessage; + state aState { + transition aTransition first start accept apayload: Anything via receiver then done; + } + bind payload = aState.aTransition.apayload; + } + + abstract action acceptActions: AcceptAction[0..*] nonunique :> actions, acceptPerformances { + doc + /* + * acceptActions is the base feature for standalone AcceptActionUsages. + */ + } + + abstract action def ControlAction :> Action { + doc + /* + * A ControlAction is the Action of a control node, which has no inherent behavior. + */ + + bind start = done { + doc + /* + * A ControlAction is instantaneous. + */ + } + } + + action def MergeAction :> ControlAction, MergePerformance { + doc + /* + * A MergeAction is the ControlAction for a merge node. + * + * Note: Incoming succession connectors to a MergeAction must have source multiplicity + * 0..1 and subset the incomingHBLink feature inherited from MergePerformance. + */ + } + + action def DecisionAction :> ControlAction, DecisionPerformance { + doc + /* + * A DecisionAction is the ControlAction for a decision node. + * + * Note: Outgoing succession connectors from a DecisionAction must have target multiplicity + * 0..1 and subset the outgoingHBLink feature inherited from DecisionPerformance. + * If an outgoing succession has a guard, it should have a transitionStep typed by + * DecisionTransition. + */ + } + + action def JoinAction :> ControlAction { + doc + /* + * A JoinAction is the ControlAction for a JoinNode. + * + * Note: Join behavior results from requiring that the source multiplicity of all + * incoming succession connectors be 1..1. + */ + } + + action def ForkAction :> ControlAction { + doc + /* + * A ForkAction is the ControlAction for a ForkNode. + * + * Note: Fork behavior results from requiring that the target multiplicity of all + * outgoing succession connectors be 1..1. + */ + } + + abstract action def TransitionAction :> Action, TransitionPerformance { + doc + /* + * A TransitionAction is a TransitionPerformance with an Action as transitionLinkSource. + * It is the base type of all TransitionUsages. + */ + + in transitionLinkSource : Action :>> TransitionPerformance::transitionLinkSource; + ref acceptedMessage : MessageConnection :>> trigger; + + ref receiver :>> triggerTarget; + + action accepter : AcceptMessageAction :>> 'accept'; + + bind receiver = accepter.receiver; + bind acceptedMessage = accepter.acceptedMessage; + + action effect: Action :>> TransitionPerformance::effect; + } + + action def DecisionTransitionAction :> TransitionAction, NonStateTransitionPerformance { + doc + /* + * A DecisionTransitionAction is a TransitionAction and NonStateTransitionPerformance that has a + * guard, but no trigger or effects. It is the base type of TransitionUsages used as + * conditional successions in action models. + */ + + ref action :>> accepter[0..0]; + ref action :>> effect[0..0]; + } + + abstract action transitionActions: TransitionAction[0..*] nonunique :> actions { + doc + /* + * transitionActions is the base feature for all TransitionUsages. + */ + } + + action def AssignmentAction :> FeatureWritePerformance, Action { + doc + /* + * An AssignmentAction is an Action, used to type an AssignmentActionUsage. It is also a + * FeatureWritePerformance that updates the accessedFeature of its target Occurrence with + * the given replacementValues. + */ + + in target : Occurrence[1]; + inout replacementValues : Anything[0..*] nonunique; + } + + abstract action assignmentActions : AssignmentAction[0..*] nonunique :> actions { + doc + /* + * assignmentActions is the base feature for all AssignmentActionsUsages. + */ + + in :>> target : Occurrence[1] default that as Occurrence { + doc + /* + * The default target for assignmentActions is its featuring instance (if that is + * an Occurrence). + */ + } + } + + action def IfThenAction :> Action, IfThenPerformance { + doc + /* + * An IfThenAction is a Kernel IfThenPerformance that is also an Action. + * It is the base type for all IfActionUsages. + */ + + in :>> ifTest[1]; + in action :>> thenClause[0..1]; + } + + action def IfThenElseAction :> IfThenAction, IfThenElsePerformance { + doc + /* + * An IfThenElseAction is a Kernel IfThenElsePeformance that is also an IfThenAction. + * It is the base type for all IfActionUsages that have an elseAction. + */ + + in :>> ifTest[1]; + in action :>> thenClause[0..1]; + in action :>> elseClause[0..1]; + } + + abstract action ifThenActions : IfThenAction[0..*] nonunique :> actions { + doc + /* + * ifThenActions is the base feature for all IfActionUsages. + */ + } + + abstract action ifThenElseActions : IfThenElseAction[0..*] nonunique :> actions { + doc + /* + * ifThenElseActions is the base feature for all IfActionUsages that have an elseAction. + */ + } + + abstract action def LoopAction :> Action { + doc + /* + * A LoopAction is the base type for all LoopActionUsages. + */ + + + in action body[0..*] { + doc + /* + * The action that is performed repeatedly in the loop. + */ + } + } + + action def WhileLoopAction :> LoopAction, LoopPerformance { + doc + /* + * A WhileLoopAction is a Kernel LoopPerformance that is also a LoopAction. + * It is the base type for all WhileLoopActionUsages. + */ + + in :>> whileTest default {true} { + doc + /* + * A Boolean expression that must be true for the loop to continue. + * It is evaluated before the body is performed and is always evaluated at + * least once. + */ + } + + in action body :>> LoopAction::body, LoopPerformance::body { + doc + /* + * The action that is performed while the whileTest is true and the + * untilTest is false. + */ + } + + in :>> untilTest default {false} { + doc + /* + * A Boolean expression that must be false for the loop to continue. + * It is evaluated after the body is performed. + */ + } + } + + private abstract action def ForLoopActionBase :> LoopAction { + in action body; + in ref seq[0..*] ordered nonunique; + } + + action def ForLoopAction :> ForLoopActionBase { + doc + /* + * A ForLoopAction is a LoopAction that iterates over an ordered sequence of values. + * It is the base type for all ForLoopActionUsages. + */ + + protected ref var[0..1] :> seq { + doc + /* + * The loop variable that is assigned successive elements of seq on each + * iteration of the loop. + */ + } + + in ref :>> seq { + doc + /* + * The sequence of values over which the loop iterates. + */ + } + + in action :>> body { + doc + /* + * The action that is performed on each iteration of the loop. + */ + } + + private attribute index : Positive { + doc + /* + * The index of the element of seq assigned to var on the current iteration + * of the loop. + */ + } + + private action initialization + assign index := 1; + then private action whileLoop + while index <= size(seq) { + assign var := seq#(index); + then perform body; + then assign index := index + 1; + } + } + + abstract action loopActions : LoopAction[0..*] nonunique :> actions { + doc + /* + * loopActions is the base feature for all LoopActionUsages. + */ + } + + abstract action whileLoopActions : WhileLoopAction[0..*] nonunique :> loopActions { + doc + /* + * whileLoopActions is the base feature for all WhileLoopActionUsages. + */ + } + + abstract action forLoopActions : ForLoopAction[0..*] nonunique :> loopActions { + doc + /* + * forLoopActions is the base feature for all ForLoopActionUsages. + */ + } +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Allocations.sysml b/src/sysml.library/Systems Library/Allocations.sysml new file mode 100644 index 0000000000000000000000000000000000000000..a3ab8a890aeaaa252394ec63254ff022c386fefa --- /dev/null +++ b/src/sysml.library/Systems Library/Allocations.sysml @@ -0,0 +1,29 @@ +standard library package Allocations { + doc + /* + * This package defines the base types for allocations and related structural elements + * in the SysML language. + */ + + private import Base::Anything; + private import Connections::*; + + allocation def Allocation :> BinaryConnection { + doc + /* + * Allocation is the most general class of allocation, represented as a connection + * between the source of the allocation and the target. Allocation is the base type + * of all AllocationDefinitions. + */ + + end source: Anything[0..*] :>> BinaryConnection::source; + end target: Anything[0..*] :>> BinaryConnection::target; + } + + abstract allocation allocations: Allocation[0..*] nonunique :> binaryConnections { + doc + /* + * allocations is the base feature of all AllocationUsages. + */ + } +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/AnalysisCases.sysml b/src/sysml.library/Systems Library/AnalysisCases.sysml new file mode 100644 index 0000000000000000000000000000000000000000..6af7c0418ca5128358f72810a37d0dd632d86ec1 --- /dev/null +++ b/src/sysml.library/Systems Library/AnalysisCases.sysml @@ -0,0 +1,38 @@ +standard library package AnalysisCases { + doc + /* + * This package defines the base types for analysis cases and related behavioral elements + * in the SysML language. + */ + + private import Performances::Evaluation; + private import Performances::evaluations; + private import Calculations::Calculation; + private import Cases::Case; + private import Cases::cases; + + abstract analysis def AnalysisCase :> Case { + doc + /* + * AnalysisCase is the most general class of performances of AnalysisCaseDefinitions. + * AnalysisCase is the base class of all AnalysisCaseDefinitions. + */ + + ref analysis self : AnalysisCase :>> Case::self; + subject subj :>> Case::subj; + + abstract analysis subAnalysisCases : AnalysisCase[0..*] :> analysisCases, subcases { + doc + /* + * Other AnalysisCases carried out as part of the performance of this AnalysisCase. + */ + } + } + + abstract analysis analysisCases : AnalysisCase[0..*] nonunique :> cases { + doc + /* + * analysisCases is the base feature of all AnalysisCaseUsages. + */ + } +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Attributes.sysml b/src/sysml.library/Systems Library/Attributes.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8562b0153f70a73450c214da87401961cd3ff826 --- /dev/null +++ b/src/sysml.library/Systems Library/Attributes.sysml @@ -0,0 +1,25 @@ +standard library package Attributes { +doc +/* + * This package defines the base types for attributes and related structural elements + * in the SysML language. + */ + + private import Base::DataValue; + private import Base::dataValues; + + alias AttributeValue for DataValue { + doc + /* + * AttributeValue is the most general type of data values that represent qualities or characteristics + * of a system or part of a system. AttributeValue is the base type of all AttributeDefinitions. + */ + } + + alias attributeValues for dataValues { + doc + /* + * attributeValues is the base feature for all AttributeUsages. + */ + } +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Calculations.sysml b/src/sysml.library/Systems Library/Calculations.sysml new file mode 100644 index 0000000000000000000000000000000000000000..598ed1e4c5e41a08726b09d1f556e34b1acd8cc4 --- /dev/null +++ b/src/sysml.library/Systems Library/Calculations.sysml @@ -0,0 +1,37 @@ +standard library package Calculations { + doc + /* + * This package defines the base types for calculations and related behavioral elements in the + * SysML language. + */ + + private import Performances::Evaluation; + private import Performances::evaluations; + private import Actions::Action; + private import Actions::actions; + + abstract calc def Calculation :> Action, Evaluation { + doc + /* + * Calculation is the most general class of evaluations of CalculationDefinitions in a + * system or part of a system. Calculation is the base class of all CalculationDefinitions. + */ + + ref calc self: Calculation :>> Action::self, Evaluation::self; + + abstract calc subcalculations: Calculation :> calculations, subactions { + doc + /* + * The subactions of this Calculation that are Calculations. + */ + } + + } + + abstract calc calculations: Calculation[0..*] nonunique :> actions, evaluations { + doc + /* + * calculations is the base Feature for all CalculationUsages. + */ + } +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Cases.sysml b/src/sysml.library/Systems Library/Cases.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f934b48e7e3be0c5ce5bb10489b15b6fc08d0429 --- /dev/null +++ b/src/sysml.library/Systems Library/Cases.sysml @@ -0,0 +1,71 @@ +standard library package Cases { + doc + /* + * This package defines the base types for cases and related behavioral elements + * in the SysML language. + */ + + private import Base::Anything; + private import Requirements::RequirementCheck; + private import Calculations::Calculation; + private import Calculations::calculations; + private import Parts::Part; + private import Parts::parts; + + abstract case def Case :> Calculation { + doc + /* + * Case is the most general class of performances of CaseDefinitions. + * Case is the base class of all CaseDefinitions. + */ + + ref case self : Case :>> Calculation::self; + + subject subj : Anything[1] { + doc + /* + * The subject that was investigated by this Case. + */ + } + + ref part actors : Part[0..*] :> parts { + doc + /* + * The Parts that fill the role of actors for this Case. + * (Note: This is not itself an actor parameter, because specific actor + * parameters will be added for specific Cases.) + */ + } + + objective obj : RequirementCheck[1] { + doc + /* + * A check of whether the objective RequirementUsage was satisfied for this Case. + */ + + subject subj default Case::result; + } + + return ref result[0..*] { + doc + /* + * The result determined by the case, which should satisfy the case objective. + */ + } + + abstract case subcases : Case[0..*] :> cases, subcalculations { + doc + /* + * Other Cases carried out as part of the performance of this Case. + */ + } + + } + + abstract case cases : Case[0..*] nonunique :> calculations { + doc + /* + * cases is the base Feature of all CaseUsages. + */ + } +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Connections.sysml b/src/sysml.library/Systems Library/Connections.sysml new file mode 100644 index 0000000000000000000000000000000000000000..b3d49c583e27bd083e631e29fb85d73d02db90eb --- /dev/null +++ b/src/sysml.library/Systems Library/Connections.sysml @@ -0,0 +1,153 @@ +standard library package Connections { + doc + /* + * This package defines the base types for connections and related structural elements + * in the SysML language. + */ + + private import Base::Anything; + private import Occurrences::Occurrence; + private import Occurrences::HappensDuring; + private import Objects::LinkObject; + private import Objects::linkObjects; + private import Objects::BinaryLinkObject; + private import Objects::binaryLinkObjects; + private import Transfers::Transfer; + private import Transfers::transfers; + private import Transfers::FlowTransfer; + private import Transfers::flowTransfers; + private import Transfers::FlowTransferBefore; + private import Transfers::flowTransfersBefore; + private import ScalarValues::Natural; + private import Parts::Part; + private import Parts::parts; + private import Actions::Action; + private import Actions::actions; + + abstract connection def Connection :> LinkObject, Part { + doc + /* + * Connection is the most general class of links between things within some + * containing structure. Connection is the base type of all ConnectionDefinitions. + */ + } + + abstract connection def BinaryConnection :> Connection, BinaryLinkObject { + doc + /* + * BinaryConnection is the most general class of binary links between two things + * within some containing structure. BinaryConnection is the base type of all + * ConnectionDefinitions with exactly two ends. + */ + + end source: Anything[0..*] :>> BinaryLinkObject::source; + end target: Anything[0..*] :>> BinaryLinkObject::target; + } + + abstract flow def MessageConnection :> BinaryConnection, Transfer, Action { + doc + /* + * MessageConnection is the class of binary connections that represent a transfer + * of objects or values between two occurrences. It is the base type of all + * FlowConnectionDefinitions. + */ + + end occurrence source: Occurrence[0..*] :>> BinaryConnection::source, Transfer::source; + end occurrence target: Occurrence[0..*] :>> BinaryConnection::target, Transfer::target; + + ref payload :>> 'item'; + + private ref part thisConnection = self; + + in event occurrence sourceEvent [1] default thisConnection.start { + doc + /* + * An occurrence happening during the source of this flow connection + * that is either the start of the connection or happens before it. + */ + } + in event occurrence targetEvent [1] default thisConnection.done { + doc + /* + * An occurrence happening during the target of this flow connection + * that is either the end of the connection or happens after it. + */ + } + + connection :HappensDuring connect sourceEvent to source[1]; + connection :HappensDuring connect targetEvent to target[1]; + + private attribute seBeforeNum: Natural[1] = if sourceEvent==thisConnection.start ? 0 else 1; + private attribute teAfterNum: Natural[1] = if targetEvent==thisConnection.done ? 0 else 1; + succession [seBeforeNum] first sourceEvent[0..1] then self[0..1]; + succession [teAfterNum] first self[0..1] then targetEvent[0..1]; + } + + abstract flow def FlowConnection :> MessageConnection, FlowTransfer { + doc + /* + * FlowConnection is the subclass of message connections that a alsow flow transfers. + * It is the base type for FlowConnectionUsages that identify their source output and + * target input. + */ + + end occurrence source: Occurrence[0..*] :>> MessageConnection::source, FlowTransfer::source; + end occurrence target: Occurrence[0..*] :>> MessageConnection::target, FlowTransfer::target; + } + + abstract flow def SuccessionFlowConnection :> FlowConnection, FlowTransferBefore { + doc + /* + * SuccessionFlowConnection is the subclass of flow connections that represent + * temporally ordered transfers. It is the base type for all SuccessionFlowConnectionUsages. + */ + + end occurrence source: Occurrence[0..*] :>> FlowConnection::source, FlowTransferBefore::source; + end occurrence target: Occurrence[0..*] :>> FlowConnection::target, FlowTransferBefore::target; + } + + abstract connection connections: Connection[0..*] nonunique :> linkObjects, parts { + doc + /* + * connections is the base feature of all ConnectionUsages. + */ + } + + abstract connection binaryConnections: Connection[0..*] nonunique :> connections, binaryLinkObjects { + doc + /* + * binaryConnections is the base feature of all binary ConnectionUsages. + */ + } + + abstract message messageConnections: MessageConnection[0..*] nonunique :> binaryConnections, transfers, actions { + doc + /* + * messageConnections is the base feature of all FlowConnectionUsages. + */ + + end occurrence source: Occurrence[0..*] :>> MessageConnection::source, binaryConnections::source, transfers::source; + end occurrence target: Occurrence[0..*] :>> MessageConnection::target, binaryConnections::target, transfers::target; + } + + abstract message flowConnections: FlowConnection[0..*] nonunique :> messageConnections, flowTransfers { + doc + /* + * flowConnections is the base feature of all FlowConnectionUsages that identify their source output + * and target input. + */ + + end occurrence source: Occurrence[0..*] :>> FlowConnection::source, messageConnections::source, flowTransfers::source; + end occurrence target: Occurrence[0..*] :>> FlowConnection::target, messageConnections::target, flowTransfers::target; + } + + abstract message successionFlowConnections: SuccessionFlowConnection[0..*] nonunique :> flowConnections, flowTransfersBefore { + doc + /* + * successionFlowConnections is the base feature of all SuccessionFlowConnectionUsages. + */ + + end occurrence source: Occurrence[0..*] :>> SuccessionFlowConnection::source, flowConnections::source, flowTransfersBefore::source; + end occurrence target: Occurrence[0..*] :>> SuccessionFlowConnection::target, flowConnections::target, flowTransfersBefore::target; + } +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Constraints.sysml b/src/sysml.library/Systems Library/Constraints.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8f4b6060f4e5cbb041989ef02f6fa64ecc329012 --- /dev/null +++ b/src/sysml.library/Systems Library/Constraints.sysml @@ -0,0 +1,44 @@ +standard library package Constraints { + doc + /* + * This package defines the base types for constraints and related elements in the + * SysML language. + */ + + private import Performances::BooleanEvaluation; + private import Performances::booleanEvaluations; + private import Performances::trueEvaluations; + private import Performances::falseEvaluations; + + abstract constraint def ConstraintCheck :> BooleanEvaluation { + doc + /* + * ConstraintCheck is the most general class for constraint checking. ConstraintCheck is the base + * type of all ConstraintDefinitions. + */ + + ref constraint self: ConstraintCheck :>> BooleanEvaluation::self; + } + + abstract constraint constraintChecks: ConstraintCheck[0..*] nonunique :> booleanEvaluations { + doc + /* + * constraintChecks is the base feature of all ConstraintUsages. + */ + } + + abstract constraint assertedConstraintChecks :> constraintChecks, trueEvaluations { + doc + /* + * assertedConstraintChecks is the subset of constraintChecks for ConstraintChecks asserted to be true. + */ + } + + abstract constraint negatedConstraintChecks :> constraintChecks, falseEvaluations { + doc + /* + * negatedConstraintChecks is the subset of constraintChecks for ConstraintChecks asserted to be false. + */ + } + +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Interfaces.sysml b/src/sysml.library/Systems Library/Interfaces.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4e606d689b48723dadf8242d156756f4f65727fe --- /dev/null +++ b/src/sysml.library/Systems Library/Interfaces.sysml @@ -0,0 +1,48 @@ +standard library package Interfaces { + doc + /* + * This package defines the base types for interfaces and related structural elements in the SysML language. + */ + + private import Connections::Connection; + private import Connections::connections; + private import Connections::BinaryConnection; + private import Connections::binaryConnections; + private import Ports::Port; + + abstract interface def Interface :> Connection { + doc + /* + * Interface is the most general class of links between Ports on Parts + * within some containing structure. Interface is the base type of all + * InterfaceDefinitions. + */ + } + + abstract interface def BinaryInterface :> Interface, BinaryConnection { + doc + /* + * BinaryInterface is the most general class of links between two Ports + * on Parts within some containing structure. BinaryInterface is the base + * type of all binary InterfaceDefinitions with exactly two ends. + */ + + end source: Port[0..*] :>> BinaryConnection::source; + end target: Port[0..*] :>> BinaryConnection::target; + } + + abstract interface interfaces: Interface[0..*] nonunique :> connections { + doc + /* + * interfaces is the base feature of all InterfaceUsages. + */ + } + + abstract interface binaryInterfaces: BinaryInterface[0..*] nonunique :> interfaces, binaryConnections { + doc + /* + * interfaces is the base feature of all binary InterfaceUsages. + */ + } + +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Items.sysml b/src/sysml.library/Systems Library/Items.sysml new file mode 100644 index 0000000000000000000000000000000000000000..0159f5c31c749be412eb56d19abcab8f138681cc --- /dev/null +++ b/src/sysml.library/Systems Library/Items.sysml @@ -0,0 +1,149 @@ +standard library package Items { + doc + /* + * This package defines the base types for items and related structural elements in the + * SysML language. + */ + + private import Objects::Object; + private import Objects::objects; + private import Parts::Part; + private import Parts::parts; + private import Occurrences::HappensWhile; + private import Occurrences::JustOutsideOf; + private import Objects::StructuredSpaceObject; + private import Constraints::ConstraintCheck; + private import Constraints::constraintChecks; + private import CollectionFunctions::contains; + private import SequenceFunctions::isEmpty; + private import SequenceFunctions::notEmpty; + private import SequenceFunctions::includes; + private import SequenceFunctions::union; + private import ControlFunctions::forAll; + + abstract item def Item :> Object { + doc + /* + * Item is the most general class of objects that are part of, exist in or flow through a system. + * Item is the base type of all ItemDefinitions. + */ + + ref self: Item :>> Object::self; + + item start: Item :>> startShot; + item done: Item :>> endShot; + + item shape : Item :>> spaceBoundary { + doc + /* + * The shape of an Item is its spatial boundary. + */ + } + + item envelopingShapes : Item[0..*] { + doc + /* + * Each enveloping shape is the shape of an Item that spacially overlaps this Item for its + * entire lifetime. + */ + + /* Enables two dimensional items to be enveloped by two or three dimensional shapes. */ + attribute :>> innerSpaceDimension = + if (that as Item).innerSpaceDimension == 3 | (that as Item).outerSpaceDimension == 3? 2 + else (that as Item).outerSpaceDimension - 1 { + doc + /* + * Enables two dimensional items to be enveloped by two or three dimensional shapes. + */ + } + assert constraint { (that as Item).innerSpaceDimension < 3 implies notEmpty(outerSpaceDimension) } + + item envelopingItem [1]; + + assert constraint { + doc + /* + * This constraint prevents an envelopingShape frombeing a portion. + */ + + envelopingItem.shape.spaceTimeCoincidentOccurrences->includes(that) and + envelopingItem.spaceTimeEnclosedOccurrences->includes(that.that) + } + } + + item boundingShapes : StructuredSpaceObject [0..*] :> envelopingShapes { + doc + /* + * envelopingShapes that are structured space objects with every face or every edge + * intersecting this Item. + */ + + item boundingShape: Item :>> self; + + item :>> faces { + item face :>> self; + item inter [1]; + assert constraint { contains(inter.intersectionsOf, union(face, boundingShape)) } + } + item :>> edges { + item edge :>> self; + item inter [1]; + assert constraint { isEmpty(faces) implies + contains(inter.intersectionsOf, union(edge, boundingShape)) } + } + } + + item voids :>> innerSpaceOccurrences [0..*] { + doc + /* + * Voids are inner space occurrences of this Item. + */ + } + + attribute isSolid = isEmpty(voids) { + doc + /* + * An Item is solid if it has no voids. + */ + } + + abstract item subitems: Item[0..*] :> items, subobjects { + doc + /* + * The Items that are composite subitems of this Item. + */ + } + + abstract part subparts: Part[0..*] :> subitems, parts { + doc + /* + * The subitems of this Item that are Parts. + */ + } + + abstract constraint checkedConstraints: ConstraintCheck[0..*] :> constraintChecks, ownedPerformances { + doc + /* + * Constraints that have been checked by this Item. + */ + } + } + + connection def Touches :> JustOutsideOf, HappensWhile { + doc + /* + * Touching items are just outside each other and happen at the same time. + */ + + end item touchedItemToo [0..*] :>> separateSpaceToo, thisOccurrence; + end item touchedItem [0..*] :>> separateSpace, thatOccurrence; + } + + abstract item items : Item[0..*] nonunique :> objects { + doc + /* + * items is the base feature of all ItemUsages. + */ + } + +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Metadata.sysml b/src/sysml.library/Systems Library/Metadata.sysml new file mode 100644 index 0000000000000000000000000000000000000000..be1fa1c9e42dc7608cd3535e910c91befe419e9a --- /dev/null +++ b/src/sysml.library/Systems Library/Metadata.sysml @@ -0,0 +1,30 @@ +standard library package Metadata { +doc +/* + * This package defines the base types for metadata definitions and related + * metadata annotations in the SysML language. + */ + + private import Metaobjects::Metaobject; + private import Metaobjects::metaobjects; + private import Items::Item; + private import Items::items; + + abstract metadata def MetadataItem :> Metaobject, Item { + doc + /* + * MetadataItem is the most general class of Items that represent Metaobjects. + * MetadataItem is the base type of all MetadataDefinitions. + */ + } + + abstract item metadataItems : MetadataItem[0..*] :> metaobjects, items { + doc + /* + * metadataItems is the base feature of all MetadataUsages. + * + * Note: It is not itself a MetadataUsage, because it is not being used as an + * AnnotatingElement here. + */ + } +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Parts.sysml b/src/sysml.library/Systems Library/Parts.sysml new file mode 100644 index 0000000000000000000000000000000000000000..171001571f30e9581d31c9ef678f976f4479c52a --- /dev/null +++ b/src/sysml.library/Systems Library/Parts.sysml @@ -0,0 +1,81 @@ +standard library package Parts { +doc +/* + * This package defines the base types for parts and related structural elements in the + * SysML language. + */ + + private import Objects::Object; + private import Objects::objects; + private import Items::Item; + private import Items::items; + private import Ports::Port; + private import Ports::ports; + private import Actions::Action; + private import Actions::actions; + private import States::StateAction; + private import States::stateActions; + + abstract part def Part :> Item { + doc + /* + * Part is the most general class of objects that represent all or a part of a system. + * Part is the base type of all PartDefinitions. + */ + + ref self: Part :>> Item::self; + + part start: Part :>> Item::start; + part done: Part :>> Item::done; + + abstract port ownedPorts: Port[0..*] :> ports, timeEnclosedOccurrences { + doc + /* + * Ports that are owned by this Part. + */ + } + + abstract ref action performedActions: Action[0..*] :> actions, enactedPerformances { + doc + /* + * Actions that are performed by this Part. + */ + } + + abstract action ownedActions: Action[0..*] :> actions, ownedPerformances { + doc + /* + * Actions that are owned by this Part. + */ + + ref part :>> this : Part = that as Part { + doc + /* + * The "this" reference of an ownedAction is always its owning Part. + */ + } + } + + abstract ref state exhibitedStates: StateAction[0..*] :> stateActions, performedActions { + doc + /* + * StateActions that are exhibited by this Part. + */ + } + + abstract state ownedStates: StateAction[0..*] :> stateActions, ownedActions { + doc + /* + * StateActions that are owned by this Part. + */ + } + } + + abstract part parts: Part[0..*] nonunique :> items { + doc + /* + * parts is the base feature of all part properties. + */ + } + +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Ports.sysml b/src/sysml.library/Systems Library/Ports.sysml new file mode 100644 index 0000000000000000000000000000000000000000..e0bc793e7aa65210772e0cc074055cbab7fe96d4 --- /dev/null +++ b/src/sysml.library/Systems Library/Ports.sysml @@ -0,0 +1,34 @@ +standard library package Ports { + doc + /* + * This package defines the base types for ports and related structural elements + * in the SysML language. + */ + + private import Objects::Object; + private import Objects::objects; + + abstract port def Port :> Object { + doc + /* + * Port is the most general class of objects that represent connection points + * for interacting with a Part. Port is the base type of all PortDefinitions. + */ + + ref self: Port :>> Object::self; + + port subports: Port :> timeEnclosedOccurrences { + doc + /* + * The Ports that are subports of this Port. + */ + } + } + + abstract port ports : Port[0..*] nonunique :> objects { + doc + /* + * ports is the base feature of all PortUsages. + */ + } +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Requirements.sysml b/src/sysml.library/Systems Library/Requirements.sysml new file mode 100644 index 0000000000000000000000000000000000000000..2ea58f6901d20714d0f57dd2765f546b75b5054e --- /dev/null +++ b/src/sysml.library/Systems Library/Requirements.sysml @@ -0,0 +1,194 @@ +standard library package Requirements { + doc + /* + * This package defines the base types for requirements and related elements in the SysML language. + */ + + private import Base::Anything; + private import ScalarValues::String; + private import ControlFunctions::allTrue; + private import Constraints::constraintChecks; + private import Constraints::assertedConstraintChecks; + private import Constraints::negatedConstraintChecks; + private import Parts::Part; + private import Parts::parts; + private import Actions::Action; + private import Interfaces::Interface; + private import Attributes::AttributeValue; + + private abstract constraint def RequirementConstraintCheck { + doc + /* + * RequirementConstraintCheck is the base ConstraintCheck for RequirementCheck, defining the + * separate assumptions and required constraints such that, if all the assumptions are true, + * then all the required constraints must be true. + */ + + constraint assumptions[0..*] :> constraintChecks, subperformances { + doc + /* + * Assumptions that must hold for the required constraints to apply. + */ + } + + constraint constraints[0..*] :> constraintChecks, subperformances { + doc + /* + * The required constraints that are to be checked. + */ + } + + return result = allTrue(assumptions()) implies allTrue(constraints()) { + doc + /* + * If all the assumptions are true, then all the required constraints must hold. + */ + } + } + + abstract requirement def RequirementCheck :> RequirementConstraintCheck { + doc + /* + * RequirementCheck is the most general class for requirements checking. RequirementsCheck is the base + * type of all requirement definitions. + */ + + ref requirement :>> self: RequirementCheck; + + subject subj : Anything[1] { + doc + /* + * The entity that is being checked for satisfaction of the required constraints. + */ + } + + ref part actors : Part[0..*] { + doc + /* + * The Parts that fill the role of actors for this RequirementCheck. + * (Note: This is not itself an actor parameter, because specific actor + * parameters will be added for specific RequirementChecks.) + */ + } + + ref part stakeholders : Part[0..*] { + doc + /* + * The Parts that represent stakeholders interested in the concern being checked. + * (Note: This is not itself a stakeholder parameter, because specific stakeholder + * parameters will be added for specific RequirementChecks.) + */ + } + + /* + * Note: assumptions and constraints are redefined here solely to simplify the + * resolution of their qualified names as library elements. + */ + constraint assumptions :>> RequirementConstraintCheck::assumptions; + constraint constraints :>> RequirementConstraintCheck::constraints; + + abstract requirement subrequirements[0..*] :> requirementChecks, constraints { + doc + /* + * Nested requirements, which are also required constraints. + */ + } + + abstract concern concerns[0..*] :> concernChecks, subrequirements { + doc + /* + * The checks of any concerns being addressed (as required constraints). + */ + } + + } + + requirement def FunctionalRequirementCheck :> RequirementCheck { + doc + /* + * A functional requirement specifies an action that a system, or part of a system, must perform. + */ + + subject: Action; + } + + requirement def InterfaceRequirementCheck :> RequirementCheck { + doc + /* + * An interface requirement specifies an interface for connecting systems and system parts, which + * optionally may include item flows across the interface and/or interface constraints. + */ + + subject: Interface; + } + + requirement def PerformanceRequirementCheck :> RequirementCheck { + doc + /* + * A performance requirement quantitavely measures the extent to which a system, or a system part, + * satisfies a required capability or condition. + */ + + subject: AttributeValue; + } + + requirement def PhysicalRequirementCheck :> RequirementCheck { + doc + /* + * A physical requirement specifies physical characteristics and/or physical constraints of the + * system, or a system part. + */ + + subject: Part; + } + + requirement def DesignConstraintCheck :> RequirementCheck { + doc + /* + * A design constraint specifies a constraint on the implementation of the system or system part, + * such as the system must use a commercial off the shelf component. + */ + + subject: Part; + } + + concern def ConcernCheck :> RequirementCheck { + doc + /* + * ConcernCheck is the most general class for concern checking. ConcernCheck is the base type of + * all ConcernDefinitions. + */ + + ref concern :>> self: ConcernCheck; + + } + + abstract requirement requirementChecks: RequirementCheck[0..*] nonunique :> constraintChecks { + doc + /* + * requirementChecks is the base feature of all requirement usages. + */ + } + + abstract requirement satisfiedRequirementChecks :> requirementChecks, assertedConstraintChecks { + doc + /* + * satisfiedRequirementChecks is the subset of requirementChecks for Requirements asserted to be satisfied. + */ + } + + abstract requirement notSatisfiedRequirementChecks: RequirementCheck[0..*] :> requirementChecks, negatedConstraintChecks { + doc + /* + * notSatisfiedRequirementChecks is the subset of requirementChecks for Requirements asserted to be not satisfied. + */ + } + + abstract concern concernChecks: ConcernCheck[0..*] nonunique :> requirementChecks { + doc + /* + * concernChecks is the base feature of all ConcernUsages. + */ + } + +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/StandardViewDefinitions.sysml b/src/sysml.library/Systems Library/StandardViewDefinitions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..94f975fbe06a0b7ee57a7dfa9ca41ce82d8bd3c3 --- /dev/null +++ b/src/sysml.library/Systems Library/StandardViewDefinitions.sysml @@ -0,0 +1,123 @@ +standard library package StandardViewDefinitions { + doc /* + * This package defines the standard view definitions for the SysML language. + */ + public import SysML::*; + + view def GeneralView { + doc /* + * View definition to present any members of exposed model element(s). + * This is the most general view, enabling presentation of any model element. + * The typical rendering in graphical notation is as a graph of nodes and edges. + * Specializations of GeneralView can be specified through appropriate selection of filters, e.g.: + * - package view, filtering on Package, Package containment, package Import + * - definition and usage view, filtering on Definition, Usage, Specialization, FeatureTyping (covering defined by) + * - requirement view, filtering on RequirementDefinition, RequirementUsage, Specialization, FeatureTyping, + * SatisfyRequirementUsage, AllocationDefinition, AllocationUsage, + * - view and viewpoint view, filtering on ViewDefinition, ViewUsage, ViewpointDefinition, ViewpointUsage, + * RenderingDefinition, RenderingUsage, ConcernDefinition, ConcernUsage, StakeholderMembership, ... + * - language extension view, filtering on Metaclass, MetadataFeature, MetadataAccessExpression, ... + * Note: filters are specified by referencing concepts from the KerML.kerml and SysML.sysml standard library packages. + */ + } + + view def InterconnectionView { + doc /* + * View definition to present exposed features as nodes, nested features as + * nested nodes, and connections between features + * as edges between (nested) nodes. Nested nodes may present boundary features + * (e.g., ports, parameters). + */ + } + + view def ActionFlowView specializes InterconnectionView { + doc /* + * View definition to present connections between actions. + * Valid nodes and edges in an ActionFlowView are: + * - Actions with nested actions + * - Parameters with direction + * - Flow connection usages (e.g., kinds of transfers from output to input) + * - Binding connections between parameters (e.g., delegate a parameter from + * one level of nesting to another) + * - Proxy connection points + * - Swim lanes + * - Conditional succession + * - Control nodes (fork, join, decision, merge) + * - Control structures, e.g., if-then-else, until-while-loop, for-loop + * - Send and accept actions + * - Change and time triggers + * - Compartments on actions and parameters + */ + } + + view def StateTransitionView specializes InterconnectionView { + doc /* + * View definition to present states and their transitions. + * Valid nodes and edges in a StateTransitionView are: + * - States with nested states + * - Entry, do, and exit actions + * - Transition usages with triggers, guards, and actions + * - Compartments on states + */ + } + + view def SequenceView { + doc /* + * View definition to present time ordering of event occurrences on lifelines + * of exposed features. + * Valid nodes and edges in a SequenceView are: + * - Features such as parts with their lifelines + * - Event occurrences on the lifelines + * - Messages sent from one part to another with and without a type of flow + * - Succession between event occurrences + * - Nested sequence view (e.g., a reference to a view) + * - Compartments + * The typical rendering in graphical notation depicts the exposed features + * horizontally along the top, with vertical lifelines. The time axis is + * vertical, with time increasing from top to bottom. + */ + } + + view def GeometryView { + doc /* + * View definition to present a visualization of exposed spatial items in two + * or three dimensions + * Valid nodes and edges in a GeometryView are: + * - Spatial item, including shape + * - Coordinate frame + * - Feature related to spatial item, such as a quantity (e.g. temperature) + * of which values are to be rendered on a color scale + * The typical rendering in graphical notation would include a number of + * visualization parameters, such as: + * - 2D or 3D view + * - viewing direction + * - zoom level + * - light sources + * - object projection mode, e.g., isometric, perspective, orthographic + * - object rendering mode, e.g., shaded, wireframe, hidden line + * - object pan (placement) and rotate (orientation) settings + * - color maps + */ + } + + view def GridView { + doc /* + * View definition to present exposed model elements and their relationships, + * arranged in a rectangular grid. + * GridView is the generalization of the following more specialized views: + * - Tabular view + * - Data value tabular view + * - Relationship matrix view, e.g. presenting allocation or dependency relationships + */ + } + + view def BrowserView { + doc /* + * View definition to present the hierarchical membership structure of model + * elements starting from one or more exposed root elements. + * The typical rendering in graphical notation is as an indented list of rows, + * consisting of dynamically collapsible-expandable nodes that represent + * branches and leaves of the tree, as in graphical user interface widgets. + */ + } +} diff --git a/src/sysml.library/Systems Library/States.sysml b/src/sysml.library/Systems Library/States.sysml new file mode 100644 index 0000000000000000000000000000000000000000..60bf0cbe303e78b4d9bfba580a26b936a30b6a0e --- /dev/null +++ b/src/sysml.library/Systems Library/States.sysml @@ -0,0 +1,101 @@ +standard library package States { + doc + /* + * This package defines the base types for states and related behavioral elements in the + * SysML language. + */ + + private import Occurrences::Occurrence; + private import StatePerformances::StatePerformance; + private import StatePerformances::StateTransitionPerformance; + private import Actions::Action; + private import Actions::TransitionAction; + private import Actions::transitionActions; + private import Actions::AcceptAction; + private import Actions::actions; + private import SequenceFunctions::notEmpty; + private import SequenceFunctions::size; + + abstract state def StateAction :> Action, StatePerformance { + doc + /* + * A StateAction is a kind of Action that is also a StatePerformance. It is the base type for all + * StateDefinitions. + */ + + entry action entryAction :>> 'entry'; + do action doAction: Action :>> 'do'; + exit action exitAction: Action :>> 'exit'; + + attribute :>> isTriggerDuring; + + ref state self: StateAction :>> Action::self, StatePerformance::self; + + action :>> subactions :> middle { + doc + /* + * The subperformances of this StateAction that are Actions, other than the entry and exit Actions. + * These subactions all take place in the "middle" of the StatePerformance, that is, after the + * entry Action and before the exit Action. + */ + } + + action substates: StateAction[0..*] :> stateActions, subactions { + doc + /* + * The subactions of this state that are states. + * + * NOTE: This feature is declared as an ActionUsage, not a StateUsage, so that the constraint + * checkStateUsageExclusiveStateSpecialization does not apply to it, since this constraint + * would otherwise incorrectly require that "substates" subset "exclusiveStates". + */ + } + + abstract state exclusiveStates: StateAction[0..*] :> substates { + doc + /* + * The substates of this state that are mutually exclusive, that is, whose performances do not + * overlap in time. + */ + } + + abstract action stateTransitions: StateTransitionAction[0..*] :> transitions { + doc + /* + * The transitions of this state that are state transitions. + */ + } + + succession stateSequencing first exclusiveStates[0..1] then exclusiveStates[0..1] { + doc + /* + * Exclusive states cannot overlap, so it must be possible to strictly sequence them in time. + */ + } + assert constraint {notEmpty(exclusiveStates) implies size(stateSequencing) == size(exclusiveStates) - 1} + } + + action def StateTransitionAction :> TransitionAction, StateTransitionPerformance { + doc + /* + * A StateTransitionAction is a TransitionAction and a StateTransitionPerformance whose transitionLinkSource + * is a State. It is the base type of TransitionUsages used transitions in state models. + */ + + in transitionLinkSource[1]: StateAction :>> + TransitionAction::transitionLinkSource, StateTransitionPerformance::transitionLinkSource; + + out payload[0..*]; + in :>> receiver; + + bind payload = accepter.payload; + bind receiver = accepter.receiver; + } + + abstract state stateActions: StateAction[0..*] nonunique :> actions { + doc + /* + * stateActions is the base feature for all StateUsages. + */ + } +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/SysML.sysml b/src/sysml.library/Systems Library/SysML.sysml new file mode 100644 index 0000000000000000000000000000000000000000..12458382d885ca9ffe786f7ce5f87b1ecb25cfa7 --- /dev/null +++ b/src/sysml.library/Systems Library/SysML.sysml @@ -0,0 +1,536 @@ +standard library package SysML { + doc + /* + * This package contains a reflective KerML model of the KerML abstract syntax. + */ + + private import ScalarValues::*; + public import Systems::*; + + package Systems { + public import KerML::Kernel::*; + + metadata def AcceptActionUsage specializes ActionUsage { + derived ref item receiverArgument : Expression[0..1]; + derived ref item payloadParameter : ReferenceUsage[1..1] subsets nestedReference, parameter; + derived ref item payloadArgument : Expression[0..1]; + } + + metadata def ActionDefinition specializes Behavior, OccurrenceDefinition { + derived ref item 'action' : ActionUsage[0..*] ordered subsets step, usage; + } + + metadata def ActionUsage specializes Step, OccurrenceUsage { + derived ref item actionDefinition : Behavior[0..*] ordered redefines behavior, occurrenceDefinition; + } + + metadata def ActorMembership specializes ParameterMembership { + derived item ownedActorParameter : PartUsage[1..1] redefines ownedMemberParameter; + } + + metadata def AllocationDefinition specializes ConnectionDefinition { + derived ref item 'allocation' : AllocationUsage[0..*] ordered subsets usage; + } + + metadata def AllocationUsage specializes ConnectionUsage { + derived ref item allocationDefinition : AllocationDefinition[0..*] ordered redefines connectionDefinition; + } + + metadata def AnalysisCaseDefinition specializes CaseDefinition { + derived ref item resultExpression : Expression[0..1] subsets expression, ownedFeature; + } + + metadata def AnalysisCaseUsage specializes CaseUsage { + derived ref item analysisCaseDefinition : AnalysisCaseDefinition[0..1] redefines caseDefinition; + derived ref item resultExpression : Expression[0..1] subsets ownedFeature; + } + + metadata def AssertConstraintUsage specializes ConstraintUsage, Invariant { + derived ref item assertedConstraint : ConstraintUsage[1..1]; + } + + metadata def AssignmentActionUsage specializes ActionUsage { + derived ref item targetArgument : Expression[0..1]; + derived ref item valueExpression : Expression[0..1]; + derived ref item referent : Feature[1..1] subsets member; + } + + metadata def AttributeDefinition specializes DataType, Definition; + + metadata def AttributeUsage specializes Usage { + derived attribute isReference : Boolean[1..1] redefines isReference; + + derived ref item attributeDefinition : DataType[0..*] ordered redefines definition; + } + + metadata def BindingConnectorAsUsage specializes BindingConnector, ConnectorAsUsage; + + metadata def CalculationDefinition specializes Function, ActionDefinition { + derived ref item calculation : CalculationUsage[0..*] ordered subsets 'action', expression; + } + + metadata def CalculationUsage specializes Expression, ActionUsage { + derived ref item calculationDefinition : Function[0..1] ordered redefines function, actionDefinition; + } + + metadata def CaseDefinition specializes CalculationDefinition { + derived ref item objectiveRequirement : RequirementUsage[0..1] ordered subsets usage; + derived ref item subjectParameter : Usage[1..1] subsets parameter, usage; + derived ref item actorParameter : PartUsage[0..*] ordered subsets parameter, usage; + } + + metadata def CaseUsage specializes CalculationUsage { + derived ref item objectiveRequirement : RequirementUsage[0..1] ordered subsets usage; + derived ref item caseDefinition : CaseDefinition[0..1] redefines calculationDefinition; + derived ref item subjectParameter : Usage[1..1] subsets parameter, usage; + derived ref item actorParameter : PartUsage[0..*] ordered subsets parameter, usage; + } + + metadata def ConcernDefinition specializes RequirementDefinition; + + metadata def ConcernUsage specializes RequirementUsage { + derived ref item concernDefinition : ConcernDefinition[0..1] redefines requirementDefinition; + } + + metadata def ConjugatedPortDefinition specializes PortDefinition { + derived ref item originalPortDefinition : PortDefinition[1..1] redefines owningNamespace; + derived ref item ownedPortConjugator : PortConjugation[1..1] redefines ownedConjugator; + } + + metadata def ConjugatedPortTyping specializes FeatureTyping { + ref item conjugatedPortDefinition : ConjugatedPortDefinition[1..1] redefines type; + derived ref item portDefinition : PortDefinition[1..1]; + } + + metadata def ConnectionDefinition specializes AssociationStructure, PartDefinition { + derived ref item connectionEnd : Usage[0..*] ordered redefines associationEnd; + } + + metadata def ConnectionUsage specializes ConnectorAsUsage, PartUsage { + derived ref item connectionDefinition : AssociationStructure[0..*] ordered subsets itemDefinition redefines association; + } + + abstract metadata def ConnectorAsUsage specializes Usage, Connector; + + metadata def ConstraintDefinition specializes OccurrenceDefinition, Predicate; + + metadata def ConstraintUsage specializes BooleanExpression, OccurrenceUsage { + derived ref item constraintDefinition : Predicate[0..1] redefines predicate; + } + + abstract metadata def ControlNode specializes ActionUsage; + + metadata def DecisionNode specializes ControlNode; + + metadata def Definition specializes Classifier { + attribute isVariation : Boolean[1..1]; + + derived ref item 'variant' : Usage[0..*] subsets ownedMember; + derived item variantMembership : VariantMembership[0..*] subsets ownedMembership; + derived ref item usage : Usage[0..*] ordered subsets feature; + derived ref item directedUsage : Usage[0..*] ordered subsets usage, directedFeature; + derived ref item ownedUsage : Usage[0..*] ordered subsets ownedFeature, usage; + derived ref item ownedReference : ReferenceUsage[0..*] ordered subsets ownedUsage; + derived ref item ownedAttribute : AttributeUsage[0..*] ordered subsets ownedUsage; + derived ref item ownedEnumeration : EnumerationUsage[0..*] ordered subsets ownedAttribute; + derived ref item ownedOccurrence : OccurrenceUsage[0..*] ordered subsets ownedUsage; + derived ref item ownedItem : ItemUsage[0..*] ordered subsets ownedOccurrence; + derived ref item ownedPart : PartUsage[0..*] ordered subsets ownedItem; + derived ref item ownedPort : PortUsage[0..*] ordered subsets ownedUsage; + derived ref item ownedConnection : ConnectorAsUsage[0..*] ordered subsets ownedPart; + derived ref item ownedFlow : FlowConnectionUsage[0..*] subsets ownedConnection; + derived ref item ownedInterface : InterfaceUsage[0..*] ordered subsets ownedConnection; + derived ref item ownedAllocation : AllocationUsage[0..*] ordered subsets ownedConnection; + derived ref item ownedAction : ActionUsage[0..*] ordered subsets ownedOccurrence; + derived ref item ownedState : StateUsage[0..*] ordered subsets ownedAction; + derived ref item ownedTransition : TransitionUsage[0..*] subsets ownedUsage; + derived ref item ownedCalculation : CalculationUsage[0..*] ordered subsets ownedAction; + derived ref item ownedConstraint : ConstraintUsage[0..*] ordered subsets ownedOccurrence; + derived ref item ownedRequirement : RequirementUsage[0..*] ordered subsets ownedConstraint; + derived ref item ownedConcern : ConcernUsage[0..*] subsets ownedRequirement; + derived ref item ownedCase : CaseUsage[0..*] ordered subsets ownedCalculation; + derived ref item ownedAnalysisCase : AnalysisCaseUsage[0..*] ordered subsets ownedCase; + derived ref item ownedVerificationCase : VerificationCaseUsage[0..*] ordered subsets ownedCase; + derived ref item ownedUseCase : UseCaseUsage[0..*] ordered subsets ownedCase; + derived ref item ownedView : ViewUsage[0..*] ordered subsets ownedPart; + derived ref item ownedViewpoint : ViewpointUsage[0..*] ordered subsets ownedRequirement; + derived ref item ownedRendering : RenderingUsage[0..*] ordered subsets ownedPart; + derived ref item ownedMetadata : MetadataUsage[0..*] ordered subsets ownedItem; + } + + metadata def EnumerationDefinition specializes AttributeDefinition { + attribute isVariation : Boolean[1..1] redefines isVariation; + + derived ref item enumeratedValue : EnumerationUsage[0..*] ordered redefines 'variant'; + } + + metadata def EnumerationUsage specializes AttributeUsage { + derived ref item enumerationDefinition : EnumerationDefinition[1..1] redefines attributeDefinition; + } + + metadata def EventOccurrenceUsage specializes OccurrenceUsage { + derived attribute isReference : Boolean[1..1] redefines isReference; + + derived ref item eventOccurrence : OccurrenceUsage[1..1]; + } + + metadata def ExhibitStateUsage specializes StateUsage, PerformActionUsage { + derived ref item exhibitedState : StateUsage[1..1] redefines performedAction; + } + + abstract metadata def Expose specializes Import { + attribute visibility : VisibilityKind[1..1] redefines visibility; + attribute isImportAll : Boolean[1..1] redefines isImportAll; + } + + metadata def FlowConnectionDefinition specializes Interaction, ConnectionDefinition, ActionDefinition; + + metadata def FlowConnectionUsage specializes ConnectionUsage, ItemFlow, ActionUsage { + derived ref item flowConnectionDefinition : Interaction[0..*] ordered redefines actionDefinition, connectionDefinition, interaction; + } + + metadata def ForLoopActionUsage specializes LoopActionUsage { + derived ref item seqArgument : Expression[1..1]; + derived ref item loopVariable : ReferenceUsage[1..1]; + } + + metadata def ForkNode specializes ControlNode; + + metadata def FramedConcernMembership specializes RequirementConstraintMembership { + attribute kind : RequirementConstraintKind[1..1] redefines kind; + + derived item ownedConcern : ConcernUsage[1..1] redefines ownedConstraint; + derived ref item referencedConcern : ConcernUsage[1..1] redefines referencedConstraint; + } + + metadata def IfActionUsage specializes ActionUsage { + derived ref item elseAction : ActionUsage[0..1]; + derived ref item thenAction : ActionUsage[1..1]; + derived ref item ifArgument : Expression[1..1]; + } + + metadata def IncludeUseCaseUsage specializes UseCaseUsage, PerformActionUsage { + derived ref item useCaseIncluded : UseCaseUsage[1..1] redefines performedAction; + } + + metadata def InterfaceDefinition specializes ConnectionDefinition { + derived ref item interfaceEnd : PortUsage[0..*] ordered redefines connectionEnd; + } + + metadata def InterfaceUsage specializes ConnectionUsage { + derived ref item interfaceDefinition : InterfaceDefinition[0..*] redefines connectionDefinition; + } + + metadata def ItemDefinition specializes Structure, OccurrenceDefinition; + + metadata def ItemUsage specializes OccurrenceUsage { + derived ref item itemDefinition : Structure[0..*] ordered subsets occurrenceDefinition; + } + + metadata def JoinNode specializes ControlNode; + + metadata def LifeClass specializes Class { + attribute isSufficient : Boolean[1..1] redefines isSufficient; + } + + abstract metadata def LoopActionUsage specializes ActionUsage { + derived ref item bodyAction : ActionUsage[1..1]; + } + + metadata def MembershipExpose specializes MembershipImport, Expose; + + metadata def MergeNode specializes ControlNode; + + metadata def MetadataDefinition specializes ItemDefinition, Metaclass; + + metadata def MetadataUsage specializes ItemUsage, MetadataFeature { + derived ref item metadataDefinition : Metaclass[0..1] redefines itemDefinition, metaclass; + } + + metadata def NamespaceExpose specializes Expose, NamespaceImport; + + metadata def ObjectiveMembership specializes FeatureMembership { + derived item ownedObjectiveRequirement : RequirementUsage[1..1] redefines ownedMemberFeature; + } + + metadata def OccurrenceDefinition specializes Definition, Class { + attribute isIndividual : Boolean[1..1]; + + derived ref item lifeClass : LifeClass[0..1] subsets ownedMember; + } + + metadata def OccurrenceUsage specializes Usage { + attribute isIndividual : Boolean[1..1]; + attribute portionKind : PortionKind[0..1]; + + derived ref item occurrenceDefinition : Class[0..*] ordered redefines definition; + derived ref item individualDefinition : OccurrenceDefinition[0..1] subsets occurrenceDefinition; + } + + metadata def PartDefinition specializes ItemDefinition; + + metadata def PartUsage specializes ItemUsage { + derived ref item partDefinition : PartDefinition[0..*] ordered subsets itemDefinition; + } + + metadata def PerformActionUsage specializes ActionUsage, EventOccurrenceUsage { + derived ref item performedAction : ActionUsage[1..1] redefines eventOccurrence; + } + + metadata def PortConjugation specializes Conjugation { + ref item originalPortDefinition : PortDefinition[1..1] redefines originalType; + derived ref item conjugatedPortDefinition : ConjugatedPortDefinition[1..1] redefines owningType; + } + + metadata def PortDefinition specializes OccurrenceDefinition, Structure { + derived ref item conjugatedPortDefinition : ConjugatedPortDefinition[0..1] subsets ownedMember; + } + + metadata def PortUsage specializes OccurrenceUsage { + derived ref item portDefinition : PortDefinition[0..*] ordered redefines occurrenceDefinition; + } + + enum def PortionKind { + enum 'timeslice'; + enum 'snapshot'; + } + + metadata def ReferenceUsage specializes Usage { + derived attribute isReference : Boolean[1..1] redefines isReference; + } + + metadata def RenderingDefinition specializes PartDefinition { + derived ref item 'rendering' : RenderingUsage[0..*] ordered subsets usage; + } + + metadata def RenderingUsage specializes PartUsage { + derived ref item renderingDefinition : RenderingDefinition[0..1] redefines partDefinition; + } + + enum def RequirementConstraintKind { + enum assumption; + enum 'requirement'; + } + + metadata def RequirementConstraintMembership specializes FeatureMembership { + attribute kind : RequirementConstraintKind[1..1]; + + derived item ownedConstraint : ConstraintUsage[1..1] redefines ownedMemberFeature; + derived ref item referencedConstraint : ConstraintUsage[1..1]; + } + + metadata def RequirementDefinition specializes ConstraintDefinition { + attribute reqId : String[0..1] redefines declaredShortName; + derived attribute text : String[0..*]; + + derived ref item subjectParameter : Usage[1..1] subsets parameter, usage; + derived ref item actorParameter : PartUsage[0..*] ordered subsets usage, parameter; + derived ref item stakeholderParameter : PartUsage[0..*] ordered subsets parameter, usage; + derived ref item assumedConstraint : ConstraintUsage[0..*] ordered subsets ownedFeature; + derived ref item requiredConstraint : ConstraintUsage[0..*] ordered subsets ownedFeature; + derived ref item framedConcern : ConcernUsage[0..*] ordered subsets requiredConstraint; + } + + metadata def RequirementUsage specializes ConstraintUsage { + attribute reqId : String[0..1] redefines declaredShortName; + derived attribute text : String[0..*]; + + derived ref item requirementDefinition : RequirementDefinition[0..1] redefines constraintDefinition; + derived ref item requiredConstraint : ConstraintUsage[0..*] ordered subsets ownedFeature; + derived ref item assumedConstraint : ConstraintUsage[0..*] ordered subsets ownedFeature; + derived ref item subjectParameter : Usage[1..1] subsets parameter, usage; + derived ref item framedConcern : ConcernUsage[0..*] ordered subsets requiredConstraint; + derived ref item actorParameter : PartUsage[0..*] ordered subsets usage, parameter; + derived ref item stakeholderParameter : PartUsage[0..*] ordered subsets parameter, usage; + } + + metadata def RequirementVerificationMembership specializes RequirementConstraintMembership { + attribute kind : RequirementConstraintKind[1..1] redefines kind; + + derived item ownedRequirement : RequirementUsage[1..1] redefines ownedConstraint; + derived ref item verifiedRequirement : RequirementUsage[1..1] redefines referencedConstraint; + } + + metadata def SatisfyRequirementUsage specializes RequirementUsage, AssertConstraintUsage { + derived ref item satisfiedRequirement : RequirementUsage[1..1] redefines assertedConstraint; + derived ref item satisfyingFeature : Feature[1..1]; + } + + metadata def SendActionUsage specializes ActionUsage { + derived ref item receiverArgument : Expression[0..1]; + derived ref item payloadArgument : Expression[1..1]; + derived ref item senderArgument : Expression[0..1]; + } + + metadata def StakeholderMembership specializes ParameterMembership { + derived item ownedStakeholderParameter : PartUsage[1..1] redefines ownedMemberParameter; + } + + metadata def StateDefinition specializes ActionDefinition { + attribute isParallel : Boolean[1..1]; + + derived ref item 'state' : StateUsage[0..*] ordered subsets 'action'; + derived ref item entryAction : ActionUsage[0..1]; + derived ref item doAction : ActionUsage[0..1]; + derived ref item exitAction : ActionUsage[0..1]; + } + + enum def StateSubactionKind { + enum 'entry'; + enum 'do'; + enum 'exit'; + } + + metadata def StateSubactionMembership specializes FeatureMembership { + attribute kind : StateSubactionKind[1..1]; + + derived item 'action' : ActionUsage[1..1] redefines ownedMemberFeature; + } + + metadata def StateUsage specializes ActionUsage { + attribute isParallel : Boolean[1..1]; + + derived ref item stateDefinition : Behavior[0..*] ordered redefines actionDefinition; + derived ref item entryAction : ActionUsage[0..1]; + derived ref item doAction : ActionUsage[0..1]; + derived ref item exitAction : ActionUsage[0..1]; + } + + metadata def SubjectMembership specializes ParameterMembership { + derived item ownedSubjectParameter : Usage[1..1] redefines ownedMemberParameter; + } + + metadata def SuccessionAsUsage specializes ConnectorAsUsage, Succession; + + metadata def SuccessionFlowConnectionUsage specializes SuccessionItemFlow, FlowConnectionUsage; + + enum def TransitionFeatureKind { + enum trigger; + enum guard; + enum effect; + } + + metadata def TransitionFeatureMembership specializes FeatureMembership { + attribute kind : TransitionFeatureKind[1..1]; + + derived item transitionFeature : Step[1..1] redefines ownedMemberFeature; + } + + metadata def TransitionUsage specializes ActionUsage { + derived ref item source : ActionUsage[1..1]; + derived ref item target : ActionUsage[1..1]; + derived ref item triggerAction : AcceptActionUsage[0..*] subsets ownedFeature; + derived ref item guardExpression : Expression[0..*] subsets ownedFeature; + derived ref item effectAction : ActionUsage[0..*] subsets feature; + derived ref item 'succession' : Succession[1..1] subsets ownedMember; + } + + metadata def TriggerInvocationExpression specializes InvocationExpression { + attribute kind : TriggerKind[1..1]; + } + + enum def TriggerKind { + enum 'when'; + enum 'at'; + enum 'after'; + } + + metadata def Usage specializes Feature { + attribute isVariation : Boolean[1..1]; + derived attribute isReference : Boolean[1..1]; + + derived ref item 'variant' : Usage[0..*] subsets ownedMember; + derived item variantMembership : VariantMembership[0..*] subsets ownedMembership; + derived ref item owningDefinition : Definition[0..1] subsets owningType; + derived ref item owningUsage : Usage[0..1] subsets owningType; + derived ref item definition : Classifier[0..*] ordered redefines type; + derived ref item usage : Usage[0..*] ordered subsets feature; + derived ref item directedUsage : Usage[0..*] ordered subsets usage, directedFeature; + derived ref item nestedUsage : Usage[0..*] ordered subsets ownedFeature, usage; + derived ref item nestedReference : ReferenceUsage[0..*] ordered subsets nestedUsage; + derived ref item nestedAttribute : AttributeUsage[0..*] ordered subsets nestedUsage; + derived ref item nestedEnumeration : EnumerationUsage[0..*] ordered subsets nestedAttribute; + derived ref item nestedOccurrence : OccurrenceUsage[0..*] ordered subsets nestedUsage; + derived ref item nestedItem : ItemUsage[0..*] ordered subsets nestedOccurrence; + derived ref item nestedPart : PartUsage[0..*] ordered subsets nestedItem; + derived ref item nestedPort : PortUsage[0..*] ordered subsets nestedUsage; + derived ref item nestedConnection : ConnectorAsUsage[0..*] ordered subsets nestedPart; + derived ref item nestedFlow : FlowConnectionUsage[0..*] subsets nestedConnection; + derived ref item nestedInterface : InterfaceUsage[0..*] ordered subsets nestedConnection; + derived ref item nestedAllocation : AllocationUsage[0..*] ordered subsets nestedConnection; + derived ref item nestedAction : ActionUsage[0..*] ordered subsets nestedOccurrence; + derived ref item nestedState : StateUsage[0..*] ordered subsets nestedAction; + derived ref item nestedTransition : TransitionUsage[0..*] subsets nestedUsage; + derived ref item nestedCalculation : CalculationUsage[0..*] ordered subsets nestedAction; + derived ref item nestedConstraint : ConstraintUsage[0..*] ordered subsets nestedOccurrence; + derived ref item nestedRequirement : RequirementUsage[0..*] ordered subsets nestedConstraint; + derived ref item nestedConcern : ConcernUsage[0..*] subsets nestedRequirement; + derived ref item nestedCase : CaseUsage[0..*] ordered subsets nestedCalculation; + derived ref item nestedAnalysisCase : AnalysisCaseUsage[0..*] ordered subsets nestedCase; + derived ref item nestedVerificationCase : VerificationCaseUsage[0..*] ordered subsets nestedCase; + derived ref item nestedUseCase : UseCaseUsage[0..*] ordered subsets nestedCase; + derived ref item nestedView : ViewUsage[0..*] ordered subsets nestedPart; + derived ref item nestedViewpoint : ViewpointUsage[0..*] ordered subsets nestedRequirement; + derived ref item nestedRendering : RenderingUsage[0..*] ordered subsets nestedPart; + derived ref item nestedMetadata : MetadataUsage[0..*] ordered subsets nestedItem; + } + + metadata def UseCaseDefinition specializes CaseDefinition { + derived ref item includedUseCase : UseCaseUsage[0..*] ordered; + } + + metadata def UseCaseUsage specializes CaseUsage { + derived ref item useCaseDefinition : UseCaseDefinition[0..1] redefines caseDefinition; + derived ref item includedUseCase : UseCaseUsage[0..*] ordered; + } + + metadata def VariantMembership specializes OwningMembership { + derived item ownedVariantUsage : Usage[1..1] redefines ownedMemberElement; + } + + metadata def VerificationCaseDefinition specializes CaseDefinition { + derived ref item verifiedRequirement : RequirementUsage[0..*] ordered; + } + + metadata def VerificationCaseUsage specializes CaseUsage { + derived ref item verificationCaseDefinition : VerificationCaseDefinition[0..1] subsets caseDefinition; + derived ref item verifiedRequirement : RequirementUsage[0..*] ordered; + } + + metadata def ViewDefinition specializes PartDefinition { + derived ref item 'view' : ViewUsage[0..*] ordered subsets usage; + derived ref item satisfiedViewpoint : ViewpointUsage[0..*] ordered subsets ownedRequirement; + derived ref item viewRendering : RenderingUsage[0..1]; + derived ref item viewCondition : Expression[0..*] ordered subsets ownedMember; + } + + metadata def ViewRenderingMembership specializes FeatureMembership { + derived item ownedRendering : RenderingUsage[1..1] redefines ownedMemberFeature; + derived ref item referencedRendering : RenderingUsage[1..1]; + } + + metadata def ViewUsage specializes PartUsage { + derived ref item viewDefinition : ViewDefinition[0..1] redefines partDefinition; + derived ref item satisfiedViewpoint : ViewpointUsage[0..*] ordered subsets nestedRequirement; + derived ref item exposedElement : Element[0..*] ordered subsets member; + derived ref item viewRendering : RenderingUsage[0..1]; + derived ref item viewCondition : Expression[0..*] ordered subsets ownedMember; + } + + metadata def ViewpointDefinition specializes RequirementDefinition { + derived ref item viewpointStakeholder : PartUsage[0..*] ordered; + } + + metadata def ViewpointUsage specializes RequirementUsage { + derived ref item viewpointDefinition : ViewpointDefinition[0..1] redefines requirementDefinition; + derived ref item viewpointStakeholder : PartUsage[0..*] ordered; + } + + metadata def WhileLoopActionUsage specializes LoopActionUsage { + derived ref item whileArgument : Expression[1..1]; + derived ref item untilArgument : Expression[0..1]; + } + + } + +} diff --git a/src/sysml.library/Systems Library/UseCases.sysml b/src/sysml.library/Systems Library/UseCases.sysml new file mode 100644 index 0000000000000000000000000000000000000000..6d3997d2ea1719c8f24494bf00b552e2bb97e7d3 --- /dev/null +++ b/src/sysml.library/Systems Library/UseCases.sysml @@ -0,0 +1,57 @@ +standard library package UseCases { + doc + /* + * This package defines the base types for use cases and related behavioral elements in the SysML language. + */ + + private import Cases::Case; + private import Cases::cases; + + use case def UseCase :> Case { + doc + /* + * UseCase is the most general class of performances of UseCaseDefinitions. + * UseCase is the base class of all UseCaseDefinitions. + */ + + ref use case self : UseCase :>> Case::self; + subject subj :>> Case::subj; + objective obj :>> Case::obj; + + ref use case start: UseCase :>> start { + doc + /* + * The starting snapshot of a Use Case. + */ + } + + ref use case done: UseCase :>> done { + doc + /* + * The ending snapshot of a Use Case. + */ + } + + abstract subUseCases : UseCase[0..*] :> subcases { + doc + /* + * Other UseCases carried out as part of the performance of this UseCase. + */ + } + + abstract ref includedUseCases : UseCase[0..*] :> enclosedPerformances { + doc + /* + * Other UseCases included by this UseCase (i.e., as modeled by an + * IncludeUseCaseUsage). + */ + } + } + + use case useCases : UseCase[0..*] nonunique :> cases { + doc + /* + * useCases is the base feature of all UseCaseUsages. + */ + } +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/VerificationCases.sysml b/src/sysml.library/Systems Library/VerificationCases.sysml new file mode 100644 index 0000000000000000000000000000000000000000..6ac9d78ecba991e2d87ec54af0c48cf607cec1ec --- /dev/null +++ b/src/sysml.library/Systems Library/VerificationCases.sysml @@ -0,0 +1,103 @@ +standard library package VerificationCases { + doc + /* + * This package defines the base types for verification cases and related behavioral elements + * in the SysML language. + */ + + private import Cases::Case; + private import Cases::cases; + private import Requirements::RequirementCheck; + private import ScalarValues::Boolean; + + abstract verification def VerificationCase :> Case { + doc + /* + * VerificationCase is the most general class of performances of VerificationCaseDefinitions. + * VericationCase is the base class of all VerificationCaseDefinitions. + */ + + ref verification self : VerificationCase :>> Case::self; + subject subj :>> Case::subj; + return verdict : VerdictKind :>> result; + + objective obj :>> Case::obj { + subject subj = VerificationCase::subj; + + requirement requirementVerifications : RequirementCheck[0..*] :> subrequirements { + doc + /* + * A record of the evaluations of the RequirementChecks of requirements being verified. + */ + } + } + + ref requirement requirementVerifications : RequirementCheck[0..*] = obj.requirementVerifications { + doc + /* + * Checks on whether the verifiedRequirements of the VerificationCase have been satisfied. + */ + } + + abstract verification subVerificationCases : VerificationCase[0..*] :> verificationCases, subcases { + doc + /* + * The subcases of this VerificationCase that are VerificationCaseUsages. + */ + } + + } + + abstract verification verificationCases : VerificationCase[0..*] nonunique :> cases { + doc + /* + * verificationCases is the base feature of all VerificationCaseUsages. + */ + } + + enum def VerdictKind { + doc + /* + * VerdictKind is an enumeration of the possible results of a VerificationCase. + */ + + pass; + fail; + inconclusive; + error; + } + + calc def PassIf { + doc + /* + * PassIf returns a pass or fail VerdictKind depending on whether its argument is + * true or false. + */ + + in attribute isPassing : Boolean; + return attribute verdict : VerdictKind = if isPassing? VerdictKind::pass else VerdictKind::fail; + } + + metadata def VerificationMethod { + doc + /* + * VerificationMethod can be used as metadata annotating a verification case or action. + */ + + attribute kind : VerificationMethodKind[1..*]; + } + + enum def VerificationMethodKind { + doc + /* + * VerificationMethodKind is an enumeration of the standard methods by which verification + * can be carried out. + */ + + inspect; + analyze; + demo; + test; + } + +} \ No newline at end of file diff --git a/src/sysml.library/Systems Library/Views.sysml b/src/sysml.library/Systems Library/Views.sysml new file mode 100644 index 0000000000000000000000000000000000000000..9b541ece537f643eb6543a6bd3118d02aeb4cf0b --- /dev/null +++ b/src/sysml.library/Systems Library/Views.sysml @@ -0,0 +1,163 @@ +standard library package Views { + doc + /* + * This package defines the base types for views, viewpoints, renderings and related elements + * in the SysML language. + */ + + private import Parts::Part; + private import Parts::parts; + private import Requirements::RequirementCheck; + private import Requirements::requirementChecks; + + abstract view def View :> Part { + ref view :>> self : View; + + abstract ref view subviews : View[0..*] :> views { + doc + /* + * Other Views that are used in the rendering of this View. + */ + } + + abstract ref rendering viewRendering : Rendering[0..1] { + doc + /* + * The rendering of this View. + */ + } + + viewpoint viewpointSatisfactions : ViewpointCheck[0..*] :> viewpointChecks, checkedConstraints { + doc + /* + * Checks that the View satisfies all required ViewpointUsages. + */ + } + + satisfy requirement viewpointConformance by that { + doc + /* + * An assertion that all viewpointSatisfactions are true. + */ + + require viewpointSatisfactions { + doc + /* + * The required ViewpointChecks. + */ + } + } + } + + abstract viewpoint def ViewpointCheck :> RequirementCheck { + doc + /* + * ViewpointCheck is a RequirementCheck for checking if a View meets the concerns of viewpoint stakeholders. + * It is the base type of all ViewpointDefinitions. + */ + + ref viewpoint :>> self : ViewpointCheck; + subject subj : View[1] :>> RequirementCheck::subj; + } + + abstract rendering def Rendering :> Part { + doc + /* + * Rendering is the base type of all RenderingDefinitions. + */ + + ref rendering :>> self : Rendering; + + abstract ref rendering subrenderings : Rendering[0..*] :> renderings { + doc + /* + * Other Renderings used to carry out this Rendering. + */ + } + } + + rendering def TextualRendering :> Rendering { + doc + /* + * A TextualRendering is a Rendering of a View into a textual format. + */ + } + + rendering def GraphicalRendering :> Rendering { + doc + /* + * A GraphicalRendering is a Rendering of a View into a Graphical format. + */ + } + + rendering def TabularRendering :> Rendering { + doc + /* + * A TabularRendering is a Rendering of a View into a tabular format. + */ + } + + abstract view views : View[0..*] nonunique :> parts { + doc + /* + * views is the base feature of all ViewUsages. + */ + } + + abstract viewpoint viewpointChecks : ViewpointCheck[0..*] nonunique :> requirementChecks { + doc + /* + * viewpointChecks is the base feature of all ViewpointUsages. + */ + } + + abstract rendering renderings : Rendering[0..*] nonunique :> parts { + doc + /* + * renderings is the base feature of all RenderingUsages. + */ + } + + rendering asTextualNotation : TextualRendering[1] :> renderings { + doc + /* + * asTextualNotation renders a View into textual notation as defined in the + * KerML and SysML specifications. + */ + } + + rendering asTreeDiagram : GraphicalRendering[1] :> renderings { + doc + /* + * asTreeDiagram renders a View as a tree diagram, using the + * graphical notation defined in the SysML specification. + */ + } + + rendering asInterconnectionDiagram : GraphicalRendering[1] :> renderings { + doc + /* + * asInterconnectionDiagram renders a View as an interconnection + * diagram, using the graphical notation defined in the SysML specification. + */ + } + + rendering asElementTable : TabularRendering[1] :> renderings { + doc + /* + * asElementTable renders a View as a table, with one row for each exposed + * Element and columns rendered by applying the columnViews in order to the + * Element in each row. + */ + + view columnView[0..*] ordered { + doc + /* + * The Views to be rendered in the column cells, in order, of each rows of the table. + */ + + abstract ref rendering :>> viewRendering[0..1]; + } + rendering :>> subrenderings[0..*] = columnView.viewRendering; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Analysis Examples/AnalysisAnnotation.sysml b/src/sysml/src/examples/Analysis Examples/AnalysisAnnotation.sysml new file mode 100644 index 0000000000000000000000000000000000000000..5d9748661a12f041eabea75ec17a24a31207d05f --- /dev/null +++ b/src/sysml/src/examples/Analysis Examples/AnalysisAnnotation.sysml @@ -0,0 +1,26 @@ +package AnalysisAnnotation { + private import ScalarValues::Real; + private import AnalysisTooling::*; + private import ISQ::*; + + action def ComputeDynamics { + metadata ToolExecution { + toolName = "ModelCenter"; + uri = "aserv://localhost/Vehicle/Equation1"; + } + + in dt : TimeValue { @ToolVariable { name = "deltaT"; } } + in whlpwr : PowerValue { @ToolVariable { name = "power"; } } + in Cd : Real { @ToolVariable { name = "C_D"; } } + in Cf: Real { @ToolVariable { name = "C_F"; } } + in tm : MassValue { @ToolVariable { name = "mass"; } } + in v_in : SpeedValue { @ToolVariable { name = "v0"; } } + in x_in : LengthValue { @ToolVariable { name = "x0"; } } + + out a_out : AccelerationValue { @ToolVariable { name = "a"; } } + out v_out : SpeedValue { @ToolVariable { name = "v"; } } + out x_out : LengthValue { @ToolVariable { name = "x"; } } + + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Analysis Examples/Dynamics.sysml b/src/sysml/src/examples/Analysis Examples/Dynamics.sysml new file mode 100644 index 0000000000000000000000000000000000000000..26746dd7101e2fd43dc8b92c086350b78b113c59 --- /dev/null +++ b/src/sysml/src/examples/Analysis Examples/Dynamics.sysml @@ -0,0 +1,91 @@ +package Dynamics { + private import ScalarValues::Real; + private import ISQ::*; + + // Function definitions + + calc def Power { + in whlpwr : PowerValue; in Cd : Real; in Cf : Real; in tm : MassValue; in v : SpeedValue; + return tp : PowerValue = whlpwr - Cd * v - Cf * tm * v; + } + + calc def Acceleration { in dt : TimeValue; in tm : MassValue; in tp: PowerValue; + return a : AccelerationValue = tp * dt * tp; + } + + calc def Velocity { in dt : TimeValue; in v0 : SpeedValue; in a : AccelerationValue; + return v : SpeedValue = v0 + a * dt; + } + + calc def Position { in dt : TimeValue; in x0 : LengthValue; in v : SpeedValue; + return x : LengthValue = x0 + v * dt; + } + + // Analysis action def + + action def StraightLineVehicleDynamics { + + in attribute dt : TimeValue; + in attribute whlpwr : PowerValue; + in attribute Cd : Real; + in attribute Cf: Real; + in attribute tm : MassValue; + in attribute v_in : SpeedValue; + in attribute x_in : LengthValue; + + out attribute a_out : AccelerationValue; + out attribute v_out : SpeedValue; + out attribute x_out : LengthValue; + + assert constraint { + attribute tp : PowerValue; + + tp == Power(whlpwr, Cd, Cf, tm, v_in) & + a_out == Acceleration(dt, tm, tp) & + v_out == Velocity(dt, v_in, a_out) & + x_out == Position(dt, x_in, v_in) + } + } + + + // Analysis actions + + action dyn1 : StraightLineVehicleDynamics { + in attribute dt : TimeValue; + in attribute whlpwr : PowerValue; + in attribute Cd : Real; + in attribute Cf: Real; + in attribute tm : MassValue; + in attribute v_in : SpeedValue; + in attribute x_in : LengthValue; + + attribute tp : PowerValue = Power(whlpwr, Cd, Cf, tm, v_in); + + out attribute :>> a_out : AccelerationValue = Acceleration(dt, tm, tp); + out attribute :>> v_out : SpeedValue = Velocity(dt, v_in, a_out); + out attribute :>> x_out : LengthValue = Position(dt, x_in, v_in); + } + + action dyn2 : StraightLineVehicleDynamics { + calc acc : Acceleration { + in dt = dyn2::dt; + in tm = dyn2::tm; + in tp = Power(whlpwr, Cd, Cf, tm, v_in); + } + bind a_out = acc.a; + + calc vel : Velocity { + in dt = dyn2::dt; + in v0 = dyn2::v_in; + in a = acc.a; + } + bind v_out = vel.v; + + calc pos : Position { + in dt = dyn2::dt; + in x0 = dyn2::x_in; + in v0 = vel.v; + } + bind x_out = pos.x; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Analysis Examples/Turbojet Stage Analysis.sysml b/src/sysml/src/examples/Analysis Examples/Turbojet Stage Analysis.sysml new file mode 100644 index 0000000000000000000000000000000000000000..5e2991c26b20a02077f9c36fd5bcaf8c23a29701 --- /dev/null +++ b/src/sysml/src/examples/Analysis Examples/Turbojet Stage Analysis.sysml @@ -0,0 +1,110 @@ +package 'Turbojet Stage Analysis' { + private import Quantities::ScalarQuantityValue; + private import MeasurementReferences::DimensionOneValue; + private import ISQ::*; + + package 'Thermodynamic Functions' { + calc def 'Ideal Gas Law' { in rho; in R_bar; in T; + return p = rho * R_bar * T; + } + + calc def 'Reversible Adiabatic Compression Density' { in rho_1; in p_1; in p_2; in gamma; + return rho_2 = rho_1 * (p_2 / p_1)^(1/gamma); + } + + calc def 'Reversible Adiabatic Compression Temperature' { in T_1; in p_1; in p_2; in gamma; + return T_2 = T_1 * (p_2 / p_1)**((gamma - 1) / gamma); + } + + calc def 'Total Pressure' { in P_static; in rho; in V; + 1/2 * rho * V^2 + P_static + } + + // Showing explicit parameter typing + calc def 'Total Temperature' { in T_static : TemperatureValue; in Cp : DimensionOneValue; in V : VolumeValue; + return : TemperatureValue = 1/(2 * Cp) * V^2 + T_static; + } + + calc def 'Total Enthalpy' { in h_total; in h_static; in V; + return H_total = 1/2 * V^2 + h_static; + } + } + + package 'Thermodynamics Structure' { + part def 'Ideal Gas Parcel' { + comment + /* + The parcel is an infinitesimal volume used to analyze points in a flow + */ + attribute 'Molar Mass'; + attribute 'Density'; + attribute 'Pressure'; + attribute 'Temperature'; + attribute 'Enthalpy'; + attribute 'Specific Gas Constant'; + } + + part def 'Moving Ideal Gas Parcel' specializes 'Ideal Gas Parcel' { + comment about 'Stagnation Pressure' + /* + Stagnation pressure is the pressure of the parcel if the kinetic energy defined by its + velocity in a given coordinate frame is converted to gas internal energy through deceleration + to a velocity that matches the current frame. + */ + attribute 'Stagnation Pressure'; + attribute 'Stagnation Temperature'; + attribute 'Stagnation Enthalpy'; + + comment about 'Static Pressure' + /* + Static pressure is the pressure of the parcel as it moves + */ + attribute 'Static Pressure' redefines 'Ideal Gas Parcel'::'Pressure'; + attribute 'Static Temperature' redefines 'Ideal Gas Parcel'::'Temperature'; + attribute 'Static Enthalpy' redefines 'Ideal Gas Parcel'::'Enthalpy'; + } + + action def 'Thermodynamic Process'; // need start and end shots to show beginning and end attributes + + action def 'Adiabatic Process' specializes 'Thermodynamic Process' { + /* + Thermodynamic process typically have their states defined at beginning and end + of the process (since these starts are path-independent) + */ + action 'Stage 1' :>> start; + action 'Stage 2' :>> done; + } + + action def 'Reversible Adiabatic Process' specializes 'Adiabatic Process'; + } + + package 'Low-Pressure Compressor Analysis' { + + part 'Analysis Context' { + private import 'Thermodynamic Functions'::*; + + part 'Inlet Gas' : 'Thermodynamics Structure'::'Moving Ideal Gas Parcel' { + // Explicit binding notation + calc 'Solve for Pressure1' : 'Ideal Gas Law'; + bind 'Density' = 'Solve for Pressure1'.rho; + bind 'Specific Gas Constant' = 'Solve for Pressure1'.R_bar; + bind 'Static Temperature' = 'Solve for Pressure1'.T; + bind 'Static Pressure' = 'Solve for Pressure1'.p; + + // Shorthand parameter binding notation + calc 'Solve for Pressure2' : 'Ideal Gas Law' { + in rho = 'Density'; + in R_bar = 'Specific Gas Constant'; + in T = 'Static Temperature'; + } + + // Invocation expression notation + attribute :>> 'Static Pressure' = 'Ideal Gas Law'('Density', 'Specific Gas Constant', 'Static Temperature'); + + // Equation as a constraint (note "==") + constraint { 'Static Pressure' == 'Ideal Gas Law'('Density', 'Specific Gas Constant', 'Static Temperature') } + } + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Analysis Examples/Vehicle Analysis Demo.sysml b/src/sysml/src/examples/Analysis Examples/Vehicle Analysis Demo.sysml new file mode 100644 index 0000000000000000000000000000000000000000..1310f62a5ebd43d119d06efc1711fafad329a781 --- /dev/null +++ b/src/sysml/src/examples/Analysis Examples/Vehicle Analysis Demo.sysml @@ -0,0 +1,286 @@ +package 'Vehicle Analysis Demo' { + private import ScalarValues::*; + private import ISQ::*; + private import USCustomaryUnits::*; + + private import VehicleQuantities::*; + private import VehicleModel::*; + private import FuelEconomyRequirementsModel::*; + private import DynamicsModel::*; + private import FuelEconomyAnalysisModel::*; + + package VehicleQuantities { + private import Quantities::*; + private import MeasurementReferences::*; + + attribute def DistancePerVolumeUnit :> DerivedUnit { + private attribute distancePF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute volumePF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (distancePF, volumePF); } + } + + attribute def DistancePerVolumeValue :> ScalarQuantityValue { + :>> num : Real; + :>> mRef : DistancePerVolumeUnit; + } + + attribute gallon : VolumeUnit = 231.0 * 'in' ** 3; + attribute mpg : DistancePerVolumeUnit = 'mi' / gallon; + } + + package VehicleModel { + item def Fuel; + + port def FuelPort { + out item fuel: Fuel; + } + + part def FuelTank { + attribute volumeMax : VolumeValue; + attribute fuelVolume : VolumeValue; + attribute fuelLevel : Real = fuelVolume / volumeMax; + + port fuelInPort : ~FuelPort; + port fuelOutPort : FuelPort; + } + + part def Wheel { + attribute diameter : LengthValue; + } + + part def Vehicle { + attribute mass : MassValue; + attribute cargoMass : MassValue; + + attribute wheelDiameter : LengthValue; + attribute driveTrainEfficiency : Real; + + attribute fuelEconomy_city : DistancePerVolumeValue; + attribute fuelEconomy_highway : DistancePerVolumeValue; + + port fuelInPort : ~FuelPort; + } + + part vehicle_c1 : Vehicle { + port :>> fuelInPort { + in item :>> fuel; + } + + part fuelTank : FuelTank { + port :>> fuelInPort { + in item :>> fuel; + } + } + + bind fuelInPort.fuel = fuelTank.fuelInPort.fuel; + + part wheel : Wheel[4] { + :>> diameter = wheelDiameter; + } + } + } + + package FuelEconomyRequirementsModel { + requirement def FuelEconomyRequirement { + attribute actualFuelEconomy : DistancePerVolumeValue; + attribute requiredFuelEconomy : DistancePerVolumeValue; + + require constraint { actualFuelEconomy >= requiredFuelEconomy } + } + + requirement cityFuelEconomyRequirement : FuelEconomyRequirement { + :>> requiredFuelEconomy = 25 [mpg]; + } + + requirement highwayFuelEconomyRequirement : FuelEconomyRequirement { + :>> requiredFuelEconomy = 30 [mpg]; + } + } + + package DynamicsModel { + calc def Acceleration { in p : PowerValue; in m : MassValue; in v : SpeedValue; + return : AccelerationValue = p / (m * v); + } + + calc def Velocity { in v0 : SpeedValue; in a : AccelerationValue; in dt : TimeValue; + return : SpeedValue = v0 + a * dt; + } + + calc def Position { in x0 : LengthValue; in v : SpeedValue; in dt : TimeValue; + return : LengthValue = x0 + v * dt; + } + + constraint def StraightLineDynamicsEquations { + in p : PowerValue; + in m : MassValue; + in dt : TimeValue; + in x_i : LengthValue; + in v_i : SpeedValue; + in x_f : LengthValue; + in v_f : SpeedValue; + in a : AccelerationValue; + + attribute v_avg : SpeedValue = (v_i + v_f)/2; + + a == Acceleration(p, m, v_avg) & + v_f == Velocity(v_i, a, dt) & + x_f == Position(x_i, v_avg, dt) + } + + action def StraightLineDynamics { + in power : PowerValue; + in mass : MassValue; + in delta_t : TimeValue; + in x_in : LengthValue; + in v_in : SpeedValue; + out x_out : LengthValue; + out v_out : SpeedValue; + out a_out : AccelerationValue; + + assert constraint dynamics : StraightLineDynamicsEquations { + in p = power; + in m = mass; + in dt = delta_t; + in x_i = x_in; + in v_i = v_in; + in x_f = x_out; + in v_f = v_out; + in a = a_out; + } + } + } + + package FuelEconomyAnalysisModel { + private import SequenceFunctions::size; + private import SampledFunctions::SampledFunction; + private import SampledFunctions::SamplePair; + private import ControlFunctions::forAll; + + attribute def ScenarioState { + position : LengthValue; + velocity : SpeedValue; + } + + attribute def NominalScenario :> SampledFunction { + attribute def TimeStateRecord :> SamplePair { + t : TimeValue :>> domainValue; + s : ScenarioState :>> rangeValue; + } + :>> samples : TimeStateRecord; + n : Natural = size(samples); + } + + analysis def FuelEconomyAnalysis { + subject vehicle: Vehicle; + in attribute scenario : NominalScenario; + in requirement fuelEconomyRequirement : FuelEconomyRequirement; + return calculatedFuelEconomy : DistancePerVolumeValue; + + objective fuelEconomyAnalysisObjective { + doc + /* + * The objective of this analysis is to determine whether the + * current vehicle design configuration can satisfy the fuel + * economy requirement. + */ + + assume constraint { + vehicle.wheelDiameter == 33 ['in'] & + vehicle.driveTrainEfficiency == 0.4 + } + + require fuelEconomyRequirement { + :>> actualFuelEconomy = calculatedFuelEconomy; + } + } + + action dynamicsAnalysis { + in sc: NominalScenario; + out power : PowerValue[*]; + out acceleration : AccelerationValue[*]; + /* + * Solve for the required engine power as a function of time + * to support the scenarios. + */ + assert constraint straightLineDynamics { + (1..sc.n-1)->forAll {in i: Integer; + private thisSample : NominalScenario::TimeStateRecord = + sc.samples#(i); + private nextSample : NominalScenario::TimeStateRecord = + sc.samples#(i+1); + StraightLineDynamicsEquations ( + p = power#(i), + m = vehicle.mass, + dt = nextSample.t - thisSample.t, + x_i = thisSample.s.position, + v_i = thisSample.s.velocity, + x_f = nextSample.s.position, + v_f = nextSample.s.velocity, + a = acceleration#(i) + ) + } + } + } + + action fuelConsumptionAnalysis { + in power : PowerValue[*] = dynamicsAnalysis.power; + in acceleration : AccelerationValue[*] = dynamicsAnalysis.acceleration; + out fuelEconomy : DistancePerVolumeValue = calculatedFuelEconomy; + /* + * Solve the engine equations to determine how much fuel is + * consumed. The engine RPM is a function of the speed of the + * vehicle and the gear state. + */ + } + } + } + + part vehicleFuelEconomyAnalysisContext { + requirement vehicleFuelEconomyRequirementsGroup { + subject vehicle : Vehicle; + + requirement vehicleFuelEconomyRequirement_city :> cityFuelEconomyRequirement { + doc /* The vehicle shall provide a fuel economy that is greater than or equal to + * 25 miles per gallon for the nominal city driving scenarios. + */ + + :>> actualFuelEconomy = vehicle.fuelEconomy_city; + + assume constraint { vehicle.cargoMass == 1000 [lb] } + } + + requirement vehicleFuelEconomyRequirement_highway :> highwayFuelEconomyRequirement { + doc /* The vehicle shall provide a fuel economy that is greater than or equal to + * 30 miles per gallon for the nominal highway driving scenarios. + */ + + :>> actualFuelEconomy = vehicle.fuelEconomy_highway; + + assume constraint { vehicle.cargoMass == 1000 [lb] } + } + + } + + attribute cityScenario : NominalScenario; + attribute highwayScenario : NominalScenario; + + analysis cityFuelEconomyAnalysis : FuelEconomyAnalysis { + subject vehicle = vehicle_c1; + in attribute scenario = cityScenario; + in requirement fuelEconomyRequirement = cityFuelEconomyRequirement; + } + + analysis highwayFuelEconomyAnalysis : FuelEconomyAnalysis { + subject vehicle = vehicle_c1; + in attribute scenario = highwayScenario; + in requirement fuelEconomyRequirement = highwayFuelEconomyRequirement; + } + + part vehicle_c1_analysized :> vehicle_c1 { + attribute :>> fuelEconomy_city = cityFuelEconomyAnalysis.calculatedFuelEconomy; + attribute :>> fuelEconomy_highway = highwayFuelEconomyAnalysis.calculatedFuelEconomy; + } + + satisfy vehicleFuelEconomyRequirementsGroup by vehicle_c1_analysized; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Arrowhead Framework Example/AHFCoreLib.sysml b/src/sysml/src/examples/Arrowhead Framework Example/AHFCoreLib.sysml new file mode 100644 index 0000000000000000000000000000000000000000..1c7d1d65210239debf40f63ddfde9804b174281e --- /dev/null +++ b/src/sysml/src/examples/Arrowhead Framework Example/AHFCoreLib.sysml @@ -0,0 +1,55 @@ +// /** Mandatory Services and Systems */ +library package AHFCoreLib { + private import AHFProfileLib::*; + private import ScalarValues::*; + private import AHFProfileMetadata::*; + + #service port def ServiceDiscovery { + // The functionalities as Requests (Operations) cannot be defined yet + // We could consider using flows to designate the functionalities + } + + #service port def ServiceDiscoveryDD :> ServiceDiscovery{ + } + + #service port def Authorisation { + attribute publickey:String; // just as examples + } + + #service port def AuthorisationDD :> Authorisation{ + } + + + #clouddd ArrowheadCore{ + // /** Design Level */ + // First the system definitions (SysD) of core systems + + #system service_registry { + #service serviceDiscovery : ServiceDiscovery ; + } + + #system authorization{ + #service authorisation : Authorisation; + attribute protocol:String = "HTTP"; + } + + #system orchestrationDesign; // just indicated for now + + // /** Design Description level */ + #systemdd service_registry_DD :> service_registry{ + #servicedd :>> serviceDiscovery:ServiceDiscoveryDD { + #idd serviceDiscovery_HTTP ;// nested port for HTTP protocol + // here we refer the functionalities like operation Register etc. + #idd serviceDiscovery_MQTT ; // nested port for MQTT protocol + } + } + + #systemdd authorization_DD :> authorization{ + #servicedd :>> authorisation { + #idd authorisation_HTTP ; // nested port for HTTP protocol + #idd authorisation_MQTT ; // nested port for MQTT protocol + } + action Echo_behavior :> ServiceMethod; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Arrowhead Framework Example/AHFNorwayTopics.sysml b/src/sysml/src/examples/Arrowhead Framework Example/AHFNorwayTopics.sysml new file mode 100644 index 0000000000000000000000000000000000000000..d59cd053737c205373cc32d64cffa9059022e125 --- /dev/null +++ b/src/sysml/src/examples/Arrowhead Framework Example/AHFNorwayTopics.sysml @@ -0,0 +1,160 @@ +package AHFNorway { + doc /* This is the Norwegian use-case for Arrowhead Framework */ + // The use-case is for Productive4.0 and Arrowhead Tools + // The system is taken from a chemical factory + // This is focusing on the monitoring of products when delivered + private import AHFProfileLib::*; + private import AHFProfileMetadata::*; + private import AHFCoreLib::**; + private import ScalarValues::*; + + #service def APISService { + doc /* Service design */ + + attribute :>> serviceDefinition = "APISPullService"; + attribute :>> intrfce_protocol = "{JSON}"; + attribute :>> serviceURL = "pull"; + } + + #servicedd port def APIS_DD :> APISService { + doc /* Service design description with nested protocol-specific ports */ + + #idd port APIS_HTTP { + // the asynch implementation of synchronous remote calls + out cll:CallGiveItems; + in retrn:ResultGiveItems; + } + + #idd port APIS_MQTT { + // GetAllItems functionality + out pub:Publish; + out retall:Return_AllItems; + in subscr:Subscribe; + } + } + + // Asynchronous signals + attribute def Publish {nametopic:String;} + attribute def Subscribe{nametopic:String;} + attribute def Return_AllItems {itms:String;} + attribute def Subscribe_giveItems{itms:String;} + attribute def Return_Ack{ack:Boolean;} + + // Signals for implementing the remote procedure call by asynch signals + attribute def CallGiveItems{itms:String; } + attribute def ResultGiveItems{ack:Boolean;} + + #clouddd AHFNorway_LocalCloudDD :> ArrowheadCore { + #systemdd TellUConsumer { + #servicedd serviceDiscovery:~ServiceDiscoveryDD ; // communicating with ServiceRegistry + #servicedd apisp:APIS_DD ; + + attribute :>> systemname = "UngerApisClient"; + attribute :>> address = "Unger_network_ip"; + attribute :>> portno = 0; + + // We want an operation call to GiveItems, and actually sending the payload + // Call apisp::APIS_HTTP::giveItems(in allitems: String = "All the items", out ackback:Boolean); + + state TellUbehavior{ + entry send CallGiveItems("All the items") via apisp.APIS_HTTP; + then Wait; + state Wait; + accept rs:ResultGiveItems + // Here do whatever about the result rs.ret + then Wait; + } + + } + + #systemdd APISProducer { + #servicedd serviceDiscovery:~ServiceDiscoveryDD ; // communicating with ServiceRegistry + #servicedd tellu:~APIS_DD; // providing the APISService + #servicedd apisc:APIS_DD ; // talking to APISConsumer + + :>> systemname = "PrediktorApisServer"; + :>> address = "Prediktor_network_ip"; + :>> portno = 6565; + attribute x:Boolean; + + action giveItems :> ServiceMethod + { in itms:String; out ack:Boolean; + /* Forward itms and return an ack */ + first start; + then send Return_AllItems(itms) via apisc.APIS_MQTT; + success = true; + bind ack = success; + } + + state APISPbehavior{ + entry send Publish("Return_AllItems") via apisc.APIS_MQTT; + then WaitOnData; + + state WaitOnData; + accept cl:CallGiveItems via tellu.APIS_HTTP + do action { + first start; + then action giveItems{ in itms=cl.itms; out ack=x; } + then send ResultGiveItems(x) via tellu.APIS_HTTP; + } + then WaitOnData; + } + } + + #systemdd APISConsumer { + #servicedd serviceDiscovery:~ServiceDiscovery ; // communicating with ServiceRegistry + #servicedd apisp:~APIS_DD ; + :>> systemname = "TellUClient"; + :>> address = "Prediktor_network_ip"; + :>> portno = 1; + + // Now sending signal to the remote behavior through the port functionality + state MQTT_APISP { + entry send Subscribe("Return_AllItems") via apisp.APIS_MQTT; + then Idle; + state Idle; + accept Return_AllItems via apisp.APIS_MQTT + // Get the stuff and do something with them + then Idle; + } + } + + part MQTTServer { + port getTopic:~APIS_DD; + port giveTopic:APIS_DD; + + state Serve{ + entry; + then Publ; + state Publ; + accept pub:Publish via getTopic.APIS_MQTT + // store information about who will provide "Publish::nametopic" + then Subsr; + + state Subsr; + accept Subscribe via giveTopic.APIS_MQTT + // store information about who want to receive "Subscribe::nametopic" + then Idle; + + state Idle; + accept retrnall:Return_AllItems via getTopic.APIS_MQTT + do send retrnall via giveTopic.APIS_MQTT + then Idle; + } + } + + connect APISProducer.apisc to MQTTServer.getTopic; + connect MQTTServer.giveTopic to APISConsumer.apisp; + + connect TellUConsumer.apisp to APISProducer.tellu; + + // Then we need to connect the application systems to the mandatory systems + connect APISProducer.serviceDiscovery to service_registry.serviceDiscovery; + connect TellUConsumer.serviceDiscovery to service_registry.serviceDiscovery; + connect APISConsumer.serviceDiscovery to service_registry.serviceDiscovery; + + // Same procedure for the other mandatory services + + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Arrowhead Framework Example/AHFProfileLib.sysml b/src/sysml/src/examples/Arrowhead Framework Example/AHFProfileLib.sysml new file mode 100644 index 0000000000000000000000000000000000000000..e723d58d9905fc652c4e734689802e60d818b31e --- /dev/null +++ b/src/sysml/src/examples/Arrowhead Framework Example/AHFProfileLib.sysml @@ -0,0 +1,117 @@ +library package AHFProfileLib { + // Systems and Services and their functionalities + private import ScalarValues::*; + + // Design level + port def SD{ + doc /* Service definition */ + + attribute serviceDefinition:String; + attribute serviceURL:String; + attribute intrfce_protocol:String; // which may be "REST" or "MQTT" etc. + } + + part def SysLocalCloudsDesign { + doc /* System of Systems Definition */ + + // System of Local Clouds + part locclouds:LocalCloudDesign[1..*]; + } + + part system_of_systems:SysLocalCloudsDD; // defining a top level usage + + part def LocalCloudDesign { + doc /* Local Cloud definition */ + + part systems:SysD[1..*]; + } + + part def SysD { + doc /* System definitions */ + + port services: SD[1..*]; + attribute systemname: String; + attribute address: String; + attribute portno: Integer; + } + + // Design Description level + port def IDD :> SD{ + doc /* Interface Design Description of services */ + + attribute encoding_kind:String; + } + + port def SDDD :> SD{ + doc /* Service Definition Design Description */ + + port idds:IDD[*]; // nested protocol-specific services + } + + part def SysLocalCloudsDD :> SysLocalCloudsDesign { + doc /* System of Systems Detailed Description */ + + part :>> locclouds:LocalCloudDD[1..*]; // the descriptions + } + + part def LocalCloudDD :> LocalCloudDesign { + part :>> systems:SysDD[1..*]; + } + + part def SysDD :> SysD{ + doc /* System Detailed Description */ + + port :>> services:SDDD; + action ServiceMethod[1..*]; //means general behaviors + } +} + +library package AHFProfileMetadata{ + private import Metaobjects::SemanticMetadata; + private import AHFProfileLib::*; + + port global_sd:SD; + metadata def SDMetadata :> SemanticMetadata{ + // :>> baseType = system_of_systems.locclouds.systems.services meta SysML::PortUsage; + // :>> baseType = SysD::services meta SysML::PortUsage; + :>> baseType default global_sd meta SysML::PortUsage; + } + + metadata def SysLocalCloudsMetadata :> SemanticMetadata{ + :>> baseType = system_of_systems meta SysML::PartUsage; + } + + metadata def LocalCloudsMetadata :> SemanticMetadata{ + :>> baseType default system_of_systems::locclouds meta SysML::PartUsage; + } + + metadata def SysDMetadata :> SemanticMetadata{ + :>> baseType default system_of_systems::locclouds::systems meta SysML::PartUsage; + // :>> baseType default LocalCloudDesign::systems meta SysML::PartUsage; + } + + metadata def IDDMetadata :> SDMetadata{ + // :>> baseType = system_of_systems.locclouds.systems.services.idd meta SysML::PortUsage; + :>> baseType = SDDD::idds meta SysML::PortUsage; + // :>> global_sddd.idd; + } + + port global_sddd:SDDD; + metadata def SDDDMetadata :> SDMetadata { + // :>> baseType = system_of_systems.locclouds.systems.services meta SysML::PortUsage; + :>> baseType = global_sddd meta SysML::PortUsage; + } + + metadata def LocalCloudsDDMetadata :> LocalCloudsMetadata{ + :>> baseType = system_of_systems::locclouds meta SysML::PartUsage; + } + + part global_clouddd:LocalCloudDD; + part global_systemsdd:SysDD; + metadata def SysDDMetadata :> SysDMetadata{ + // :>> baseType = system_of_systems.locclouds.systems meta SysML::PartUsage; + //:>> baseType = LocalCloudDD::systems meta SysML::PartUsage; + :>> baseType = global_systemsdd meta SysML::PartUsage; + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Arrowhead Framework Example/AHFSequences.sysml b/src/sysml/src/examples/Arrowhead Framework Example/AHFSequences.sysml new file mode 100644 index 0000000000000000000000000000000000000000..88c2c0996fb885fc9cb0154476f986841f33d717 --- /dev/null +++ b/src/sysml/src/examples/Arrowhead Framework Example/AHFSequences.sysml @@ -0,0 +1,122 @@ +// ** This is the Norwegian use-case for Arrowhead Framework */ +package AHFNorwaySequences { + // Here we show sequences of the Norwegian use-case + private import AHFProfileLib::*; + private import AHFCoreLib::*; + private import AHFNorway::*; + private import ScalarValues::*; + + part AHFN_LocalCloudDD_Seqs = AHFNorway_LocalCloudDD{ + occurrence def APIS_transfer_lifetime { + // lifetime orderings + ref part tlc = AHFNorway_LocalCloudDD.TellUConsumer{ + event occurrence call_getItems1; + then event occurrence return_getItems1; + event occurrence call_getItems2; + then event occurrence return_getItems2; + } + ref part apsp = AHFNorway_LocalCloudDD.APISProducer{ + event occurrence send_publish_returnallitems; + then event occurrence receive_call_getItems1; + then event occurrence send_returnallitems1; + then event occurrence return_getItems_ack1; + then event occurrence receive_call_getItems2; + then event occurrence send_returnallitems2; + then event occurrence return_getItems_ack2; + } + ref part mqtts = AHFNorway_LocalCloudDD.MQTTServer{ + event occurrence receive_publish_returnallitems; + then event occurrence receive_subscribe_returnallitems; + then event forw1:MQTTforwarding; + then event forw2:MQTTforwarding; + } + ref part apsc = AHFNorway_LocalCloudDD.APISConsumer{ + event occurrence send_subscribe_returnallitems; + then event forw1:MQTTforwarding; + then event forw2:MQTTforwarding; + } + occurrence forw1:MQTTforwarding; + occurrence forw2:MQTTforwarding; + + message publish_returnallitems of Publish + from apsp.send_publish_returnallitems to mqtts.receive_publish_returnallitems; + message subscribe_returnallitems of Subscribe + from apsc.send_subscribe_returnallitems to mqtts.receive_subscribe_returnallitems; + message call_getItems1 of CallGiveItems[1] + from tlc.call_getItems1 to apsp.receive_call_getItems1; + bind apsp.send_returnallitems1 = forw1.mq; // binding the sending to the actual gate + /* How to express that this event sends a Return_AllItems? */ + message returnack1 of ResultGiveItems + from apsp.return_getItems_ack1 to tlc.return_getItems1; + message call_getItems2 of CallGiveItems[1] + from tlc.call_getItems2 to apsp.receive_call_getItems2; + bind apsp.send_returnallitems2 = forw2.mq; // binding the sending to the actual gate + message returnack2 of ResultGiveItems + from apsp.return_getItems_ack2 to tlc.return_getItems2; + } + + occurrence def MQTTforwarding { + ref part mqttsf = AHFNorway_LocalCloudDD.MQTTServer{ + event occurrence receive_returnallitems; + then event occurrence send_returnallitems; + } + + ref part apscf :> AHFNorway_LocalCloudDD.APISConsumer { + event occurrence receive_returnallitems; + } + + in event occurrence mq; // parameter for gate + + message sendallitems1 of Return_AllItems + from mq to mqttsf.receive_returnallitems; + message sendallitems2 of Return_AllItems + from mqttsf.send_returnallitems to apscf.receive_returnallitems; + } + + + interface APIS_transfer_interface : Interfaces::Interface connect ( + tlu ::> AHFNorway_LocalCloudDD.TellUConsumer.apisp.APIS_HTTP, // port reference + apsph ::> AHFNorway_LocalCloudDD.APISProducer.tellu.APIS_HTTP, + apspm ::> AHFNorway_LocalCloudDD.APISProducer.apisc.APIS_MQTT, + apsc ::> AHFNorway_LocalCloudDD.APISConsumer.apisp.APIS_MQTT, + mqget ::> AHFNorway_LocalCloudDD.MQTTServer.getTopic, + mqgive ::> AHFNorway_LocalCloudDD.MQTTServer.giveTopic) { + + message publish_returnallitems of Publish + from apspm to mqget; + message subscribe_returnallitems of Subscribe + from apsc to mqgive; + message call_getItems of CallGiveItems[1] + from tlu to apsph; + message returnallitems of Return_AllItems + from apspm to mqget; + message sendallitems of Return_AllItems + from mqgive to apsc; + message returnack of ResultGiveItems + from apsph to tlu; + + // Successions on each lifetime + // tlu + succession first call_getItems.startShot + then returnack.endShot; + // apisp (taking both ports) + succession first publish_returnallitems.startShot + then call_getItems.endShot; + succession first call_getItems.endShot + then returnallitems.startShot; + succession first returnallitems.startShot + then returnack.startShot; + // MQTTServer + succession first publish_returnallitems.endShot + then subscribe_returnallitems.endShot; + succession first subscribe_returnallitems + then returnallitems.endShot; + succession first returnallitems.endShot + then sendallitems.startShot; + // apisc + succession first subscribe_returnallitems.startShot + then sendallitems.endShot; + } + + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Camera Example/Camera.sysml b/src/sysml/src/examples/Camera Example/Camera.sysml new file mode 100644 index 0000000000000000000000000000000000000000..28d9fd1f77c4e81fd8ea68d528fad94bf70f49a4 --- /dev/null +++ b/src/sysml/src/examples/Camera Example/Camera.sysml @@ -0,0 +1,14 @@ +part def Camera { + private import PictureTaking::*; + + perform action takePicture[*] :> PictureTaking::takePicture; + + part focusingSubsystem { + perform takePicture.focus; + } + + part imagingSubsystem { + perform takePicture.shoot; + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Camera Example/PictureTaking.sysml b/src/sysml/src/examples/Camera Example/PictureTaking.sysml new file mode 100644 index 0000000000000000000000000000000000000000..ad9b63968b584537b5bad402537f7b1980a37f56 --- /dev/null +++ b/src/sysml/src/examples/Camera Example/PictureTaking.sysml @@ -0,0 +1,12 @@ +package PictureTaking { + part def Exposure; + + action def Focus { out xrsl: Exposure; } + action def Shoot { in xsf: Exposure; } + + action takePicture { + action focus: Focus[1]; + flow focus.xrsl to shoot.xsf; + action shoot: Shoot[1]; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Cause and Effect Examples/CauseAndEffectExample.sysml b/src/sysml/src/examples/Cause and Effect Examples/CauseAndEffectExample.sysml new file mode 100644 index 0000000000000000000000000000000000000000..0cc238de895337cce40887137da05c7804373cfd --- /dev/null +++ b/src/sysml/src/examples/Cause and Effect Examples/CauseAndEffectExample.sysml @@ -0,0 +1,55 @@ +package CauseAndEffectExample { + private import CauseAndEffect::*; + + part def Causer1; + part def Causer2; + part def Effected1; + part def Effected2; + + #multicausation connection def MultiCauseEffect { + end #cause cause1 : Causer1; + end #cause cause2 : Causer2; + end #effect effect1 : Effected1; + end #effect effect2 : Effected2; + } + + part causer1 : Causer1; + part causer2 : Causer2; + part effected1 : Effected1; + part effected2 : Effected2; + + #multicausation connection : MultiCauseEffect connect + ( cause1 ::> causer1, cause2 ::> causer2, + effect1 ::> effected1, effect2 ::> effected2 ); + + #multicausation connect + ( cause1 ::> causer1, cause2 ::> causer2, + effect1 ::> effected1, effect2 ::> effected2 ); + + occurrence a; + item b; + part c; + action d; + + #multicausation connection { + end #cause ::> a; + end #cause ::> b; + end #effect ::> c; + end #effect ::> d; + } + + #cause causeA ::> a; + #cause causeB ::> b; + #effect effectC ::> c; + #effect effectD ::> d; + + #multicausation connect ( causeA, causeB, effectC, effectD ); + + #causation connect a to c; + #causation connect b to d { + @CausationMetadata { + isNecessary = true; + probability = 0.1; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Cause and Effect Examples/MedicalDeviceFailure.sysml b/src/sysml/src/examples/Cause and Effect Examples/MedicalDeviceFailure.sysml new file mode 100644 index 0000000000000000000000000000000000000000..75626e65f41505d90ad93ca4b2007cf7b79582cc --- /dev/null +++ b/src/sysml/src/examples/Cause and Effect Examples/MedicalDeviceFailure.sysml @@ -0,0 +1,25 @@ +package MedicalDeviceFailure { + private import CauseAndEffect::*; + + part medicalDevice { + part battery { + event occurrence depleted; + event occurrence cannotBeCharged; + } + + event occurrence deviceFails; + + ref patient { + event occurrence therapyDelayed; + } + + #multicausation connection { + end #cause ::> battery.depleted; + end #cause ::> battery.cannotBeCharged; + end #effect ::> deviceFails; + } + + #causation connect deviceFails to patient.therapyDelayed; + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Comment Examples/Comments.sysml b/src/sysml/src/examples/Comment Examples/Comments.sysml new file mode 100644 index 0000000000000000000000000000000000000000..324319d88bf2d843f04b32dc21b7bacc32ebaab6 --- /dev/null +++ b/src/sysml/src/examples/Comment Examples/Comments.sysml @@ -0,0 +1,15 @@ +package Comments { + doc /* Documentation Comment */ + + doc /* Documentation about Package */ + + comment cmt /* Named Comment */ + comment cmt_cmt about cmt /* Comment about Comment */ + + comment about C /* Documention Comment on Part Def */ + part def C { + doc /* Documentation in Part Def */ + comment /* Comment in Part Def */ + comment about Comments /* Comment about Package */ + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Flashlight Example/Flashlight Example.sysml b/src/sysml/src/examples/Flashlight Example/Flashlight Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..3f755946cbe3c73d170868f86e411b3028a1ce8d --- /dev/null +++ b/src/sysml/src/examples/Flashlight Example/Flashlight Example.sysml @@ -0,0 +1,60 @@ +package 'Flashlight Example' { + + attribute def OnOffCmd; + attribute def Light; + + port def OnOffCmdPort { + out onOffCmd : OnOffCmd; + } + + port def LightPort { + out light: Light; + } + + part context { + part user { + port onOffCmdPort: OnOffCmdPort; + perform illuminateRegion.sendOnOffCmd { + out onOffCmd = onOffCmdPort.onOffCmd; + } + } + + interface userToFlashlight connect user.onOffCmdPort to flashlight.onOffCmdPort { + ref flow references illuminateRegion.onOffCmdFlow + from source.onOffCmd to target.onOffCmd; + } + + part flashlight { + port onOffCmdPort: ~OnOffCmdPort; + + perform illuminateRegion.produceDirectedLight { + in onOffCmd = onOffCmdPort.onOffCmd; + out light = lightPort.light; + } + + port lightPort: LightPort ; + } + part reflectingSource { + port lightPort: ~LightPort; + + perform illuminateRegion.reflectLight { + in light = lightPort.light; + } + } + } + + action illuminateRegion { + action sendOnOffCmd { out onOffCmd: OnOffCmd; } + + succession flow onOffCmdFlow from sendOnOffCmd.onOffCmd to produceDirectedLight.onOffCmd; + + action produceDirectedLight { in onOffCmd; out light: Light; } + + succession flow lightFlow from produceDirectedLight.light to reflectLight.light; + + action reflectLight { in light: Light; } + } + + + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Geometry Examples/CarWithEnvelopingShape.sysml b/src/sysml/src/examples/Geometry Examples/CarWithEnvelopingShape.sysml new file mode 100644 index 0000000000000000000000000000000000000000..a7186d4e12fd061b0e14304979e928505c3e2396 --- /dev/null +++ b/src/sysml/src/examples/Geometry Examples/CarWithEnvelopingShape.sysml @@ -0,0 +1,17 @@ +package CarWithEnvelopingShape { + private import ShapeItems::Box; + private import SI::mm; + + part def Car { + doc + /* + * Example car with simple enveloping shape that is a solid box + */ + + item boundingBox : Box [1] :> boundingShapes { + :>> length = 4800 [mm]; + :>> width = 1840 [mm]; + :>> height = 1350 [mm]; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Geometry Examples/CarWithShapeAndCSG.sysml b/src/sysml/src/examples/Geometry Examples/CarWithShapeAndCSG.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f6a4d69d8e1ab055a76457ca1c9860203a6e77eb --- /dev/null +++ b/src/sysml/src/examples/Geometry Examples/CarWithShapeAndCSG.sysml @@ -0,0 +1,88 @@ +package CarWithShapeAndCSG { + private import SpatialItems::*; + private import ShapeItems::*; + private import Objects::Point; + private import Quantities::VectorQuantityValue; + private import MeasurementReferences::CoordinateFrame; + private import MeasurementReferences::TranslationRotationSequence; + private import MeasurementReferences::Translation; + private import MeasurementReferences::Rotation; + private import SI::*; + + part def Car :> SpatialItem { + doc + /* + * Car with simple engine + */ + + item :>> shape = Cuboid(4800 [mm], 1840 [mm], 1350 [mm]); + + attribute datum :>> coordinateFrame { + :>> mRefs = (mm, mm, mm); + } + + part powerSource : Engine [1] :> componentItems { + :>> ecf { + :>> mRefs = datum.mRefs; + :>> transformation : TranslationRotationSequence { + :>> source = datum; + :>> elements = ( Translation((3800, (1840-190)/2, 40)[datum]) ); + } + } + } + } + + part def Engine :> SpatialItem { + doc + /* + * Simple 2-cylinder engine + * + * Note: The engine shape is modeled as a rectangular box with two cylindrical holes, a gross simplification. + */ + + item :>> shape [1]; + + attribute engineCoordinateFrame :>> coordinateFrame; + + part rawEngineBlock : SpatialItem [1] { + item :>> shape : Box [1] { + :>> length = 300 [mm]; + :>> width = 190 [mm]; + :>> height = 330 [mm]; + } + } + + private attribute rearCylinderSpacing = 90 [mm]; + private item cylinder1 : SpatialItem [1] { + item :>> shape : Cylinder [1] { + :>> radius = 55 [mm]; + :>> height = 350 [mm]; + } + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> source = ecf; + :>> elements = (Translation( (rearCylinderSpacing, rawEngineBlock.shape.width/2, -10)[ecf])); + } + } + } + + private attribute cylinderSpacing = 2*cylinder1.shape.radius + 20 [mm]; + private item cylinder2 : SpatialItem [1] { + item :>> shape : Cylinder [1] { + :>> radius = cylinder1.shape.radius; + :>> height = cylinder1.shape.height; + } + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> source = ecf; + :>> elements = ( Translation((rearCylinderSpacing + cylinderSpacing, rawEngineBlock.shape.width/2, -10)[ecf]) ); + } + } + } + + /* CSG difference of rawEngineBlock minus cylinder1 minus cylinder2 */ + attribute :> differencesOf[1] { + item :>> elements = (rawEngineBlock, cylinder1, cylinder2); + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Geometry Examples/ExternalShapeRefExample.sysml b/src/sysml/src/examples/Geometry Examples/ExternalShapeRefExample.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4bcd856aca80f5d58c45ed22bc1eac4ae65db2ac --- /dev/null +++ b/src/sysml/src/examples/Geometry Examples/ExternalShapeRefExample.sysml @@ -0,0 +1,31 @@ +package ExternalShapeRefExample { + private import ScalarValues::String; + private import ShapeItems::*; + private import ISQ::mass; + private import SI::mm; + + metadata def ExternalShapeRef { + doc + /* + * Metadata to reference an externally defined shape. + */ + + attribute purpose : String[1]; + attribute shapeIri : String[1]; + } + + part myBatteryUnit { + item :>> shape : Shell { + metadata ExternalShapeRef { + purpose = "highLoD"; + shapeIri = "file:/detailed-geometry/LEMS-250W_BatteryHousing_Example.step"; + } + } + + private item envelopingBoxBatteryUnit : Box :> envelopingShapes { + :>> length = 140[mm]; + :>> width = 148[mm]; + :>> height = 90[mm]; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Geometry Examples/SimpleQuadcopter.sysml b/src/sysml/src/examples/Geometry Examples/SimpleQuadcopter.sysml new file mode 100644 index 0000000000000000000000000000000000000000..47f0bf335ebf5b1fbe534e4bc9e9769bbd70a55a --- /dev/null +++ b/src/sysml/src/examples/Geometry Examples/SimpleQuadcopter.sysml @@ -0,0 +1,247 @@ +package SimpleQuadcopter { + private import ISQ::*; + private import SI::*; + private import SpatialItems::*; + private import ShapeItems::*; + private import RealFunctions::sqrt; + private import TrigFunctions::pi; + private import TrigFunctions::tan; + private import MeasurementReferences::CoordinateFrame; + private import MeasurementReferences::TranslationRotationSequence; + private import MeasurementReferences::Translation; + private import MeasurementReferences::Rotation; + + part motorShape : SpatialItem { + item :>> shape : Cylinder { + :>> radius = 18 [mm]; + :>> height = 30 [mm]; + } + } + + part def Strut :> SpatialItem { + // By default will get same coordinateFrame.mRefs as owning SpatialItem, i.e.: + // attribute :>> coordinateFrame { :>> mRefs = (mm, mm, mm); } + + /* rawStrut is a construction shape: a rectangular beam */ + part rawStrut : SpatialItem { + item :>> shape : Box { + :>> length = 160 [mm]; + :>> width = 15 [mm]; + :>> height = 8 [mm]; + } + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (0, shape.width/2, 0)[source])); + } + } + } + + /* motorCutout is a construction shape: a cylinder of the same shape as the */ + part motorCutout : SpatialItem { + item :>> shape = motorShape.shape; + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (175, 0, -1)[source])); + } + } + } + + /* Strut shape is CSG difference of rawStrut minus motorCutout */ + attribute :> differencesOf[1] { + item :>> elements = (rawStrut, motorCutout); + } + } + + part def PropellerMotorAssy :> SpatialItem { + // By default will get same coordinateFrame.mRefs as owning CompoundSpatialItem, i.e.: + // attribute :>> coordinateFrame { :>> mRefs = (mm, mm, mm); } + + part propeller : SpatialItem { + item :>> shape : Cylinder { + doc /* propeller stay-out volume, without propeller shaft */ + :>> radius = 80 [mm]; + :>> height = 6 [mm]; + } + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (175, 0, 31)[source])); + } + } + } + + part motor : SpatialItem { + item :>> shape = motorShape.shape; + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (175, 0, 0)[source])); + } + } + } + + // By default the shape of a PropellerMotorAssy is the union of its owned composite items and parts that are SpatialItems. + } + + part def Camera :> SpatialItem { + // By default will get same coordinateFrame.mRefs as owning CompoundSpatialItem, i.e.: + // attribute :>> coordinateFrame { :>> mRefs = (mm, mm, mm); } + + part cameraHousing : SpatialItem { + item :>> shape : Cylinder { + :>> radius = 15 [mm]; + :>> height = 24 [mm]; + } + } + + /* The field of view is modeled as an item, since it is not a part of the quadcopter but rather a stay-out volume + * that can for example be used to formulate a constraint. + */ + item fieldOfView : SpatialItem { + doc /* Conical field of view with half-top angle 20 degree */ + item :>> shape : Cone { + :>> radius = height * tan(20 * pi/180) [mm]; + :>> height = 500 [mm]; + } + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Rotation( (0, 1, 0)[source], 180['°'])); + } + } + } + + // By default the shape of a Camera is the union of its owned composite items and parts that are SpatialItems. + } + + part quadCopter : SpatialItem { + attribute datum :>> coordinateFrame { + doc /* The datum is the top level coordinate frame of the system-of-interest, i.e., the quadcopter. + * By convention its origin is placed at the bottom of the mainBody with the +X axis pointing in the + * forward fligth (velocity) direction and the +Z axis pointing upward. The +Y axis completes the + * right-handed Cartesian coordinate system. + */ + :>> mRefs = (mm, mm, mm); + } + + part mainBody : SpatialItem { + + /* rawBody is a construction shape: the enveloping rectangular box */ + part rawBody : SpatialItem { + item :>> shape : Box { + :>> length = 160 [mm]; + :>> width = 15 [mm]; + :>> height = 8 [mm]; + } + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (0, shape.width/2, 0)[source])); + } + } + } + + /* cuttingBox is a construction shape: the enveloping rectangular box */ + part cuttingCornersBox : SpatialItem { + item :>> shape : Box { + :>> length = 105 [mm]; + :>> width = 105 [mm]; + :>> height = 60 [mm]; + } + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (0, -shape.length/sqrt(2), -10)[source]), + Rotation((0, 0, 1)[source], 45['°'])); + } + } + } + + /* Main body shape is the CSG intersection of rawBody and cuttingCornersBox */ + attribute :> intersectionsOf[1] { + item :>> elements = (rawBody, cuttingCornersBox); + } + // Current syntax is not end-user friendly + // It will be possible to specify following simple CSG expression: + // item :>> shape = rawBody & cuttingCornersBox; + } + + // Helper construction parameters + private attribute xStrut : LengthValue = 49.60[mm]; + private attribute yStrut : LengthValue = 24.65[mm]; + private attribute zStrut : LengthValue = 25[mm]; + private attribute zPMAssy : LengthValue = 12[mm]; + + part strut1 : Strut { + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (xStrut.num, yStrut.num, zStrut.num)[source]), + Rotation((0, 0, 1)[source], 45['°'])); + } + } + } + part strut2 : Strut { + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (-xStrut.num, yStrut.num, zStrut.num)[source]), + Rotation((0, 0, 1)[source], 135['°'])); + } + } + } + part strut3 : Strut { + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (-xStrut.num, -yStrut.num, zStrut.num)[source]), + Rotation((0, 0, 1)[source], 225['°'])); + } + } + } + part strut4 : Strut { + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (xStrut.num, -yStrut.num, zStrut.num)[source]), + Rotation((0, 0, 1)[source], 315['°'])); + } + } + } + + part propellerMotorAssy1 : PropellerMotorAssy { + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (xStrut.num, yStrut.num, zPMAssy.num)[source]), + Rotation((0, 0, 1)[source], 45['°'])); + } + } + } + part propellerMotorAssy2 : PropellerMotorAssy { + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (-xStrut.num, yStrut.num, zPMAssy.num)[source]), + Rotation((0, 0, 1)[source], 135['°'])); + } + } + } + part propellerMotorAssy3 : PropellerMotorAssy { + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (-xStrut.num, -yStrut.num, zPMAssy.num)[source]), + Rotation((0, 0, 1)[source], 225['°'])); + } + } + } + part propellerMotorAssy4 : PropellerMotorAssy { + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (xStrut.num, -yStrut.num, zPMAssy.num)[source]), + Rotation((0, 0, 1)[source], 315['°'])); + } + } + } + + /* The camera is placed protruding from the +X face of the main body, rotated about the +Y axis over 50° downwards */ + part camera : Camera { + attribute :>> coordinateFrame { + :>> transformation : TranslationRotationSequence { + :>> elements = (Translation( (59, 0, 2)[source]), + Rotation((0, 1, 0)[source], 50['°'])); + } + } + } + + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Geometry Examples/VehicleGeometryAndCoordinateFrames.sysml b/src/sysml/src/examples/Geometry Examples/VehicleGeometryAndCoordinateFrames.sysml new file mode 100644 index 0000000000000000000000000000000000000000..df42084b2cae583b8ba9056d9864a309ba654a06 --- /dev/null +++ b/src/sysml/src/examples/Geometry Examples/VehicleGeometryAndCoordinateFrames.sysml @@ -0,0 +1,131 @@ +package VehicleGeometryAndCoordinateFrames { + private import TrigFunctions::*; + private import ISQ::*; + private import SI::*; + private import Time::*; + + private import ShapeItems::*; + private import SpatialItems::*; + + private import MeasurementReferences::CoordinateFrame; + private import MeasurementReferences::TranslationRotationSequence; + private import MeasurementReferences::Translation; + private import MeasurementReferences::Rotation; + + private import Collections::Array; + private import ScalarValues::Boolean; + private import ScalarValues::Real; + private import ScalarValues::Natural; + private import ControlFunctions::forAll; + + part def Vehicle :> SpatialItem; + + part def Chassis :> SpatialItem { + item :>> shape = Box(4800 [mm], 1840 [mm], 1350 [mm]); + } + + part def Wheel :> SpatialItem { + doc + /* + * Generic wheel with lugbolts + * + * The radius is estimated for a 22 inch hub plus 110 mm tire height. + * The wheel width is equal to the cylinder height. + * The wheel has 5 lugbolts that are evenly distributed along a circle centered at the wheel's center. + */ + + ref item :>> self : Wheel; + item :>> shape : Cylinder { + :>> radius = 22/2*25.4 + 110 [mm]; + :>> height = 220 [mm]; + } + attribute wheelCoordinateFrame : CoordinateFrame; + + attribute numberOfBolts : Natural = 5; + part lugBolts : LugBolt[1..numberOfBolts]; + + /* + * As an example of a more involved placement of composite parts, constrain the positions of the coordinate frame origins + * of the lugbolts to a circle with radius lbpr distributed evenly over 360°. + */ + attribute lugBoltPlacementRadius :>> radius default 60 [mm]; + private attribute lugBoltDistributionAngle :>> planeAngle = 360/numberOfBolts ['°']; + private attribute lbda : Real = lugBoltDistributionAngle.num * (pi/180); // lugBoltDistributionAngle in radian + assert constraint { + (1..numberOfBolts)->forAll { + in i : Natural; + private attribute lbcf = lugBolts#(i).coordinateFrame; + private attribute trs : TranslationRotationSequence { + :>> source = wcf; + :>> target = lbcf; + :>> elements = Translation((lbpr*cos((i-1)*lbda), lbpr*sin((i-1)*lbda), -8)[wcf]); + } + lbcf.transformation == trs + } + } + } + + part def LugBolt :> SpatialItem { + item :>> shape : Cylinder { + :>> radius = 14 [mm]; + :>> height = 40 [mm]; + } + } + + part vehicle : Vehicle, SpatialItem { + /* + * Vehicle frame origin at center of bottom plate of chassis + * with +Z upwards and +X in the forward (front) direction + */ + attribute datum :>> coordinateFrame { + :>> mRefs = (mm, mm, mm); + } + + part chassis : Chassis[1] :> componentItems { + attribute :>> coordinateFrame { + attribute :>> transformation : TranslationRotationSequence { + attribute :>> source = datum; + attribute :>> elements = Translation((-(shape as Box).length/2, -(shape as Box).width/2, 0)[datum]); + } + } + } + + private attribute plusXAxis : Array { :>> dimensions = 3; :>> elements : Real[3] = (1, 0, 0); } + private attribute frontWheelXShift : Real = 1670; + private attribute rearWheelXShift : Real = -1820; + private attribute wheelYShift : Real = 720; + + part leftFrontWheel : Wheel[1] :> componentItems { + attribute :>> coordinateFrame { + attribute :>> transformation : TranslationRotationSequence { + attribute :>> source = datum; + attribute :>> elements = (Translation((frontWheelXShift, wheelYShift, 80)[datum]), Rotation(plusXAxis[datum], -90['°'])); + } + } + } + part rightFrontWheel : Wheel[1] :> componentItems { + attribute :>> coordinateFrame { + attribute :>> transformation : TranslationRotationSequence { + attribute :>> source = datum; + attribute :>> elements = (Translation((frontWheelXShift, -wheelYShift, 80)[datum]), Rotation((1, 0, 0)[datum], 90['°'])); + } + } + } + part leftRearWheel : Wheel[1] :> componentItems { + attribute :>> coordinateFrame { + attribute :>> transformation : TranslationRotationSequence { + attribute :>> source = datum; + attribute :>> elements = (Translation((rearWheelXShift, wheelYShift, 80)[datum]), Rotation((1, 0, 0)[datum], 90['°'])); + } + } + } + part rightRearWheel : Wheel[1] :> componentItems { + attribute :>> coordinateFrame { + attribute :>> transformation : TranslationRotationSequence { + attribute :>> source = datum; + attribute :>> elements = (Translation((rearWheelXShift, -wheelYShift, 80)[datum]), Rotation((-1, 0, 0)[datum], 90['°'])); + } + } + } + } +} diff --git a/src/sysml/src/examples/Import Tests/AliasImport.sysml b/src/sysml/src/examples/Import Tests/AliasImport.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8a4cd5e8a3572178ae725a55276b2e65c525c0ba --- /dev/null +++ b/src/sysml/src/examples/Import Tests/AliasImport.sysml @@ -0,0 +1,13 @@ +package AliasImport { + package Definitions { + part def Vehicle; + + alias Car for Vehicle; + } + + package Usages { + private import Definitions::Car; + + part vehicle : Car; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Import Tests/CircularImport.sysml b/src/sysml/src/examples/Import Tests/CircularImport.sysml new file mode 100644 index 0000000000000000000000000000000000000000..110dfb6160967bcf8ff949cf5f2c3abe881724b5 --- /dev/null +++ b/src/sysml/src/examples/Import Tests/CircularImport.sysml @@ -0,0 +1,27 @@ +package CircularImport { + + package P1 { + public import P2::*; + part def A; + } + package P2 { + public import P1::*; + part def B; + } + package Test1 { + public import P1::*; + part x: A; + part y: B; + } + package Test2 { + public import P2::*; + part x: A; + part y: B; + } + + part x: P1::A; + + // The following should not fail. + part y: P1::B; + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Import Tests/PrivateImportTest.sysml b/src/sysml/src/examples/Import Tests/PrivateImportTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..c57b82fd35b44c9dd6123b100dc23c5fd55d8bda --- /dev/null +++ b/src/sysml/src/examples/Import Tests/PrivateImportTest.sysml @@ -0,0 +1,33 @@ +package PrivateImportTest { + package P1 { + part def A; + } + package P2 { + private import P1::*; + } + + part x: P1::A; + + public import P2::*; + // This should fail. + // A is not visible, because the import in P2 is private. + // part y: A; + // part y1: P2::A; + + package P3 { + part def B; + } + + private import P3::*; + + // This should not fail. + // Private import only restricts visibility outside the package. + part z: B; + + package P4 { + public import all P2::*; + + // This should not fail because "import all" overrides private import. + part z1: A; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Import Tests/QualifiedNameImportTest.sysml b/src/sysml/src/examples/Import Tests/QualifiedNameImportTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..dce2d6d5a1fa9889a288593c5941489606a9c714 --- /dev/null +++ b/src/sysml/src/examples/Import Tests/QualifiedNameImportTest.sysml @@ -0,0 +1,13 @@ +package QualifiedNameImportTest { + package P1 { + part def A; + } + package P2 { + package P2a { + public import P1::*; + } + // The following should not fail. + // A is a member of P2a because of the import. + part x: P2a::A; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Individuals Examples/AnalysisIndividualExample.sysml b/src/sysml/src/examples/Individuals Examples/AnalysisIndividualExample.sysml new file mode 100644 index 0000000000000000000000000000000000000000..2f83ae7245956d3d16fd78921d31c0eaffbef8ac --- /dev/null +++ b/src/sysml/src/examples/Individuals Examples/AnalysisIndividualExample.sysml @@ -0,0 +1,95 @@ +package AnalysisIndividualExample { + private import ScalarValues::*; + private import Quantities::*; + private import ISQ::*; + private import USCustomaryUnits::*; + + package VehicleQuantities { + private import MeasurementReferences::*; + + attribute def DistancePerVolumeUnit :> DerivedUnit { + private attribute distancePF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = 1; } + private attribute volumePF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -3; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (distancePF, volumePF); } + } + + attribute def DistancePerVolumeValue :> ScalarQuantityValue { + :>> num : Real; + :>> mRef : DistancePerVolumeUnit; + } + + attribute gallon : VolumeUnit = 231.0 * 'in' ** 3; + attribute mpg : DistancePerVolumeUnit = 'mi' / gallon; + attribute hp : PowerUnit = 745.7[SI::W]; + } + + package VehicleModel { + public import VehicleQuantities::*; + + part def Vehicle { + attribute power :> ISQ::power; + } + + part def Engine { + attribute peakPower :> ISQ::power; + attribute fuelEfficiency : Real; + } + + part vehicle_c1 : Vehicle { + attribute :>> power = engine.peakPower; + part engine : Engine[1]; + } + } + + package FuelEconomyAnalysisModel { + private import VehicleModel::*; + private import SequenceFunctions::size; + private import SampledFunctions::SampledFunction; + private import SampledFunctions::SamplePair; + private import ControlFunctions::forAll; + + action def FuelConsumption { + in power : PowerValue[*]; + out fuelEconomy : DistancePerVolumeValue; + } + + analysis def FuelEconomyAnalysis { + subject vehicle: Vehicle; + + action fuelConsumption : FuelConsumption { + in power = vehicle.power; + out fuelEconomy : DistancePerVolumeValue; + } + + return calculatedFuelEconomy : DistancePerVolumeValue = + fuelConsumption.fuelEconomy; + } + } + + package IndividualAnalysisModel { + private import VehicleModel::*; + private import FuelEconomyAnalysisModel::*; + + individual part def Vehicle_1 :> Vehicle; + individual part def Engine_1 :> Engine; + + individual analysis def FuelEconomyAnalysis_1 :> FuelEconomyAnalysis; + individual action def FuelConsumption_1 :> FuelConsumption; + + individual analysis fuelEconomyAnalysis_1 : FuelEconomyAnalysis_1 { + subject vehicle : Vehicle_1 :> vehicle_c1 { + individual part :>> engine : Engine_1 { + attribute :>> peakPower = 200[hp]; + attribute :>> fuelEfficiency = 0.4; + } + } + individual action :>> fuelConsumption : FuelEconomyAnalysis_1 { + snapshot :>> done :> fuelConsumption { + out :>> fuelEconomy = 35[mph]; + } + } + } + + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Individuals Examples/JohnIndividualExample.sysml b/src/sysml/src/examples/Individuals Examples/JohnIndividualExample.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8ecf160c5dd909603fba40ef3919c0f5ab03f084 --- /dev/null +++ b/src/sysml/src/examples/Individuals Examples/JohnIndividualExample.sysml @@ -0,0 +1,57 @@ +package JohnIndividualExample { + + item def Person { + doc + /* + * This is the definition of the class of persons, each of whom has an age. + */ + + attribute age : ScalarValues::Natural; + + timeslice asPresident : Person [0..*] { + doc + /* + * These are the periods during which a Person is president. + */ + } + } + + individual item def John :> Person { + doc + /* + * This the definition of the individual Person who is John. + * There is at most one such person. + */ + } + + item def Country { + doc + /* + * This is the definition of the class of countries, each of which may have + * at most one president (at any point in time). + */ + ref presidentOfCountry[0..1] : Person :> presidentOfCountry.asPresident; + } + + individual item def UnitedStates :> Country { + doc + /* + * This is the definition of the individual country that is the + * United States. It contains a single instance. The United States + * always has a president who must be at least 35 years old. + */ + + ref presidentOfUS[1] :>> presidentOfCountry { + assert constraint { age >= 35 } + } + } + + timeslice item UnitedStatesWithJohnAsPresident[*] : UnitedStates { + doc + /* + * These are the time slices of the United States during + * which John is president of the United States. + */ + ref :>> presidentOfUS : John; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceModel.sysml b/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceModel.sysml new file mode 100644 index 0000000000000000000000000000000000000000..1ddd03fe6655e48c4ec4eef3cbd47a226450dcbb --- /dev/null +++ b/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceModel.sysml @@ -0,0 +1,42 @@ +package ServerSequenceModel { + private import ScalarValues::String; + public import SignalDefinitions::*; + + package SignalDefinitions { + item def Subscribe { + attribute topic : String; + ref part subscriber; + } + + item def Publish { + attribute topic : String; + ref publication; + } + + item def Deliver { + ref publication; + } + } + + part def PubSubSequence { + part producer[1] { + event occurrence publish_source_event; + } + + message publish_message from producer.publish_source_event to server.publish_target_event; + + part server[1] { + event occurrence subscribe_target_event; + then event occurrence publish_target_event; + then event occurrence deliver_source_event; + } + + message subscribe_message from consumer.subscribe_source_event to server.subscribe_target_event; + message deliver_message from server.deliver_source_event to consumer.deliver_target_event; + + part consumer { + event occurrence subscribe_source_event; + then event occurrence deliver_target_event; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceModelOutside.sysml b/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceModelOutside.sysml new file mode 100644 index 0000000000000000000000000000000000000000..6e205fac3410f940fb1b394721cf53eb9032fa56 --- /dev/null +++ b/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceModelOutside.sysml @@ -0,0 +1,20 @@ +package ServerSequenceModelOutside { + public import ServerSequenceModel::*; + + part def PubSubSequenceOutside :> PubSubSequence { + part :>> producer { + event publish_source_event = publish_message.start; + } + + part :>> server { + event occurrence :>> subscribe_target_event = subscribe_message.done; + then event occurrence :>> publish_target_event = publish_message.done; + then event occurrence :>> deliver_source_event = deliver_message.start; + } + + part :>> consumer { /* Redundant with timing constraints on server and generic transfers. */ + event occurrence :>> subscribe_source_event = subscribe_message.start; + then event occurrence :>> deliver_target_event = deliver_message.done; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceOutsideRealization-2.sysml b/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceOutsideRealization-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..0f5d4e44bc00aaf3ad55c3e4f115e087ff7d2d6b --- /dev/null +++ b/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceOutsideRealization-2.sysml @@ -0,0 +1,101 @@ +package ServerSequenceOutsideRealization_2 { + private import ScalarValues::String; + private import ServerSequenceModelOutside::*; + private import Configuration::*; + + package Configuration { + + port def PublicationPort; + + port def SubscriptionPort; + + part producer_2[1] { + attribute someTopic : String; + private item somePublication; + /* Requiring FIFO sort (as opposed to just default) to make arrival/leave ordering + * in ServerSequenceModelOutside.sysml equivalent to accept/send ordering in + * ServerSquenceRealization-2.sysml. */ + :>> incomingTransferSort = Occurrences::earlierFirstIncomingTransferSort; + + port publicationPort : ~PublicationPort; + + perform action producerBehavior { + action publish send Publish(someTopic, somePublication) via publicationPort; + } + } + + interface producer_2.publicationPort to server_2.publicationPort { + bind source::outgoingTransfersFromSelf = target::incomingTransfersToSelf; + } + + part server_2[1] { + port publicationPort : PublicationPort; + port subscriptionPort : SubscriptionPort; + :>> incomingTransferSort = Occurrences::earlierFirstIncomingTransferSort; + + exhibit state serverBehavior { + entry; then waitForSubscription; + + state waitForSubscription; + transition subscribing + first waitForSubscription + accept sub : Subscribe via subscriptionPort + then waitForPublication; + + state waitForPublication; + transition delivering + first waitForPublication + accept pub : Publish via publicationPort + if pub.topic == subscribing.sub.topic + do send Deliver(pub.publication) to subscribing.sub.subscriber + then waitForPublication; + } + } + + interface consumer_2.subscriptionPort to server_2.subscriptionPort { + bind source::outgoingTransfersFromSelf = target::incomingTransfersToSelf; + } + + part consumer_2[1] { + attribute myTopic : String; + :>> incomingTransferSort = Occurrences::earlierFirstIncomingTransferSort; + + port subscriptionPort : ~SubscriptionPort; + + perform action consumerBehavior { + action subscribe send Subscribe(myTopic, consumer_2) to server_2; + then action delivery accept Deliver via consumer_2; + } + } + + } + + part realization_2 : PubSubSequence { + part :>> producer :> producer_2; + part :>> server :> server_2; + part :>> consumer :> consumer_2; + + message :>> publish_message: Transfers::MessageTransfer { + end :>> source = producer.publicationPort; + end :>> target = server.publicationPort; + } + message :>> subscribe_message: Transfers::MessageTransfer { + end :>> source = consumer.subscriptionPort; + end :>> target = server.subscriptionPort; + } + message :>> deliver_message: Transfers::MessageTransfer { + end :>> source = server; + end :>> target = consumer; + } + + /* Binding sent/accept messages to specification model messages. */ + /* Sends */ + bind producer_2.producerBehavior.publish.sentMessage = publish_message; + bind consumer_2.consumerBehavior.subscribe.sentMessage = subscribe_message; + bind server_2.serverBehavior.delivering.effect.sentMessage = deliver_message; + /* Accepts */ + bind consumer_2.consumerBehavior.delivery.acceptedMessage = subscribe_message; + bind server_2.serverBehavior.subscribing.accepter.acceptedMessage = subscribe_message; + bind server_2.serverBehavior.delivering.accepter.acceptedMessage = publish_message; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceOutsideRealization-3.sysml b/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceOutsideRealization-3.sysml new file mode 100644 index 0000000000000000000000000000000000000000..82cc7fd48ecb5d32b5182299e22d775d5125361d --- /dev/null +++ b/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceOutsideRealization-3.sysml @@ -0,0 +1,159 @@ +package ServerSequenceOutsideRealization_3 { + private import ScalarValues::String; + private import ServerSequenceModelOutside::*; + private import Configuration::*; + + package Configuration { + + port def PublicationPort { + in ref publish : Publish; + } + + port def SubscriptionPort { + in ref subscribe : Subscribe; + out ref deliver : Deliver; + } + + interface def PublicationInterface { + end source : ~PublicationPort; + end target : PublicationPort; + } + + interface def SubscriptionInterface { + end source : ~SubscriptionPort; + end target : SubscriptionPort; + } + + part producer_3[1] { + attribute someTopic : String; + private item somePublication; + + port publicationPort : ~PublicationPort { + out ref :>> publish; + } + + perform action producerBehavior { + action publish { + out ref request : Publish[1] = Publish(someTopic, somePublication); + } + } + + /* Internal flows are instantaneous to make arrival/leave ordering in SequenceModelOutside.sysml + * equivalent to ordering participant internals in ServerSequenceRealization-3.sysml. */ + flow publish_request from producerBehavior.publish.request to publicationPort.publish + { attribute :>> isInstant = true;} + } + + interface publication_interface : PublicationInterface connect producer_3.publicationPort to server_3.publicationPort { + flow publish_request from publication_interface.source.publish to publication_interface.target.publish; + } + + part server_3[1] { + port publicationPort : PublicationPort { + in ref :>> publish; + } + port subscriptionPort : SubscriptionPort { + in ref :>> subscribe; + out ref :>> deliver; + } + + flow subscribe_request from subscriptionPort.subscribe to serverBehavior.subscribing.request + { attribute :>> isInstant = true;} + flow publish_request from publicationPort.publish to serverBehavior.publishing.request + { attribute :>> isInstant = true;} + flow deliver_response from serverBehavior.delivering.response to subscriptionPort.deliver + { attribute :>> isInstant = true;} + + perform action serverBehavior { + + action subscribing { + in ref request : Subscribe[1]; + out attribute topic : String[1] = request.topic; + } + + then merge continuePublishing; + then action publishing { + in ref request : Publish[1]; + out attribute topic[1] = request.topic; + out ref publication[1] = request.publication; + } + + then decide; + if publishing.topic == subscribing.topic then delivering; + else continuePublishing; + + then action delivering { + in topic : String[1] = subscribing.topic; + in publication[1] = publishing.publication; + out ref response : Deliver = Deliver(publication); + } + then continuePublishing; + + } + } + + interface subscription_interface : SubscriptionInterface connect consumer_3.subscriptionPort to server_3.subscriptionPort { + flow subscribe_request from subscription_interface.source.subscribe to subscription_interface.target.subscribe; + flow deliver_response from subscription_interface.target.deliver to subscription_interface.source.deliver; + } + + part consumer_3[1] { + attribute myTopic : String; + + port subscriptionPort : ~SubscriptionPort { + out ref :>> subscribe; + in ref :>> deliver; + } + + flow subscribe_request from consumerBehavior.subscribe.request to subscriptionPort.subscribe + { attribute :>> isInstant = true;} + flow deliver_response from subscriptionPort.deliver to consumerBehavior.delivery.response + { attribute :>> isInstant = true;} + + perform action consumerBehavior { + action subscribe { + out ref request : Subscribe = Subscribe(myTopic); + } + then action delivery { + in ref response : Deliver; + } + } + } + + } + + part realization_2 : PubSubSequence { + part :>> producer :> producer_3 { + event producerBehavior.publish[1] :>> publish_source_event; + } + + part :>> server :> server_3 { + event serverBehavior.subscribing[1] :>> subscribe_target_event; + event serverBehavior.publishing[1] :>> publish_target_event; + event serverBehavior.delivering[1] :>> deliver_source_event; + } + + part :>> consumer :> consumer_3 { + event consumerBehavior.subscribe[1] :>> subscribe_source_event; + event consumerBehavior.delivery[1] :>> deliver_target_event; + } + + flow :>> publish_message from producer.producerBehavior.publish.request to server.serverBehavior.publishing.request { + event producer.publish_request[1]; + then event publication_interface.publish_request[1]; + then event server.publish_request[1]; + } + + flow :>> subscribe_message from consumer.consumerBehavior.subscribe.request to server.serverBehavior.subscribing.request { + event consumer.subscribe_request[1]; + then event subscription_interface.subscribe_request[1]; + then event server.subscribe_request[1]; + } + + flow :>> deliver_message from server.serverBehavior.delivering.response to consumer.consumerBehavior.delivery.response { + event server.deliver_response[1]; + then event subscription_interface.deliver_response[1]; + then event consumer.deliver_response[1]; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceRealization-2.sysml b/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceRealization-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..9953f47708f98da3b557c56818be06c0fda5eeac --- /dev/null +++ b/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceRealization-2.sysml @@ -0,0 +1,106 @@ +package ServerSequenceRealization_2 { + private import ScalarValues::String; + private import ServerSequenceModel::*; + private import Configuration::*; + + package Configuration { + + port def PublicationPort; + + port def SubscriptionPort; + + part producer_2[1] { + attribute someTopic : String; + private item somePublication; + + port publicationPort : ~PublicationPort; + + perform action producerBehavior { + action publish send Publish(someTopic, somePublication) via publicationPort; + } + } + + interface producer_2.publicationPort to server_2.publicationPort { + bind source::outgoingTransfersFromSelf = target::incomingTransfersToSelf; + } + + part server_2[1] { + port publicationPort : PublicationPort; + port subscriptionPort : SubscriptionPort; + + exhibit state serverBehavior { + entry; then waitForSubscription; + + state waitForSubscription; + transition subscribing + first waitForSubscription + accept sub : Subscribe via subscriptionPort + then waitForPublication; + + state waitForPublication; + transition delivering + first waitForPublication + accept pub : Publish via publicationPort + if pub.topic == subscribing.sub.topic + do send Deliver(pub.publication) to subscribing.sub.subscriber + then waitForPublication; + } + } + + interface consumer_2.subscriptionPort to server_2.subscriptionPort { + bind source::outgoingTransfersFromSelf = target::incomingTransfersToSelf; + } + + part consumer_2[1] { + attribute myTopic : String; + + port subscriptionPort : ~SubscriptionPort; + + perform action consumerBehavior { + action subscribe send Subscribe(myTopic, consumer_2) to server_2; + then action delivery accept Deliver via consumer_2; + } + } + + } + + part realization_2 : PubSubSequence { + part :>> producer :> producer_2 { + event producerBehavior.publish[1] :>> publish_source_event; + } + + part :>> server :> server_2 { + event serverBehavior.subscribing.accepter[1] :>> subscribe_target_event; + event serverBehavior.delivering.accepter[1] :>> publish_target_event; + event serverBehavior.delivering.effect[1] :>> deliver_source_event; + } + + part :>> consumer :> consumer_2 { + event consumerBehavior.subscribe[1] :>> subscribe_source_event; + event consumerBehavior.delivery[1] :>> deliver_target_event; + } + + message :>> publish_message: Transfers::MessageTransfer { + end :>> source = producer.publicationPort; + end :>> target = server.publicationPort; + } + message :>> subscribe_message: Transfers::MessageTransfer { + end :>> source = consumer.subscriptionPort; + end :>> target = server.subscriptionPort; + } + message :>> deliver_message: Transfers::MessageTransfer { + end :>> source = server; + end :>> target = consumer; + } + + /* Binding sent/accept messages to specification model messages. */ + /* Sends */ + bind producer_2.producerBehavior.publish.sentMessage = publish_message; + bind consumer_2.consumerBehavior.subscribe.sentMessage = subscribe_message; + bind server_2.serverBehavior.delivering.effect.sentMessage = deliver_message; + /* Accepts */ + bind consumer_2.consumerBehavior.delivery.acceptedMessage = subscribe_message; + bind server_2.serverBehavior.subscribing.accepter.acceptedMessage = subscribe_message; + bind server_2.serverBehavior.delivering.accepter.acceptedMessage = publish_message; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceRealization-3.sysml b/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceRealization-3.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8a0e8bcbe4929ecdcf01c941d10ac02993ab6100 --- /dev/null +++ b/src/sysml/src/examples/Interaction Sequencing Examples/ServerSequenceRealization-3.sysml @@ -0,0 +1,151 @@ +package ServerSequenceRealization_3 { + private import ScalarValues::String; + private import ServerSequenceModel::*; + private import Configuration::*; + + package Configuration { + + port def PublicationPort { + in ref publish : Publish; + } + + port def SubscriptionPort { + in ref subscribe : Subscribe; + out ref deliver : Deliver; + } + + interface def PublicationInterface { + end source : ~PublicationPort; + end target : PublicationPort; + } + + interface def SubscriptionInterface { + end source : ~SubscriptionPort; + end target : SubscriptionPort; + } + + part producer_3[1] { + attribute someTopic : String; + private item somePublication; + + port publicationPort : ~PublicationPort { + out ref :>> publish; + } + + perform action producerBehavior { + action publish { + out ref request : Publish[1] = Publish(someTopic, somePublication); + } + } + + flow publish_request from producerBehavior.publish.request to publicationPort.publish; + } + + interface publication_interface : PublicationInterface connect producer_3.publicationPort to server_3.publicationPort { + flow publish_request from publication_interface.source.publish to publication_interface.target.publish; + } + + part server_3[1] { + port publicationPort : PublicationPort { + in ref :>> publish; + } + port subscriptionPort : SubscriptionPort { + in ref :>> subscribe; + out ref :>> deliver; + } + + flow subscribe_request from subscriptionPort.subscribe to serverBehavior.subscribing.request; + flow publish_request from publicationPort.publish to serverBehavior.publishing.request; + flow deliver_response from serverBehavior.delivering.response to subscriptionPort.deliver; + + perform action serverBehavior { + + action subscribing { + in ref request : Subscribe[1]; + out attribute topic : String[1] = request.topic; + } + + then merge continuePublishing; + then action publishing { + in ref request : Publish[1]; + out attribute topic[1] = request.topic; + out ref publication[1] = request.publication; + } + + then decide; + if publishing.topic == subscribing.topic then delivering; + else continuePublishing; + + then action delivering { + in topic : String[1] = subscribing.topic; + in publication[1] = publishing.publication; + out ref response : Deliver = Deliver(publication); + } + then continuePublishing; + + } + } + + interface subscription_interface : SubscriptionInterface connect consumer_3.subscriptionPort to server_3.subscriptionPort { + flow subscribe_request from subscription_interface.source.subscribe to subscription_interface.target.subscribe; + flow deliver_response from subscription_interface.target.deliver to subscription_interface.source.deliver; + } + + part consumer_3[1] { + attribute myTopic : String; + + port subscriptionPort : ~SubscriptionPort { + out ref :>> subscribe; + in ref :>> deliver; + } + + flow subscribe_request from consumerBehavior.subscribe.request to subscriptionPort.subscribe; + flow deliver_response from subscriptionPort.deliver to consumerBehavior.delivery.response; + + perform action consumerBehavior { + action subscribe { + out ref request : Subscribe = Subscribe(myTopic); + } + then action delivery { + in ref response : Deliver; + } + } + } + + } + + part realization_2 : PubSubSequence { + part :>> producer :> producer_3 { + event producerBehavior.publish[1] :>> publish_source_event; + } + + part :>> server :> server_3 { + event serverBehavior.subscribing[1] :>> subscribe_target_event; + event serverBehavior.publishing[1] :>> publish_target_event; + event serverBehavior.delivering[1] :>> deliver_source_event; + } + + part :>> consumer :> consumer_3 { + event consumerBehavior.subscribe[1] :>> subscribe_source_event; + event consumerBehavior.delivery[1] :>> deliver_target_event; + } + + flow :>> publish_message from producer.producerBehavior.publish.request to server.serverBehavior.publishing.request { + event producer.publish_request[1]; + then event publication_interface.publish_request[1]; + then event server.publish_request[1]; + } + + flow :>> subscribe_message from consumer.consumerBehavior.subscribe.request to server.serverBehavior.subscribing.request { + event consumer.subscribe_request[1]; + then event subscription_interface.subscribe_request[1]; + then event server.subscribe_request[1]; + } + + flow :>> deliver_message from server.serverBehavior.delivering.response to consumer.consumerBehavior.delivery.response { + event server.deliver_response[1]; + then event subscription_interface.deliver_response[1]; + then event consumer.deliver_response[1]; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Mass Roll-up Example/MassConstraintExample.sysml b/src/sysml/src/examples/Mass Roll-up Example/MassConstraintExample.sysml new file mode 100644 index 0000000000000000000000000000000000000000..d8af9dfdfd5fc86ee109af5b76d5e074ecc1e4cc --- /dev/null +++ b/src/sysml/src/examples/Mass Roll-up Example/MassConstraintExample.sysml @@ -0,0 +1,117 @@ +package MassConstraintExample { + private import ISQ::*; + private import SI::*; + private import NumericalFunctions::*; + + part def Engine { + attribute m :> mass; + } + + part def Transmission { + attribute m :> mass; + } + + part def Vehicle1 { + attribute m : MassValue = eng.m + trans.m; + + part eng : Engine { + attribute :>> m : MassValue; + } + + part trans : Transmission { + attribute :>> m : MassValue; + } + } + + part def Vehicle2 { + assert constraint { m == eng.m + trans.m } + + attribute m : MassValue; + + part eng : Engine { + attribute :>> m : MassValue; + } + + part trans : Transmission { + attribute :>> m : MassValue; + } + } + + constraint def MassConstraint3 { + in totalMass : MassValue; + in partMasses : MassValue[0..*]; + + totalMass == sum(partMasses) + } + + part def Vehicle3 { + assert constraint massConstraint : MassConstraint3 { + in totalMass = m; + in partMasses = (eng.m, trans.m); + } + + attribute m : MassValue; + + part eng { + attribute m : MassValue; + } + + part trans { + attribute m : MassValue; + } + } + + constraint def MassConstraint4 { + in totalMass : MassValue; + in partMasses : MassValue[0..*]; + } + + constraint mc : MassConstraint4 { + in totalMass : MassValue; + in partMasses : MassValue[0..*]; + + totalMass == sum(partMasses) + } + + part def Vehicle4 { + assert mc { + in totalMass = m; + in partMasses = (eng.m, trans.m); + } + + attribute m : MassValue; + + part eng : Engine { + attribute :>> m : MassValue; + } + + part trans : Transmission { + attribute :>> m : MassValue; + } + } + + constraint def MassLimit { + in mass : MassValue; + in maxMass : MassValue; + + mass <= maxMass + } + + part def Vehicle5 { + assert constraint ml : MassLimit { + in mass = m; + in maxMass = 2500 [kg]; + } + + attribute m : MassValue = eng.m + trans.m; + + part eng : Engine { + attribute :>> m : MassValue; + } + + part trans : Transmission { + attribute :>> m : MassValue; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Mass Roll-up Example/MassRollup.sysml b/src/sysml/src/examples/Mass Roll-up Example/MassRollup.sysml new file mode 100644 index 0000000000000000000000000000000000000000..e483162eb8d4c87094072705047997c0bbb06651 --- /dev/null +++ b/src/sysml/src/examples/Mass Roll-up Example/MassRollup.sysml @@ -0,0 +1,27 @@ +package MassRollup { + private import NumericalFunctions::*; + + part def MassedThing { + attribute mass :> ISQ::mass; + attribute totalMass :> ISQ::mass; + } + + part simpleThing : MassedThing { + attribute redefines totalMass = mass; + } + + part compositeThing : MassedThing { + part subcomponents: MassedThing[*]; + + attribute redefines totalMass default + mass + sum(subcomponents.totalMass); + } + + part filteredMassThing :> compositeThing { + abstract attribute minMass :> ISQ::mass; + + attribute redefines totalMass = + mass + sum(subcomponents.totalMass.?{in p :> ISQ::mass; p > minMass}); + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Mass Roll-up Example/Vehicles.sysml b/src/sysml/src/examples/Mass Roll-up Example/Vehicles.sysml new file mode 100644 index 0000000000000000000000000000000000000000..fb8736c452e0aa66b896b01be7f8ddcce74cdace --- /dev/null +++ b/src/sysml/src/examples/Mass Roll-up Example/Vehicles.sysml @@ -0,0 +1,37 @@ +package VehicleMasses { + private import ScalarValues::*; + private import MassRollup::*; + + part def CarPart :> MassedThing { + attribute serialNumber: String; + } + + part car: CarPart :> compositeThing { + attribute vin redefines serialNumber; + + part carParts: CarPart[*] redefines subcomponents; + + part engine :> simpleThing, carParts { + //... + } + + part transmission :> simpleThing, carParts { + //... + } + } + + // Example usage + private import SI::*; + part c :> car { + redefines mass = 1000 [kg]; + part redefines engine { + redefines mass = 100 [kg]; + } + + part redefines transmission { + redefines mass = 50 [kg]; + } + } + + // c.totalMass --> 1150.0 [kg] +} \ No newline at end of file diff --git a/src/sysml/src/examples/Metadata Examples/IssueMetadataExample.sysml b/src/sysml/src/examples/Metadata Examples/IssueMetadataExample.sysml new file mode 100644 index 0000000000000000000000000000000000000000..b6c011f1e0b33fe759804588d64fe0300434736d --- /dev/null +++ b/src/sysml/src/examples/Metadata Examples/IssueMetadataExample.sysml @@ -0,0 +1,30 @@ +package IssueMetadataExample { + private import ModelingMetadata::Issue; + + //Example: the following identifies an issue with the interface + + metadata InterfaceCompatibilityIssue : Issue about engineToTransmissionInterface { + text = "This issue is about the interface compatability between the engine and transmission." + + "The interface def includes an end defined by a ClutchPort." + + "However, the interface usage connects the transmission port that is defined by ~DrivePwrPort." + + "This should have surfaced a compatibility issue, since the interface is not really compatible with its definition"; + } + + interface def EngineToTransmissionInterface{ + end p1:DrivePwrPort; + end p2:ClutchPort; + } + port def DrivePwrPort; + port def ClutchPort; + + part engine{ + port drivePwrPort:DrivePwrPort; + } + part transmission{ + port clutchPort:~DrivePwrPort; + } + + interface engineToTransmissionInterface:EngineToTransmissionInterface + connect engine.drivePwrPort to transmission.clutchPort; + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Metadata Examples/RationaleMetadataExample.sysml b/src/sysml/src/examples/Metadata Examples/RationaleMetadataExample.sysml new file mode 100644 index 0000000000000000000000000000000000000000..fa6b602d8760942cab2034e0fbc383f42d395fa0 --- /dev/null +++ b/src/sysml/src/examples/Metadata Examples/RationaleMetadataExample.sysml @@ -0,0 +1,24 @@ +package RationaleMetadataExample { + private import ModelingMetadata::Rationale; + + /* Example: the following provides the rationale for selecting the engine4cyl based on a trade study analysis. + The rationale could be contained in the vehicle configuration with the selected engine */ + + part engine; + part engine4cyl :> engine; + part engine6cyl :> engine; + + metadata engineSelectionRationale : Rationale about engine4cyl { + text = "This rationale for selecting the engine4cyl refers to the engineTradeOffAnalysis."; + explanation = engineTradeOffAnalysis; + } + + private import TradeStudies::*; + analysis engineTradeOffAnalysis:TradeStudy{ + subject alternatives :> engine [2] = (engine4cyl, engine6cyl); + + /* ... */ + + return selectedEngine :> engine; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Metadata Examples/RequirementMetadataExample.sysml b/src/sysml/src/examples/Metadata Examples/RequirementMetadataExample.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4501e4b79eb2492c73ba091c596ccbb7b42bf6ee --- /dev/null +++ b/src/sysml/src/examples/Metadata Examples/RequirementMetadataExample.sysml @@ -0,0 +1,34 @@ +package RequirementMetadataExample { + private import Metaobjects::SemanticMetadata; + private import ModelingMetadata::*; + private import RiskMetadata::*; + private import RiskLevelEnum::*; + + requirement def Goal; + requirement goals : Goal[*] nonunique; + metadata def goal :> SemanticMetadata { + :>> baseType = goals meta SysML::RequirementUsage; + } + + requirement <'1'> vehicleMassRequirement { + doc /* The total mass of a vehicle shall be less than or equal to the required mass. */ + + @StatusInfo { + status = StatusKind::tbd; + risk { + totalRisk = high; + technicalRisk = medium; + scheduleRisk = low; + costRisk = medium; + } + originator = "Bob"; + owner = "Mary"; + } + } + + #goal requirement deliverPayload { + assume #goal constraint payloadMassLimit; + require #goal vehicleMassRequirement; + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Metadata Examples/RiskMetadataExample.sysml b/src/sysml/src/examples/Metadata Examples/RiskMetadataExample.sysml new file mode 100644 index 0000000000000000000000000000000000000000..5db0fe86763b24dff1d03b4ed6507b4416189e9b --- /dev/null +++ b/src/sysml/src/examples/Metadata Examples/RiskMetadataExample.sysml @@ -0,0 +1,19 @@ +package RiskMetadataExample { + private import RiskMetadata::*; + private import RiskLevelEnum::*; + + part engine4cyl{ + @Risk { + totalRisk = high; + technicalRisk = medium; + scheduleRisk = medium; + } + @Risk { + totalRisk { + probability = 0.3; + impact = 0.7; + } + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Metadata Examples/VerificationMetadataExample.sysml b/src/sysml/src/examples/Metadata Examples/VerificationMetadataExample.sysml new file mode 100644 index 0000000000000000000000000000000000000000..98269d03c9ea2d30f5bd8302b2f458315c6315c2 --- /dev/null +++ b/src/sysml/src/examples/Metadata Examples/VerificationMetadataExample.sysml @@ -0,0 +1,15 @@ +package VerificationMetadataExample { + private import VerificationCases::*; + private import VerificationMethodKind::*; + + verification def MassTest; + verification massTests:MassTest { + @VerificationMethod{ kind = (test,demo); } + objective { + } + action weighVehicle { + @VerificationMethod{ kind = analyze; } + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Packet Example/PacketUsage.sysml b/src/sysml/src/examples/Packet Example/PacketUsage.sysml new file mode 100644 index 0000000000000000000000000000000000000000..39963799dda5afd40fbc6f0b06bd211d44e9593c --- /dev/null +++ b/src/sysml/src/examples/Packet Example/PacketUsage.sysml @@ -0,0 +1,16 @@ +package 'Packet Usage' { + public import Packets::*; + private import ScalarValues::Real; + + part packet1: 'Thermal Data Packet'; + part packet2: 'Thermal Data Packet'; + part packet3: 'Thermal Data Packet' { + attribute 'special data field' redefines 'packet data field'{ + attribute redefines 'user data field' { + attribute 'special data': Real; + } + } + } + +} + diff --git a/src/sysml/src/examples/Packet Example/Packets.sysml b/src/sysml/src/examples/Packet Example/Packets.sysml new file mode 100644 index 0000000000000000000000000000000000000000..11067e15a81231c1fb460eaf4d4a858103dae2d9 --- /dev/null +++ b/src/sysml/src/examples/Packet Example/Packets.sysml @@ -0,0 +1,35 @@ +package Packets { + private import ScalarValues::*; + private import Time::DateTime; + + attribute 'packet header' { } + + attribute 'packet data field' { + attribute 'packet secondary header' redefines 'packet header'; + attribute 'user data field'; + } + + part def 'Data Packet' { + attribute 'packet primary header' redefines 'packet header' { + attribute 'packet version number': Integer; + attribute 'packet identification': String; + attribute 'packet data length': Integer; + } + attribute redefines 'packet data field'; + } + + part def 'Thermal Data Packet' :> 'Data Packet' { + attribute 'packet data field' redefines Packets::'packet data field'{ + attribute 'packet secondary header' redefines 'packet header' { + attribute 'packet timestamp': DateTime; + attribute 'telemetry packet type': String; + } + + attribute 'user data field' redefines Packets::'packet data field'::'user data field' { + attribute timestamp: DateTime; + attribute temperature: Real; + } + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Requirements Examples/HSUVRequirements.sysml b/src/sysml/src/examples/Requirements Examples/HSUVRequirements.sysml new file mode 100644 index 0000000000000000000000000000000000000000..3eb53a2efa644079904d767a9c87de541fa50589 --- /dev/null +++ b/src/sysml/src/examples/Requirements Examples/HSUVRequirements.sysml @@ -0,0 +1,39 @@ +package HSUVRequirements { + private import Requirements::*; + + requirement <'UR1.1'> Load: FunctionalRequirementCheck { + // The following requirements are composite sub-requirements. + requirement Passengers; + requirement FuelCapacity; + requirement Cargo; + } + + requirement <'UR1.2'> EcoFriendliness: PerformanceRequirementCheck { + requirement <'URI1.2.1'> Emissions: PerformanceRequirementCheck { + /* The car shall meet 2010 Kyoto Accord emissions standards. */ + } + } + + requirement <'UR1.3'> Performance: PerformanceRequirementCheck { + requirement Acceleration; + requirement <'UR1.3.1'> FuelEconomy: PerformanceRequirementCheck { + /* User shall obtain fuel economy better than that provided by + * 95% of cars built in 2004. + */ + } + requirement Braking; + requirement Range; + requirement Power; + } + + requirement <'UR1.4'> Ergonomics; + + // Syntactically, should this be explicitly marked as a "group"? + requirement HybridSUVSpec { + // The following requirements are required by reference. + require Load; + require EcoFriendliness; + require Performance; + require Ergonomics; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Requirements Examples/RequirementDerivationExample.sysml b/src/sysml/src/examples/Requirements Examples/RequirementDerivationExample.sysml new file mode 100644 index 0000000000000000000000000000000000000000..69d0eb76cf4b5f2f54fa823381f284039202e9a3 --- /dev/null +++ b/src/sysml/src/examples/Requirements Examples/RequirementDerivationExample.sysml @@ -0,0 +1,39 @@ +package RequirementDerivationExample { + private import RequirementDerivation::*; + + requirement def Req1; + + requirement def Req1_1; + requirement def Req1_2; + + #derivation connection def Req1_Derivation { + end #original r1 : Req1; + end #derive r1_1 : Req1_1; + end #derive r1_2 : Req1_2; + } + + part def System; + part def Subsystem1; + part def Subsystem2; + + part system : System { + part sub1 : Subsystem1; + part sub2 : Subsystem2; + } + + part satisfactionContext { + ref :>> system; + + satisfy requirement req1 : Req1 by system; + satisfy requirement req1_1 : Req1_1 by system.sub1; + satisfy requirement req1_2 : Req1_2 by system.sub2; + + #derivation connection : Req1_Derivation { + end r1 ::> req1; + end r1_1 ::> req1_1; + end r1_2 ::> req1_1; + } + + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Requirements Examples/VehicleRequirementDerivation.sysml b/src/sysml/src/examples/Requirements Examples/VehicleRequirementDerivation.sysml new file mode 100644 index 0000000000000000000000000000000000000000..6db4ff57b742bc763ed165ae7804e606c39697e1 --- /dev/null +++ b/src/sysml/src/examples/Requirements Examples/VehicleRequirementDerivation.sysml @@ -0,0 +1,40 @@ +package VehicleRequirementDerivation { + private import RequirementDerivation::*; + + part vehicle { + attribute mass :> ISQ::mass; + + part chassis { + attribute mass :> ISQ::mass; + } + + part engine { + attribute mass :> ISQ::mass; + } + } + + requirement def MassRequirement { + subject mass :> ISQ::mass; + attribute massLimit :> ISQ::mass; + require constraint { mass <= massLimit } + } + + requirement vehicleMassRequirement : MassRequirement { + subject :>> mass = vehicle.mass; + } + + requirement chassisMassRequirement : MassRequirement { + subject :>> mass = vehicle.chassis.mass; + } + + requirement engineMassRequirement : MassRequirement { + subject :>> mass = vehicle.engine.mass; + } + + #derivation connection { + end #original ::> vehicleMassRequirement; + end #derive ::> chassisMassRequirement; + end #derive ::> engineMassRequirement; + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Room Model/RoomModel.sysml b/src/sysml/src/examples/Room Model/RoomModel.sysml new file mode 100644 index 0000000000000000000000000000000000000000..e591fae87f493aa6c1ac996e2a4e31d6e9e444a3 --- /dev/null +++ b/src/sysml/src/examples/Room Model/RoomModel.sysml @@ -0,0 +1,77 @@ +// SysML v2 Interpretation of the SysML v1 Room Connection Example +package RoomModel { + package RoomDefinitionModelLibrary{ + private import Port_Definitions::*; + private import Flow_Definitions::*; + package Part_Definitions{ + // Rooms + part def Classroom { + port classEntry: EntryWay_to_Classroom; + } + part def Storageroom { + port storageEntry: EntryWay_to_Storageroom; + } + part def Hallway { + // conjugate ports with ~ + port hallExit_to_Classroom: ~EntryWay_to_Classroom; + port hallExit_to_Storageroom: ~EntryWay_to_Storageroom; + } + } + package Port_Definitions{ + port def EntryWay_to_Classroom { + //flow properties + in ref student:Student; + in ref teacher:Teacher; + in ref furniture:Furniture; + in ref air:Air; + } + port def EntryWay_to_Storageroom { + //flow properties + in ref furniture: Furniture; + in ref air: Air; + } + } + package Flow_Definitions { + // Conveyed items between Hallway, Classroom, and Storageroom + part def Air; + part def Furniture; + part def Student; + part def Teacher; + } + } + package Room_Configuration{ + // defining the parts and their interconnection in context + private import RoomDefinitionModelLibrary::*; + private import RoomDefinitionModelLibrary::Part_Definitions::*; + private import RoomDefinitionModelLibrary::Port_Definitions::*; + private import RoomDefinitionModelLibrary::Flow_Definitions::*; + part roomContext{ + part c:Classroom; + part s:Storageroom; + part h:Hallway; + + // Connectors and item flows between hallway and classroom + flow HallToClassroom_Air + from h.hallExit_to_Classroom.air + to c.classEntry.air; + flow HallToClassroom_Furniture + from h.hallExit_to_Classroom.furniture + to c.classEntry.furniture; + flow HallToClassroom_Student + from h.hallExit_to_Classroom.student + to c.classEntry.student; + flow HallToClassroom_Teacher + from h.hallExit_to_Classroom.teacher + to c.classEntry.teacher; + flow HallToStorageroom_Air + from h.hallExit_to_Storageroom.air + to s.storageEntry.air; + flow HallToStorageroom_Furniture + from h.hallExit_to_Storageroom.furniture + to s.storageEntry.furniture; + } + } +} + + + diff --git a/src/sysml/src/examples/Simple Tests/ActionTest.sysml b/src/sysml/src/examples/Simple Tests/ActionTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..117270bceb3d9924166b09f850cff40a33946771 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/ActionTest.sysml @@ -0,0 +1,33 @@ +package ActionTest { + action def A{ in x; } + + action a: A { + first start; + + action b { in y = x; } + + bind x = b.y; + } + + attribute def S; + + action a1 { + first start; + then merge m; + then accept S; + then accept sig after 10[SI::s]; + then accept at Time::Iso8601DateTime("2022-01-30T01:00:00Z"); + + then send S() to b; + then accept when b.f; + then decide; + if true then m; + else done; + } + + action b { + attribute f : ScalarValues::Boolean; + ref action a : A; + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/AliasTest.sysml b/src/sysml/src/examples/Simple Tests/AliasTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..00e3785e311e588bde62d4c5e1c69badc3896ee0 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/AliasTest.sysml @@ -0,0 +1,22 @@ +package AliasTest { + private import ISQSpaceTime::breadth; // import of an alias + attribute b :> breadth; + + part def P1 { + port porig1; + alias po1 for porig1; + } + + part p1 : P1 { + port po1 :>> po1; + } + + part p2 : P1 { + port pdest; + alias pd1 for pdest; + } + + + connect p1.po1 to p2.pdest; + connect p1.po1 to p2.pd1; +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/AllocationTest.sysml b/src/sysml/src/examples/Simple Tests/AllocationTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..e0ce6d44c8b81713f9ba2127e1f5b9ae7d4cc73c --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/AllocationTest.sysml @@ -0,0 +1,35 @@ +package AllocationTest { + part def Logical { + part component; + } + + part def Physical { + part assembly { + part element; + } + } + + part l : Logical { + part :>> component; + } + part p : Physical { + part :>> assembly { + part :>> element; + } + } + + allocation def A; + + allocation def Logical_to_Physical :> A { + end logical : Logical; + end physical : Physical; + } + + allocation allocation1 : Logical_to_Physical allocate l to p; + allocation allocation2 : Logical_to_Physical allocate ( + logical ::> l, + physical ::> p + ); + + allocate l.component to p.assembly.element; +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/AnalysisTest.sysml b/src/sysml/src/examples/Simple Tests/AnalysisTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..b345419f04fdf9c43fa6c6a79dcefbe478148aa0 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/AnalysisTest.sysml @@ -0,0 +1,38 @@ +package AnalysisTest { + + part def V { + m; + } + + part vv : V; + + requirement def AnalysisObjective { + doc /* ... */ + } + + analysis def AnalysisCase { + subject v : V; + + objective obj : AnalysisObjective { + subject = result; + } + + v.m + } + + analysis def AnalysisPlan { + subject v : V; + + objective { + doc /* ... */ + } + + analysis analysisCase : AnalysisCase { return mass; } + } + + part analysisContext { + analysis analysisPlan : AnalysisPlan { + subject v = vv; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/AssignmentTest.sysml b/src/sysml/src/examples/Simple Tests/AssignmentTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..a2a88431ed0a5b656571734e3f01c414fdd33737 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/AssignmentTest.sysml @@ -0,0 +1,52 @@ +package AssignmentTest { + + part def Counter { + attribute count : ScalarValues::Integer := 0; + + action incr { + assign count := count + 1; + } + + action decr { + assign count := count - 1; + } + } + + attribute def Incr; + attribute def Decr; + + state def Counting { + part counter : Counter; + entry assign counter.count := 0; + + then state wait; + accept Incr + then increment; + accept Decr + then decrement; + + state increment { + do assign counter.count := counter.count + 1; + } + then wait; + + state decrement { + do assign counter.count := counter.count - 1; + } + then wait; + } + + calc def Increment { + in c : Counter; + return : Counter; + + perform c.incr; + c + } + + action a { + state counting : Counting; + assign counting.counter.count := counting.counter.count + 1; + assign counting.counter.count := Increment(counting.counter).count; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/CalculationTest.sysml b/src/sysml/src/examples/Simple Tests/CalculationTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4890d55082a25074520eda6b449b4bb4c1053e62 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/CalculationTest.sysml @@ -0,0 +1,30 @@ +package CalculationExample { + private import ISQ::*; + private import NumericalFunctions::*; + + part def VehiclePart { + attribute m : MassValue; + } + + part def Vehicle :> VehiclePart; + + part vehicle : Vehicle { + part eng : VehiclePart; + part trans : VehiclePart; + attribute ::> m = ms.totalMass; + } + + calc def MassSum { + in partMasses : MassValue[0..*]; + return totalMass : MassValue = sum(partMasses); + } + + calc ms: MassSum { + in partMasses = (vehicle.eng.m, vehicle.trans.m); + return totalMass; + } + + part vehicles[*] = (vehicle, vehicle); + attribute masses1[*] = (vehicles as VehiclePart).m; + attribute masses2[*] = (vehicles as vehicle).m; +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/CommentTest.sysml b/src/sysml/src/examples/Simple Tests/CommentTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..1cf70de30ac7533272a4cc5bc1d17ca7b7df4fea --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/CommentTest.sysml @@ -0,0 +1,44 @@ + /* AAA */ + //a lexical comment ("note") is not a part of model +package CommentTest { + // inside package + /* +*AAA + * BBB*/ + /* + * + * + * AAA *** + *BBB + */ + + /* + * AAAA + * BBBB */ + /* AAAA + + + * BBBB + * + * CCCC + */ + locale "en_US" /* + * AAAA + * BBBB + * CCC DDD + */ + + /* comment inside a package */ + doc locale "en_US" /* Documentation about Package */ + comment cmt /* Named Comment */ + comment cmt_cmt about cmt /* Comment about Comment */ + + comment about C /* Documention Comment about Part Def */ + part def C { + doc /* Documentation in Part Def */ + comment /* Comment in Part Def */ + comment about CommentTest locale "en_US" /* Comment about Package */ + } + /* abc */ + part def A; +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/ConjugationTest.sysml b/src/sysml/src/examples/Simple Tests/ConjugationTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..eccdaa1765075b6e7d3b8c457db2f66bd5cd30f9 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/ConjugationTest.sysml @@ -0,0 +1,35 @@ +package ConjugationTest { + port def P; + + part def B { + port p1: P; + port p2: ~P; + } + + connection def A { + end port p1: P; + end port p2: ~P; + } + + interface def I { + end p1: P; + end p2: ~P; + } + + part def B1 { + part p { + port p1: P; + port p2: ~P; + } + + connection a: A { + end port p3: P ::> p.p1; + end port p4: ~P ::> p.p2; + } + interface i: I { + end port p3: P ::> p.p1; + end port p4: ~P ::> p.p2; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/ConnectionTest.sysml b/src/sysml/src/examples/Simple Tests/ConnectionTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..2c14b4daafdbc7d54c6ade448d6dfe22cbf42fab --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/ConnectionTest.sysml @@ -0,0 +1,49 @@ +package ConnectionTest { + + part p { + part x { + part x1; + } + } + + part def P { + part y; + + connect p to y; + + part p1 :> p; + + connect p1.x to y; + connect p1.x.x1 to y; + } + + abstract connection def C { + part p; + end end1; + end end2; + end end3; + } + + part d1; + part d2; + part d3; + part d4; + + connection bus : C connect (d1, d2, d3, d4); + + connection : C { + end :>> end1 ::> d1; + end end2 ::> d2; + end end3 ::> d3; + } + + connection { + part q; + end end1 ::> d1 :> q; + end end2 ::> d2; + } + + abstract flow def F; + + message : F from p to p; +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/ConstraintTest.sysml b/src/sysml/src/examples/Simple Tests/ConstraintTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..af9cd200c377260154c07d4bdff0faba43102bfa --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/ConstraintTest.sysml @@ -0,0 +1,90 @@ +package ConstraintTest { + private import ISQ::MassValue; + private import SI::kg; + private import NumericalFunctions::sum; + + constraint def MassAnalysis { + attribute totalMass: MassValue; + attribute componentMasses: MassValue[0..*]; + + totalMass == sum(componentMasses) + } + + part def Component { + attribute mass: MassValue; + } + + part vehicle : Component { + part engine : Component; + part frontAxleAssembly : Component; + part rearAxleAssembly : Component; + } + + part vehicle1a :> vehicle { + assert constraint massAnalysis : MassAnalysis { + attribute redefines totalMass; + attribute redefines componentMasses; + } + + bind massAnalysis.totalMass = mass; + bind massAnalysis.componentMasses[1] = engine.mass; + bind massAnalysis.componentMasses[1] = frontAxleAssembly.mass; + bind massAnalysis.componentMasses[1] = rearAxleAssembly.mass; + } + + part vehicle1b :> vehicle { + assert constraint massAnalysis : MassAnalysis { + attribute redefines totalMass = mass; + attribute redefines componentMasses = (engine.mass, frontAxleAssembly.mass, rearAxleAssembly.mass); + } + } + + constraint def MassAnalysis2 { + in totalMass : MassValue; + in componentMasses: MassValue[0..*]; + + totalMass == sum(componentMasses) + } + + part vehicle2a :> vehicle { + assert constraint massConstraint : MassAnalysis2; + + bind massConstraint.totalMass = mass; + bind massConstraint.componentMasses[1] = engine.mass; + bind massConstraint.componentMasses[1] = frontAxleAssembly.mass; + bind massConstraint.componentMasses[1] = rearAxleAssembly.mass; + } + + part vehicle2b :> vehicle { + assert constraint massAnalysis2 : MassAnalysis2 { + in totalMass = mass; + in componentMasses = (engine.mass, frontAxleAssembly.mass, rearAxleAssembly.mass); + } + } + + constraint def MassAnalysis3 { + in totalMass : MassValue; + in componentMasses: MassValue[0..*]; + } + + constraint massAnalysis3 : MassAnalysis3 { + in totalMass : MassValue; + in componentMasses: MassValue[0..*]; + + totalMass == sum(componentMasses) + } + + part vehicle3 :> vehicle { + assert massAnalysis3 { + in totalMass = mass; + in componentMasses = (engine.mass, frontAxleAssembly.mass, rearAxleAssembly.mass); + } + } + + part vehicle4 :> vehicle { + assert constraint { mass == engine.mass + frontAxleAssembly.mass + rearAxleAssembly.mass } + } + + constraint massLimitation { mass : MassValue; massLimit : MassValue; mass < massLimit } + assert not massLimitation { :>> mass = vehicle3.mass; :>> massLimit = vehicle4.mass; } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/ControlNodeTest.sysml b/src/sysml/src/examples/Simple Tests/ControlNodeTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f24eca6bb7c1e10334c07d775bc129478ba5972e --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/ControlNodeTest.sysml @@ -0,0 +1,15 @@ +action def ControlNodeTest { + action A1; + then J; + + action A2; + then J; + + join J; + then fork F; + then B1; + then B2; + + action B1; + action B2; +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/DecisionTest.sysml b/src/sysml/src/examples/Simple Tests/DecisionTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..5a85a00df7eed10aa2ba438e50acf500fa7d818c --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/DecisionTest.sysml @@ -0,0 +1,22 @@ +action def DecisionTest { + attribute x = 1; + + decide 'test x'; + if x == 1 then A1; + if x > 1 then A2; + else A3; + + then decide; + if true then A1; + if false then A2; + + action A1; + action A2; + action A3; + + succession S first A1 + if x == 0 then A2; + + first A3; + if x > 0 then 'test x'; +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/DefaultValueTest.sysml b/src/sysml/src/examples/Simple Tests/DefaultValueTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..86847c828771cf5d3506f75a6c654c9a305f26d4 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/DefaultValueTest.sysml @@ -0,0 +1,18 @@ +package DefaultValueTest { + + part def V { + attribute m default = 10; + attribute n = 20; + } + + part v1 : V { + attribute :>> m = 20; + } + + part def W :> V { + attribute :>> m default = n; + } + + part v2 = W(); + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/DependencyTest.sysml b/src/sysml/src/examples/Simple Tests/DependencyTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..d39e4122e70290c819cc1d7a2e302f1e71f02ddb --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/DependencyTest.sysml @@ -0,0 +1,20 @@ +package DependencyTest { + + package System { + package 'Application Layer'; + package 'Service Layer'; + package 'Data Layer'; + } + + private import System::*; + + dependency Use from 'Application Layer' to 'Service Layer'; + dependency from 'Service Layer' to 'Data Layer'; + + attribute x; + attribute y; + attribute z; + + dependency z to x, y; + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/EnumerationTest.sysml b/src/sysml/src/examples/Simple Tests/EnumerationTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..2dc2fb4b55ed95f0a2d4d84329f99e92bfb9f37f --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/EnumerationTest.sysml @@ -0,0 +1,54 @@ +package EnumerationTest { + + attribute def Color { + attribute val : ScalarValues::Natural; + } + + enum def ColorKind :> Color { + doc + /* + * An EnumerationDefinition can contain only EnumerationUsages. However, + * it can specialize an AttributeDefinition in order to inherit + * common features for its enumeration values. + */ + + enum red { + :>> val = 0; + } + enum blue { + :>> val = 1; + } + enum green { + :>> val = 2; + } + } + + enum color : ColorKind; + enum color1 = ColorKind::blue; // Implicitly typed by ColorKind. + attribute color2 : ColorKind = color1; + + enum def E1 { a; b; c; + doc + /* + * The "enum" keyword is optional for EnumerationUsages used to define the + * enumerated values of an EnumerationDefinition. + */ + } + + enum def E2; + + attribute def Size :> ScalarValues::Real { + doc + /* + * An EnumerationDefinition can also be used to restrict a supertype to + * specific values. + */ + } + enum def SizeChoice :> Size { + = 60.0; + = 70.0; + = 80.0; + } + enum size: SizeChoice = 60.0; + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/FeaturePathTest.sysml b/src/sysml/src/examples/Simple Tests/FeaturePathTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..48b83980496d5a913141eb577a3739e4ef28ca9f --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/FeaturePathTest.sysml @@ -0,0 +1,43 @@ +package Q { + part def F { + part a : A; + } + + part f : F; + + part def A { + part g = f.a; + } + + part def B { + part f : F; + part a : A; + } + + part def C { + part b : B { + connect f.a to a.g; + bind f.a = a.g; + } + + part c subsets b.f { + part aa subsets a; + } + + flow b.f.a to c.aa; + } + + part e1 { + attribute x : E; + // Ensure that "e1" resolves correctly. + bind e1.x = E::e2; + } + + enum def E { + enum e1; + enum e2; + } + + part g = A().g.g.g; + +} diff --git a/src/sysml/src/examples/Simple Tests/ImportTest.sysml b/src/sysml/src/examples/Simple Tests/ImportTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..c767014c3fce2703d7244a0c5be063b9945955b0 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/ImportTest.sysml @@ -0,0 +1,18 @@ +package ImportTest { + package Pkg1 { + private import Pkg2::Pkg21::Pkg211::P211; + private import Pkg2::Pkg21::*; + private import Pkg211::*::**; + part p11 : Pkg211::P211; + part def P12; + } + + package Pkg2 { + private import Pkg1::*; + package Pkg21 { + package Pkg211 { + part def P211 :> P12; + } + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/ItemTest.sysml b/src/sysml/src/examples/Simple Tests/ItemTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..92e212d4a0580808e7400883b0e908611860f528 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/ItemTest.sysml @@ -0,0 +1,23 @@ +package ItemTest { + + item f: A; + + public item def A { + item b: B; + protected ref part c: C; + } + + abstract item def B { + public abstract part a: A; + } + + private part def C { + private in ref y: A, B; + } + + port def P { + in item a1: A; + out item a2: A; + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/MetadataTest.sysml b/src/sysml/src/examples/Simple Tests/MetadataTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..2ebd767b78013ccfc2704b8ed578d5eae559e402 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/MetadataTest.sysml @@ -0,0 +1,42 @@ +package MetadataTest { + private import 'User Defined Extensions'::*; + + library package 'User Defined Extensions' { + + #Security enum def ClassificationLevel :> ScalarValues::Natural { + uncl : ClassificationLevel = 0; + conf : ClassificationLevel = 1; + #Security enum secret : ClassificationLevel = 2; + } + + metadata def Classified { + ref :>> annotatedElement : SysML::Usage; + ref classificationLevel : ClassificationLevel; + } + + metadata def Security; + } + + ref x { + metadata Classified { + classificationLevel = ClassificationLevel::conf; + } + } + + ref y { + @Classified { + classificationLevel = ClassificationLevel::conf; + } + @Security; + } + + private ref #Classified #Security z1; + abstract #Classified z2; + + ref z { + #Security #Classified metadata Classified { + classificationLevel = ClassificationLevel::secret; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/MultiplicityTest.sysml b/src/sysml/src/examples/Simple Tests/MultiplicityTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f42d0ae8c9b4eaa271ceef86c247b1fa53345580 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/MultiplicityTest.sysml @@ -0,0 +1,19 @@ +package MultiplicityTest { + + part def P; + attribute n : ScalarValues::Integer = 5; + + part a[1]; + part b[0..2] : P; + part c : P[2..*]; + part d[*]; + + part e[n]; + part f[n..*]; + part g[1..n]; + + attribute def A { + attribute i :ScalarValues::Integer; + attribute x : A[i]; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/OccurrenceTest.sysml b/src/sysml/src/examples/Simple Tests/OccurrenceTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..e218aa0bc25f203df163c294ed82497f127fcf58 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/OccurrenceTest.sysml @@ -0,0 +1,33 @@ +package OccurrenceTest { + occurrence def Occ { + attribute a; + ref occurrence occ1 : Occ; + occurrence occ2 : Occ; + item x; + part y; + + individual snapshot s : Ind; + timeslice t; + } + + occurrence occ : Occ { + occurrence o1 : Occ; + ref occurrence o2 : Occ; + item z; + } + + individual occurrence def Ind { + snapshot s2; + timeslice t2; + } + individual occurrence ind : Ind, Occ { + snapshot s3; + individual timeslice t3; + } + + individual snapshot s4 : Ind; + + occurrence o1 { + occurrence o2; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/ParameterTest.sysml b/src/sysml/src/examples/Simple Tests/ParameterTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..32d07ef1daa65759712cbd4a410c54ee31572425 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/ParameterTest.sysml @@ -0,0 +1,16 @@ +package ParameterTest { + attribute def A { + attribute x : ScalarValues::String; + attribute y : A; + } + + attribute a : A; + + calc def F { in p : A; in q : ScalarValues::Integer; return : ScalarValues::Integer; } + + attribute f = F(a, 2); + attribute g = F(q = 1, p = a); + + attribute b = A(y=a, x=""); + attribute c = A("test2"); +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/PartTest.sysml b/src/sysml/src/examples/Simple Tests/PartTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..3eeb191dd951a84dc2ff5126e66a79c541eba5df --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/PartTest.sysml @@ -0,0 +1,44 @@ +package PartTest { + + part f: A; + + public part def A { + part <'1'> b: B; + protected port c: C; + readonly attribute x[0..2]; + derived ref attribute y :> x; + ref z : ScalarValues::Integer; + } + + abstract part def B { + public abstract part a: A[1..2]; + public abstract part b subsets a; + public abstract part c[0..1] subsets a; + port x: ~C { + port p; + ref port q; + } + package P { } + + action a1; + perform action a2; + + state s1; + exhibit state s2; + } + + private port def C { + private in ref y: A, B; + alias z1 for y; + alias z2 for y; + port c1 : C; + ref port c2 : C; + } + + part p1 :> p2; + part p2 :> p3; + part p3 :> p1; + + part p4 :> p4; + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/RequirementTest.sysml b/src/sysml/src/examples/Simple Tests/RequirementTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..7fab0245bf433639e09357f144d883018232fc32 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/RequirementTest.sysml @@ -0,0 +1,29 @@ +package RequirementTest { + constraint def C; + constraint c : C; + private import q::**; + requirement def R { + assume constraint c1 : C; + require c; + doc /* */ + requirement; + requirement def <'1'> A { + doc /* Text */ + subject s; + } + } + requirement def R1 { + require constraint c1 :>> c; + } + part p; + part q { + requirement r : R; + satisfy r by p; + assert satisfy r by q; + } + + requirement r1 : R1; + not satisfy r1 by p; + assert not satisfy r1 by q; + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/RootPackageTest.sysml b/src/sysml/src/examples/Simple Tests/RootPackageTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4be14fa2152aaf1b7bcd655c20179a5a0fc8a7dc --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/RootPackageTest.sysml @@ -0,0 +1,14 @@ +package P1 { + part def A; +} + +package P2 { + private import P1::*; + part a : A; +} + +private import P2::*; + +package P3 { + part b subsets a; +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/StateTest.sysml b/src/sysml/src/examples/Simple Tests/StateTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8aeebb121ac4dcae737a160a1497bbe17d5a24d8 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/StateTest.sysml @@ -0,0 +1,56 @@ +package StateTest { + attribute def Sig { + x; + } + attribute def Exit; + + part p; + + action act; + + state def S { + do action A; + entry; then S1; + + state S1; + accept s : Sig + do action D + then S2; + + state S2 { + do send Sig(T.s.x) to p; + state S3; + } + accept Exit then done; + + transition + first S1 + accept s : Sig + do action D + then S2.S3; + + transition T + first S2.S3 + accept s : Sig via p + if true + do send s to p + then S1; + + exit act; + } + + state s parallel { + state s1; + state s2; + } + + state s4 { + do action a; + action c; + } + + state s5 :> s4 { + do action b :>> c; + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/StructuredControlTest.sysml b/src/sysml/src/examples/Simple Tests/StructuredControlTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..7c2cade9e37f6c492abb7c5f0877aed55c208a85 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/StructuredControlTest.sysml @@ -0,0 +1,36 @@ +package StructuredControlTest { + + action { + attribute i : ScalarValues::Integer := 0; + attribute b : ScalarValues::Boolean; + + if i < 0 { + assign i := 0; + } else if i == 0 { + assign i := 1; + } else { + assign i := i + 1; + } + + if i > 0 { + assign i := i + 1; + } + + then action aLoop + while i > 0 { + assign i := i - 1; + } until b; + + then while i > 0 { + assign i := i - 1; + } + + loop { + assign i := i - 1; + } until b; + + for n : ScalarValues::Integer in (1, 2, 3) { + assign i := i * n; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/TextualRepresentationTest.sysml b/src/sysml/src/examples/Simple Tests/TextualRepresentationTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..9eed883ddfdad6a203d67226140a8a3cd3ba99c4 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/TextualRepresentationTest.sysml @@ -0,0 +1,22 @@ +package TextualRepresentationTest { + private import ScalarValues::Real; + + item def C { + attribute x: Real; + assert constraint x_constraint { + rep inOCL language "ocl" + /* self.x > 0.0 */ + } + } + + action def setX { + in c : C; + in newX : Real; + + language "alf" + /* c.x = newX; + * WriteLine("Set new x"); + */ + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/TradeStudyTest.sysml b/src/sysml/src/examples/Simple Tests/TradeStudyTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..c9ce1ca0b8628a84b3c4a787eec8e57fb488b1cb --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/TradeStudyTest.sysml @@ -0,0 +1,21 @@ +package TradeStudyTest { + private import ScalarValues::Real; + private import TradeStudies::*; + + part def Engine; + part engine1: Engine; + part engine2: Engine; + + analysis engineTradeStudy : TradeStudy { + subject : Engine[1..*] = (engine1, engine2); + objective : MaximizeObjective; + + calc :>> evaluationFunction { + in part : Engine; + return : Real; + } + + return part : Engine; + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/UseCaseTest.sysml b/src/sysml/src/examples/Simple Tests/UseCaseTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..282350489da19c6af6f367fc034530dc922b8ed4 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/UseCaseTest.sysml @@ -0,0 +1,36 @@ +package UseCaseTest { + + part def System; + part def User; + + use case def UseSystem { + subject system : System; + actor user : User; + + objective { + /* Goal */ + } + + include use case uc1 : UC1; + include use case uc2 { + subject = system; + actor user = UseSystem::user; + } + } + + use case def UC1; + + part user : User; + + use case uc2 { + actor :>> user; + } + + use case u : UseSystem; + + part system : System { + include uc2; + perform u; + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/VariabilityTest.sysml b/src/sysml/src/examples/Simple Tests/VariabilityTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..c6567c16d22596dff0bbc569eb10a488e3710be8 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/VariabilityTest.sysml @@ -0,0 +1,41 @@ +package VariabilityTest { + part def P { + attribute a; + } + + part def Q :> P; + attribute def B; + variation part def V :> P { + variant part x : Q { + attribute b : B :>> a; + } + } + + part q : Q; + variation part v : P { + variant q { + attribute b : B :>> a; + } + } + + part y : P = v::q; + + variation action def A { + variant action a1; + variant action a2; + } + + variation use case uc1 { + variant use case uc11; + variant use case uc12; + } + + variation analysis a1; + + variation verification v1; + + variation requirement r { + variant requirement r1; + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/VerificationTest.sysml b/src/sysml/src/examples/Simple Tests/VerificationTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..1224ab3161c2cb172dfd45629110967662d8a992 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/VerificationTest.sysml @@ -0,0 +1,39 @@ +package VerificationTest { + + part def V { + m : ScalarValues::Integer; + } + + part vv : V; + + requirement def R { + doc /* ... */ + } + + requirement r : R; + + verification def VerificationCase { + subject v : V; + objective { + verify requirement : R; + } + + VerificationCases::PassIf(v.m == 0) + } + + verification def VerificationPlan { + subject v : V; + + objective { + verify r; + } + + verification verificationCase : VerificationCase; + } + + part verificationContext { + verification verificationPlan : VerificationPlan { + subject v = vv; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Simple Tests/ViewTest.sysml b/src/sysml/src/examples/Simple Tests/ViewTest.sysml new file mode 100644 index 0000000000000000000000000000000000000000..ff111edd1874bfd945e84eefe3afd41708cf8bf6 --- /dev/null +++ b/src/sysml/src/examples/Simple Tests/ViewTest.sysml @@ -0,0 +1,44 @@ +package ViewTest { + package P { + public part p1; + private part p2; + } + + part def S; + + concern def C { + stakeholder s : S; + } + + concern c : C { + stakeholder s1; + } + + viewpoint def VP { + frame c; + } + + rendering def R; + + rendering r : R; + + view def V { + viewpoint vp: VP { + frame concern c1; + concern c2; + } + render rendering r1: R[0..1]; + + view v: V[0..*] { + expose P::*; + render r; + + rendering r2; + + alias vp1 for p1; + // Note: "expose" imports all. + alias vp2 for p2; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/State Space Representation Examples/CartSample.sysml b/src/sysml/src/examples/State Space Representation Examples/CartSample.sysml new file mode 100644 index 0000000000000000000000000000000000000000..9a208904344e5912e063c48ace21a8bb9e4d4153 --- /dev/null +++ b/src/sysml/src/examples/State Space Representation Examples/CartSample.sysml @@ -0,0 +1,64 @@ +// State Space Representation cart example + +package CartSample { + private import StateSpaceRepresentation::*; + part def Cart { + attribute mass :> ISQ::mass; + + attribute def CartInput :> Input { + attribute force :> ISQ::force; + } + + attribute def CartOutput :> Output { + attribute velocity :> ISQ::speed; + } + + attribute def CartState :> StateSpace { + attribute velocity :> ISQ::speed; + } + + attribute def CartStateDerivative :> StateDerivative { + ref :>> stateSpace : CartState; + attribute accel :> ISQ::acceleration; + } + } + + part def Pusher { + attribute def PusherOutput :> Output { + attribute force :> ISQ::force; + } + } + + part context { + part cart : Cart { + action cartBehavior : ContinuousStateSpaceDynamics { + in input : CartInput; + out output : CartOutput; + :>> stateSpace : CartState; + + calc :>> getDerivative { + in input: CartInput; + in stateSpace: CartState; + CartStateDerivative(input.force / mass) + } + calc :>> getOutput { + in :>> stateSpace : CartState; + CartOutput(stateSpace.velocity) + } + } + } + part pusher : Pusher { + attribute pusherForce :> ISQ::force; + + action pusherBehavior : ContinuousStateSpaceDynamics { + in input; + out output : PusherOutput; + calc :>> getOutput { + PusherOutput(pusherForce) + } + } + } + + flow pusher.pusherBehavior.output.force to cart.cartBehavior.input.force; + } +} diff --git a/src/sysml/src/examples/State Space Representation Examples/EVSample.sysml b/src/sysml/src/examples/State Space Representation Examples/EVSample.sysml new file mode 100644 index 0000000000000000000000000000000000000000..81de40e84bca871d96474360cf8a5ea064291636 --- /dev/null +++ b/src/sysml/src/examples/State Space Representation Examples/EVSample.sysml @@ -0,0 +1,319 @@ +// State Space Representation EV example +package EVSample { + private import SI::*; + private import StateSpaceRepresentation::*; + + attribute <'A⋅h'> 'ampere hour' : ElectricChargeUnit = A*h; + + part def Vehicle { + attribute mass :> ISQ::mass; + + attribute def VehicleInput :> Input { + attribute force :> ISQ::force; + } + + attribute def VehicleOutput :> Output { + attribute accel :> ISQ::acceleration; + attribute velocity :> ISQ::speed; + attribute distance :> ISQ::distance; + } + + attribute def VehicleState :> StateSpace { + attribute velocity :> ISQ::speed; + attribute distance :> ISQ::distance; + } + } + + part def Battery { + attribute baseVoltage :> ISQ::electricPotential; + attribute socInit: ScalarValues::Real; + attribute capacity :> ISQ::electricCharge; + attribute internalResistance :> ISQ::resistance; + + attribute def BatteryInput :> Input { + attribute current :> ISQ::electricCurrent; + } + + attribute def BatteryOutput :> Output { + attribute voltage :> ISQ::electricPotential; + } + + attribute def BatteryState :> StateSpace { + attribute soc: ScalarValues::Real; + } + + } + + part def Motor { + torquePerCurrent :> Quantities::scalarQuantities = ISQ::torque / ISQ::electricCurrent; + + attribute motR :> ISQ::resistance; + attribute motL :> ISQ::inductance; + + attribute def MotorInput :> Input { + attribute voltage :> ISQ::electricPotential; + attribute friction :> ISQ::torque; + } + + attribute def MotorOutput :> Output { + attribute current :> ISQ::electricCurrent; + attribute torque :> ISQ::torque; + } + + attribute def MotorState :> StateSpace { + attribute current :> ISQ::electricCurrent; + } + } + + part def Tire { + attribute radius :> ISQ::length; + attribute moment :> ISQ::momentOfInertia; + + attribute def TireInput :> Input { + attribute torque :> ISQ::torque; + attribute accel :> ISQ::acceleration; + } + + attribute def TireOutput :> Output { + attribute force :> ISQ::force; + attribute outTorque :> ISQ::torque; + } + } + + requirement def VehicleRequirement { + in vehicle : Vehicle; + } + + analysis def VehicleAnalysis { + subject vehicle : Vehicle; + requirement vehicleRequirement : VehicleRequirement; + } + + + requirement def RangeRequirement :> VehicleRequirement { + doc /* The range of EV must be longer than the required spec under the flat road. */ + attribute actualRange : LengthValue; + attribute requiredRange : LengthValue; + + require constraint { actualRange >= requiredRange } + } + + analysis def RangeAnalysis :> VehicleAnalysis { + return simulatedRange : LengthValue; + + requirement rangeRequirement :>> vehicleRequirement : RangeRequirement; + + objective rangeAnalysisObjective { + doc /* This analysis is to estimate the range of + * the EV by simulating the vehicle driving under the compact vehicle regulation. + */ + require rangeRequirement { + :>> actualRange = simulatedRange; + } + } + } + + requirement def EfficiencyRequirement :> VehicleRequirement { + doc /* The efficiency of EV must be better than the required spec. */ + attribute actualEfficiency; + attribute requiredEfficiency; + + require constraint { actualEfficiency >= requiredEfficiency } + } + + analysis def EfficiencyAnalysis :> VehicleAnalysis { + return simulatedEfficiency; + + requirement efficiencyRequirement :>> vehicleRequirement : EfficiencyRequirement; + + objective efficiencyAnalysisObjective { + require efficiencyRequirement { + attribute :>> actualEfficiency = simulatedEfficiency; + } + } + } + + requirement def MaxSpeedRequirement :> VehicleRequirement { + doc /* The maximum speed of EV must be larger than the required spec. */ + attribute actualMaxSpeed :> ISQ::speed; + attribute requiredMaxSpeed :> ISQ::speed; + } + + analysis def MaxSpeedAnalysis :> VehicleAnalysis { + return simulatedMaxSpeed; + + requirement maxSpeedRequirement :>> vehicleRequirement : MaxSpeedRequirement; + + objective maxSpeedAnalysisObjective { + require maxSpeedRequirement { + attribute :>> actualMaxSpeed = simulatedMaxSpeed; + } + } + } + + + part vehicle : Vehicle { + attribute :>> mass default 1000[kg]; + + /* airFrictionCoefficient [kg / m] = 1/2 * rho[kg/m^3] * Cd * S[m^2], + * where rho is air density, S is front projected area. */ + attribute airFrictionCoefficient = 0.2; + + attribute efficiency; + + action vehicleBehavior : ContinuousStateSpaceDynamics { + in input : VehicleInput; + out output : VehicleOutput; + :>> stateSpace : VehicleState; + } + + part battery: Battery { + :>> baseVoltage = 300[V]; + :>> capacity = 50['A⋅h']; + :>> socInit = 0.8; + :>> internalResistance = 1.8['Ω']; + action batteryBehavior : ContinuousStateSpaceDynamics { + in input : BatteryInput; + out output : BatteryOutput; + :>> stateSpace : BatteryState; + } + } + + flow battery.batteryBehavior.output.voltage to motor.motorBehavior.input.voltage; + flow motor.motorBehavior.output.current to battery.batteryBehavior.input.current; + + part motor: Motor { + :>> motR = 4['Ω']; + :>> motL = 0.2[H]; + + action motorBehavior : ContinuousStateSpaceDynamics { + in input : MotorInput; + out output : MotorOutput; + :>> stateSpace : MotorState; + } + } + + flow motor.motorBehavior.output.torque to tire.tireBehavior.input.torque; + flow vehicleBehavior.output.accel to tire.tireBehavior.input.accel; + + part tire: Tire { + :>> moment default 300['kg⋅m²']; + :>> radius default 0.7[m]; + action tireBehavior : ContinuousStateSpaceDynamics { + in input : TireInput; + out output : TireOutput; + } + } + + flow tire.tireBehavior.output.outTorque to motor.motorBehavior.input.friction; + flow tire.tireBehavior.output.force to vehicleBehavior.input.force; + } + + part vehicle_compact :> vehicle { + attribute :>> mass = 800[kg]; + part :>> tire { + :>> moment = 200['kg⋅m²']; + :>> radius = 0.5[m]; + } + } + + part smallEVRangeContext { + requirement smallEVRequirement : VehicleRequirement { + doc /* The small EVs must be ligher than 900[kg] */ + in :>> vehicle = vehicle_compact; + /* To comform with the regulation and the battery mass will impact it. */ + assume constraint { vehicle.mass < 900[kg] } + } + + analysis smallEVAnalysis : VehicleAnalysis { + subject :>> vehicle :> vehicle_compact; + requirement :>> vehicleRequirement = smallEVRequirement; + } + + requirement rangeRequirementSmall :> smallEVRequirement : RangeRequirement { + doc /* The small EVs must run longer than 130km */ + attribute :>> requiredRange = 130[km]; + } + + analysis rangeAnalysisSmall :> smallEVAnalysis : RangeAnalysis { + requirement :>> rangeRequirement = rangeRequirementSmall; + return simulatedRange = vehicle.vehicleBehavior.output.distance; + } + + requirement efficiencyRequirementSmall :> smallEVRequirement : EfficiencyRequirement { + doc /* The target efficiency of small EVs is 0.9. */ + attribute :>> requiredEfficiency = 0.9; + } + + analysis efficiencyAnalysisSmall :> smallEVAnalysis : EfficiencyAnalysis { + requirement :>> efficiencyRequirement = efficiencyRequirementSmall; + + return simulatedEfficiency = vehicle.efficiency; + } + + requirement maxSpeedRequirementSmall :> smallEVRequirement : MaxSpeedRequirement { + doc /* The target maximum speed of small EVs is 130 [km/h]. */ + attribute :>> requiredMaxSpeed = 130 [km/h]; + } + + analysis maxSpeedAnalysisSmall :> smallEVAnalysis : MaxSpeedAnalysis { + requirement :>> maxSpeedRequirement = maxSpeedRequirementSmall; + out voltage :> ISQ::electricPotential = vehicle.battery.batteryBehavior.output.voltage; + return simulatedMaxSpeed = vehicle.vehicleBehavior.output.velocity; + } + } + + part vehicle_large :> vehicle { + attribute :>> mass = 1100[kg]; + part :>> tire { + :>> moment = 300['kg⋅m²']; + :>> radius = 0.7[m]; + } + } + + part largeEVRangeContext { + requirement largeEVRequirement : VehicleRequirement { + doc /* The large EVs must be ligher than 900[kg] */ + in :>> vehicle = vehicle_large; + /* To comform with the regulation and the battery mass will impact it. */ + assume constraint { vehicle.mass < 1200[kg] } + } + + analysis largeEVAnalysis : VehicleAnalysis { + subject :>> vehicle :> vehicle_large; + requirement :>> vehicleRequirement = largeEVRequirement; + } + + requirement rangeRequirementLarge :> largeEVRequirement : RangeRequirement { + doc /* The large EVs must run longer than 200km */ + attribute :>> requiredRange = 200[km]; + } + + analysis rangeAnalysisLarge :> largeEVAnalysis : RangeAnalysis { + requirement :>> rangeRequirement = rangeRequirementLarge; + return simulatedRange = vehicle.vehicleBehavior.output.distance; + } + + requirement efficiencyRequirementLarge :> largeEVRequirement : EfficiencyRequirement { + doc /* The target efficiency of large EVs is 0.8. */ + attribute :>> requiredEfficiency = 0.8; + } + + analysis efficiencyAnalysisLarge :> largeEVAnalysis : EfficiencyAnalysis { + requirement :>> efficiencyRequirement = efficiencyRequirementLarge; + + return simulatedEfficiency = vehicle.efficiency; + } + + requirement maxSpeedRequirementLarge :> largeEVRequirement : MaxSpeedRequirement { + doc /* The target maximum speed of large EVs is 140 [km/h]. */ + attribute :>> requiredMaxSpeed = 140 [km/h]; + } + + analysis maxSpeedAnalysisLarge :> largeEVAnalysis : MaxSpeedAnalysis { + requirement :>> maxSpeedRequirement = maxSpeedRequirementLarge; + out voltage = vehicle.battery.batteryBehavior.output.voltage; + return simulatedMaxSpeed = vehicle.vehicleBehavior.output.velocity; + } + } +} diff --git a/src/sysml/src/examples/Variability Examples/VehicleVariabilityModel.sysml b/src/sysml/src/examples/Variability Examples/VehicleVariabilityModel.sysml new file mode 100644 index 0000000000000000000000000000000000000000..1a8aef8232b26af2e5a8aab61a198964d51215e2 --- /dev/null +++ b/src/sysml/src/examples/Variability Examples/VehicleVariabilityModel.sysml @@ -0,0 +1,165 @@ +package VehicleVariabilityModel { + + package DesignModel { + public import PartDefinitions::*; + public import PartsTree::*; + public import ActionDefinitions::*; + public import ActionTree::*; + + package PartDefinitions { + part def Vehicle; + + attribute def Diameter; + part def Cylinder { + attribute diameter : Diameter[1]; + } + + part def Engine; + part def Transmission; + part def Sunroof; + + port def AutoPort; + } + + package PartsTree { + part vehicle : Vehicle { + part engine : Engine[1]; + part transmission : Transmission[1]; + part sunroof : Sunroof[0..1]; + } + + part engine : Engine { + port autoPort : AutoPort; + part cylinder : Cylinder[2..*]; + } + + part '4cylEngine' :> engine { + part :>> cylinder[4]; + } + + part '6cylEngine' :> engine { + part :>> cylinder[6]; + } + + part transmission : Transmission; + part manualTransmission :> transmission; + part automaticTransmission :> transmission; + } + + package ActionDefinitions { + action def GenerateTorque; + action def AmplifyTorque; + action def ProvidePower; + } + + package ActionTree { + action generateTorque4Cyl : GenerateTorque; + action generateTorque6Cyl : GenerateTorque; + + action amplifyTorqueManual : AmplifyTorque; + action amplifyTorqueAutomatic : AmplifyTorque; + } + } + + package '150% Model' { + private import DesignModel::*; + + package PartsTree { + + // Variation point definitions + + variation attribute def DiameterChoices :> Diameter { + variant attribute diameterSmall; + variant attribute diameterLarge; + } + + variation part def EngineChoices :> Engine { + variant '4cylEngine'; + variant '6cylEngine' { + variation port :>> autoPort { + variant port autoPort1; + variant port autoPort2; + } + + part :>> cylinder { + attribute :>> diameter : DiameterChoices; + } + + assert constraint { + (autoPort == autoPort::autoPort1 & cylinder.diameter == cylinder::diameter::diameterSmall) ^ + (autoPort == autoPort::autoPort2 & cylinder.diameter == cylinder::diameter::diameterLarge) + } + } + } + + // Part superset model + + abstract part vehicleFamily :> vehicle { + // Variation point usage + part :>> engine : EngineChoices[1]; + + // Variation point with embedded variant definitions + variation part :>> transmission : Transmission[1] { + variant manualTransmission; + variant automaticTransmission; + } + + assert constraint { + (engine == '4cylEngine' & transmission == transmission::manualTransmission) ^ + (engine == '6cylEngine' & transmission == transmission::automaticTransmission) + } + + // Variation point on variant multiplicity (inherited multiplicity is [0..1]) + variation part :>> sunroof { + variant part withSunroof[1]; + variant part withoutSunroof[0]; + } + + perform ActionTree::providePowerFamily; + } + } + + package ActionTree { + + // Action superset Model + + action providePowerFamily : ProvidePower { + variation action generateTorque : GenerateTorque { + variant generateTorque4Cyl; + variant generateTorque6Cyl; + } + + variation action amplifyTorque : AmplifyTorque { + variant amplifyTorqueManual; + variant amplifyTorqueAutomatic; + } + + assert constraint { + (generateTorque == generateTorque::generateTorque4Cyl & + amplifyTorque == amplifyTorque::amplifyTorqueManual + ) xor + (generateTorque == generateTorque::generateTorque6Cyl & + amplifyTorque == amplifyTorque::amplifyTorqueAutomatic + ) + } + } + } + } + + package '100% Model' { + private import '150% Model'::*; + + // Vehicle instance model + + part vehicle4Cyl :> PartsTree::vehicleFamily { + part :>> engine = engine::'4cylEngine'; + part :>> transmission = transmission::manualTransmission; + part :>> sunroof = sunroof::withoutSunroof; + + perform action :>> providePowerFamily { + action :>> generateTorque = generateTorque::generateTorque4Cyl; + action :>> amplifyTorque = amplifyTorque::amplifyTorqueManual; + } + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Vehicle Example/SysML v2 Spec Annex A SimpleVehicleModel.sysml b/src/sysml/src/examples/Vehicle Example/SysML v2 Spec Annex A SimpleVehicleModel.sysml new file mode 100644 index 0000000000000000000000000000000000000000..c6f6d63b29765874f8d641c50b7c6f748ef5d987 --- /dev/null +++ b/src/sysml/src/examples/Vehicle Example/SysML v2 Spec Annex A SimpleVehicleModel.sysml @@ -0,0 +1,1580 @@ +package SimpleVehicleModel{ + // 2023-02 release + public import Definitions::*; + public import ISQ::*; + package Definitions{ + public import PartDefinitions::*; + public import PortDefinitions::*; + public import ItemDefinitions::*; + public import SignalDefinitions::*; + public import InterfaceDefinitions::*; + public import AllocationDefinitions::*; + public import ActionDefinitions::*; + public import StateDefinitions::*; + public import RequirementDefinitions::*; + public import AttributeDefinitions::*; + public import IndividualDefinitions::*; + public import MetadataDefinitions::**; + public import KeyWord_MetadataDefinitions::*; + package PartDefinitions{ + part def Vehicle { + attribute mass :> ISQ::mass; + attribute dryMass:>ISQ::mass; + attribute cargoMass:>ISQ::mass; + attribute position:>ISQ::length; + attribute velocity:>ISQ::speed; + attribute acceleration:>ISQ::acceleration; + attribute electricalPower:>ISQ::power; + attribute Tmax:>ISQ::temperature; + attribute maintenanceTime: Time::DateTime; + attribute brakePedalDepressed: Boolean; + port ignitionCmdPort:IgnitionCmdPort; + port pwrCmdPort:PwrCmdPort; + port vehicleToRoadPort:VehicleToRoadPort; + port statusPort:StatusPort; + perform action providePower; + perform action provideBraking; + perform action controlDirection; + perform action performSelfTest; + perform action applyParkingBrake; + perform action senseTemperature; + exhibit state vehicleStates parallel { + ref controller : VehicleController; + state operatingStates { + entry action initial; + state off; + state starting; + state on { + entry performSelfTest; + do providePower; + exit applyParkingBrake; + constraint {electricalPower<=500[W]} + } + + transition initial then off; + + transition off_To_starting + first off + accept ignitionCmd:IgnitionCmd via ignitionCmdPort + if ignitionCmd.ignitionOnOff==IgnitionOnOff::on and brakePedalDepressed + do send StartSignal() to controller + then starting; + + transition starting_To_on + first starting + accept VehicleOnSignal + then on; + + transition on_To_off + first on + accept VehicleOffSignal + do send OffSignal() to controller + then off; + } + + state healthStates { + entry action initial; + do senseTemperature{ + out temp; + } + + state normal; + state maintenance; + state degraded; + + transition initial then normal; + + transition normal_To_maintenance + first normal + accept at maintenanceTime + then maintenance; + + transition normal_To_degraded + first normal + accept when senseTemperature.temp > Tmax + do send OverTemp() to controller + then degraded; + + transition maintenance_To_normal + first maintenance + accept ReturnToNormal + then normal; + + transition degraded_To_normal + first degraded + accept ReturnToNormal + then normal; + } + } + } + part def Engine{ + attribute mass :> ISQ::mass; + attribute peakHorsePower:>ISQ::power; + attribute fuelEfficiency:Real; + attribute cost:Real; + attribute displacement :> ISQ::volume; + port engineControlPort: ~ControlPort; + port fuelInPort: ~ FuelPort; + port fuelCmdPort:FuelCmdPort; + port drivePwrPort:DrivePwrPort; + port ignitionCmdPort:IgnitionCmdPort; + port flyWheelPort; + perform action generateTorque; + exhibit state engineStates{ + state off; + state starting; + state on{ + do generateTorque; + } + } + } + part def StarterMotor{ + port gearPort:GearPort; + } + part def Cylinder; + part def Transmission{ + attribute gearRatio:Real; + port clutchPort:~DrivePwrPort; + exhibit state transmissionStates; + } + part def Driveshaft; + part def AxleAssembly; + part def Axle{ + attribute mass:>ISQ::mass; + } + part def FrontAxle:>Axle{ + attribute steeringAngle:>ISQ::angularMeasure; + } + part def HalfAxle{ + port shankCompositePort:ShankCompositePort{ + } + } + part def Differential; + part def Wheel{ + attribute diameter:LengthValue; + port lugNutCompositePort:LugNutCompositePort; + } + part def Hub{ + port shankCompositePort:ShankCompositePort; + } + abstract part def Software; + part def VehicleSoftware:>Software; + part def VehicleController:>Software { + port controlPort:ControlPort; + exhibit state controllerStates parallel { + state operatingStates { + entry action initial; + state off; + state on; + transition initial then off; + transition 'off-on' + first off + accept StartSignal + then on; + transition 'on-off' + first on + accept OffSignal + then off; + } + } + } + part def CruiseController:>Software { + port setSpeedPort:~SetSpeedPort; + port speedSensorPort:~SpeedSensorPort; + port cruiseControlPort:CruiseControlPort; + exhibit state cruiseControllerStates; + } + part def SpeedSensor{ + port speedSensorPort:SpeedSensorPort; + } + part def FuelTank{ + attribute mass :> ISQ::mass; + ref item fuel:Fuel{ + attribute :>> fuelMass; + } + attribute fuelKind:FuelKind; + attribute fuelMassMax:>ISQ::mass; + assert constraint fuelConstraint {fuel.fuelMass<=fuelMassMax} + port fuelOutPort:FuelPort; + port fuelInPort:~FuelPort; + } + part def BodyAssy; + part def Body{ + attribute color:Colors; + } + part def Thermostat; + part def WaterHose; + part def Road{ + attribute incline:Real; + attribute friction:Real; + } + part def Engine4Cyl; + part def Engine6Cyl; + part def TransmissionChoices; + part def TransmissionAutomatic; + part def TransmissionManual; + part def Sunroof; + + //logical Components + part def ElectricalGenerator; + part def TorqueGenerator; + part def SteeringSubsystem; + part def BrakingSubsystem; + } + package PortDefinitions{ + port def IgnitionCmdPort{ + in item ignitionCmd:IgnitionCmd; + } + port def StatusPort; + port def GearPort; + port def PwrCmdPort{ + in item pwrCmd:PwrCmd; + } + port def FuelCmdPort:>PwrCmdPort{ + in item fuelCmd:FuelCmd redefines pwrCmd; + } + port def FuelPort{ + out item fuel:Fuel; + } + port def DrivePwrPort{ + out torque:Torque; + } + port def ShaftPort_a; + port def ShaftPort_b; + port def ShaftPort_c; + port def ShaftPort_d; + port def DiffPort; + port def AxlePort; + port def AxleToWheelPort; + port def WheelToAxlePort; + port def WheelToRoadPort; + + port def LugNutCompositePort{ + port lugNutPort:LugNutPort [*]; + } + port def ShankCompositePort{ + port shankPort:ShankPort [*]; + } + port def LugNutPort{ + attribute threadDia; + attribute threadPitch; + } + port def ShankPort{ + attribute threadDia; + attribute threadPitch; + attribute shaftLength; + } + + port def VehicleToRoadPort; + port def ControlPort; + port def CruiseControlPort:>ControlPort; + port def SpeedSensorPort; + port def SetSpeedPort; + + port def DriverCmdPort{ + out item driverCmd[*]:DriverCmd; + } + port def HandPort :> DriverCmdPort { + out item ignitionCmd:IgnitionCmd subsets driverCmd; + out item pwrCmd:PwrCmd subsets driverCmd; + } + } + package ItemDefinitions{ + item def PwrCmd{ + attribute throttleLevel:Real; + } + item def FuelCmd:>PwrCmd; + item def Fuel{ + attribute fuelMass:>ISQ::mass; + } + item def SensedSpeed{ + attribute speed:>ISQ::speed; + } + } + package SignalDefinitions{ + item def Cmd{ + } + item def DriverCmd; + item def IgnitionCmd:>DriverCmd{ + attribute ignitionOnOff:IgnitionOnOff; + } + item def EngineStatus; + + attribute def VehicleStartSignal; + attribute def VehicleOnSignal; + attribute def VehicleOffSignal; + attribute def StartSignal; + attribute def OffSignal; + attribute def OverTemp; + attribute def ReturnToNormal; + attribute def SetSpeed:>Real; + } + package InterfaceDefinitions{ + interface def EngineToTransmissionInterface{ + end p1:DrivePwrPort; + end p2:~DrivePwrPort; + flow p1.torque to p2.torque; + } + interface def FuelInterface { + end fuelOutPort:FuelPort; + end fuelInPort:~FuelPort; + flow of Fuel from fuelOutPort.fuel to fuelInPort.fuel; + } + + interface def WheelFastenerInterface{ + end lugNutPort:LugNutPort; + end shankPort:ShankPort; + attribute maxTorque : Torque; + constraint {lugNutPort.threadDia == shankPort.threadDia} + } + interface def WheelHubInterface{ + end lugNutCompositePort:LugNutCompositePort; + end shankCompositePort:ShankCompositePort; + interface wheelFastenerInterface:WheelFastenerInterface [5] + connect lugNutCompositePort.lugNutPort to shankCompositePort.shankPort; + } + } + package AllocationDefinitions{ + allocation def LogicalToPhysical{ + end #logical logicalEnd; + end #physical physicalEnd; + } + } + package ActionDefinitions{ + action def ProvidePower { + in item pwrCmd:PwrCmd; + out wheelToRoadTorque:Torque[2]; + } + action def GenerateTorque { + in item fuelCmd:FuelCmd; + out engineTorque:Torque; + } + action def AmplifyTorque { + in engineTorque:Torque; + out transmissionTorque:Torque; + } + action def TransferTorque { + in transmissionTorque:Torque; + out driveshaftTorque:Torque; + } + action def DistributeTorque { + in driveshaftTorque:Torque; + out wheelToRoadTorque:Torque[2]; + } + action def PerformSelfTest; + action def ApplyParkingBrake; + action def SenseTemperature{ + out temp: ISQ::TemperatureValue; + } + } + package StateDefinitions { + state def VehicleStates; + state def ControllerStates; + state def CruiseControllerStates; + } + package RequirementDefinitions{ + requirement def MassRequirement{ + doc /*The actual mass shall be less than the required mass*/ + attribute massRequired:>ISQ::mass; + attribute massActual:>ISQ::mass; + require constraint {massActual<=massRequired} + } + requirement def ReliabilityRequirement{ + doc /*The actual reliability shall be greater than the required reliability*/ + attribute reliabilityRequired:Real; + attribute reliabilityActual:Real; + require constraint {reliabilityActual>=reliabilityRequired} + } + requirement def TorqueGenerationRequirement { + doc /* The engine shall generate torque as a function of RPM as shown in Table 1. */ + subject generateTorque:ActionDefinitions::GenerateTorque; + } + requirement def DrivePowerOutputRequirement { + doc /* The engine shall provide a connection point to transfer torque to the transmission.*/ + } + requirement def FuelEconomyRequirement { + doc /* The vehicle shall maintain an average fuel economomy of at least x miles per gallon for the nominal + driving scenario */ + attribute actualFuelEconomy :> distancePerVolume; + attribute requiredFuelEconomy :> distancePerVolume; + require constraint {actualFuelEconomy >= requiredFuelEconomy} + } + } + package AttributeDefinitions{ + public import ScalarValues::*; + public import Quantities::*; + public import MeasurementReferences::DerivedUnit; + public import SIPrefixes::kilo; + // Numerical Functions provides basic operators such as Sum expression + public import NumericalFunctions::*; + public import SI::*; + public import USCustomaryUnits::*; + alias Torque for ISQ::TorqueValue; + + enum def Colors {black;grey;red;} + enum def DiameterChoices:>ISQ::LengthValue{ + enum = 60 [mm]; + enum = 80 [mm]; + enum = 100 [mm]; + } + attribute cylinderDiameter: DiameterChoices = 80 [mm]; + enum def IgnitionOnOff {on;off;} + enum def FuelKind {gas;diesel;} + + distancePerVolume :> scalarQuantities = distance / volume; + timePerDistance :> scalarQuantities = time / distance; + volumePerDistance :> scalarQuantities = volume / distance; + volumePerTime :> scalarQuantities = volume / time; + + // kpl is approx .425 * mpg + kpl : DerivedUnit = km / L; + rpm : DerivedUnit = 1 / SI::min; + kW : DerivedUnit = kilo * W; + + } + package IndividualDefinitions{ + individual def VehicleRoadContext_1:>GenericContext::Context; + individual def Vehicle_1:>Vehicle; + individual def FrontAxleAssembly_1:>AxleAssembly; + individual def FrontAxle_1:>FrontAxle; + individual def Wheel_1:>Wheel; + individual def Wheel_2:>Wheel; + individual def RearAxleAssembly_1:>AxleAssembly; + individual def Road_1:>Road; + } + package MetadataDefinitions { + public import AnalysisTooling::*; + metadata def Safety { + attribute isMandatory : Boolean; + } + metadata def Security; + } + package KeyWord_MetadataDefinitions{ + public import Metaobjects::SemanticMetadata; + + // the following is used to define the key word failureMode + state failureModes[*] nonunique; + + // with alias + metadata def failureMode :> SemanticMetadata { + :>> baseType = failureModes meta SysML::StateUsage; + } + + occurrence logicalOccurrences [*] nonunique; + + metadata def logical :> SemanticMetadata { + :>> baseType = logicalOccurrences meta SysML::Usage; + } + + occurrence physicalOccurrences [*] nonunique; + + metadata def

physical :> SemanticMetadata { + :>> baseType = physicalOccurrences meta SysML::Usage; + } + } + package GenericContext { + + part def Context { + attribute time:TimeValue; + attribute spatialCF: CartesianSpatial3dCoordinateFrame[1] { :>> mRefs = (m, m, m); } + attribute velocityCF: CartesianVelocity3dCoordinateFrame[1] = spatialCF/s; + attribute accelarationCF: CartesianAcceleration3dCoordinateFrame[1] = velocityCF/s; + } + } + } + + package VehicleLogicalConfiguration{ + package PartsTree{ + #logical part vehicleLogical:Vehicle{ + part torqueGenerator:TorqueGenerator{ + action generateTorque; + } + part electricalGenerator:ElectricalGenerator{ + action generateElectricity; + } + part steeringSystem:SteeringSubsystem; + part brakingSubsystem:BrakingSubsystem; + } + } + } + package VehicleLogicalToPhysicalAllocation{ + public import VehicleConfigurations::VehicleConfiguration_b::PartsTree::**; + public import VehicleLogicalConfiguration::PartsTree::*; + + allocation vehicleLogicalToPhysicalAllocation:LogicalToPhysical + allocate vehicleLogical to vehicle_b{ + allocate vehicleLogical.torqueGenerator to vehicle_b.engine{ + allocate vehicleLogical.torqueGenerator.generateTorque to vehicle_b.engine.generateTorque; + } + allocate vehicleLogical.electricalGenerator to vehicle_b.engine{ + allocate vehicleLogical.electricalGenerator.generateElectricity to vehicle_b.engine.alternator.generateElectricity; + } + } + } + package VehicleConfigurations{ + package VehicleConfiguration_a{ + package PartsTree{ + part vehicle_a:Vehicle{ + attribute mass redefines Vehicle::mass=dryMass+cargoMass+fuelTank.fuel.fuelMass; + attribute dryMass redefines Vehicle::dryMass=sum(partMasses); + attribute redefines Vehicle::cargoMass=0 [kg]; + attribute partMasses [*] nonunique :>ISQ::mass; + part fuelTank:FuelTank{ + attribute redefines mass=75[kg]; + ref item redefines fuel{ + attribute redefines fuelMass=50[kg]; + } + } + part frontAxleAssembly:AxleAssembly{ + attribute mass :> ISQ::mass=800[kg]; + part frontAxle:Axle; + part frontWheels:Wheel[2]; + } + part rearAxleAssembly:AxleAssembly{ + attribute mass :> ISQ::mass=875[kg]; + attribute driveTrainEfficiency:Real = 0.6; + part rearAxle:Axle; + part rearWheels:Wheel[2]{ + attribute redefines diameter; + } + } + } + } + package ActionTree{ + } + package Requirements{ + } + } + package VehicleConfiguration_b{ + //Shapes library for simple geometry + public import ShapeItems::Box; + public import ParametersOfInterestMetadata::mop; + public import ModelingMetadata::*; // incudes status info + + package PartsTree{ + part vehicle_b : Vehicle{ + #mop attribute mass redefines mass=dryMass+cargoMass+fuelTank.fuel.fuelMass; + attribute dryMass redefines dryMass=sum(partMasses); + attribute redefines cargoMass default 0 [kg]; + attribute partMasses=(fuelTank.mass,frontAxleAssembly.mass,rearAxleAssembly.mass,engine.mass,transmission.mass,driveshaft.mass); + attribute avgFuelEconomy :> distancePerVolume; + port fuelCmdPort: FuelCmdPort redefines pwrCmdPort { + in item fuelCmd redefines pwrCmd; + } + port setSpeedPort:~SetSpeedPort; + port vehicleToRoadPort redefines vehicleToRoadPort{ + port wheelToRoadPort1:WheelToRoadPort; + port wheelToRoadPort2:WheelToRoadPort; + } + perform ActionTree::providePower redefines providePower; + perform ActionTree::performSelfTest redefines performSelfTest; + perform ActionTree::applyParkingBrake redefines applyParkingBrake; + perform ActionTree::senseTemperature redefines senseTemperature; + exhibit state vehicleStates redefines vehicleStates; + + // Example vehicle with simple enveloping shape that is a solid + item :> envelopingShapes : Box[1] { + length1:>> length = 4800 [mm]; + width1:>> width = 1840 [mm]; + height1:>> height = 1350 [mm]; + } + + part fuelTank:FuelTank{ + attribute redefines mass=75[kg]; + ref item redefines fuel{ + attribute redefines fuelMass=60[kg]; + } + attribute redefines fuelMassMax=60 [kg]; + } + part frontAxleAssembly:AxleAssembly{ + attribute mass :> ISQ::mass=800[kg]; + port shaftPort_d:ShaftPort_d; + part frontAxle:FrontAxle; + part frontWheels:Wheel[2]; + } + + part rearAxleAssembly:AxleAssembly{ + attribute mass :> ISQ::mass=875[kg]; + attribute driveTrainEfficiency:Real = 0.6; + port shaftPort_d:ShaftPort_d; + perform providePower.distributeTorque; + part rearWheel1:Wheel{ + attribute redefines diameter; + port wheelToRoadPort:WheelToRoadPort; + port lugNutCompositePort :>> lugNutCompositePort{ + port lugNutPort :>> lugNutPort [5]; + } + } + part rearWheel2:Wheel{ + attribute redefines diameter; + port wheelToRoadPort:WheelToRoadPort; + port lugNutCompositePort :>> lugNutCompositePort{ + port lugNutPort :>> lugNutPort [5]; + } + } + part differential:Differential{ + port shaftPort_d:ShaftPort_d; + port leftDiffPort:DiffPort; + port rightDiffPort:DiffPort; + } + part rearAxle{ + part leftHalfAxle:HalfAxle{ + port leftAxleToDiffPort:AxlePort; + port shankCompositePort :>> shankCompositePort{ + port shankPort :>> shankPort [5]; + } + } + part rightHalfAxle:HalfAxle{ + port rightAxleToDiffPort:AxlePort; + port shankCompositePort :>> shankCompositePort { + port shankPort :>> shankPort [5]; + } + } + } + + bind shaftPort_d=differential.shaftPort_d; + connect differential.leftDiffPort to rearAxle.leftHalfAxle.leftAxleToDiffPort; + connect differential.rightDiffPort to rearAxle.rightHalfAxle.rightAxleToDiffPort; + + interface wheelToleftHalAxleInterface:WheelHubInterface + connect rearWheel1.lugNutCompositePort [1] to rearAxle.leftHalfAxle.shankCompositePort [1]; + interface wheelTorightHalAxleInterface:WheelHubInterface + connect rearWheel2.lugNutCompositePort [1] to rearAxle.rightHalfAxle.shankCompositePort [1]; + + } + part starterMotor:StarterMotor; + part engine:Engine{ + perform providePower.generateTorque redefines generateTorque; + part cylinders:Cylinder[4..6]; + part alternator{ + action generateElectricity; + } + satisfy Requirements::engineSpecification by vehicle_b.engine{ + requirement torqueGenerationRequirement :>> torqueGenerationRequirement{ + subject generateTorque redefines generateTorque = vehicle_b.engine.generateTorque; + } + requirement drivePowerOuputRequirement :>> drivePowerOutputRequirement{ + port torqueOutPort redefines torqueOutPort=vehicle_b.engine.drivePwrPort; + } + } + } + part transmission:Transmission{ + attribute mass :> ISQ::mass=100[kg]; + port shaftPort_a:ShaftPort_a; + perform providePower.amplifyTorque; + } + part driveshaft:Driveshaft{ + attribute mass :> ISQ::mass=100[kg]; + port shaftPort_b:ShaftPort_b; + port shaftPort_c:ShaftPort_c; + perform providePower.transferTorque; + } + part vehicleSoftware:VehicleSoftware{ + part vehicleController: VehicleController { + exhibit state controllerStates redefines controllerStates; + part cruiseController:CruiseController; + } + } + part speedSensor:SpeedSensor; + + // parts in bodyAssy and interioer are marked as safety or security features + part bodyAssy:BodyAssy{ + part body:Body{ + attribute :>> color = Colors::red; + } + part bumper {@Safety{isMandatory = true;}} + part keylessEntry {@Security;} + } + part interior { + part alarm {@Security;} + part seatBelt[2] {@Safety{isMandatory = true;}} + part frontSeat[2]; + part driverAirBag {@Safety{isMandatory = false;}} + } + + //connections + bind engine.fuelCmdPort=fuelCmdPort; + + interface engineToTransmissionInterface:EngineToTransmissionInterface + connect engine.drivePwrPort to transmission.clutchPort; + + interface fuelInterface:FuelInterface + connect fuelTank.fuelOutPort to engine.fuelInPort; + + allocate ActionTree::providePower.generateToAmplify to engineToTransmissionInterface; + + bind engine.ignitionCmdPort=ignitionCmdPort; + connect starterMotor.gearPort to engine.flyWheelPort; + connect vehicleSoftware.vehicleController.controlPort to engine.engineControlPort; + bind vehicle_b.setSpeedPort = vehicleSoftware.vehicleController.cruiseController.setSpeedPort; + connect speedSensor.speedSensorPort to vehicleSoftware.vehicleController.cruiseController.speedSensorPort; + bind vehicleSoftware.vehicleController.cruiseController.cruiseControlPort = vehicleSoftware.vehicleController.controlPort; + connect transmission.shaftPort_a to driveshaft.shaftPort_b; + connect driveshaft.shaftPort_c to rearAxleAssembly.shaftPort_d; + bind rearAxleAssembly.rearWheel1.wheelToRoadPort=vehicleToRoadPort.wheelToRoadPort1; + bind rearAxleAssembly.rearWheel2.wheelToRoadPort=vehicleToRoadPort.wheelToRoadPort2; + + satisfy Requirements::vehicleSpecification by vehicle_b{ + requirement vehicleMassRequirement:>>vehicleMassRequirement{ + attribute redefines massActual=vehicle_b.mass; + attribute redefines fuelMassActual = vehicle_b.fuelTank.fuel.fuelMass; + } + } + } + } + package ActionTree{ + action providePower:ProvidePower{ + in item fuelCmd:FuelCmd redefines pwrCmd; + out wheelToRoadTorque redefines wheelToRoadTorque [2] = distributeTorque.wheelToRoadTorque; + action generateTorque:GenerateTorque { + in item = providePower.fuelCmd; + } + action amplifyTorque:AmplifyTorque; + action transferTorque:TransferTorque; + action distributeTorque:DistributeTorque; + + //named flow + flow generateToAmplify from generateTorque.engineTorque to amplifyTorque.engineTorque; + //unnamed flows + flow amplifyTorque.transmissionTorque to transferTorque.transmissionTorque; + flow transferTorque.driveshaftTorque to distributeTorque.driveshaftTorque; + } + action performSelfTest: PerformSelfTest; + action applyParkingBrake: ApplyParkingBrake; + action senseTemperature: SenseTemperature; + } + package DiscreteInteractions{ + package Sequence{ + part def Driver{ + port p1; + port p2; + } + + part part0{ + perform action startVehicle{ + action turnVehicleOn send ignitionCmd via driver.p1{ + in ignitionCmd:IgnitionCmd; + } + action trigger1 accept ignitionCmd:IgnitionCmd via vehicle.ignitionCmdPort; + flow of IgnitionCmd from trigger1.ignitionCmd to startEngine.ignitionCmd; + action startEngine{ + in item ignitionCmd:IgnitionCmd; + out item es:EngineStatus; + } + flow of EngineStatus from startEngine.es to sendStatus.es; + action sendStatus send es via vehicle.statusPort{ + in es:EngineStatus; + } + action trigger2 accept es:EngineStatus via driver.p2; + } + part driver : Driver { + perform startVehicle.turnVehicleOn; + perform startVehicle.trigger2; + event occurrence driverReady; + } + part vehicle : Vehicle { + perform startVehicle.trigger1; + perform startVehicle.sendStatus; + event occurrence doorClosed; + } + first vehicle.doorClosed then driver.driverReady; + message of ignitionCmd:IgnitionCmd from driver.turnVehicleOn to vehicle.trigger1; + message of es:EngineStatus from vehicle.sendStatus to driver.trigger2; + } + } + occurrence CruiseControl1{ + part vehicle_b:>PartsTree::vehicle_b{ + port redefines setSpeedPort{ + event occurrence setSpeedReceived; + } + part redefines speedSensor{ + port redefines speedSensorPort{ + event occurrence sensedSpeedSent; + } + } + part redefines vehicleSoftware{ + part redefines vehicleController{ + part redefines cruiseController{ + port redefines setSpeedPort{ + //analagous to gate: event occurrence bound but may not need this since the port is bound + event occurrence setSpeedReceived = vehicle_b.setSpeedPort.setSpeedReceived; + } + port redefines speedSensorPort{ + event occurrence sensedSpeedReceived; + } + port redefines cruiseControlPort{ + event occurrence fuelCmdSent; + } + } + } + } + part redefines engine{ + port redefines fuelCmdPort{ + event occurrence fuelCmdReceived; + } + } + message sendSensedSpeed of SensedSpeed + from speedSensor.speedSensorPort.sensedSpeedSent to vehicleSoftware.vehicleController.cruiseController.speedSensorPort.sensedSpeedReceived; + message sendFuelCmd of FuelCmd + from vehicleSoftware.vehicleController.cruiseController.cruiseControlPort.fuelCmdSent to engine.fuelCmdPort.fuelCmdReceived; + } + } + occurrence CruiseControl2{ + part vehicle_b:>PartsTree::vehicle_b{ + port redefines setSpeedPort{ + event occurrence setSpeedReceived; + } + part redefines speedSensor{ + port redefines speedSensorPort{ + event sendSensedSpeed.source; + } + } + part redefines vehicleSoftware{ + part redefines vehicleController{ + part redefines cruiseController{ + port redefines setSpeedPort{ + //analagous to gate: event occurrence bound but may not need this since the port is bound + event occurrence setSpeedReceived = vehicle_b.setSpeedPort.setSpeedReceived; + } + port redefines speedSensorPort{ + event occurrence setSpeedReceived=setSpeedPort.setSpeedReceived; + then event sendSensedSpeed.target; + } + port redefines cruiseControlPort{ + event sendFuelCmd.source; + } + } + } + } + part redefines engine{ + port redefines fuelCmdPort{ + event sendFuelCmd.target; + } + } + message sendSensedSpeed of SensedSpeed; + message sendFuelCmd of FuelCmd; + } + } + } + package Requirements{ + public import RequirementDerivation::*; + public import ModelingMetadata::*; // incudes status info + item marketSurvey; + dependency from vehicleSpecification to marketSurvey; + + requirement vehicleSpecification{ + subject vehicle:Vehicle; + requirement <'1'> vehicleMassRequirement: MassRequirement { + doc /* The total mass of the vehicle shall be less than or equal to the required mass. + Assume total mass includes a full tank of gas of 60 kg*/ + attribute redefines massRequired=2000 [kg]; + attribute redefines massActual default vehicle.dryMass + fuelMassActual; + attribute fuelMassActual:>ISQ::mass; + attribute fuelMassMax:>ISQ::mass = 60 [kg]; + assume constraint {fuelMassActual==fuelMassMax} + } + + allocate vehicleMassRequirement to PartsTree::vehicle_b.mass; + + requirement <'2'> vehicleFuelEconomyRequirements{ + doc /* fuel economy requirements group */ + attribute assumedCargoMass:>ISQ::mass; + requirement <'2_1'> cityFuelEconomyRequirement:FuelEconomyRequirement{ + redefines requiredFuelEconomy= 10 [km / L]; + assume constraint {assumedCargoMass<=500 [kg]} + } + requirement <'2_2'> highwayFuelEconomyRequirement:FuelEconomyRequirement{ + redefines requiredFuelEconomy= 12.75 [km / L]; + assume constraint {assumedCargoMass<=500 [kg]} + + //StatusInfo is contained in ModelingMetadata library + // StatusKind has values for open, closed, tbd, tbr, tbd + @StatusInfo { + status = StatusKind::closed; + originator = "Bob"; + owner = "Mary"; + } + } + } + } + requirement engineSpecification { + subject engine1:Engine; + requirement <'1'> engineMassRequirement: MassRequirement { + doc /* The total mass of the engine shall be less than or equal to the required mass.*/ + attribute redefines massRequired=200 [kg]; + attribute redefines massActual = engine1.mass; + } + requirement torqueGenerationRequirement : TorqueGenerationRequirement{ + subject generateTorque default engine1.generateTorque; + } + + requirement drivePowerOutputRequirement : DrivePowerOutputRequirement{ + port torqueOutPort{ + out torque:Torque; + } + } + } + // the engine mass requirement is derived from the vehicle mass requirement + #derivation connection { + end #original ::> vehicleSpecification.vehicleMassRequirement; + end #derive ::> engineSpecification.engineMassRequirement; + } + + } + } + package Engine4Cyl_Variant{ + public import ModelingMetadata::*; // incudes refinement + part engine:Engine{ + part cylinders:Cylinder[4..8] ordered; + } + part engine4Cyl:>engine{ + part redefines cylinders [4]; + part cylinder1 subsets cylinders[1]; + part cylinder2 subsets cylinders[1]; + part cylinder3 subsets cylinders[1]; + part cylinder4 subsets cylinders[1]; + } + #refinement dependency engine4Cyl to VehicleConfiguration_b::PartsTree::vehicle_b::engine; + } + package WheelHubAssemblies{ + // alternative 1 - w/o explicit nesxted interfaces + part wheelHubAssy1{ + part wheel1:Wheel{ + port :>>lugNutCompositePort:LugNutCompositePort { + port lugNutPort :>> lugNutPort [5]; + } + } + part hub1:Hub{ + port :>> shankCompositePort:ShankCompositePort { + port shankPort :>> shankPort [5]; + } + } + interface wheelHubInterface:WheelHubInterface + connect wheel1.lugNutCompositePort [1] to hub1.shankCompositePort [1]; + } + // alternative 2 - w multiple nesxted interfaces + part wheelHubAssy2{ + part wheel1:Wheel{ + port :>>lugNutCompositePort:LugNutCompositePort { + port lugNutPort :>> lugNutPort [5]; + } + } + part hub1:Hub{ + port :>> shankCompositePort:ShankCompositePort { + port shankPort :>> shankPort [5]; + } + } + interface wheelHubInterface:WheelHubInterface + connect lugNutCompositePort ::> wheel1.lugNutCompositePort [1] to shankCompositePort ::> hub1.shankCompositePort [1] { + interface wheelFastenerInterface1 :> wheelFastenerInterface + connect lugNutPort ::> lugNutCompositePort.lugNutPort [5] to shankPort ::> shankCompositePort.shankPort [5]; + } + } + // alternative 3 - w explicit nesxted interfaces + part wheelHubAssy3{ + part wheel1:Wheel{ + port lugNutCompositePort :>> lugNutCompositePort { + port lugNutPort [5] :>> lugNutPort { + attribute :>> threadDia = 14 [mm]; + attribute :>> threadPitch = 1.5 [mm]; + } + port lugNutPort1 [1] :> lugNutPort; + port lugNutPort2 [1] :> lugNutPort; + port lugNutPort3 [1] :> lugNutPort; + } +} + part hub1:Hub{ + port shankCompositePort :>> shankCompositePort { + port shankPort [5] :>> shankPort { + attribute :>> threadDia = 14 [mm]; + attribute :>> threadPitch = 1.5 [mm]; + attribute :>> shaftLength = 70 [mm]; + } + port shankPort1 [1] :> shankPort; + port shankPort2 [1] :> shankPort; + port shankPort3 [1] :> shankPort; + } +} + interface wheelHubInterface:WheelHubInterface + connect lugNutCompositePort ::> wheel1.lugNutCompositePort [1] to shankCompositePort ::> hub1.shankCompositePort [1] { + interface wheelFastenerInterface1 :> wheelFastenerInterface + connect lugNutPort ::> lugNutCompositePort.lugNutPort1 to shankPort ::> shankCompositePort.shankPort1 { + attribute :>> maxTorque = 90 * 1.356 [N*m]; + } + interface wheelFastenerInterface2 :> wheelFastenerInterface + connect lugNutPort ::> lugNutCompositePort.lugNutPort2 to shankPort ::> shankCompositePort.shankPort2 { + attribute :>> maxTorque = 90 * 1.356 [N*m]; + } + interface wheelFastenerInterface3 :> wheelFastenerInterface + connect lugNutPort ::> lugNutCompositePort.lugNutPort3 to shankPort ::> shankCompositePort.shankPort3 { + attribute :>> maxTorque = 90 * 1.356 [N*m]; + } + } + } + } + } + package VehicleAnalysis{ + public import RiskMetadata::*; + public import RiskLevelEnum::*; + // recursive public import uses double asterisk ** + public import VehicleConfigurations::VehicleConfiguration_b::**; + package FuelEconomyAnalysisModel{ + public import SampledFunctions::SampledFunction; + + /* + This analysis model was provided by Hisashi Miyashita on January 27, 2021 + We use the simplest fuel consumption analysis model introduced in: + Akcelik, R. "Fuel efficiency and other objectives in traffic system management." Traffic Engineering and Control 22.2 (1981): 54-65. + + Fuel consumption rate f can be decomposed to: + f = f_a + f_b * tpd_avg, + where tpd_avg is average interrupted travel time per unit distance, actually the inverse of the average velocity [t/km]; + f_a is the best fuel consumption per distance; and + f_b is the additional fuel consumption per distance and average travel time, which can be regarded as the idling fuel consumption. + Approximately, it is proportional to engine displacement and it ranges from 0.5 to 0.6 [l/hour/litre of engine displacement] + according to: + Review of the Incidence, Energy Use and Costs of Passenger Vehicle Idling; Gordon W. Taylor, P.Eng. Prepared for the Office of Energy Efficiency, Natural Resources Canada, 2003 + + We assume f_a can be approximated to + fuel_consumption / distance = BSFC * SGG * required_power_avg * tpd_avg, + where required_power_avg is the required power, and it can be approximately derived from: + total_energy == P_req * tpd_avg * distance == 1/2 * mass / tpd_avg^2 + This part is computed with BestFuelConsumptionPerDistance calc def. + + BSFC means Brake-Specific Fuel Consumption, defined as gram/power. SGG is the specific gravity of gasoline. + The high octane gasoline is about 0.76[l/kg]. + */ + + attribute def Scenario :> SampledFunction { + attribute wayPoint[1..*] { + attribute elapseTime[1] :> ISQ::time; + attribute position[1] :> ISQ::distance; + } + } + + calc def FuelConsumption { + in bestFuelConsumption: Real; + in idlingFuelConsumption: Real; + in tpd_avg:>timePerDistance; + attribute f = bestFuelConsumption + idlingFuelConsumption * tpd_avg; + return dpv :> distancePerVolume = 1/f; + } + + calc def AverageTravelTimePerDistance { + in scenario: Scenario; + return tpd_avg:>timePerDistance; + } + calc def TraveledDistance { + in scenario: Scenario; + return distance:> length; + } + calc def IdlingFuelConsumptionPerTime { + in engine:Engine; + attribute idlingFuelConsumptionPerDisplacement: Real = 0.5; + return f_a : Real = engine.displacement * idlingFuelConsumptionPerDisplacement; + } + + attribute specificGravityOfGasoline: Real = 0.76; + calc def BestFuelConsumptionPerDistance { + in mass: MassValue; + in bsfc: Real; + in tpd_avg:> timePerDistance; + in distance:>length; + attribute required_power_avg:> ISQ::power; + constraint {required_power_avg == 1/2 * mass * tpd_avg **(-3) / distance} + return f_b : Real = bsfc * specificGravityOfGasoline * required_power_avg * tpd_avg; + } + + calc def ComputeBSFC{ + in engine: Engine; + return : Real; + } + + analysis fuelEconomyAnalysis { + subject = vehicle_b; + + objective fuelEconomyAnalysisObjective { + doc /*estimate the vehicle fuel economy*/ + require vehicleSpecification.vehicleFuelEconomyRequirements; + } + + in attribute scenario: Scenario; + // define a series of waypoints + + attribute distance = TraveledDistance(scenario); + attribute tpd_avg = AverageTravelTimePerDistance(scenario); + attribute bsfc = ComputeBSFC(vehicle_b.engine); + attribute f_a = BestFuelConsumptionPerDistance(vehicle_b.mass, bsfc, tpd_avg, distance); + attribute f_b = IdlingFuelConsumptionPerTime(vehicle_b.engine); + + return attribute calculatedFuelEconomy:>distancePerVolume=FuelConsumption(f_a, f_b, tpd_avg); + } + } + package ElectricalPowerAnalysis{ + } + package ReliabilityAnalyis{ + } + package VehicleTradeOffAnalysis{ + /* The following example provides the rationale for selecting the engine4cyl. + The rationale and risk are contained in a metadata library. */ + + @Rationale about engineTradeOffAnalysis::vehicle_b_engine4cyl{ + explanation = VehicleAnalysis::VehicleTradeOffAnalysis::engineTradeOffAnalysis; + text = "the engine4cyl was evaluated to have a higher objective function compared to the engine6cyl based on the trade-off analyiss"; + } + + // The following risk for the engine4cyl could have been included as part of the objective evaluaiton criteria + + @Risk about engineTradeOffAnalysis::vehicle_b_engine4cyl { + totalRisk = medium; + technicalRisk = medium; + scheduleRisk = medium; + costRisk = RiskLevelEnum::low; + } + @Risk about engineTradeOffAnalysis::vehicle_b_engine4cyl::engine::fuelEfficiency { + technicalRisk { + probability = 0.3; + impact = 0.5; + } + } + + + public import TradeStudies::*; + //evaluation function with criterion engine mass, engine power, and engine cost + calc def EngineEvaluation { + in engineMass:>ISQ::mass; + in enginePower:>ISQ::power; + in engineFuelEfficiency:Real; + in engineCost:Real; + return eval:Real; + } + calc def EngineEvaluation_4cyl { + in engineMass:>ISQ::mass; + in enginePower:>ISQ::power; + in engineFuelEfficiency:Real; + in engineCost:Real; + return eval:Real; + } + calc def EngineEvaluation_6cyl { + in engineMass:>ISQ::mass; + in enginePower:>ISQ::power; + in engineFuelEfficiency:Real; + in engineCost:Real; + return eval:Real; + } + analysis engineTradeOffAnalysis:TradeStudy{ + subject vehicleAlternatives[2]:>vehicle_b; + + part vehicle_b_engine4cyl:>vehicleAlternatives{ + part engine redefines engine{ + part cylinders :>> cylinders [4]; + attribute mass redefines mass=180 [kg]; + attribute peakHorsePower redefines peakHorsePower = 180 [W]; + attribute fuelEfficiency redefines fuelEfficiency=.6; + attribute cost redefines cost = 1000; + } + } + part vehicle_b_engine6cyl:>vehicleAlternatives{ + part engine redefines engine{ + part cylinders redefines cylinders [6]; + attribute mass redefines mass=220 [kg]; + attribute peakHorsePower redefines peakHorsePower = 220 [W]; + attribute fuelEfficiency redefines fuelEfficiency=.5; + attribute cost redefines cost = 1500; + } + } + + objective :MaximizeObjective; + /*Select vehicle alternative with the engine whose evaluation function returns the max value*/ + + calc :> evaluationFunction{ + in part vehicle:>vehicle_b_engine4cyl; + return attribute eval:Real=EngineEvaluation_4cyl (vehicle.engine.mass, vehicle.engine.peakHorsePower, vehicle.engine.fuelEfficiency, vehicle.engine.cost); + } + calc :> evaluationFunction{ + in part vehicle:>vehicle_b_engine6cyl; + return attribute eval:Real=EngineEvaluation_6cyl (vehicle.engine.mass, vehicle.engine.peakHorsePower, vehicle.engine.fuelEfficiency, vehicle.engine.cost); + } + return part selectedVehicle:>vehicle_b; + } + } + } + package VehicleVerification{ + public import VehicleConfigurations::VehicleConfiguration_b::**; + public import VerificationCaseDefinitions::*; + public import VerificationCases1::*; + // the following is a model library which contains VerdictKind + public import VerificationCases::*; + public import VerificationSystem::*; + package VerificationCaseDefinitions{ + verification def MassTest; + verification def AccelerationTest; + verification def ReliabilityTest; + } + package VerificationCases1{ + verification massTests:MassTest { + subject vehicle_uut :> vehicle_b; + actor vehicleVerificationSubSystem_1 = verificationContext.massVerificationSystem; + objective { + verify vehicleSpecification.vehicleMassRequirement{ + redefines massActual=weighVehicle.massMeasured; + } + } + // method kinds are test, demo, analyze, should also include inspection, similarity + @ VerificationMethod{ + kind = (VerificationMethodKind::test, VerificationMethodKind::analyze); + } + action weighVehicle { + out massMeasured:>ISQ::mass; + } + then action evaluatePassFail { + in massMeasured:>ISQ::mass; + out verdict = PassIf(vehicleSpecification.vehicleMassRequirement(vehicle_uut)); + } + flow from weighVehicle.massMeasured to evaluatePassFail.massMeasured; + return :>> verdict = evaluatePassFail.verdict; + } + } + package VerificationSystem{ + part verificationContext{ + perform massTests; + part vehicle_UnitUnderTest :> vehicle_b; + part massVerificationSystem{ + part scale{ + perform massTests.weighVehicle; + } + part operator{ + perform massTests.evaluatePassFail; + } + } + } + } + } + package VehicleIndividuals{ + individual a:VehicleRoadContext_1{ + timeslice t0_t2_a{ + snapshot t0_a { + attribute t0 redefines time=0 [s]; + snapshot t0_r:Road_1{ + :>>Road::incline =0; + :>>Road::friction=.1; + } + snapshot t0_v:Vehicle_1{ + :>>Vehicle::position=0 [m]; + :>>Vehicle::velocity=0 [m]; + :>>Vehicle::acceleration=1.96 [m/s**2]; + // .2 g where 1 g = 9.8 meters/sec^2 + snapshot t0_fa:FrontAxleAssembly_1{ + snapshot t0_leftFront:Wheel_1; + snapshot t0_rightFront:Wheel_2; + } + } + } + snapshot t1_a{ + attribute t1 redefines time=1 [s]; + snapshot t1_r:Road_1{ + :>>Road::incline =0; + :>>Road::friction=.1; + } + snapshot t1_v:Vehicle_1{ + :>>Vehicle::position=.98 [m]; + :>>Vehicle::velocity=1.96 [m/s]; + :>>Vehicle::acceleration=1.96 [m/s**2]; + // .2 g where 1 g = 9.8 meters/sec^2 + snapshot t1_fa:FrontAxleAssembly_1{ + snapshot t1_leftFront:Wheel_1; + snapshot t1_rightFront:Wheel_2; + } + } + } + snapshot t2_a{ + attribute t2 redefines time=2 [s]; + snapshot t2_r:Road_1{ + :>>Road::incline =0; + :>>Road::friction=.1; + } + snapshot t2_v:Vehicle_1{ + :>>Vehicle::position=3.92 [m]; + :>>Vehicle::velocity=3.92 [m/s]; + :>>Vehicle::acceleration=1.96 [m/s**2]; + // .2 g where 1 g = 9.8 meters/sec^2 + snapshot t2_fa:FrontAxleAssembly_1{ + snapshot t2_leftFront:Wheel_1; + snapshot t2_rightFront:Wheel_2; + } + } + } + } + } + } + package MissionContext{ + /* Define mission context with mission use cases for vehicle_b */ + public import VehicleConfigurations::VehicleConfiguration_b::**; + public import ParametersOfInterestMetadata::moe; + public import TransportPassengerScenario::*; + package ContextDefinitions{ + part def MissionContext:>GenericContext::Context; + part def Road; + part def Driver{ + port handPort:HandPort{ + } + exhibit state driverStates{ + state initial; + state wait; + transition initial then wait; + //ignition on + transition 'wait-wait-1' + first wait + do send IgnitionCmd (ignitionOnOff=IgnitionOnOff::on) via handPort + then wait; + // ignition off + transition 'wait-wait-2' + first wait + do send IgnitionCmd (ignitionOnOff=IgnitionOnOff::off) via handPort + then wait; + } + } + part def Passenger; + + requirement transportRequirements; + use case def TransportPassenger{ + objective TransportObjective { + doc /*deliver passenger to destination safely, comfortably, and within acceptable time*/ + require transportRequirements; + } + subject vehicle:Vehicle; + actor environment; + actor road; + actor driver; + actor passenger [0..4]; + include use case getInVehicle_a:>getInVehicle [1..5]; + include use case getOutOfVehicle_a:>getOutOfVehicle [1..5]; + } + + use case getInVehicle:GetInVehicle { + action unlockDoor_in [0..1]; + then action openDoor_in; + then action enterVehicle; + then action closeDoor_in; + } + use case def GetInVehicle{ + subject vehicle:Vehicle; + actor driver [0..1]; + actor passenger [0..1]; + assert constraint {driver != null xor passenger != null} + } + + use case getOutOfVehicle:GetOutOfVehicle { + action openDoor_out; + then action exitVehicle; + then action closeDoor_out; + then action lockDoor_out; + } + use case def GetOutOfVehicle{ + subject vehicle:Vehicle; + actor driver [0..1]; + actor passenger [0..1]; + assert constraint {driver != null xor passenger != null} + } + } + package TransportPassengerScenario{ + public import ContextDefinitions::TransportPassenger; + + // this version uses nesting vs fork and join for concurrent actions + use case transportPassenger:TransportPassenger{ + first start; + then action a{ + action driverGetInVehicle subsets getInVehicle_a[1]; + action passenger1GetInVehicle subsets getInVehicle_a[1]; + } + then action trigger accept ignitionCmd:IgnitionCmd; + then action b{ + action driveVehicleToDestination; + action providePower; + } + then action c{ + action driverGetOutOfVehicle subsets getOutOfVehicle_a[1]; + action passenger1GetOutOfVehicle subsets getOutOfVehicle_a[1]; + } + then done; + } + + + //this version uses forks and joins + use case transportPassenger_1:TransportPassenger{ + // declare actions + action driverGetInVehicle subsets getInVehicle_a[1]; + action passenger1GetInVehicle subsets getInVehicle_a[1]; + action driverGetOutOfVehicle subsets getOutOfVehicle_a[1]; + action passenger1GetOutOfVehicle subsets getOutOfVehicle_a[1]; + action driveVehicleToDestination; + action providePower; + item def VehicleOnSignal; + join join1; + join join2; + join join3; + action trigger accept ignitionCmd:IgnitionCmd; + + // define control flow + first start; + then fork fork1; + then driverGetInVehicle; + then passenger1GetInVehicle; + first driverGetInVehicle then join1; + first passenger1GetInVehicle then join1; + first join1 then trigger; + first trigger then fork2; + //succession trigger if trigger.ignitionCmd.ignitionOnOff==IgnitionOnOff::on then fork2; + + fork fork2; + then driveVehicleToDestination; + then providePower; + first driveVehicleToDestination then join2; + first providePower then join2; + first join2 then fork3; + + fork fork3; + then driverGetOutOfVehicle; + then passenger1GetOutOfVehicle; + first driverGetOutOfVehicle then join3; + first passenger1GetOutOfVehicle then join3; + + first join3 then done; + } + } + + part missionContext:ContextDefinitions::MissionContext{ + #moe attribute transportTime :> ISQ::time; + perform transportPassenger; + // bind parts to actors of use case + part road:ContextDefinitions::Road = transportPassenger.road; + part driver:ContextDefinitions::Driver = transportPassenger.driver{ + perform transportPassenger.a.driverGetInVehicle.unlockDoor_in; + perform transportPassenger.a.driverGetInVehicle.openDoor_in; + perform transportPassenger.a.driverGetInVehicle.enterVehicle; + perform transportPassenger.a.driverGetInVehicle.closeDoor_in; + perform transportPassenger.c.driverGetOutOfVehicle.openDoor_out; + perform transportPassenger.c.driverGetOutOfVehicle.exitVehicle; + perform transportPassenger.c.driverGetOutOfVehicle.closeDoor_out; + perform transportPassenger.c.driverGetOutOfVehicle.lockDoor_out; + perform transportPassenger.b.driveVehicleToDestination; + } + part passenger1:ContextDefinitions::Passenger = transportPassenger.passenger { + perform transportPassenger.a.passenger1GetInVehicle.unlockDoor_in; + perform transportPassenger.a.passenger1GetInVehicle.openDoor_in; + perform transportPassenger.a.passenger1GetInVehicle.enterVehicle; + perform transportPassenger.a.passenger1GetInVehicle.closeDoor_in; + perform transportPassenger.c.passenger1GetOutOfVehicle.openDoor_out; + perform transportPassenger.c.passenger1GetOutOfVehicle.exitVehicle; + perform transportPassenger.c.passenger1GetOutOfVehicle.closeDoor_out; + perform transportPassenger.c.passenger1GetOutOfVehicle.lockDoor_out; + } + part vehicle_b_1:>vehicle_b = transportPassenger.vehicle{ + attribute :>> position3dVector = (0,0,0) [spatialCF]; + perform transportPassenger.b.providePower redefines providePower; + perform transportPassenger.trigger; + } + connect driver.handPort to vehicle_b_1.ignitionCmdPort; + connect road to vehicle_b_1.vehicleToRoadPort; + } + } + package VehicleSuperSetModel{ + /* all of vehicleFamily is included in the superset model to enable subsetting a specific vehicle configuration*/ + package VariationPointDefinitions { + variation part def TransmissionChoices:>Transmission { + variant part transmissionAutomatic:TransmissionAutomatic; + variant part transmissionManual:TransmissionManual; + } + } + package VehiclePartsTree{ + public import VariationPointDefinitions::*; + abstract part vehicleFamily { + // variation with nested variation + variation part engine:Engine{ + variant part engine4Cyl:Engine4Cyl; + variant part engine6Cyl:Engine6Cyl{ + part cylinder:Cylinder [6]{ + variation attribute diameter:LengthValue{ + variant attribute smallDiameter:LengthValue; + variant attribute largeDiagmeter:LengthValue; + } + } + } + } + // variation point based on variation of part definition + part transmissionChoices:TransmissionChoices; + // optional variation point + part sunroof:Sunroof[0..1]; + // selection constraint + assert constraint selectionConstraint{ + (engine==engine::engine4Cyl and transmissionChoices==TransmissionChoices::transmissionManual) xor + (engine==engine::engine6Cyl and transmissionChoices==TransmissionChoices::transmissionAutomatic) + } + part driveshaft; + part frontAxleAssembly; + part rearAxleAssembly; + } + } + } + package SafetyandSecurityGroups { + public import VehicleConfigurations::VehicleConfiguration_b::PartsTree::*; + package SafetyGroup { + /* Parts that contribute to safety. */ + public import vehicle_b::**; + filter @Safety; + } + package SecurityGroup { + /* Parts that contribute to security. */ + public import vehicle_b::**; + filter @Security; + } + package SafetyandSecurityGroup { + /* Parts that contribute to safety OR security. */ + public import vehicle_b::**; + filter @Safety or @Security; + } + package MandatorySafetyGroup { + /* Parts that contribute to safety AND are mandatory. */ + public import vehicle_b::**; + filter @Safety and Safety::isMandatory; + } + } + package Views_Viewpoints{ + package ViewpointDefinitions{ + viewpoint def BehaviorViewpoint; + viewpoint def SafetyViewpoint{ + frame concern vs:VehicleSafety; + } + part def SafetyEngineer; + concern def VehicleSafety { + doc /* identify system safety features */ + stakeholder se:SafetyEngineer; + } + } + package ViewDefinitions{ + //public import Views to access rendering method library + public import Views::*; + view def TreeView{ + render asTreeDiagram; + } + view def NestedView; + view def RelationshipView; + view def TableView; + view def PartsTreeView:>TreeView { + filter @SysML::PartUsage; + } + view def PartsInterconnection:>NestedView; + } + package VehicleViews{ + public import ViewpointDefinitions::*; + public import ViewDefinitions::*; + public import VehicleConfigurations::VehicleConfiguration_b::*; + view vehiclePartsTree_Safety:PartsTreeView{ + satisfy requirement sv:SafetyViewpoint; + expose PartsTree::**; + filter @Safety; + } + } + } +} + diff --git a/src/sysml/src/examples/Vehicle Example/VehicleDefinitions.sysml b/src/sysml/src/examples/Vehicle Example/VehicleDefinitions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..17b6a252e5a7c80c32792324e0eb205580182be3 --- /dev/null +++ b/src/sysml/src/examples/Vehicle Example/VehicleDefinitions.sysml @@ -0,0 +1,54 @@ +package VehicleDefinitions { + doc + /* + * Example vehicle definitions model. + */ + + private import ScalarValues::*; + private import Quantities::*; + private import MeasurementReferences::*; + private import ISQ::*; + private import SI::*; + + /* PART DEFINITIONS */ + + part def Vehicle { + attribute mass :> ISQ::mass; + } + part def Transmission; + part def AxleAssembly; + part def Axle { + port leftMountingPoint: AxleMountIF; + port rightMountingPoint: AxleMountIF; + } + part def Wheel { + port hub: WheelHubIF; + } + part def Lugbolt { + attribute tighteningTorque :> ISQ::torque; + } + + /* PORT DEFINITIONS */ + + port def DriveIF { + in driveTorque :> ISQ::torque; + } + + port def AxleMountIF { + out transferredTorque :> ISQ::torque; + } + + port def WheelHubIF { + in appliedTorque :> ISQ::torque; + } + + /* INTERFACE DEFINITIONS */ + + interface def Mounting { + doc /* The definition of the interface for mounting a Wheel to an Axle. */ + end axleMount: AxleMountIF; + end hub: WheelHubIF; + + flow axleMount.transferredTorque to hub.appliedTorque; + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Vehicle Example/VehicleIndividuals.sysml b/src/sysml/src/examples/Vehicle Example/VehicleIndividuals.sysml new file mode 100644 index 0000000000000000000000000000000000000000..9673c3e8eee9fbc064052ed38644503ca39c4263 --- /dev/null +++ b/src/sysml/src/examples/Vehicle Example/VehicleIndividuals.sysml @@ -0,0 +1,111 @@ +package VehicleIndividuals { + private import VehicleUsages::*; + private import Time::DateTime; + private import SI::kg; + + package IndividualDefinitions { + + individual part def Vehicle1 :> Vehicle { + doc + /* + * This is an individual Vehicle with a mass of 1800 kg. + */ + + attribute redefines mass = 1800 [kg]; + } + + individual part def Vehicle2 :> Vehicle { + doc + /* + * This is an individual Vehicle with a mass of 1700 kg. + */ + + attribute redefines mass = 1700 [kg]; + } + + individual part def AxleAssembly1 :> AxleAssembly; + + individual part def Wheel1 :> Wheel; + individual part def Wheel2 :> Wheel; + } + + package IndividualSnapshots { + public import IndividualDefinitions::*; + + attribute t0: DateTime; + attribute t1: DateTime; + + snapshot part vehicle1_t0: Vehicle1 { + doc + /* + * This is a snapshot of Vehicle1 at time t0; + */ + + // Note: Timestamping of snapshots is not yet formalized. + attribute t = t0; + } + + timeslice part vehicle1_t0_t1: Vehicle1 { + doc + /* + * This is a time slice of Vehicle1 starting at snapshot vehicle1_t0 + * (time t0) and ending at time t1. + */ + + snapshot :>> start = vehicle1_t0; + snapshot :>> done { + attribute t = t1; + } + } + } + + package IndividualConfigurations { + public import IndividualSnapshots::*; + + individual part vehicle1_C2: Vehicle1 :> vehicle_C2 { + doc + /* + * This asserts that for some portion of its lifetime, Vehicle1 conforms + * to the configuration vehicle_C2; + */ + } + + snapshot part vehicle1_C2_t0 : Vehicle1 :> vehicle1_C2, vehicle1_t0 { + doc + /* + * This is a snapshot of Vehicle1 in configuration vehicle1_C2 at time t0. + */ + + snapshot axleAssembly1_t0: AxleAssembly1 :>> frontAxleAssembly { + doc + /* + * frontAxleAssembly is a feature of vehicle1_C2. + */ + + snapshot leftFrontWheel_t0: Wheel1 :>> leftFrontWheel { + doc + /* + * This asserts that Wheel1 is the leftFrontWheel of vehicle_C2_t0 + * (leftFrontWheel is a feature of vehicle_C2::frontAxleAssembly). + */ + } + } + } + + snapshot part vehicle1_C2_t1 : Vehicle1 :> vehicle1_C2, vehicle1_t0_t1.done { + doc + /* + * This is a snapshot of Vehicle1 in configuration vehicle_C2 at time t1. + */ + + snapshot axleAssembly1_t1: AxleAssembly1 :>> frontAxleAssembly { + snapshot rightFrontWheel_t1: Wheel1 :>> rightFrontWheel { + doc + /* + * This asserts that Wheel1 is the rightFrontWheel of vehicle_C2_t1. + */ + } + } + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/Vehicle Example/VehicleUsages.sysml b/src/sysml/src/examples/Vehicle Example/VehicleUsages.sysml new file mode 100644 index 0000000000000000000000000000000000000000..14cc69bf867dc71e87921bff0faf105289c81d2d --- /dev/null +++ b/src/sysml/src/examples/Vehicle Example/VehicleUsages.sysml @@ -0,0 +1,96 @@ +package VehicleUsages { + doc + /* + * Example usages of elements from the vehicle definitions model. + */ + + private import SI::N; + private import SI::m; + private import ScalarFunctions::*; + + public import VehicleDefinitions::*; + + /* VALUES */ + T1 = 10.0 [N * m]; + T2 = 20.0 [N * m]; + + /* PARTS */ + part narrowRimWheel: Wheel { + doc /* Narrow-rim wheel configuration with 4 to 5 lugbolts. */ + + part lugbolt: Lugbolt[4..5]; + } + + part wideRimWheel: Wheel { + doc /* Wide-rim wheel configuration with 4 to 6 lugbolts. */ + + part lugbolt: Lugbolt[4..6]; + } + + part vehicle_C1: Vehicle { + doc /* Basic Vehicle configuration showing a part hierarchy. */ + + part frontAxleAssembly: AxleAssembly { + part frontWheel[2] subsets narrowRimWheel { + part redefines lugbolt[4] { + attribute redefines tighteningTorque = T1; + } + } + part frontAxle: Axle; + } + part rearAxleAssembly: AxleAssembly { + part rearWheel[2] subsets wideRimWheel { + part redefines lugbolt[6] { + attribute redefines tighteningTorque = T2; + } + } + part rearAxle: Axle; + } + } + + part vehicle_C2 subsets vehicle_C1 { + doc /* Specialized configuration with part-specific ports. */ + + part redefines frontAxleAssembly { + part leftFrontWheel subsets frontWheel = frontWheel#(1); + part rightFrontWheel subsets frontWheel = frontWheel#(2); + + interface leftFrontMount: Mounting connect + frontAxle.leftMountingPoint to leftFrontWheel.hub; + + interface rightFrontMount: Mounting connect + frontAxle.rightMountingPoint to rightFrontWheel.hub; + } + + part rearAxleAssembly redefines vehicle_C1::rearAxleAssembly { + part leftRearWheel subsets rearWheel = rearWheel#(1); + part rightRearWheel subsets rearWheel = rearWheel#(2); + + interface leftRearMount: Mounting connect + rearAxle.leftMountingPoint to leftRearWheel.hub; + + interface rightRearMount: Mounting connect + rearAxle.rightMountingPoint to rightRearWheel.hub; + } + } + + part vehicle_C3 subsets vehicle_C2 { + doc /* Further specialized configuration with a connection to a deeply-nested port. */ + + + part transmission: Transmission { + port drive: ~DriveIF; + } + + part redefines rearAxleAssembly { + part redefines rearAxle { + port drive: DriveIF; + } + } + + interface driveShaft connect + transDrive ::> transmission.drive to axleDrive ::> rearAxleAssembly.rearAxle.drive { + flow transDrive.driveTorque to axleDrive.driveTorque; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/v1 Spec Examples/8.4.1 Wheel Hub Assembly/Wheel Package - Updated.sysml b/src/sysml/src/examples/v1 Spec Examples/8.4.1 Wheel Hub Assembly/Wheel Package - Updated.sysml new file mode 100644 index 0000000000000000000000000000000000000000..0360fcc0d9d6b1bebd9a3c9896118e1e4646b137 --- /dev/null +++ b/src/sysml/src/examples/v1 Spec Examples/8.4.1 Wheel Hub Assembly/Wheel Package - Updated.sysml @@ -0,0 +1,92 @@ +package 'Wheel Package - Updated' { + doc + /* + * Example from the SysML 1.6 spec, subclause 8.4.1 Wheel Hub Assembly. + */ + + private import ISQ::*; + + // Quantities + + pressure = force / length^2; + + // Blocks + + part def WheelHubAssembly; + part def WheelAssembly { + inflationPressure :> pressure; + } + + part def Tire { + tireSpecification : ScalarValues::String; + action mountTire; // Should be operation + } + + part def TireBead; + + connection def PressureSeat { + end : TireBead[1]; + end : TireMountingRim[1]; + } + + part def Wheel { + diameter :> length; + width :> length; + } + + connection def BandMount { + end : Wheel[1]; + end : WirelessTirePressureMonitor[1]; + } + + part def WirelessTirePressureMonitor { + action transmitPressure; // Should be operation + } + + part def TireMountingRim; + + part def InflationValve; + + part def BalanceWeight; + + part def LugBoltMountingHole { + lugBoltSize :> length; + } + + part def LugBoltJoint { + torque :> ISQ::torque; + boltTension :> force; + } + + part def Hub; + + part def LugBoltThreadableHole { + lugBoltSize :> length; + threadSize :> length; + } + + // Parts + + part wheelHubAssembly: WheelHubAssembly { + part wheel: WheelAssembly[1] { + part t: Tire[1] { + part bead : TireBead[2]; + } + part w: Wheel[1] { + part rim : TireMountingRim[2]; + part v : InflationValve[1]; + part weight : BalanceWeight[0..6]; + part mountingHoles : LugBoltMountingHole[5]; + } + connection : PressureSeat connect t.bead to w.rim; + } + part lugBoltJoints: LugBoltJoint[5] { + ref mountingHole: LugBoltMountingHole[1] subsets wheel.w.mountingHoles; + ref threadedHole: LugBoltThreadableHole[1] subsets hub.h; + } + part hub: Hub[1] { + part h: LugBoltThreadableHole[5]; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/v1 Spec Examples/8.4.1 Wheel Hub Assembly/Wheel Package.sysml b/src/sysml/src/examples/v1 Spec Examples/8.4.1 Wheel Hub Assembly/Wheel Package.sysml new file mode 100644 index 0000000000000000000000000000000000000000..6ba0d0e93b0af916737c82a69d2092306cfdd3f0 --- /dev/null +++ b/src/sysml/src/examples/v1 Spec Examples/8.4.1 Wheel Hub Assembly/Wheel Package.sysml @@ -0,0 +1,94 @@ +package 'Wheel Package' { + doc + /* + * Example from the SysML 1.6 spec, subclause 8.4.1 Wheel Hub Assembly. + */ + + private import ISQ::*; + + pressure = force / length^2; + + part def WheelHubAssembly { + part wheel: WheelAssembly[1]; + part lugBoltJoints: LugBoltJoint[5] { + ref redefines threadedHole subsets hub.h; + ref redefines mountingHole subsets wheel.w.mountingHoles; + } + part hub: Hub[1]; + } + + part def WheelAssembly { + inflationPressure :> pressure; + + part t: Tire[1] { + part bead redefines Tire::bead; + } + part w: Wheel[1] { + part rim redefines Wheel::rim; + } + + connection : PressureSeat connect t.bead to w.rim; + } + + part def Tire { + tireSpecification : ScalarValues::String; + + part bead : TireBead[2]; + + action mountTire; + } + + part def TireBead; + + connection def PressureSeat { + end : TireBead[1]; + end : TireMountingRim[1]; + } + + part def Wheel { + diameter :> length; + width :> length; + + part rim : TireMountingRim[2]; + part v : InflationValve[1]; + part weight : BalanceWeight[0..6]; + part mountingHoles : LugBoltMountingHole[5]; + } + + connection def BandMount { + end : Wheel[1]; + end : WirelessTirePressureMonitor[1]; + } + + part def WirelessTirePressureMonitor { + action transmitPressure; + } + + part def TireMountingRim; + + part def InflationValve; + + part def BalanceWeight; + + part def LugBoltMountingHole { + lugBoltSize :> length; + } + + part def LugBoltJoint { + torque :> ISQ::torque; + boltTension :> force; + + ref mountingHole: LugBoltMountingHole[1]; + ref threadedHole: LugBoltThreadableHole[1]; + } + + part def Hub { + part h: LugBoltThreadableHole[5]; + } + + part def LugBoltThreadableHole { + lugBoltSize :> length; + threadSize :> length; + } + +} \ No newline at end of file diff --git a/src/sysml/src/examples/v1 Spec Examples/8.4.5 Constraining Decomposition/Vehicle Decomposition - Updated.sysml b/src/sysml/src/examples/v1 Spec Examples/8.4.5 Constraining Decomposition/Vehicle Decomposition - Updated.sysml new file mode 100644 index 0000000000000000000000000000000000000000..99829a297cf43a8861b50d0a195aaedada6182da --- /dev/null +++ b/src/sysml/src/examples/v1 Spec Examples/8.4.5 Constraining Decomposition/Vehicle Decomposition - Updated.sysml @@ -0,0 +1,68 @@ +package 'Vehicle Decomposition - Updated' { + doc + /* + * Example from the SysML 1.6 spec, subclause 8.4.5 Constraining Decomposition, + * updated for usage-focused approach. + */ + + // Blocks + + part def Vehicle; + + part def 'Chassis Assembly'; + + part def Wheel; + + part def LugBolt; + + part def RollBar; + part def HeavyRollBar :> RollBar; + part def LightRollBar :> RollBar; + + part def Engine; + + part def Cylinder; + + // Parts + + part vehicle : Vehicle { + part chs : 'Chassis Assembly'[1] { + part rb : RollBar[0..1]; + part w : Wheel[4] { + part lb : LugBolt[6..10]; + } + } + part eng: Engine[1] { + part cyl : Cylinder[4..8]; + } + } + + + part 'vehicle model 1' :> vehicle { + part redefines chs { + part redefines rb : LightRollBar[0..1]; + part redefines w { + part redefines lb; + } + } + part redefines eng { + part redefines cyl[4]; + } + + // Constrains total number of lugbolts. + ref lugBolts[24] = chs.w.lb; + } + + part 'vehicle model 2' :> vehicle { + part redefines chs { + part redefines rb[0]; + part redefines w { + // Constrains number of lugbolts per wheel. + part redefines lb[6..7]; + } + } + part redefines eng { + part redefines cyl[6..8]; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/v1 Spec Examples/8.4.5 Constraining Decomposition/Vehicle Decomposition.sysml b/src/sysml/src/examples/v1 Spec Examples/8.4.5 Constraining Decomposition/Vehicle Decomposition.sysml new file mode 100644 index 0000000000000000000000000000000000000000..16a3d0b4eb7fe4d9edb8dfa5da428310c39208e7 --- /dev/null +++ b/src/sysml/src/examples/v1 Spec Examples/8.4.5 Constraining Decomposition/Vehicle Decomposition.sysml @@ -0,0 +1,55 @@ +package 'Vehicle Decomposition' { + doc + /* + * Example from the SysML 1.6 spec, subclause 8.4.5 Constraining Decomposition. + */ + + part def Vehicle { + part chs : 'Chassis Assembly'[1] { + part rb redefines 'Chassis Assembly'::rb; + part redefines w { + part redefines lb; + } + } + part eng : Engine[1] { + part cyl redefines Engine::cyl; + } + + ref cylinderBR[*] = eng.cyl; + ref rollBarBR[*] = chs.rb; + ref lugBoltBR[24..32] = chs.w.lb; + } + + part def 'Chassis Assembly' { + part w : Wheel[4]; + part rb : RollBar[0..1]; + } + + part def Wheel { + part lb : LugBolt[6..10]; + } + + part def LugBolt; + + part def RollBar; + part def HeavyRollBar :> RollBar; + part def LightRollBar :> RollBar; + + part def Engine { + part cyl : Cylinder[4..8]; + } + + part def Cylinder; + + part def 'Vehicle Model 1' :> Vehicle { + ref redefines cylinderBR[4]; + ref redefines rollBarBR : LightRollBar[*]; + ref redefines lugBoltBR[24]; + } + + part def 'Vehicle Model 2' :> Vehicle { + ref redefines cylinderBR[6..8]; + ref redefines rollBarBR[0]; + ref redefines lugBoltBR[24..28]; // 6..7 per wheel + } +} \ No newline at end of file diff --git a/src/sysml/src/examples/v1 Spec Examples/D.4.7.8 Dynamics/HSUVDynamics.sysml b/src/sysml/src/examples/v1 Spec Examples/D.4.7.8 Dynamics/HSUVDynamics.sysml new file mode 100644 index 0000000000000000000000000000000000000000..002d84146be7fd6576e11be673cfc6e1b6501679 --- /dev/null +++ b/src/sysml/src/examples/v1 Spec Examples/D.4.7.8 Dynamics/HSUVDynamics.sysml @@ -0,0 +1,88 @@ +package HSUVDynamics { + private import ScalarValues::*; + private import SequenceFunctions::size; + private import ControlFunctions::*; + + attribute def Horsepwr :> Real; + attribute def Weight :> Real; + attribute def Accel :> Real; + attribute def Vel :> Real; + attribute def Dist :> Real; + attribute def Time :> Real; + + constraint def PowerEquation { + attribute whlpwr : Horsepwr; + attribute Cd : Real; + attribute Cf : Real; + attribute tw : Weight; + attribute tp : Horsepwr; + attribute v : Vel; + + tp == whlpwr - Cd * v - Cf * tw * v + } + + constraint def PositionEquation { + attribute dt : Time; + attribute v : Vel[0..*] ordered; + attribute x : Dist[0..*] ordered; + + (1..size(x)-1)->forAll {in n : Natural; x#(n + 1) == x#(n) + v#(n) * (5280/3600) * dt} + } + + constraint def VelocityEquation { + attribute dt : Time; + attribute v : Vel[0..*] ordered; + attribute a : Accel; + + (1..size(v)-1)->forAll {in n: Natural; v#(n + 1) == v#(n) + a * 32 * (3600/5280) * dt} + } + + constraint def AccelerationEquation { + attribute tw : Weight; + attribute dt : Time; + attribute tp : Horsepwr; + attribute a : Accel; + + a == (550/32) * tp * dt * tw + } + + constraint def StraightLineVehicleDynamics { + attribute dt : Time; + attribute whlpwr : Horsepwr; + attribute Cd : Real; + attribute Cf: Real; + attribute tw : Weight; + attribute a : Accel; + attribute v : Vel[0..*] ordered; + attribute x : Dist[0..*] ordered; + + constraint pwr : PowerEquation { + attribute redefines whlpwr = StraightLineVehicleDynamics::whlpwr; + attribute redefines Cd = StraightLineVehicleDynamics::Cd; + attribute redefines Cf = StraightLineVehicleDynamics::Cf; + attribute redefines tw = StraightLineVehicleDynamics::tw; + attribute redefines v = vel.v; + attribute redefines tp; + } + + constraint acc : AccelerationEquation { + attribute redefines tp = pwr.tp; + attribute redefines tw = StraightLineVehicleDynamics::tw; + attribute redefines dt = StraightLineVehicleDynamics::dt; + attribute redefines a = StraightLineVehicleDynamics::a; + } + + constraint vel : VelocityEquation { + attribute redefines a = acc.a; + attribute redefines v = StraightLineVehicleDynamics::v; + attribute redefines dt = StraightLineVehicleDynamics::dt; + } + + constraint pos : PositionEquation { + attribute redefines v = vel.v; + attribute redefines x = StraightLineVehicleDynamics::x; + attribute redefines dt = StraightLineVehicleDynamics::dt; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/01. Packages/Comment Example.sysml b/src/sysml/src/training/01. Packages/Comment Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..b55d5f3c6ae184a5663c911fec596d13ab793b1a --- /dev/null +++ b/src/sysml/src/training/01. Packages/Comment Example.sysml @@ -0,0 +1,24 @@ +package 'Comment Example' { + /* This is a comment, which is a part of the model, + * annotating (by default) it's owning namespace. */ + + comment Comment1 /* This is a named comment. */ + + comment about Automobile + /* This is an unnamed comment, annotating an + * explicitly specified element. + */ + + part def Automobile; + + alias Car for Automobile { + /* + * This is a comment annotating its owning + * element. + */ + } + + // This is a note. It is in the text, but not part + // of the model. + alias Torque for ISQ::TorqueValue; +} \ No newline at end of file diff --git a/src/sysml/src/training/01. Packages/Documentation Example.sysml b/src/sysml/src/training/01. Packages/Documentation Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..61538b080c40358dea20e305c21deceb202b6088 --- /dev/null +++ b/src/sysml/src/training/01. Packages/Documentation Example.sysml @@ -0,0 +1,14 @@ +package 'Documentation Example' { + doc /* This is documentation of the owning + * package. + */ + + part def Automobile { + doc Document1 /* This documentation of Automobile. */ + } + + alias Car for Automobile { + doc /* This is documentation of the alias. */ + } + alias Torque for ISQ::TorqueValue; +} \ No newline at end of file diff --git a/src/sysml/src/training/01. Packages/Package Example.sysml b/src/sysml/src/training/01. Packages/Package Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..84535a115d6145420f6c94c34f18fa148fd61862 --- /dev/null +++ b/src/sysml/src/training/01. Packages/Package Example.sysml @@ -0,0 +1,9 @@ +package 'Package Example' { + public import ISQ::TorqueValue; + private import ScalarValues::*; + + private part def Automobile; + + public alias Car for Automobile; + alias Torque for ISQ::TorqueValue; +} \ No newline at end of file diff --git a/src/sysml/src/training/02. Part Definitions/Part Definition Example.sysml b/src/sysml/src/training/02. Part Definitions/Part Definition Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..5f76994fced1a9bfaafc917e4008b88c625ce334 --- /dev/null +++ b/src/sysml/src/training/02. Part Definitions/Part Definition Example.sysml @@ -0,0 +1,20 @@ +package 'Part Definition Example' { + private import ScalarValues::*; + + part def Vehicle { + attribute mass : Real; + attribute status : VehicleStatus; + + part eng : Engine; + + ref part driver : Person; + } + + attribute def VehicleStatus { + attribute gearSetting : Integer; + attribute acceleratorPosition : Real; + } + + part def Engine; + part def Person; +} \ No newline at end of file diff --git a/src/sysml/src/training/03. Generalization/Generalization Example.sysml b/src/sysml/src/training/03. Generalization/Generalization Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..249083e0e4fef444930c89b4ff74425bef83b05b --- /dev/null +++ b/src/sysml/src/training/03. Generalization/Generalization Example.sysml @@ -0,0 +1,19 @@ +package 'Generalization Example' { + + abstract part def Vehicle; + + part def HumanDrivenVehicle specializes Vehicle { + ref part driver : Person; + } + + part def PoweredVehicle :> Vehicle { + part eng : Engine; + } + + part def HumanDrivenPoweredVehicle :> + HumanDrivenVehicle, PoweredVehicle; + + part def Engine; + part def Person; + +} \ No newline at end of file diff --git a/src/sysml/src/training/04. Subsetting/Subsetting Example.sysml b/src/sysml/src/training/04. Subsetting/Subsetting Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..314222360439fa24be58302f6de534fb06480b0c --- /dev/null +++ b/src/sysml/src/training/04. Subsetting/Subsetting Example.sysml @@ -0,0 +1,15 @@ +package 'Subsetting Example' { + + part def Vehicle { + part parts : VehiclePart[*]; + + part eng : Engine subsets parts; + part trans : Transmission subsets parts; + part wheels : Wheel[4] :> parts; + } + + abstract part def VehiclePart; + part def Engine :> VehiclePart; + part def Transmission :> VehiclePart; + part def Wheel :> VehiclePart; +} \ No newline at end of file diff --git a/src/sysml/src/training/05. Redefinition/Redefinition Example.sysml b/src/sysml/src/training/05. Redefinition/Redefinition Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..2b74e0f1b513b91f664038b98dbe5892657e3c56 --- /dev/null +++ b/src/sysml/src/training/05. Redefinition/Redefinition Example.sysml @@ -0,0 +1,24 @@ +package 'Redefinition Example' { + + part def Vehicle { + part eng : Engine; + } + part def SmallVehicle :> Vehicle { + part smallEng : SmallEngine redefines eng; + } + part def BigVehicle :> Vehicle { + part bigEng : BigEngine :>> eng; + } + + part def Engine { + part cyl : Cylinder[4..6]; + } + part def SmallEngine :> Engine { + part redefines cyl[4]; + } + part def BigEngine :> Engine { + part redefines cyl[6]; + } + + part def Cylinder; +} diff --git a/src/sysml/src/training/06. Enumeration Definitions/Enumeration Definitions-1.sysml b/src/sysml/src/training/06. Enumeration Definitions/Enumeration Definitions-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..fb796bfec5ed65437c6df56e4fad6836fd68c991 --- /dev/null +++ b/src/sysml/src/training/06. Enumeration Definitions/Enumeration Definitions-1.sysml @@ -0,0 +1,17 @@ +package 'Enumeration Definitions-1' { + private import ScalarValues::Real; + + enum def TrafficLightColor { + enum green; + enum yellow; + enum red; + } + + part def TrafficLight { + attribute currentColor : TrafficLightColor; + } + + part def TrafficLightGo specializes TrafficLight { + attribute redefines currentColor = TrafficLightColor::green; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/06. Enumeration Definitions/Enumeration Definitions-2.sysml b/src/sysml/src/training/06. Enumeration Definitions/Enumeration Definitions-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f33775b03020a239501bef520a218e6c3305d682 --- /dev/null +++ b/src/sysml/src/training/06. Enumeration Definitions/Enumeration Definitions-2.sysml @@ -0,0 +1,32 @@ +package 'Enumeration Definitions-2' { + private import ScalarValues::*; + private import 'Enumeration Definitions-1'::*; + + attribute def ClassificationLevel { + attribute code : String; + attribute color : TrafficLightColor; + } + + enum def ClassificationKind specializes ClassificationLevel { + unclassified { + :>> code = "uncl"; + :>> color = TrafficLightColor::green; + } + confidential { + :>> code = "conf"; + :>> color = TrafficLightColor::yellow; + } + secret { + :>> code = "secr"; + :>> color = TrafficLightColor::red; + } + } + + enum def GradePoints :> Real { + A = 4.0; + B = 3.0; + C = 2.0; + D = 1.0; + F = 0.0; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/07. Parts/Parts Example-1.sysml b/src/sysml/src/training/07. Parts/Parts Example-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..89e2d643aab5dd41567ba091f223744f3da83503 --- /dev/null +++ b/src/sysml/src/training/07. Parts/Parts Example-1.sysml @@ -0,0 +1,29 @@ +package 'Parts Example-1' { + + // Definitions + + part def Vehicle { + part eng : Engine; + } + + part def Engine { + part cyl : Cylinder[4..6]; + } + + part def Cylinder; + + // Usages + + part smallVehicle : Vehicle { + part redefines eng { + part redefines cyl[4]; + } + } + + part bigVehicle : Vehicle { + part redefines eng { + part redefines cyl[6]; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/07. Parts/Parts Example-2.sysml b/src/sysml/src/training/07. Parts/Parts Example-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..05f3eae232c6e5aaceaf4fd04df0a26efa8aed7f --- /dev/null +++ b/src/sysml/src/training/07. Parts/Parts Example-2.sysml @@ -0,0 +1,29 @@ +package 'Parts Example-2' { + + // Definitions + + part def Vehicle; + part def Engine; + part def Cylinder; + + // Usages + + part vehicle : Vehicle { + part eng : Engine { + part cyl : Cylinder[4..6]; + } + } + + part smallVehicle :> vehicle { + part redefines eng { + part redefines cyl[4]; + } + } + + part bigVehicle :> vehicle { + part redefines eng { + part redefines cyl[6]; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/08. Items/Items Example.sysml b/src/sysml/src/training/08. Items/Items Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..924c117ef21c8ff620f0342e07240d6923906faf --- /dev/null +++ b/src/sysml/src/training/08. Items/Items Example.sysml @@ -0,0 +1,17 @@ +package 'Items Example' { + private import ScalarValues::*; + + item def Fuel; + item def Person; + + part def Vehicle { + attribute mass : Real; + + ref item driver : Person; + + part fuelTank { + item fuel: Fuel; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/09. Connections/Connections Example.sysml b/src/sysml/src/training/09. Connections/Connections Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8f5a348a1d0d320830c727ea8b90c0d39bad015c --- /dev/null +++ b/src/sysml/src/training/09. Connections/Connections Example.sysml @@ -0,0 +1,42 @@ +package 'Connections Example' { + + part def WheelHubAssembly; + part def WheelAssembly; + part def Tire; + part def TireBead; + part def Wheel; + part def TireMountingRim; + part def LugBoltMountingHole; + part def Hub; + part def LugBoltThreadableHole; + part def LugBoltJoint; + + connection def PressureSeat { + end bead : TireBead[1]; + end mountingRim : TireMountingRim[1]; + } + + part wheelHubAssembly : WheelHubAssembly { + + part wheel : WheelAssembly[1] { + part t : Tire[1] { + part bead : TireBead[2]; + } + part w: Wheel[1] { + part rim : TireMountingRim[2]; + part mountingHoles : LugBoltMountingHole[5]; + } + connection : PressureSeat + connect bead references t.bead + to mountingRim references w.rim; + } + + part lugBoltJoints : LugBoltJoint[0..5]; + part hub : Hub[1] { + part h : LugBoltThreadableHole[5]; + } + connect lugBoltJoints[0..1] to wheel.w.mountingHoles[1]; + connect lugBoltJoints[0..1] to hub.h[1]; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/10. Ports/Port Conjugation Example.sysml b/src/sysml/src/training/10. Ports/Port Conjugation Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..7310f520f6f0d9c45f454b7113d504f66d74198e --- /dev/null +++ b/src/sysml/src/training/10. Ports/Port Conjugation Example.sysml @@ -0,0 +1,20 @@ +package 'Port Conjugation Example' { + + attribute def Temp; + + part def Fuel; + + port def FuelPort { + attribute temperature : Temp; + out item fuelSupply : Fuel; + in item fuelReturn : Fuel; + } + + part def FuelTank { + port fuelTankPort : FuelPort; + } + + part def Engine { + port engineFuelPort : ~FuelPort; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/10. Ports/Port Example.sysml b/src/sysml/src/training/10. Ports/Port Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..503f51ffcdadad70f201c5bd82665d408ef3db78 --- /dev/null +++ b/src/sysml/src/training/10. Ports/Port Example.sysml @@ -0,0 +1,26 @@ +package 'Port Example' { + + attribute def Temp; + + part def Fuel; + + port def FuelOutPort { + attribute temperature : Temp; + out item fuelSupply : Fuel; + in item fuelReturn : Fuel; + } + + port def FuelInPort { + attribute temperature : Temp; + in item fuelSupply : Fuel; + out item fuelReturn : Fuel; + } + + part def FuelTankAssembly { + port fuelTankPort : FuelOutPort; + } + + part def Engine { + port engineFuelPort : FuelInPort; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/11. Interfaces/Interface Decomposition Example.sysml b/src/sysml/src/training/11. Interfaces/Interface Decomposition Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..db550ada5198424875633720d6e34acaca33e5e6 --- /dev/null +++ b/src/sysml/src/training/11. Interfaces/Interface Decomposition Example.sysml @@ -0,0 +1,23 @@ +package 'Interface Decomposition Example' { + + port def SpigotBank; + port def Spigot; + + port def Faucet; + port def FaucetInlet; + + interface def WaterDelivery { + end suppliedBy : SpigotBank[1] { + port hot : Spigot; + port cold : Spigot; + } + end deliveredTo : Faucet[1..*] { + port hot : FaucetInlet; + port cold : FaucetInlet; + } + + connect suppliedBy.hot to deliveredTo.hot; + connect suppliedBy.cold to deliveredTo.cold; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/11. Interfaces/Interface Example.sysml b/src/sysml/src/training/11. Interfaces/Interface Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..a62e41b9187f59dbdbe95ffc9593d24723016449 --- /dev/null +++ b/src/sysml/src/training/11. Interfaces/Interface Example.sysml @@ -0,0 +1,19 @@ +package 'Interface Example' { + private import 'Port Example'::*; + + part def Vehicle; + + interface def FuelInterface { + end supplierPort : FuelOutPort; + end consumerPort : FuelInPort; + } + + part vehicle : Vehicle { + part tankAssy : FuelTankAssembly; + part eng : Engine; + + interface : FuelInterface connect + supplierPort ::> tankAssy.fuelTankPort to + consumerPort ::> eng.engineFuelPort; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/12. Binding Connectors/Binding Connectors Example-1.sysml b/src/sysml/src/training/12. Binding Connectors/Binding Connectors Example-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..5b4f3cee4b9735fd994fac9f13eb68cee8532a7a --- /dev/null +++ b/src/sysml/src/training/12. Binding Connectors/Binding Connectors Example-1.sysml @@ -0,0 +1,29 @@ +package 'Binding Connectors Example-1' { + private import 'Port Example'::*; + + part def Vehicle; + part def FuelPump; + part def FuelTank; + + part vehicle : Vehicle { + part tank : FuelTankAssembly { + port redefines fuelTankPort { + out item redefines fuelSupply; + in item redefines fuelReturn; + } + + bind fuelTankPort.fuelSupply = pump.pumpOut; + bind fuelTankPort.fuelReturn = tank.fuelIn; + + part pump : FuelPump { + out item pumpOut : Fuel; + in item pumpIn : Fuel; + } + + part tank : FuelTank { + out item fuelOut : Fuel; + in item fuelIn : Fuel; + } + } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/12. Binding Connectors/Binding Connectors Example-2.sysml b/src/sysml/src/training/12. Binding Connectors/Binding Connectors Example-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..ef999e7c34036c6345f5f767418fb38f3f23fa00 --- /dev/null +++ b/src/sysml/src/training/12. Binding Connectors/Binding Connectors Example-2.sysml @@ -0,0 +1,26 @@ +package 'Binding Connectors Example-2' { + private import 'Port Example'::*; + + part def Vehicle; + part def FuelPump; + part def FuelTank; + + part vehicle : Vehicle { + part tank : FuelTankAssembly { + port redefines fuelTankPort { + out item redefines fuelSupply; + in item redefines fuelReturn; + } + + part pump : FuelPump { + out item pumpOut : Fuel = fuelTankPort.fuelSupply; + in item pumpIn : Fuel; + } + + part tank : FuelTank { + out item fuelOut : Fuel; + in item fuelIn : Fuel = fuelTankPort.fuelReturn; + } + } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/13. Flow Connections/Flow Connection Definition Example.sysml b/src/sysml/src/training/13. Flow Connections/Flow Connection Definition Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..e8ee0efd8a3c587975278522ed27c0b6d02b15d1 --- /dev/null +++ b/src/sysml/src/training/13. Flow Connections/Flow Connection Definition Example.sysml @@ -0,0 +1,21 @@ +package 'Flow Connection Definition Example' { + private import 'Port Example'::*; + + part def Vehicle; + + flow def FuelFlow { + ref :>> payload : Fuel; + end port supplierPort : FuelOutPort; + end port consumerPort : FuelInPort; + } + + part vehicle : Vehicle { + part tankAssy : FuelTankAssembly; + part eng : Engine; + + flow : FuelFlow + from tankAssy.fuelTankPort.fuelSupply + to eng.engineFuelPort.fuelSupply; + + } +} \ No newline at end of file diff --git a/src/sysml/src/training/13. Flow Connections/Flow Connection Interface Example.sysml b/src/sysml/src/training/13. Flow Connections/Flow Connection Interface Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..6ae16123211fcb521f663a3422b9a981f947562c --- /dev/null +++ b/src/sysml/src/training/13. Flow Connections/Flow Connection Interface Example.sysml @@ -0,0 +1,22 @@ +package 'Flow Connection Interface Example' { + private import 'Port Example'::*; + + part def Vehicle; + + interface def FuelInterface { + end supplierPort : FuelOutPort; + end consumerPort : FuelInPort; + + flow supplierPort.fuelSupply to consumerPort.fuelSupply; + flow consumerPort.fuelReturn to supplierPort.fuelReturn; + } + + part vehicle : Vehicle { + part tankAssy : FuelTankAssembly; + part eng : Engine; + + interface : FuelInterface connect + supplierPort ::> tankAssy.fuelTankPort to + consumerPort ::> eng.engineFuelPort; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/13. Flow Connections/Flow Connection Usage Example.sysml b/src/sysml/src/training/13. Flow Connections/Flow Connection Usage Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4848ffd0c37d8b470a88db690dd11bbbfaa67b46 --- /dev/null +++ b/src/sysml/src/training/13. Flow Connections/Flow Connection Usage Example.sysml @@ -0,0 +1,18 @@ +package 'Flow Connection Interface Example' { + private import 'Port Example'::*; + + part def Vehicle; + + part vehicle : Vehicle { + part tankAssy : FuelTankAssembly; + part eng : Engine; + + flow of Fuel + from tankAssy.fuelTankPort.fuelSupply + to eng.engineFuelPort.fuelSupply; + + flow of Fuel + from eng.engineFuelPort.fuelReturn + to tankAssy.fuelTankPort.fuelReturn; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/14. Action Definitions/Action Definition Example.sysml b/src/sysml/src/training/14. Action Definitions/Action Definition Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..0a00dffc345d04d008f2e3fda4927c727f2e1724 --- /dev/null +++ b/src/sysml/src/training/14. Action Definitions/Action Definition Example.sysml @@ -0,0 +1,21 @@ +package 'Action Definition Example' { + item def Scene; + item def Image; + item def Picture; + + action def Focus { in scene : Scene; out image : Image; } + action def Shoot { in image: Image; out picture : Picture; } + + action def TakePicture { in scene : Scene; out picture : Picture; + bind focus.scene = scene; + + action focus: Focus { in scene; out image; } + + flow from focus.image to shoot.image; + + action shoot: Shoot { in image; out picture; } + + bind shoot.picture = picture; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/14. Action Definitions/Action Shorthand Example.sysml b/src/sysml/src/training/14. Action Definitions/Action Shorthand Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..eb7969916cbb3d65b093eee3c62bc135a5270c50 --- /dev/null +++ b/src/sysml/src/training/14. Action Definitions/Action Shorthand Example.sysml @@ -0,0 +1,26 @@ +package 'Action Shorthand Example' { + item def Scene; + item def Image; + item def Picture; + + action def Focus { in scene : Scene; out image : Image; } + action def Shoot { in image: Image; out picture : Picture; } + + action def TakePicture { + in item scene : Scene; + out item picture : Picture; + + action focus: Focus { + in item scene = TakePicture::scene; + out item image; + } + + flow from focus.image to shoot.image; + + then action shoot: Shoot { + in item; + out item picture = TakePicture::picture; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/14. Action Definitions/Action Succession Example-1.sysml b/src/sysml/src/training/14. Action Definitions/Action Succession Example-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..a9d14c4a96593b175152490b0b403c1fa9addf85 --- /dev/null +++ b/src/sysml/src/training/14. Action Definitions/Action Succession Example-1.sysml @@ -0,0 +1,26 @@ +package 'Action Succession Example-1' { + item def Scene; + item def Image; + item def Picture; + + action def Focus { in scene : Scene; out image : Image; } + action def Shoot { in image: Image; out picture : Picture; } + + action def TakePicture { + in item scene : Scene; + out item picture : Picture; + + bind focus.scene = scene; + + action focus: Focus { in scene; out image; } + + flow from focus.image to shoot.image; + + first focus then shoot; + + action shoot: Shoot { in image; out picture; } + + bind shoot.picture = picture; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/14. Action Definitions/Action Succession Example-2.sysml b/src/sysml/src/training/14. Action Definitions/Action Succession Example-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..294fe05f4a5b1a8503f640739aae718e3f971fb2 --- /dev/null +++ b/src/sysml/src/training/14. Action Definitions/Action Succession Example-2.sysml @@ -0,0 +1,24 @@ +package 'Action Definition Example' { + item def Scene; + item def Image; + item def Picture; + + action def Focus { in scene : Scene; out image : Image; } + action def Shoot { in image: Image; out picture : Picture; } + + action def TakePicture { + in item scene : Scene; + out item picture : Picture; + + bind focus.scene = scene; + + action focus: Focus { in scene; out image; } + + succession flow from focus.image to shoot.image; + + action shoot: Shoot { in image; out picture; } + + bind shoot.picture = picture; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/15. Actions/Action Decomposition.sysml b/src/sysml/src/training/15. Actions/Action Decomposition.sysml new file mode 100644 index 0000000000000000000000000000000000000000..3209a6ee19a30e4ad0d220f2ba8e864fa1369d6d --- /dev/null +++ b/src/sysml/src/training/15. Actions/Action Decomposition.sysml @@ -0,0 +1,27 @@ +package 'Action Decomposition' { + part def Scene; + part def Image; + part def Picture; + + action def Focus { in scene : Scene; out image : Image; } + action def Shoot { in image: Image; out picture : Picture; } + action def TakePicture { in scene : Scene; out picture : Picture; } + + action takePicture : TakePicture { + in item scene; + out item picture; + + action focus : Focus { + in item scene = takePicture::scene; + out item image; + } + + flow from focus.image to shoot.image; + + action shoot : Shoot { + in item; + out item picture = takePicture::picture; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/16. Conditional Succession/Conditional Succession Example-1.sysml b/src/sysml/src/training/16. Conditional Succession/Conditional Succession Example-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..9b7335ef3e1a937054089ddb3ce6cb6883d6bfde --- /dev/null +++ b/src/sysml/src/training/16. Conditional Succession/Conditional Succession Example-1.sysml @@ -0,0 +1,32 @@ +package 'Conditional Succession Example-1' { + part def Scene; + part def Image { + isWellFocused: ScalarValues::Boolean; + } + part def Picture; + + action def Focus { in scene : Scene; out image : Image; } + action def Shoot { in image: Image; out picture : Picture; } + action def TakePicture { in scene : Scene; out picture : Picture; } + + action takePicture : TakePicture { + in item scene; + out item picture; + + action focus : Focus { + in item scene = takePicture::scene; + out item image; + } + + first focus + if focus.image.isWellFocused then shoot; + + flow from focus.image to shoot.image; + + action shoot : Shoot { + in item; + out item picture = takePicture::picture; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/16. Conditional Succession/Conditional Succession Example-2.sysml b/src/sysml/src/training/16. Conditional Succession/Conditional Succession Example-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..472bf0170bde06a598e2c3d179421990e5fa0450 --- /dev/null +++ b/src/sysml/src/training/16. Conditional Succession/Conditional Succession Example-2.sysml @@ -0,0 +1,31 @@ +package 'Conditional Succession Example-2' { + part def Scene; + part def Image { + isWellFocused: ScalarValues::Boolean; + } + part def Picture; + + action def Focus { in scene : Scene; out image : Image; } + action def Shoot { in image: Image; out picture : Picture; } + action def TakePicture { in scene : Scene; out picture : Picture; } + + action takePicture : TakePicture { + in item scene; + out item picture; + + action focus : Focus { + in item scene = takePicture::scene; + out item image; + } + + if focus.image.isWellFocused then shoot; + + flow from focus.image to shoot.image; + + action shoot : Shoot { + in item image; + out item picture = takePicture::picture; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/17. Control/Camera.sysml b/src/sysml/src/training/17. Control/Camera.sysml new file mode 100644 index 0000000000000000000000000000000000000000..ad43eb514149eb42a58b5fed2f882f8112f0269b --- /dev/null +++ b/src/sysml/src/training/17. Control/Camera.sysml @@ -0,0 +1,25 @@ +package Camera { + private import 'Action Decomposition'::*; + + part def Camera; + part def FocusingSubsystem; + part def ImagingSubsystem; + + part camera : Camera { + ref item scene : Scene; + part photos : Picture[*]; + + part autoFocus { + in ref item scene : Scene = camera::scene; + out ref item realImage : Image; + } + + flow autoFocus.realImage to imager.focusedImage; + + part imager { + in item focusedImage : Image; + out item photo : Picture :> photos; + } + + } +} diff --git a/src/sysml/src/training/17. Control/Control Structures Example.sysml b/src/sysml/src/training/17. Control/Control Structures Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..7f78acb463c8e0759b5d0b80a67872de8ab68bfd --- /dev/null +++ b/src/sysml/src/training/17. Control/Control Structures Example.sysml @@ -0,0 +1,29 @@ +package 'Control Structures Example' { + private import ScalarValues::*; + + attribute def BatteryCharged; + + part battery; + part powerSystem; + + action def MonitorBattery { out charge : Real; } + action def AddCharge { in charge : Real; } + action def EndCharging; + + action def ChargeBattery { + loop action charging { + action monitor : MonitorBattery { + out charge; + } + + then if monitor.charge < 100 { + action addCharge : AddCharge { + in charge = monitor.charge; + } + } + } until charging.monitor.charge >= 100; + + then action endCharging : EndCharging; + then done; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/17. Control/Decision Example.sysml b/src/sysml/src/training/17. Control/Decision Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f3b57929d914f3f26d4477552d51207aa760aaf2 --- /dev/null +++ b/src/sysml/src/training/17. Control/Decision Example.sysml @@ -0,0 +1,34 @@ +package 'Decision Example' { + private import ScalarValues::*; + + attribute def BatteryCharged; + + part battery; + part powerSystem; + + action def MonitorBattery { out charge : Real; } + action def AddCharge { in charge : Real; } + action def EndCharging; + + action def ChargeBattery { + first start; + + then merge continueCharging; + + then action monitor : MonitorBattery { + out batteryCharge : Real; + } + + then decide; + if monitor.batteryCharge < 100 then addCharge; + if monitor.batteryCharge >= 100 then endCharging; + + action addCharge : AddCharge { + in charge = monitor.batteryCharge; + } + then continueCharging; + + action endCharging : EndCharging; + then done; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/17. Control/Fork Join Example.sysml b/src/sysml/src/training/17. Control/Fork Join Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..74806b4194df9f103ef59bccb89bbae56bddfa99 --- /dev/null +++ b/src/sysml/src/training/17. Control/Fork Join Example.sysml @@ -0,0 +1,41 @@ +package 'Fork Join Example' { + private import ScalarValues::*; + + attribute def TurnKeyToOn; + attribute def BrakePressure; + + action def MonitorBrakePedal { out pressure : BrakePressure; } + action def MonitorTraction { out modFreq : Real; } + action def Braking { in brakePressure : BrakePressure; in modulationFrequency : Real; } + + action def Brake { + action TurnOn; + + then fork; + then monitorBrakePedal; + then monitorTraction; + then braking; + + action monitorBrakePedal : MonitorBrakePedal { + out brakePressure; + } + then joinNode; + + action monitorTraction : MonitorTraction { + out modulationFrequency; + } + then joinNode; + + flow from monitorBrakePedal.brakePressure to braking.brakePressure; + flow from monitorTraction.modulationFrequency to braking.modulationFrequency; + + action braking : Braking { + in brakePressure; + in modulationFrequency; + } + then joinNode; + + join joinNode; + then done; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/17. Control/Merge Example.sysml b/src/sysml/src/training/17. Control/Merge Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..920e4a5d1ce97e1229e84b95227906fe19f7456b --- /dev/null +++ b/src/sysml/src/training/17. Control/Merge Example.sysml @@ -0,0 +1,42 @@ +package 'Merge Example' { + part def Scene; + part def Image; + part def Picture; + + action def Focus { in item scene : Scene; out item image : Image; } + action def Shoot { in item image : Image; out item picture : Picture; } + action def Display { in item picture : Picture; } + action def TakePicture; + + action takePicture : TakePicture { + first start; + + then merge continue; + + then action trigger { + out item scene : Scene; + } + + flow from trigger.scene to focus.scene; + + then action focus : Focus { + in item scene; + out item image; + } + + flow from focus.image to shoot.image; + + then action shoot : Shoot { + in item image ; + out item picture; + } + + flow from shoot.picture to display.picture; + + then action display : Display { + in item picture; + } + + then continue; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/18. Action Performance/Action Performance Example.sysml b/src/sysml/src/training/18. Action Performance/Action Performance Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..db12fdb151ec99742454c5c432fc0cdadbc4ad49 --- /dev/null +++ b/src/sysml/src/training/18. Action Performance/Action Performance Example.sysml @@ -0,0 +1,21 @@ +package 'Action Performance Example' { + private import 'Action Decomposition'::*; + + part def Camera; + part def AutoFocus; + part def Imager; + + part camera : Camera { + + perform action takePhoto[*] ordered + references takePicture; + + part f : AutoFocus { + perform takePhoto.focus; + } + + part i : Imager { + perform takePhoto.shoot; + } + } +} diff --git a/src/sysml/src/training/19. Assignment Actions/Assignment Example.sysml b/src/sysml/src/training/19. Assignment Actions/Assignment Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..82d9a95d500f4148d66d51538399f2db59e1751c --- /dev/null +++ b/src/sysml/src/training/19. Assignment Actions/Assignment Example.sysml @@ -0,0 +1,41 @@ +package 'For Loop Example' { + private import SequenceFunctions::*; + + action def StraightLineDynamics { + in power : ISQ::PowerValue; + in mass : ISQ::MassValue; + in delta_t : ISQ::TimeValue; + in x_in : ISQ::LengthValue; + in v_in : ISQ::SpeedValue; + out x_out : ISQ::LengthValue; + out v_out : ISQ::SpeedValue; + } + + action def ComputeMotion { + in attribute powerProfile :> ISQ::power[*]; + in attribute vehicleMass :> ISQ::mass; + in attribute initialPosition :> ISQ::length; + in attribute initialSpeed :> ISQ::speed; + in attribute deltaT :> ISQ::time; + out attribute positions :> ISQ::length[*] := ( ); + + private attribute position := initialPosition; + private attribute speed := initialSpeed; + + for i in 1..powerProfile->size() { + perform action dynamics : StraightLineDynamics { + in power = powerProfile#(i); + in mass = vehicleMass; + in delta_t = deltaT; + in x_in = position; + in v_in = speed; + out x_out; + out v_out; + } + then assign position := dynamics.x_out; + then assign speed := dynamics.v_out; + then assign positions := positions->including(position); + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/20. Asynchronous Messaging/Messaging Example.sysml b/src/sysml/src/training/20. Asynchronous Messaging/Messaging Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..1800d31d5444ee48be75407d0f106b7c6090c1ee --- /dev/null +++ b/src/sysml/src/training/20. Asynchronous Messaging/Messaging Example.sysml @@ -0,0 +1,33 @@ +package 'Messaging Example' { + item def Scene; + item def Image; + item def Picture; + + attribute def Show { + item picture : Picture; + } + + action def Focus { in item scene : Scene; out item image : Image; } + action def Shoot { in item image : Image; out item picture : Picture; } + action def TakePicture; + + action screen; + + action takePicture : TakePicture { + action trigger accept scene : Scene; + + then action focus : Focus { + in item scene = trigger.scene; + out item image; + } + + flow from focus.image to shoot.image; + + then action shoot : Shoot { + in item image; + out item picture; + } + + then send Show(shoot.picture) to screen; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/20. Asynchronous Messaging/Messaging with Ports.sysml b/src/sysml/src/training/20. Asynchronous Messaging/Messaging with Ports.sysml new file mode 100644 index 0000000000000000000000000000000000000000..b7ffbf5ab9d4e5ea223f3bc20b0c58af6da4ee19 --- /dev/null +++ b/src/sysml/src/training/20. Asynchronous Messaging/Messaging with Ports.sysml @@ -0,0 +1,40 @@ +package 'Messaging Example' { + item def Scene; + item def Image; + item def Picture; + + attribute def Show { + item picture : Picture; + } + + action def Focus { in item scene : Scene; out item image : Image; } + action def Shoot { in item image : Image; out item picture : Picture; } + action def TakePicture; + + part screen { + port displayPort; + } + + part camera { + port viewPort; + port displayPort; + + action takePicture : TakePicture { + action trigger accept scene : Scene via viewPort; + + then action focus : Focus { + in item scene = trigger.scene; + out item image; + } + + flow from focus.image to shoot.image; + + then action shoot : Shoot { + in item image; + out item picture; + } + + then send Show(shoot.picture) via displayPort; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/21. Opaque Actions/Opaque Action Example.sysml b/src/sysml/src/training/21. Opaque Actions/Opaque Action Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..b6a4f7fd437805888045b181aa60d24ce69b65e4 --- /dev/null +++ b/src/sysml/src/training/21. Opaque Actions/Opaque Action Example.sysml @@ -0,0 +1,19 @@ +package 'Opaque Action Example' { + + part def Sensor { + attribute ready : ScalarValues::Boolean; + } + + action def UpdateSensors { + in sensors : Sensor[*]; + language "Alf" + /* + * for (sensor in sensors) { + * if (sensor.ready) { + * Update(sensor); + * } + * } + */ + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/22. State Definitions/State Definition Example-1.sysml b/src/sysml/src/training/22. State Definitions/State Definition Example-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..94991df7c4817361595aeaaf5e8894127283dc32 --- /dev/null +++ b/src/sysml/src/training/22. State Definitions/State Definition Example-1.sysml @@ -0,0 +1,32 @@ +package 'State Definition Example-1' { + + attribute def VehicleStartSignal; + attribute def VehicleOnSignal; + attribute def VehicleOffSignal; + + state def VehicleStates { + entry; then off; + + state off; + + transition off_to_starting + first off + accept VehicleStartSignal + then starting; + + state starting; + + transition starting_to_on + first starting + accept VehicleOnSignal + then on; + + state on; + + transition on_to_off + first on + accept VehicleOffSignal + then off; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/22. State Definitions/State Definition Example-2.sysml b/src/sysml/src/training/22. State Definitions/State Definition Example-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f43d8fc3ff79825135db324afcb48a23d3eedfb3 --- /dev/null +++ b/src/sysml/src/training/22. State Definitions/State Definition Example-2.sysml @@ -0,0 +1,23 @@ +package 'State Definition Example-2' { + + attribute def VehicleStartSignal; + attribute def VehicleOnSignal; + attribute def VehicleOffSignal; + + state def VehicleStates { + entry; then off; + + state off; + accept VehicleStartSignal + then starting; + + state starting; + accept VehicleOnSignal + then on; + + state on; + accept VehicleOffSignal + then off; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/23. States/State Actions.sysml b/src/sysml/src/training/23. States/State Actions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..605be9e94bbf723c900c13b9758d0e24545fa102 --- /dev/null +++ b/src/sysml/src/training/23. States/State Actions.sysml @@ -0,0 +1,35 @@ +package 'State Actions' { + + attribute def VehicleStartSignal; + attribute def VehicleOnSignal; + attribute def VehicleOffSignal; + + part def Vehicle; + + action performSelfTest { in vehicle : Vehicle; } + + state def VehicleStates { in operatingVehicle : Vehicle; } + + state vehicleStates : VehicleStates { + in operatingVehicle : Vehicle; + + entry; then off; + + state off; + accept VehicleStartSignal + then starting; + + state starting; + accept VehicleOnSignal + then on; + + state on { + entry performSelfTest{ in vehicle = operatingVehicle; } + do action providePower { /* ... */ } + exit action applyParkingBrake { /* ... */ } + } + accept VehicleOffSignal + then off; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/23. States/State Decomposition-1.sysml b/src/sysml/src/training/23. States/State Decomposition-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..40eb000651c5620013978986d24f97818a0fde9c --- /dev/null +++ b/src/sysml/src/training/23. States/State Decomposition-1.sysml @@ -0,0 +1,25 @@ +package 'State Decomposition-1' { + + attribute def VehicleStartSignal; + attribute def VehicleOnSignal; + attribute def VehicleOffSignal; + + state def VehicleStates; + + state vehicleStates : VehicleStates { + entry; then off; + + state off; + accept VehicleStartSignal + then starting; + + state starting; + accept VehicleOnSignal + then on; + + state on; + accept VehicleOffSignal + then off; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/23. States/State Decomposition-2.sysml b/src/sysml/src/training/23. States/State Decomposition-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..5a4637239357ce8f67eaab940555f16435bd9117 --- /dev/null +++ b/src/sysml/src/training/23. States/State Decomposition-2.sysml @@ -0,0 +1,32 @@ +package 'State Decomposition-1' { + + attribute def VehicleStartSignal; + attribute def VehicleOnSignal; + attribute def VehicleOffSignal; + + state def VehicleStates; + + state vehicleStates : VehicleStates parallel { + + state operationalStates { + entry; then off; + + state off; + accept VehicleStartSignal + then starting; + + state starting; + accept VehicleOnSignal + then on; + + state on; + accept VehicleOffSignal + then off; + } + + state healthStates { + /* ... */ + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/24. Transitions/Change and Time Triggers.sysml b/src/sysml/src/training/24. Transitions/Change and Time Triggers.sysml new file mode 100644 index 0000000000000000000000000000000000000000..cb9ec3eec3616d14c1fbbf43ac1ee618dbc3ddd9 --- /dev/null +++ b/src/sysml/src/training/24. Transitions/Change and Time Triggers.sysml @@ -0,0 +1,43 @@ +package 'Change and Time Triggers' { + private import ISQ::TemperatureValue; + private import ISQ::DurationValue; + private import Time::TimeInstantValue; + private import SI::h; + + attribute def OverTemp; + + part def Vehicle { + attribute maintenanceTime : TimeInstantValue; + attribute maintenanceInterval : DurationValue; + attribute maxTemperature : TemperatureValue; + } + + part def VehicleController; + + action senseTemperature { out temp : TemperatureValue; } + + state healthStates { + in vehicle : Vehicle; + in controller : VehicleController; + + entry; then normal; + do senseTemperature; + + state normal; + accept at vehicle.maintenanceTime + then maintenance; + accept when senseTemperature.temp > vehicle.maxTemperature + do send OverTemp() to controller + then degraded; + + state maintenance { + entry assign vehicle.maintenanceTime := vehicle.maintenanceTime + vehicle.maintenanceInterval; + } + accept after 48 [h] + then normal; + + state degraded; + accept when senseTemperature.temp <= vehicle.maxTemperature + then normal; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/24. Transitions/Local Clock Example.sysml b/src/sysml/src/training/24. Transitions/Local Clock Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..b2e44e88d2354794affe7bd216e4e234d3d7d887 --- /dev/null +++ b/src/sysml/src/training/24. Transitions/Local Clock Example.sysml @@ -0,0 +1,32 @@ +package 'Local Clock Example' { + private import ScalarValues::String; + + item def Start; + item def Request; + + part def Server { + part :>> localClock = Time::Clock(); + + attribute today : String; + + port requestPort; + + state ServerBehavior { + entry; then off; + + state off; + accept Start via requestPort + then waiting; + + state waiting; + accept request : Request via requestPort + then responding; + accept at Time::Iso8601DateTime(today + "11:59:00") + then off; + + state responding; + accept after 5 [SI::min] + then waiting; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/24. Transitions/Transition Actions.sysml b/src/sysml/src/training/24. Transitions/Transition Actions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..137f839581657316eaa6338e38b71987a1bd6b6b --- /dev/null +++ b/src/sysml/src/training/24. Transitions/Transition Actions.sysml @@ -0,0 +1,44 @@ +package 'Transition Actions' { + + attribute def VehicleStartSignal; + attribute def VehicleOnSignal; + attribute def VehicleOffSignal; + + attribute def ControllerStartSignal; + + part def Vehicle { + brakePedalDepressed : ScalarValues::Boolean; + } + part def VehicleController; + + action performSelfTest { in vehicle : Vehicle; } + + state def VehicleStates; + + state vehicleStates : VehicleStates { + in operatingVehicle : Vehicle; + in controller : VehicleController; + + entry; then off; + + state off; + accept VehicleStartSignal + then starting; + + state starting; + accept VehicleOnSignal + if operatingVehicle.brakePedalDepressed + do send ControllerStartSignal() to controller + then on; + + state on { + entry performSelfTest{ in vehicle = operatingVehicle; } + do action providePower { /* ... */ } + exit action applyParkingBrake { /* ... */ } + } + accept VehicleOffSignal + then off; + + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/25. State Exhibition/State Exhibition Example.sysml b/src/sysml/src/training/25. State Exhibition/State Exhibition Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..1b3ad8523335373ca5b8f3a4dfc08570b64e5456 --- /dev/null +++ b/src/sysml/src/training/25. State Exhibition/State Exhibition Example.sysml @@ -0,0 +1,15 @@ +package 'State Exhibition Example' { + private import 'Transition Actions'::*; + + part vehicle : Vehicle { + + part vehicleController : VehicleController; + + exhibit vehicleStates { + in operatingVehicle = vehicle; + in controller = vehicleController; + } + + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/26. Occurrences/Event Occurrence Example.sysml b/src/sysml/src/training/26. Occurrences/Event Occurrence Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..1687e3ee182a407af6edeed72aaa78a79660504a --- /dev/null +++ b/src/sysml/src/training/26. Occurrences/Event Occurrence Example.sysml @@ -0,0 +1,29 @@ +package 'Event Occurrence Example' { + part def Driver; + part def CruiseController; + part def Speedometer; + part def Engine; + part def Vehicle; + + part driver : Driver { + event occurrence setSpeedSent; + } + + part vehicle : Vehicle { + + part cruiseController : CruiseController { + event occurrence setSpeedReceived; + then event occurrence sensedSpeedReceived; + then event occurrence fuelCommandSent; + } + + part speedometer : Speedometer { + event occurrence sensedSpeedSent; + } + + part engine : Engine { + event occurrence fuelCommandReceived; + } + + } +} \ No newline at end of file diff --git a/src/sysml/src/training/26. Occurrences/Interaction Example-1.sysml b/src/sysml/src/training/26. Occurrences/Interaction Example-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..ad0775d727d8211a05982e1ccc7ac74e763bcc2e --- /dev/null +++ b/src/sysml/src/training/26. Occurrences/Interaction Example-1.sysml @@ -0,0 +1,23 @@ +package 'Interaction Example-1' { + public import 'Event Occurrence Example'::*; + + item def SetSpeed; + item def SensedSpeed; + item def FuelCommand; + + occurrence def CruiseControlInteraction { + ref part :>> driver; + ref part :>> vehicle; + + message setSpeedMessage of SetSpeed + from driver.setSpeedSent to vehicle.cruiseController.setSpeedReceived; + + message sensedSpeedMessage of SensedSpeed + from vehicle.speedometer.sensedSpeedSent to vehicle.cruiseController.sensedSpeedReceived; + + message fuelCommandMessage of FuelCommand + from vehicle.cruiseController.fuelCommandSent to vehicle.engine.fuelCommandReceived; + + first setSpeedMessage then sensedSpeedMessage; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/26. Occurrences/Interaction Example-2.sysml b/src/sysml/src/training/26. Occurrences/Interaction Example-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..877b1d8f3dac5d8b982b2fd94603978dbebf38a4 --- /dev/null +++ b/src/sysml/src/training/26. Occurrences/Interaction Example-2.sysml @@ -0,0 +1,34 @@ +package 'Interaction Example-2' { + private import 'Event Occurrence Example'::*; + + item def SetSpeed; + item def SensedSpeed; + item def FuelCommand; + + occurrence def CruiseControlInteraction { + + ref part driver : Driver { + event setSpeedMessage.sourceEvent; + } + + ref part vehicle : Vehicle { + part cruiseController : CruiseController { + event setSpeedMessage.targetEvent; + then event sensedSpeedMessage.targetEvent; + then event fuelCommandMessage.sourceEvent; + } + + part speedometer : Speedometer { + event sensedSpeedMessage.sourceEvent; + } + + part engine : Engine { + event fuelCommandMessage.targetEvent; + } + } + + message setSpeedMessage of SetSpeed; + then message sensedSpeedMessage of SensedSpeed; + message fuelCommandMessage of FuelCommand; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/26. Occurrences/Interaction Realization-1.sysml b/src/sysml/src/training/26. Occurrences/Interaction Realization-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..36dbe8754e1afde477f61c4b013b433af11fe901 --- /dev/null +++ b/src/sysml/src/training/26. Occurrences/Interaction Realization-1.sysml @@ -0,0 +1,55 @@ +package 'Interaction Realization-1' { + private import 'Interaction Example-1'::*; + + part driver_a : Driver { + action driverBehavior { + action sendSetSpeed send SetSpeed() to vehicle_a; + } + } + + part vehicle_a : Vehicle { + part cruiseController_a : CruiseController { + action controllerBehavior { + action receiveSetSpeed accept SetSpeed via vehicle_a; + then action receiveSensedSpeed accept SensedSpeed via cruiseController_a; + then action sendFuelCommand send FuelCommand() to engine_a; + } + } + + part speedometer_a : Speedometer { + action speedometerBehavior { + action sendSensedSpeed send SensedSpeed() to cruiseController_a; + } + } + + part engine_a : Engine { + action engineBehavior { + action receiveFuelCommand accept FuelCommand via engine_a; + } + } + } + + occurrence cruiseControlInteraction_a : CruiseControlInteraction { + part :>> driver :>> driver_a { + event driverBehavior.sendSetSpeed[1] :>> setSpeedSent; + } + + part :>> vehicle :>> vehicle_a { + part :>> cruiseController :>> cruiseController_a { + event controllerBehavior.receiveSetSpeed[1] :>> setSpeedReceived; + event controllerBehavior.receiveSensedSpeed[1] :>> sensedSpeedReceived; + event controllerBehavior.sendFuelCommand[1] :>> fuelCommandSent; + } + part :>> speedometer :>> speedometer_a { + event speedometerBehavior.sendSensedSpeed[1] :>> sensedSpeedSent; + } + part :>> engine :>> engine_a { + event engineBehavior.receiveFuelCommand[1] :>> fuelCommandReceived; + } + } + + message :>> setSpeedMessage = driver_a.driverBehavior.sendSetSpeed.sentMessage; + message :>> sensedSpeedMessage = vehicle_a.speedometer_a.speedometerBehavior.sendSensedSpeed.sentMessage; + message :>> fuelCommandMessage = vehicle_a.cruiseController_a.controllerBehavior.sendFuelCommand.sentMessage; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/26. Occurrences/Interaction Realization-2.sysml b/src/sysml/src/training/26. Occurrences/Interaction Realization-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..dc83c5a5eef1871a645165681027928eb2558f43 --- /dev/null +++ b/src/sysml/src/training/26. Occurrences/Interaction Realization-2.sysml @@ -0,0 +1,82 @@ +package 'Interaction Realization-2' { + private import 'Interaction Example-1'::*; + + part driver_b : Driver { + port setSpeedPort { + out setSpeed : SetSpeed; + } + } + + interface driverToVehicleInterface connect driver_b.setSpeedPort to vehicle_b.setSpeedPort { + flow setSpeedFlow of SetSpeed + from driver_b.setSpeedPort.setSpeed to vehicle_b.setSpeedPort.setSpeed; + } + + part vehicle_b : Vehicle { + port setSpeedPort { + in setSpeed : SetSpeed; + } + + bind setSpeedPort = cruiseController_b.setSpeedPort; + + part cruiseController_b : CruiseController { + port setSpeedPort { + in setSpeed : SetSpeed; + } + port sensedSpeedPort { + in sensedSpeed : SensedSpeed; + } + port fuelCommandPort { + out fuelCommand : FuelCommand; + } + } + + flow sensedSpeedFlow of SensedSpeed + from speedometer_b.sensedSpeedPort.sensedSpeed to cruiseController_b.sensedSpeedPort.sensedSpeed; + + part speedometer_b : Speedometer { + port sensedSpeedPort { + out sensedSpeed : SensedSpeed; + } + } + + flow fuelCommandFlow of FuelCommand + from cruiseController_b.fuelCommandPort.fuelCommand to engine_b.fuelCommandPort.fuelCommand; + + part engine_b : Engine { + port fuelCommandPort { + in fuelCommand : FuelCommand; + } + } + } + + occurrence cruiseControlInteraction_b : CruiseControlInteraction { + part :>> driver :>> driver_b { + port :>> setSpeedPort { + event driver::setSpeedSent; + } + } + + part :>> vehicle :>> vehicle_b { + part :>> cruiseController :>> cruiseController_b { + port :>> setSpeedPort { + event cruiseController::setSpeedReceived; + } + } + part :>> speedometer :>> speedometer_b { + port :>> sensedSpeedPort { + event speedometer::sensedSpeedSent; + } + } + part :>> engine :>> engine_b { + port :>> fuelCommandPort { + event engine::fuelCommandReceived; + } + } + } + + message :>> setSpeedMessage = driverToVehicleInterface.setSpeedFlow; + message :>> sensedSpeedMessage = vehicle_b.sensedSpeedFlow; + message :>> fuelCommandMessage = vehicle_b.fuelCommandFlow; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/26. Occurrences/Message Payload Example.sysml b/src/sysml/src/training/26. Occurrences/Message Payload Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8bf70101c05c60fb110a21b7542af600d715f216 --- /dev/null +++ b/src/sysml/src/training/26. Occurrences/Message Payload Example.sysml @@ -0,0 +1,36 @@ +package 'Message Payload Example' { + private import 'Event Occurrence Example'::*; + + item def SetSpeed; + item def SensedSpeed; + item def FuelCommand { + attribute fuelFlow : ScalarValues::Real; + } + + part def EngineController; + + part vehicle1 :> vehicle { + part engineController : EngineController { + event occurrence fuelCommandReceived; + then event occurrence fuelCommandForwarded; + } + } + + occurrence def CruiseControlInteraction { + ref part :>> driver; + ref part vehicle :>> vehicle1; + + message setSpeedMessage of SetSpeed + from driver.setSpeedSent to vehicle.cruiseController.setSpeedReceived; + + then message sensedSpeedMessage of SensedSpeed + from vehicle.speedometer.sensedSpeedSent to vehicle.cruiseController.sensedSpeedReceived; + + then message fuelCommandMessage of fuelCommand : FuelCommand + from vehicle.cruiseController.fuelCommandSent to vehicle.engineController.fuelCommandReceived; + + then message fuelCommandForwardingMessage of fuelCommand : FuelCommand = fuelCommandMessage.fuelCommand + from vehicle.engineController.fuelCommandForwarded to vehicle.engine.fuelCommandReceived; + + } +} \ No newline at end of file diff --git a/src/sysml/src/training/26. Occurrences/Time Slice and Snapshot Example.sysml b/src/sysml/src/training/26. Occurrences/Time Slice and Snapshot Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..fb541ab867e0cf47aee2daeff2442bdc1fccd470 --- /dev/null +++ b/src/sysml/src/training/26. Occurrences/Time Slice and Snapshot Example.sysml @@ -0,0 +1,27 @@ +package 'Time Slice and Snapshot Example' { + + attribute def Date; + item def Person; + + part def Vehicle { + timeslice assembly; + + first assembly then delivery; + + snapshot delivery { + attribute deliveryDate : Date; + } + + then timeslice ownership[0..*] ordered { + snapshot sale = start; + + ref item owner : Person[1]; + + timeslice driven[0..*] { + ref item driver : Person[1]; + } + } + + snapshot junked = done; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/27. Individuals/Individuals and Roles-1.sysml b/src/sysml/src/training/27. Individuals/Individuals and Roles-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..a5db93addc8bfcf473327d63e779971eba5305a6 --- /dev/null +++ b/src/sysml/src/training/27. Individuals/Individuals and Roles-1.sysml @@ -0,0 +1,22 @@ +package 'Individuals and Roles' { + private import 'Part Definition Example'::*; + + part def Wheel; + + individual part def Vehicle_1 :> Vehicle { + part leftFrontWheel : Wheel; + part rightFrontWheel : Wheel; + } + + individual part def Wheel_1 :> Wheel; + + individual part vehicle_1 : Vehicle_1 { + snapshot part vehicle_1_t0 { + snapshot leftFrontWheel_t0 : Wheel_1 :>> leftFrontWheel; + } + + then snapshot part vehicle_1_t1 { + snapshot rightFrontWheel_t1 : Wheel_1 :>> rightFrontWheel; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/27. Individuals/Individuals and Snapshots Example.sysml b/src/sysml/src/training/27. Individuals/Individuals and Snapshots Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..9a1a915601808f528fe23537299bcdf12b16e9d1 --- /dev/null +++ b/src/sysml/src/training/27. Individuals/Individuals and Snapshots Example.sysml @@ -0,0 +1,24 @@ +package 'Individuals and Snapshots Example' { + public import 'Part Definition Example'::*; + + individual part def Vehicle_1 :> Vehicle { + + snapshot part vehicle_1_t0 { + :>> mass = 2000.0; + :>> status { + :>> gearSetting = 0; + :>> acceleratorPosition = 0.0; + } + } + + snapshot part vehicle_1_t1 { + :>> mass = 1500.0; + :>> status { + :>> gearSetting = 2; + :>> acceleratorPosition = 0.5; + } + } + + first vehicle_1_t0 then vehicle_1_t1; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/27. Individuals/Individuals and Time Slices.sysml b/src/sysml/src/training/27. Individuals/Individuals and Time Slices.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f16c8a652e174bcdb4acdf556adc27fdef3c1568 --- /dev/null +++ b/src/sysml/src/training/27. Individuals/Individuals and Time Slices.sysml @@ -0,0 +1,26 @@ +package 'Individuals and Time Slices' { + private import 'Individuals and Snapshots Example'::*; + + individual item def Alice :> Person; + individual item def Bob :> Person; + + individual : Vehicle_1 { + + timeslice aliceDriving { + ref individual item :>> driver : Alice; + + snapshot :>> start { + :>> mass = 2000.0; + } + + snapshot :>> done { + :>> mass = 1500.0; + } + } + + then timeslice bobDriving { + ref individual item :>> driver : Bob; + } + + } +} \ No newline at end of file diff --git a/src/sysml/src/training/28. Expressions/Car Mass Rollup Example 1.sysml b/src/sysml/src/training/28. Expressions/Car Mass Rollup Example 1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4b2f889d5b0b9329279e2ab0ff36dd7147925bc6 --- /dev/null +++ b/src/sysml/src/training/28. Expressions/Car Mass Rollup Example 1.sysml @@ -0,0 +1,38 @@ +package 'Car Mass Rollup Example 1' { + private import ScalarValues::*; + private import MassRollup1::*; + + part def CarPart :> MassedThing { + attribute serialNumber: String; + } + + part car: CarPart :> compositeThing { + attribute vin :>> serialNumber; + + part carParts: CarPart[*] :>> subcomponents; + + part engine :> simpleThing, carParts { + //... + } + + part transmission :> simpleThing, carParts { + //... + } + } + + // Example usage + + private import SI::kg; + part c :> car { + attribute :>> simpleMass = 1000[kg]; + part :>> engine { + attribute :>> simpleMass = 100[kg]; + } + + part redefines transmission { + attribute :>> simpleMass = 50[kg]; + } + } + + // c::totalMass --> 1150.0[kg] +} \ No newline at end of file diff --git a/src/sysml/src/training/28. Expressions/Car Mass Rollup Example 2.sysml b/src/sysml/src/training/28. Expressions/Car Mass Rollup Example 2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..c3f4ded928264298d186a5fc27dc42e1c17e2ef1 --- /dev/null +++ b/src/sysml/src/training/28. Expressions/Car Mass Rollup Example 2.sysml @@ -0,0 +1,38 @@ +package 'Car Mass Rollup 1' { + private import ScalarValues::*; + private import MassRollup2::*; + + part def CarPart :> MassedThing { + attribute serialNumber: String; + } + + part car: CarPart :> compositeThing { + attribute vin :>> serialNumber; + + part carParts: CarPart[*] :>> subcomponents; + + part engine :> carParts { + //... + } + + part transmission :> carParts { + //... + } + } + + // Example usage + + private import SI::kg; + part c :> car { + attribute :>> simpleMass = 1000[kg]; + part :>> engine { + attribute :>> simpleMass = 100[kg]; + } + + part redefines transmission { + attribute :>> simpleMass = 50[kg]; + } + } + + // c::totalMass --> 1150.0[kg] +} \ No newline at end of file diff --git a/src/sysml/src/training/28. Expressions/MassRollup1.sysml b/src/sysml/src/training/28. Expressions/MassRollup1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..ef47007677e2d9c3d9ce261bf00bab691e848078 --- /dev/null +++ b/src/sysml/src/training/28. Expressions/MassRollup1.sysml @@ -0,0 +1,19 @@ +package MassRollup1 { + private import NumericalFunctions::*; + + part def MassedThing { + attribute simpleMass :> ISQ::mass; + attribute totalMass :> ISQ::mass; + } + + part simpleThing : MassedThing { + attribute :>> totalMass = simpleMass; + } + + part compositeThing : MassedThing { + part subcomponents: MassedThing[*]; + attribute :>> totalMass = + simpleMass + sum(subcomponents.totalMass); + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/28. Expressions/MassRollup2.sysml b/src/sysml/src/training/28. Expressions/MassRollup2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8866d0644e53676e322a7aa40c2f01a4ca91f884 --- /dev/null +++ b/src/sysml/src/training/28. Expressions/MassRollup2.sysml @@ -0,0 +1,21 @@ +package MassRollup2 { + private import NumericalFunctions::*; + + part def MassedThing { + attribute simpleMass :> ISQ::mass; + attribute totalMass :> ISQ::mass default simpleMass; + } + + part compositeThing : MassedThing { + part subcomponents: MassedThing[*]; + attribute :>> totalMass default + simpleMass + sum(subcomponents.totalMass); + } + + part filteredMassThing :> compositeThing { + attribute minMass :> ISQ::mass; + attribute :>> totalMass = + simpleMass + sum(subcomponents.totalMass.?{in p:>ISQ::mass; p >= minMass}); + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/29. Calculations/Calculation Definitions.sysml b/src/sysml/src/training/29. Calculations/Calculation Definitions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..20b80263d47b50230bbab04c8cee12cde19c36ab --- /dev/null +++ b/src/sysml/src/training/29. Calculations/Calculation Definitions.sysml @@ -0,0 +1,23 @@ +package 'Calculation Definitions' { + private import ScalarValues::Real; + private import ISQ::*; + + calc def Power { in whlpwr : PowerValue; in Cd : Real; in Cf : Real; in tm : MassValue; in v : SpeedValue; + attribute drag = Cd * v; + attribute friction = Cf * tm * v; + + return : PowerValue = whlpwr - drag - friction; + } + + calc def Acceleration { in tp: PowerValue; in tm : MassValue; in v : SpeedValue; + return : AccelerationValue = tp / (tm * v); + } + + calc def Velocity { in dt : TimeValue; in v0 : SpeedValue; in a : AccelerationValue; + return : SpeedValue = v0 + a * dt; + } + + calc def Position { in dt : TimeValue; in x0 : LengthValue; in v : SpeedValue; + return : LengthValue = x0 + v * dt; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/29. Calculations/Calculation Usages-1.sysml b/src/sysml/src/training/29. Calculations/Calculation Usages-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..43012847c8144c59e3816857dfca93c3b53fca4f --- /dev/null +++ b/src/sysml/src/training/29. Calculations/Calculation Usages-1.sysml @@ -0,0 +1,42 @@ +package 'Calculation Usages-1' { + private import ScalarValues::Real; + private import ISQ::*; + private import 'Calculation Definitions'::*; + + part def VehicleDynamics { + attribute C_d : Real; + attribute C_f : Real; + attribute wheelPower : PowerValue; + attribute mass : MassValue; + + action straightLineDynamics { + in delta_t : TimeValue; + in v_in : SpeedValue; + in x_in : LengthValue; + out v_out : SpeedValue = vel.v; + out x_out : LengthValue = pos.x; + + calc acc : Acceleration { + in tp = Power(wheelPower, C_d, C_f, mass, v_in); + in tm = mass; + in v = v_in; + return a; + } + + calc vel : Velocity { + in dt = delta_t; + in v0 = v_in; + in a = acc.a; + return v; + } + + calc pos : Position { + in dt = delta_t; + in x0 = x_in; + in v0 = vel.v; + return x; + } + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/29. Calculations/Calculation Usages-2.sysml b/src/sysml/src/training/29. Calculations/Calculation Usages-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..88928ad22582272a58f38f87b07ec6cc26684f47 --- /dev/null +++ b/src/sysml/src/training/29. Calculations/Calculation Usages-2.sysml @@ -0,0 +1,29 @@ +package 'Calculation Usages-2' { + private import ScalarValues::Real; + private import ISQ::*; + private import 'Calculation Definitions'::*; + + attribute def DynamicState { + attribute v: SpeedValue; + attribute x: LengthValue; + } + + part def VehicleDynamics { + attribute C_d : Real; + attribute C_f : Real; + attribute wheelPower : PowerValue; + attribute mass : MassValue; + + calc updateState { + in delta_t : TimeValue; + in currState : DynamicState; + attribute totalPower : PowerValue = Power(wheelPower, C_d, C_f, mass, currState.v); + + return attribute newState : DynamicState { + :>> v = Velocity(delta_t, currState.v, Acceleration(totalPower, mass, currState.v)); + :>> x = Position(delta_t, currState.x, currState.v); + } + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/30. Constraints/Analytical Constraints.sysml b/src/sysml/src/training/30. Constraints/Analytical Constraints.sysml new file mode 100644 index 0000000000000000000000000000000000000000..95362ec43faf2fe74480cb50261be26651a0d82e --- /dev/null +++ b/src/sysml/src/training/30. Constraints/Analytical Constraints.sysml @@ -0,0 +1,43 @@ +package 'Analytical Constraints' { + private import ISQ::*; + private import 'Calculation Definitions'::*; + + constraint def StraightLineDynamicsEquations { + in p : PowerValue; + in m : MassValue; + in dt : TimeValue; + in x_i : LengthValue; + in v_i : SpeedValue; + in x_f : LengthValue; + in v_f : SpeedValue; + in a : AccelerationValue; + + attribute v_avg : SpeedValue = (v_i + v_f)/2; + + a == Acceleration(p, m, v_avg) and + v_f == Velocity(dt, v_i, a) and + x_f == Position(dt, x_i, v_avg) + } + + action def StraightLineDynamics { + in power : PowerValue; + in mass : MassValue; + in delta_t : TimeValue; + in x_in : LengthValue; + in v_in : SpeedValue; + out x_out : LengthValue; + out v_out : SpeedValue; + out a_out : AccelerationValue; + + assert constraint dynamics : StraightLineDynamicsEquations { + in p = power; + in m = mass; + in dt = delta_t; + in x_i = x_in; + in v_i = v_in; + in x_f = x_out; + in v_f = v_out; + in a = a_out; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/30. Constraints/Constraint Assertions-1.sysml b/src/sysml/src/training/30. Constraints/Constraint Assertions-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..bd4d202cf5eac19964d83f6378cbc74a682e6153 --- /dev/null +++ b/src/sysml/src/training/30. Constraints/Constraint Assertions-1.sysml @@ -0,0 +1,32 @@ +package 'Constraint Assertions-1' { + private import ISQ::*; + private import SI::*; + private import NumericalFunctions::*; + + part def Engine; + part def Transmission; + + constraint def MassConstraint { + in partMasses : MassValue[0..*]; + in massLimit : MassValue; + + sum(partMasses) <= massLimit + } + + part def Vehicle { + assert constraint massConstraint : MassConstraint { + in partMasses = (chassisMass, engine.mass, transmission.mass); + in massLimit = 2500[kg]; + } + + attribute chassisMass : MassValue; + + part engine : Engine { + attribute mass : MassValue; + } + + part transmission : Engine { + attribute mass : MassValue; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/30. Constraints/Constraint Assertions-2.sysml b/src/sysml/src/training/30. Constraints/Constraint Assertions-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..e18b2f620011c10ad6b1bacacfe29173d06d91f3 --- /dev/null +++ b/src/sysml/src/training/30. Constraints/Constraint Assertions-2.sysml @@ -0,0 +1,37 @@ +package 'Constraint Assertions-2' { + private import ISQ::*; + private import SI::*; + private import NumericalFunctions::*; + + part def Engine; + part def Transmission; + + constraint def MassConstraint { + in partMasses : MassValue[0..*]; + in massLimit : MassValue; + } + + constraint massConstraint : MassConstraint { + in partMasses : MassValue[0..*]; + in massLimit : MassValue; + + sum(partMasses) <= massLimit + } + + part def Vehicle { + assert massConstraint { + in partMasses = (chassisMass, engine.mass, transmission.mass); + in massLimit = 2500[kg]; + } + + attribute chassisMass : MassValue; + + part engine : Engine { + attribute mass : MassValue; + } + + part transmission : Engine { + attribute mass : MassValue; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/30. Constraints/Constraints Example-1.sysml b/src/sysml/src/training/30. Constraints/Constraints Example-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..002f162c36339c682aba46816c4dc10d0ad1aee2 --- /dev/null +++ b/src/sysml/src/training/30. Constraints/Constraints Example-1.sysml @@ -0,0 +1,32 @@ +package 'Constraints Example-1' { + private import ISQ::*; + private import SI::*; + private import NumericalFunctions::*; + + part def Engine; + part def Transmission; + + constraint def MassConstraint { + in partMasses : MassValue[0..*]; + in massLimit : MassValue; + + sum(partMasses) <= massLimit + } + + part def Vehicle { + constraint massConstraint : MassConstraint { + in partMasses = (chassisMass, engine.mass, transmission.mass); + in massLimit = 2500[kg]; + } + + attribute chassisMass : MassValue; + + part engine : Engine { + attribute mass : MassValue; + } + + part transmission : Engine { + attribute mass : MassValue; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/30. Constraints/Constraints Example-2.sysml b/src/sysml/src/training/30. Constraints/Constraints Example-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4024d62d02bada3c0b9abc71d783815bcd361a50 --- /dev/null +++ b/src/sysml/src/training/30. Constraints/Constraints Example-2.sysml @@ -0,0 +1,32 @@ +package 'Constraints Example-2' { + private import ISQ::*; + private import SI::*; + private import NumericalFunctions::*; + + part def Engine; + part def Transmission; + + constraint def MassConstraint { + attribute partMasses : MassValue[0..*]; + attribute massLimit : MassValue; + + sum(partMasses) <= massLimit + } + + part def Vehicle { + constraint massConstraint : MassConstraint { + redefines partMasses = (chassisMass, engine.mass, transmission.mass); + redefines massLimit = 2500[kg]; + } + + attribute chassisMass : MassValue; + + part engine : Engine { + attribute mass : MassValue; + } + + part transmission : Engine { + attribute mass : MassValue; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/30. Constraints/Derivation Constraints.sysml b/src/sysml/src/training/30. Constraints/Derivation Constraints.sysml new file mode 100644 index 0000000000000000000000000000000000000000..edec360a31efe090f4349e1023d69bb49b32b67b --- /dev/null +++ b/src/sysml/src/training/30. Constraints/Derivation Constraints.sysml @@ -0,0 +1,25 @@ +package 'Derivation Constraints' { + private import SI::*; + private import 'Constraints Example-1'::*; + + part vehicle1 : Vehicle { + attribute totalMass : MassValue; + assert constraint {totalMass == chassisMass + engine.mass + transmission.mass} + } + + part vehicle2 : Vehicle { + attribute totalMass : MassValue = chassisMass + engine.mass + transmission.mass; + } + + constraint def Dynamics { + in mass: MassValue; + in initialSpeed : SpeedValue; + in finalSpeed : SpeedValue; + in deltaT : TimeValue; + in force : ForceValue; + + force * deltaT == mass * (finalSpeed - initialSpeed) and + mass > 0[kg] + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/30. Constraints/Time Constraints.sysml b/src/sysml/src/training/30. Constraints/Time Constraints.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8b70b8b4d9666eb77953d73820c354e018c8d1c7 --- /dev/null +++ b/src/sysml/src/training/30. Constraints/Time Constraints.sysml @@ -0,0 +1,37 @@ +package 'Time Constraints' { + private import ISQ::TemperatureValue; + private import ISQ::DurationValue; + private import Time::TimeInstantValue; + private import Time::TimeOf; + private import Time::DurationOf; + private import SI::h; + private import SI::s; + + attribute def MaintenanceDone; + + part def Vehicle { + attribute maintenanceTime : TimeInstantValue; + attribute maintenanceInterval : DurationValue; + attribute maxTemperature : TemperatureValue; + } + + state healthStates { + in vehicle : Vehicle; + + entry; then normal; + + state normal; + accept at vehicle.maintenanceTime + then maintenance; + + state maintenance { + assert constraint { TimeOf(maintenance) > vehicle.maintenanceTime } + assert constraint { TimeOf(maintenance) - TimeOf(normal.done) < 2 [s] } + entry assign vehicle.maintenanceTime := vehicle.maintenanceTime + vehicle.maintenanceInterval; + } + accept MaintenanceDone + then normal; + + constraint { DurationOf(maintenance) <= 48 [h] } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/31. Requirements/Requirement Definitions.sysml b/src/sysml/src/training/31. Requirements/Requirement Definitions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..717ef217b57cc0ad1554cd2de48e7f6db0e0b432 --- /dev/null +++ b/src/sysml/src/training/31. Requirements/Requirement Definitions.sysml @@ -0,0 +1,42 @@ +package 'Requirement Definitions' { + private import ISQ::*; + private import SI::*; + + requirement def MassLimitationRequirement { + doc /* The actual mass shall be less than or equal to the required mass. */ + + attribute massActual: MassValue; + attribute massReqd: MassValue; + + require constraint { massActual <= massReqd } + } + + part def Vehicle { + attribute dryMass: MassValue; + attribute fuelMass: MassValue; + attribute fuelFullMass: MassValue; + } + + requirement def <'1'> VehicleMassLimitationRequirement :> MassLimitationRequirement { + doc /* The total mass of a vehicle shall be less than or equal to the required mass. */ + + subject vehicle : Vehicle; + + attribute redefines massActual = vehicle.dryMass + vehicle.fuelMass; + + assume constraint { vehicle.fuelMass > 0[kg] } + } + + port def ClutchPort; + action def GenerateTorque; + + requirement def <'2'> DrivePowerInterface { + doc /* The engine shall transfer its generated torque to the transmission via the clutch interface. */ + subject clutchPort: ClutchPort; + } + + requirement def <'3'> TorqueGeneration { + doc /* The engine shall generate torque as a function of RPM as shown in Table 1. */ + subject generateTorque: GenerateTorque; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/31. Requirements/Requirement Groups.sysml b/src/sysml/src/training/31. Requirements/Requirement Groups.sysml new file mode 100644 index 0000000000000000000000000000000000000000..bafb9c8e29672290194c2df33df78498d50e1cf8 --- /dev/null +++ b/src/sysml/src/training/31. Requirements/Requirement Groups.sysml @@ -0,0 +1,33 @@ +package 'Requirement Groups' { + private import 'Requirement Definitions'::*; + private import 'Requirement Usages'::*; + + part def Engine { + port clutchPort: ClutchPort; + perform action generateTorque: GenerateTorque; + } + + requirement vehicleSpecification { + doc /* Overall vehicle requirements group */ + + subject vehicle : Vehicle; + + require fullVehicleMassLimit; + require emptyVehicleMassLimit; + } + + requirement engineSpecification { + doc /* Engine power requirements group */ + + subject engine : Engine; + + requirement drivePowerInterface : DrivePowerInterface { + subject = engine.clutchPort; + } + + requirement torqueGeneration : TorqueGeneration { + subject = engine.generateTorque; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/31. Requirements/Requirement Satisfaction.sysml b/src/sysml/src/training/31. Requirements/Requirement Satisfaction.sysml new file mode 100644 index 0000000000000000000000000000000000000000..aa9836c2802492819fe51e7d5242cf49d039c779 --- /dev/null +++ b/src/sysml/src/training/31. Requirements/Requirement Satisfaction.sysml @@ -0,0 +1,27 @@ +package 'Requirement Satisfaction' { + private import 'Requirement Definitions'::*; + private import 'Requirement Groups'::*; + + action 'provide power' { + action 'generate torque' { } + } + + part vehicle_c1 : Vehicle { + perform 'provide power'; + + part engine_v1: Engine { + port :>> clutchPort; + perform 'provide power'.'generate torque' :>> generateTorque; + } + } + + part 'Vehicle c1 Design Context' { + + ref vehicle_design :> vehicle_c1; + + satisfy vehicleSpecification by vehicle_design; + satisfy engineSpecification by vehicle_design.engine_v1; + + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/31. Requirements/Requirement Usages.sysml b/src/sysml/src/training/31. Requirements/Requirement Usages.sysml new file mode 100644 index 0000000000000000000000000000000000000000..20be3d4781dcc5fa4e5c94d636915c6e48723fcd --- /dev/null +++ b/src/sysml/src/training/31. Requirements/Requirement Usages.sysml @@ -0,0 +1,25 @@ +package 'Requirement Usages' { + private import SI::*; + private import 'Requirement Definitions'::*; + + requirement <'1.1'> fullVehicleMassLimit : VehicleMassLimitationRequirement { + subject vehicle : Vehicle; + attribute :>> massReqd = 2000[kg]; + + assume constraint { + doc /* Full tank is full. */ + vehicle.fuelMass == vehicle.fuelFullMass + } + } + + requirement <'1.2'> emptyVehicleMassLimit : VehicleMassLimitationRequirement { + subject vehicle : Vehicle; + attribute :>> massReqd = 1500[kg]; + + assume constraint { + doc /* Full tank is empty. */ + vehicle.fuelMass == 0[kg] + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/32. Analysis/Analysis Case Definition Example.sysml b/src/sysml/src/training/32. Analysis/Analysis Case Definition Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..60eddb7a66019d7160c21cebc1f2e2f830a2e5aa --- /dev/null +++ b/src/sysml/src/training/32. Analysis/Analysis Case Definition Example.sysml @@ -0,0 +1,86 @@ +package 'Analysis Case Definition Example' { + private import ScalarValues::Real; + private import 'Calculation Definitions'::*; + private import 'Analytical Constraints'::*; + private import USCustomaryUnits::*; + private import SequenceFunctions::size; + private import Quantities::ScalarQuantityValue; + private import ControlFunctions::*; + private import ScalarValues::Positive; + + attribute def DistancePerVolumeValue :> ScalarQuantityValue; + + part def Vehicle { + attribute mass : MassValue; + attribute cargoMass : MassValue; + + attribute wheelDiameter : LengthValue; + attribute driveTrainEfficiency : Real; + + attribute fuelEconomy_city : DistancePerVolumeValue; + attribute fuelEconomy_highway : DistancePerVolumeValue; + } + + attribute def WayPoint { + time : TimeValue; + position : LengthValue; + speed : SpeedValue; + } + + analysis def FuelEconomyAnalysis { + subject vehicle : Vehicle; + objective fuelEconomyAnalysisObjective { + /* + * The objective of this analysis is to determine whether the + * subject vehicle can satisfy the fuel economy requirement. + */ + + assume constraint { + vehicle.wheelDiameter == 33 ['in'] & + vehicle.driveTrainEfficiency == 0.4 + } + + require constraint { + fuelEconomyResult > 30 [mi / gal] + } + } + + in attribute scenario : WayPoint[*]; + + action solveForPower { + out power : PowerValue[*]; + out acceleration : AccelerationValue[*]; + + /* + * Solve for the required engine power as a function of time + * to support the scenario. + */ + assert constraint { + (1..size(scenario)-1)->forAll {in i: Positive; + StraightLineDynamicsEquations ( + power#(i), + vehicle.mass, + scenario.time#(i+1) - scenario.time#(i), + scenario.position#(i), + scenario.speed#(i), + scenario.position#(i+1), + scenario.speed#(i+1), + acceleration#(i+1) + ) + } + } + } + + then action solveForFuelConsumption { + in power : PowerValue[*] = solveForPower.power; + out fuelEconomy : DistancePerVolumeValue; + + /* + * Solve the engine equations to determine how much fuel is + * consumed. + */ + } + + return fuelEconomyResult : DistancePerVolumeValue = solveForFuelConsumption.fuelEconomy; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/32. Analysis/Analysis Case Usage Example.sysml b/src/sysml/src/training/32. Analysis/Analysis Case Usage Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..062a6e069b52946fb20b9578ef2d06ee9b732f1a --- /dev/null +++ b/src/sysml/src/training/32. Analysis/Analysis Case Usage Example.sysml @@ -0,0 +1,33 @@ +package 'Analysis Case Usage Example' { + private import 'Analysis Case Definition Example'::*; + + part vehicleFuelEconomyAnalysisContext { + requirement vehicleFuelEconomyRequirements { + subject vehicle : Vehicle; + // ... + } + + attribute cityScenario : WayPoint[*] = ( //* ... */ ); + attribute highwayScenario : WayPoint[*] = ( //* ... */ ); + + analysis cityAnalysis : FuelEconomyAnalysis { + subject vehicle = vehicle_c1; + in scenario = cityScenario; + } + + analysis highwayAnalysis : FuelEconomyAnalysis { + subject vehicle = vehicle_c1; + in scenario = highwayScenario; + } + + part vehicle_c1 : Vehicle { + // ... + + attribute :>> fuelEconomy_city = cityAnalysis.fuelEconomyResult; + attribute :>> fuelEconomy_highway = highwayAnalysis.fuelEconomyResult; + } + + satisfy vehicleFuelEconomyRequirements by vehicle_c1; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/32. Analysis/Trade Study Analysis Example.sysml b/src/sysml/src/training/32. Analysis/Trade Study Analysis Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..62c91e74932cba8010460f927d1eec10fe4b528d --- /dev/null +++ b/src/sysml/src/training/32. Analysis/Trade Study Analysis Example.sysml @@ -0,0 +1,43 @@ +package 'Trade Study Analysis Example' { + private import ScalarValues::Real; + private import TradeStudies::*; + + part def Engine; + part engine4cyl : Engine; + part engine6cyl : Engine; + + calc def PowerRollup { in engine : Engine; return : ISQ::PowerValue; } + calc def MassRollup { in engine : Engine; return : ISQ::MassValue; } + calc def EfficiencyRollup { in engine : Engine; return : Real; } + calc def CostRollup { in engine : Engine; return : Real; } + + calc def EngineEvaluation { + in power : ISQ::PowerValue; + in mass : ISQ::MassValue; + in efficiency : Real; + in cost : Real; + return evaluation : Real; + // Compute evaluation... + } + + analysis engineTradeStudy : TradeStudy { + subject : Engine = (engine4cyl, engine6cyl); + objective : MaximizeObjective; + + calc :>> evaluationFunction { + in part anEngine :>> alternative : Engine; + + calc powerRollup: PowerRollup { in engine = anEngine; return power; } + calc massRollup: MassRollup { in engine = anEngine; return mass; } + calc efficiencyRollup: EfficiencyRollup { in engine = anEngine; return efficiency; } + calc costRollup: CostRollup { in engine = anEngine; return cost; } + + return :>> result : Real = EngineEvaluation( + powerRollup.power, massRollup.mass, efficiencyRollup.efficiency, costRollup.cost + ); + } + + return part :>> selectedAlternative : Engine; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/33. Verification/Verification Case Definition Example.sysml b/src/sysml/src/training/33. Verification/Verification Case Definition Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..fd4f213edbe1262ffc9376bfd01803805404ec26 --- /dev/null +++ b/src/sysml/src/training/33. Verification/Verification Case Definition Example.sysml @@ -0,0 +1,44 @@ +package 'Verification Case Definition Example' { + + part def Vehicle { + attribute mass :> ISQ::mass; + } + + requirement vehicleMassRequirement { + subject vehicle : Vehicle; + in massActual :> ISQ::mass = vehicle.mass; + doc /* The vehicle mass shall be less than or equal to 2500 kg. */ + + require constraint { massActual <= 2500[SI::kg] } + } + + verification def VehicleMassTest { + private import VerificationCases::*; + + subject testVehicle : Vehicle; + objective vehicleMassVerificationObjective { + // The subject of the verify is automatically bound to 'testVehicle' here. + verify vehicleMassRequirement; + } + + action collectData { + in part testVehicle : Vehicle = VehicleMassTest::testVehicle; + out massMeasured :> ISQ::mass; + } + + action processData { + in massMeasured :> ISQ::mass = collectData.massMeasured; + out massProcessed :> ISQ::mass; + } + + action evaluateData { + in massProcessed :> ISQ::mass = processData.massProcessed; + out verdict : VerdictKind = + // Check that 'testVehicle' statisfies 'vehicleMassRequirement' if its mass equals 'massProcessed'. + PassIf(vehicleMassRequirement(vehicle = testVehicle(mass = massProcessed))); + } + + return verdict : VerdictKind = evaluateData.verdict; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/33. Verification/Verification Case Usage Example.sysml b/src/sysml/src/training/33. Verification/Verification Case Usage Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8f43987932a9627bed6ade4e7531f459039658fc --- /dev/null +++ b/src/sysml/src/training/33. Verification/Verification Case Usage Example.sysml @@ -0,0 +1,52 @@ +package 'Verification Case Usage Example' { + private import 'Verification Case Definition Example'::*; + + part def MassVerificationSystem; + part def Scale; + + part vehicleTestConfig : Vehicle { + // ... + } + + verification vehicleMassTest : VehicleMassTest { + subject testVehicle :> vehicleTestConfig; + } + + part massVerificationSystem : MassVerificationSystem { + perform vehicleMassTest; + + part scale : Scale { + perform vehicleMassTest.collectData { + in part :>> testVehicle; + + // In reality, this would be some more involved process. + measurement = testVehicle.mass; + + out :>> massMeasured = measurement; + } + } + } + + individual def TestSystem :> MassVerificationSystem; + + individual def TestVehicle1 :> Vehicle; + individual def TestVehicle2 :> Vehicle; + + individual testSystem : TestSystem :> massVerificationSystem { + timeslice test1 { + perform action :>> vehicleMassTest { + in individual :>> testVehicle : TestVehicle1 { + :>> mass = 2500[SI::kg]; + } + } + } + + then timeslice test2 { + perform action :>> vehicleMassTest { + in individual :>> testVehicle : TestVehicle2 { + :>> mass = 3000[SI::kg]; + } + } + } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/34. Use Cases/Use Case Definition Example.sysml b/src/sysml/src/training/34. Use Cases/Use Case Definition Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..785e6fbb1077a3155d1fdc78e7e84b4541225dcd --- /dev/null +++ b/src/sysml/src/training/34. Use Cases/Use Case Definition Example.sysml @@ -0,0 +1,34 @@ +package 'Use Case Definition Example' { + + part def Vehicle; + part def Person; + part def Environment; + part def 'Fuel Station'; + + use case def 'Provide Transportation' { + subject vehicle : Vehicle; + + actor driver : Person; + actor passengers : Person[0..4]; + actor environment : Environment; + + objective { + doc + /* Transport driver and passengers from starting location + * to ending location. + */ + } + } + + use case def 'Enter Vehicle' { + subject vehicle : Vehicle; + actor driver : Person; + actor passengers : Person[0..4]; + } + + use case def 'Exit Vehicle' { + subject vehicle : Vehicle; + actor driver : Person; + actor passengers : Person[0..4]; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/34. Use Cases/Use Case Usage Example.sysml b/src/sysml/src/training/34. Use Cases/Use Case Usage Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4f9dd1e114ff7c81bd98a88e18fd7eb59a2f12c3 --- /dev/null +++ b/src/sysml/src/training/34. Use Cases/Use Case Usage Example.sysml @@ -0,0 +1,37 @@ +package 'Use Case Usage Example' { + + private import 'Use Case Definition Example'::*; + + part def 'Fuel Station'; + + use case 'provide transportation' : 'Provide Transportation' { + first start; + + then include use case 'enter vehicle' : 'Enter Vehicle' { + actor :>> driver = 'provide transportation'::driver; + actor :>> passengers = 'provide transportation'::passengers; + } + + then use case 'drive vehicle' { + actor driver = 'provide transportation'::driver; + actor environment = 'provide transportation'::environment; + + include 'add fuel'[0..*] { + actor :>> fueler = driver; + } + } + + then include use case 'exit vehicle' : 'Exit Vehicle' { + actor :>> driver = 'provide transportation'::driver; + actor :>> passengers = 'provide transportation'::passengers; + } + + then done; + } + + use case 'add fuel' { + subject vehicle : Vehicle; + actor fueler : Person; + actor 'fuel station' : 'Fuel Station'; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/35. Variability/Variation Configuration.sysml b/src/sysml/src/training/35. Variability/Variation Configuration.sysml new file mode 100644 index 0000000000000000000000000000000000000000..34e688f8ac065f51fd3435f30443c1d642e55325 --- /dev/null +++ b/src/sysml/src/training/35. Variability/Variation Configuration.sysml @@ -0,0 +1,14 @@ +package 'Variation Configuration' { + private import 'Variation Usages'::*; + + part vehicle4Cyl :> vehicleFamily { + part redefines engine = engine::'4cylEngine'; + part redefines transmission = transmission::manualTransmission; + } + + part vehicle6Cyl :> vehicleFamily { + part redefines engine = engine::'6cylEngine'; + part redefines transmission = transmission::manualTransmission; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/35. Variability/Variation Definitions.sysml b/src/sysml/src/training/35. Variability/Variation Definitions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..6cfed57e3342d27b8b5219e21d01726ffafb029b --- /dev/null +++ b/src/sysml/src/training/35. Variability/Variation Definitions.sysml @@ -0,0 +1,35 @@ +package 'Variation Definitions' { + private import ScalarValues::Real; + private import SI::mm; + + attribute def Diameter :> ISQ::LengthValue; + + part def Cylinder { + attribute diameter : Diameter[1]; + } + + part def Engine { + part cylinder : Cylinder[2..*]; + } + + part '4cylEngine' : Engine { + part redefines cylinder[4]; + } + + part '6cylEngine' : Engine { + part redefines cylinder[6]; + } + + // Variability model + + variation attribute def DiameterChoices :> Diameter { + variant attribute diameterSmall = 70[mm]; + variant attribute diameterLarge = 100[mm]; + } + + variation part def EngineChoices :> Engine { + variant '4cylEngine'; + variant '6cylEngine'; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/35. Variability/Variation Usages.sysml b/src/sysml/src/training/35. Variability/Variation Usages.sysml new file mode 100644 index 0000000000000000000000000000000000000000..96b42274758249c919b9a86eb2e536f826cb51bb --- /dev/null +++ b/src/sysml/src/training/35. Variability/Variation Usages.sysml @@ -0,0 +1,25 @@ +package 'Variation Usages' { + private import 'Variation Definitions'::*; + + part def Vehicle; + part def Transmission; + part manualTransmission; + part automaticTransmission; + + abstract part vehicleFamily : Vehicle { + part engine : EngineChoices[1]; + + variation part transmission : Transmission[1] { + variant manualTransmission; + variant automaticTransmission; + } + + assert constraint { + (engine == engine::'4cylEngine' and + transmission == transmission::manualTransmission) xor + (engine == engine::'6cylEngine' and + transmission == transmission::automaticTransmission) + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/36. Dependencies/Dependency Example.sysml b/src/sysml/src/training/36. Dependencies/Dependency Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..32a93d1a902d0a5a0bbc26c1b6297e6bc7bc1beb --- /dev/null +++ b/src/sysml/src/training/36. Dependencies/Dependency Example.sysml @@ -0,0 +1,27 @@ +package 'Dependency Example' { + + part 'System Assembly' { + part 'Computer Subsystem' { + // ... + } + + part 'Storage Subsystem' { + // ... + } + } + + package 'Software Design' { + item def MessageSchema { + // ... + } + item def DataSchema { + // ... + } + } + + dependency from 'System Assembly'::'Computer Subsystem' to 'Software Design'; + + dependency Schemata + from 'System Assembly'::'Storage Subsystem' + to 'Software Design'::MessageSchema, 'Software Design'::DataSchema; +} \ No newline at end of file diff --git a/src/sysml/src/training/37. Allocation/Allocation Definition Example.sysml b/src/sysml/src/training/37. Allocation/Allocation Definition Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..b10344f55bdcbc5cb6207811b7925653a065cec9 --- /dev/null +++ b/src/sysml/src/training/37. Allocation/Allocation Definition Example.sysml @@ -0,0 +1,38 @@ +package 'Allocation Definition Example' { + package LogicalModel { + action def ProvidePower; + action def GenerateTorque; + + part def LogicalElement; + part def TorqueGenerator :> LogicalElement; + + action providePower : ProvidePower { + action generateTorque : GenerateTorque; + } + + part torqueGenerator : TorqueGenerator { + perform providePower.generateTorque; + } + + } + + package PhysicalModel { + private import LogicalModel::*; + + part def PhysicalElement; + part def PowerTrain :> PhysicalElement; + + part powerTrain : PowerTrain { + part engine { + perform providePower.generateTorque; + } + } + + allocation def LogicalToPhysical { + end logical : LogicalElement; + end physical : PhysicalElement; + } + + allocation torqueGenAlloc : LogicalToPhysical allocate torqueGenerator to powerTrain; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/37. Allocation/Allocation Usage Example.sysml b/src/sysml/src/training/37. Allocation/Allocation Usage Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4f44d44c3b3d4626bbc623d504181c4ca5c56401 --- /dev/null +++ b/src/sysml/src/training/37. Allocation/Allocation Usage Example.sysml @@ -0,0 +1,34 @@ +package 'Allocation Usage Example' { + package LogicalModel { + action def ProvidePower; + action def GenerateTorque; + + part def TorqueGenerator; + + action providePower : ProvidePower { + action generateTorque : GenerateTorque; + } + + part torqueGenerator : TorqueGenerator { + perform providePower.generateTorque; + } + } + + package PhysicalModel { + private import LogicalModel::*; + + part def PowerTrain; + part def Engine; + + part powerTrain : PowerTrain { + part engine : Engine { + perform providePower.generateTorque; + } + } + + allocate torqueGenerator to powerTrain { + allocate torqueGenerator.generateTorque to powerTrain.engine.generateTorque; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/38. Metadata/Metadata Example-1.sysml b/src/sysml/src/training/38. Metadata/Metadata Example-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f89f23bdf152f893f55d194f1a05f53b35fcbc08 --- /dev/null +++ b/src/sysml/src/training/38. Metadata/Metadata Example-1.sysml @@ -0,0 +1,32 @@ +package 'Metadata Example-1' { + + metadata def SafetyFeature; + metadata def SecurityFeature { + :> annotatedElement : SysML::PartDefinition; + :> annotatedElement : SysML::PartUsage; + } + + metadata SafetyFeature about + vehicle::interior::seatBelt, + vehicle::interior::driverAirBag, + vehicle::bodyAssy::bumper; + + metadata SecurityFeature about + vehicle::interior::alarm, + vehicle::bodyAssy::keylessEntry; + + part vehicle { + part interior { + part alarm; + part seatBelt[2]; + part frontSeat[2]; + part driverAirBag; + } + part bodyAssy { + part body; + part bumper; + part keylessEntry; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/38. Metadata/Metadata Example-2.sysml b/src/sysml/src/training/38. Metadata/Metadata Example-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..842acb3f64a788901cf244968b8840fdb8be8e9c --- /dev/null +++ b/src/sysml/src/training/38. Metadata/Metadata Example-2.sysml @@ -0,0 +1,20 @@ +package 'Metadata Example-2' { + + action computeDynamics { + private import AnalysisTooling::*; + + metadata ToolExecution { + toolName = "ModelCenter"; + uri = "aserv://localhost/Vehicle/Equation1"; + } + + in dt : ISQ::TimeValue { @ToolVariable { name = "deltaT"; } } + in a : ISQ::AccelerationValue { @ToolVariable { name = "mass"; } } + in v_in : ISQ::SpeedValue { @ToolVariable { name = "v0"; } } + in x_in : ISQ::LengthValue { @ToolVariable { name = "x0"; } } + + out v_out : ISQ::SpeedValue { @ToolVariable { name = "v"; } } + out x_out : ISQ::LengthValue { @ToolVariable { name = "x"; } } + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/39. Filtering/Filtering Example-1.sysml b/src/sysml/src/training/39. Filtering/Filtering Example-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..c881e6cc6f36ccaf61059a42250b14984391ce5a --- /dev/null +++ b/src/sysml/src/training/39. Filtering/Filtering Example-1.sysml @@ -0,0 +1,37 @@ +package 'Filtering Example-1' { + private import ScalarValues::Boolean; + + metadata def Safety { + attribute isMandatory : Boolean; + } + + part vehicle { + part interior { + part alarm; + part seatBelt[2] {@Safety{isMandatory = true;}} + part frontSeat[2]; + part driverAirBag {@Safety{isMandatory = false;}} + } + part bodyAssy { + part body; + part bumper {@Safety{isMandatory = true;}} + part keylessEntry; + } + part wheelAssy { + part wheel[2]; + part antilockBrakes[2] {@Safety{isMandatory = false;}} + } + } + + package 'Safety Features' { + /* Parts that contribute to safety. */ + private import vehicle::**; + filter @Safety; + } + + package 'Mandatory Safety Features' { + /* Parts that contribute to safety AND are mandatory. */ + private import vehicle::**; + filter @Safety and Safety::isMandatory; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/39. Filtering/Filtering Example-2.sysml b/src/sysml/src/training/39. Filtering/Filtering Example-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..6131b85d018ee7ee08cf6ed3f059b3ebfd128477 --- /dev/null +++ b/src/sysml/src/training/39. Filtering/Filtering Example-2.sysml @@ -0,0 +1,35 @@ +package 'Filtering Example-2' { + private import ScalarValues::Boolean; + + metadata def Safety { + attribute isMandatory : Boolean; + } + + part vehicle { + part interior { + part alarm; + part seatBelt[2] {@Safety{isMandatory = true;}} + part frontSeat[2]; + part driverAirBag {@Safety{isMandatory = false;}} + } + part bodyAssy { + part body; + part bumper {@Safety{isMandatory = true;}} + part keylessEntry; + } + part wheelAssy { + part wheel[2]; + part antilockBrakes[2] {@Safety{isMandatory = false;}} + } + } + + package 'Safety Features' { + /* Parts that contribute to safety. */ + private import vehicle::**[@Safety]; + } + + package 'Mandatory Safety Features' { + /* Parts that contribute to safety AND are mandatory. */ + private import vehicle::**[@Safety and Safety::isMandatory]; + } +} \ No newline at end of file diff --git a/src/sysml/src/training/40. Language Extension/Model Library Example.sysml b/src/sysml/src/training/40. Language Extension/Model Library Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..0ea7219642953b4b8a3f7386abe0106fae0f25bf --- /dev/null +++ b/src/sysml/src/training/40. Language Extension/Model Library Example.sysml @@ -0,0 +1,35 @@ +library package 'Model Library Example' { + private import ScalarValues::Real; + private import RiskMetadata::Level; + + abstract occurrence def Situation; + + abstract occurrence situations : Situation[*] nonunique; + + abstract occurrence def Cause { + attribute probability : Real; + } + + abstract occurrence causes : Cause[*] nonunique :> situations; + + abstract occurrence def Failure { + attribute severity : Level; + } + + abstract occurrence failures : Failure[*] nonunique :> situations; + + abstract connection def Causation :> Occurrences::HappensBefore { + end cause : Situation[*]; + end effect : Situation[*]; + } + + abstract connection causations : Causation[*] nonunique; + + item def Scenario { + occurrence :>> situations; + occurrence :>> causes :> situations; + occurrence :>> failures :> situations; + } + + item scenarios : Scenario[*] nonunique; +} \ No newline at end of file diff --git a/src/sysml/src/training/40. Language Extension/Semantic Metadata Example.sysml b/src/sysml/src/training/40. Language Extension/Semantic Metadata Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..863b7d2239b2ec2a2f6ba43e31a9a7de975b948f --- /dev/null +++ b/src/sysml/src/training/40. Language Extension/Semantic Metadata Example.sysml @@ -0,0 +1,25 @@ +library package 'Semantic Metadata Example' { + private import 'Model Library Example'::*; + private import Metaobjects::SemanticMetadata; + + metadata def situation :> SemanticMetadata { + :>> baseType = situations meta SysML::Usage; + } + + metadata def cause :> SemanticMetadata { + :>> baseType = causes meta SysML::Usage; + } + + metadata def failure :> SemanticMetadata { + :>> baseType = failures meta SysML::Usage; + } + + metadata def causation :> SemanticMetadata { + :>> baseType = causations meta SysML::Usage; + } + + metadata def scenario :> SemanticMetadata { + :>> baseType = scenarios meta SysML::Usage; + } + +} \ No newline at end of file diff --git a/src/sysml/src/training/40. Language Extension/User Keyword Example.sysml b/src/sysml/src/training/40. Language Extension/User Keyword Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4048e95f4e9edb05d8dea0821762093bbcfef200 --- /dev/null +++ b/src/sysml/src/training/40. Language Extension/User Keyword Example.sysml @@ -0,0 +1,32 @@ +package 'User Keyword Example' { + private import ScalarValues::Real; + private import 'Semantic Metadata Example'::*; + private import RiskMetadata::LevelEnum; + + part def Device { + part battery { + attribute power : Real; + } + } + + #scenario def DeviceFailure { + ref device : Device; + attribute minPower : Real; + + #cause 'battery old' { + :>> probability = 0.01; + } + + #causation first 'battery old' then 'power low'; + + #situation 'power low' { + constraint { device.battery.power < minPower } + } + + #causation first 'power low' then 'device shutoff'; + + #failure 'device shutoff' { + :>> severity = LevelEnum::high; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/41. Views/Viewpoint Example.sysml b/src/sysml/src/training/41. Views/Viewpoint Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..b881917c49fec5f827ce72515d541743c86648f0 --- /dev/null +++ b/src/sysml/src/training/41. Views/Viewpoint Example.sysml @@ -0,0 +1,38 @@ +package 'Viewpoint Example' { + part def 'Systems Engineer'; + part def 'IV&V'; + + concern 'system breakdown' { + doc /* + * To ensure that a system covers all its required capabilities, + * it is necessary to understand how it is broken down into + * subsystems and components that provide those capabilities. + */ + + stakeholder se : 'Systems Engineer'; + stakeholder ivv : 'IV&V'; + } + + concern 'modularity' { + doc /* + * There should be well defined interfaces between the parts of + * a system that allow each part to be understood individually, + * as well as being part of the whole system. + */ + + stakeholder se : 'Systems Engineer'; + } + + viewpoint 'system structure perspective' { + frame 'system breakdown'; + frame 'modularity'; + + require constraint { + doc /* + * A system structure view shall show the hierarchical + * part decomposition of a system, starting with a + * specified root part. + */ + } + } +} \ No newline at end of file diff --git a/src/sysml/src/training/41. Views/Views Example.sysml b/src/sysml/src/training/41. Views/Views Example.sysml new file mode 100644 index 0000000000000000000000000000000000000000..c13cb1d768d0a46cd2e05a6cd0c3a999f5fe1eb2 --- /dev/null +++ b/src/sysml/src/training/41. Views/Views Example.sysml @@ -0,0 +1,35 @@ +package 'Views Example' { + private import Views::*; + private import 'Viewpoint Example'::*; + private import 'Filtering Example-2'::*; + + view def 'Part Structure View' { + satisfy 'system structure perspective'; + filter @SysML::PartUsage; + } + + view 'vehicle structure view' : 'Part Structure View' { + expose vehicle::**; + render asTreeDiagram; + } + + rendering asTextualNotationTable :> asElementTable { + view :>> columnView[1] { + render asTextualNotation; + } + } + + view 'vehicle tabular views' { + + view 'safety features view' : 'Part Structure View' { + expose vehicle::**[@Safety]; + render asTextualNotationTable; + } + + view 'non-safety features view' : 'Part Structure View' { + expose vehicle::**[not (@Safety)]; + render asTextualNotationTable; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/01-Parts Tree/1a-Parts Tree.sysml b/src/sysml/src/validation/01-Parts Tree/1a-Parts Tree.sysml new file mode 100644 index 0000000000000000000000000000000000000000..dd5bd686e3b37fbcafbe75ae23f2a3dea639df84 --- /dev/null +++ b/src/sysml/src/validation/01-Parts Tree/1a-Parts Tree.sysml @@ -0,0 +1,125 @@ +package '1a-Parts Tree' { + private import SI::kg; + + package Definitions { + part def Vehicle { + attribute mass :> ISQ::mass { + doc + /* + * The 'mass' attribute property is declared here to be a + * specialization (subset) of the general 'mass' quantity + * from the 'ISQ' (International System of Quantities) + * library model. + */ + } + } + part def AxleAssembly; + part def Axle { + attribute mass :> ISQ::mass; + } + part def FrontAxle :> Axle { + attribute steeringAngle: ScalarValues::Real; + } + part def Wheel; + } + + package Usages { + private import Definitions::* { + /* + * A "private" private import makes the imported names private to the + * imported package. + */ + } + + part vehicle1: Vehicle { + /* + * 'vehicle1' is a package-owned part of type Vehicle. + */ + + attribute mass redefines Vehicle::mass = 1750 [kg] { + /* + * This redefines the 'mass' attribute property from 'Vehicle' to + * give it a fixed attribute. + */ + } + + part frontAxleAssembly: AxleAssembly { + /* + * 'frontAxleAssembly' is a nested part of part 'vehicle1'. + * It is a composite part of the containing part. + * + * (And similarly for 'rearAxleAssembly'.) + */ + + part frontAxle: Axle; + + part frontWheel: Wheel[2] ordered { + /* + * 'frontWheel' is a nested part of type 'Wheel' with + * multiplicity "2". This means that this axle assembly + * must have exactly two wheels. However, there is still + * only one 'frontWheel' part. The part is "ordered", + * so that the first wheel can be distinguished from the + * second. + */ + } + } + + part rearAxleAssembly: AxleAssembly { + part rearAxle: Axle; + part rearWheel: Wheel[2] ordered; + } + + } + + part vehicle1_c1: Vehicle { + /* + * 'vehicle1_c1' is a modified copy of 'vehicle1'. There is no + * connection between this copy and the original version in the + * model. + */ + + attribute mass redefines Vehicle::mass = 2000 [kg] { + /* + * The mass attribute has been modified. + */ + } + + part frontAxleAssembly: AxleAssembly { + + part frontAxle: FrontAxle { + /* + * The part 'frontAxle' has been modified to have type 'FrontAxle'. + */ + } + + part frontWheel: Wheel[2] ordered { + /* + * The parts 'frontWheel_1' and 'frontWheel_2' have been added + * as subsets of 'frontWheel'. These are separate parts from + * 'frontWheel', but essentially provide alternate names for + * each of the two wheels, as given by their defining expressions. + */ + } + part frontWheel_1 subsets frontWheel = frontWheel#(1); + part frontWheel_2 subsets frontWheel = frontWheel#(2); + } + + part rearAxleAssembly: AxleAssembly { + /* + * 'rearAxleAssembly' has also been modified to add subsetting parts + * for 'rearWheel'. + */ + + part rearAxle: Axle; + + part rearWheel: Wheel[2] ordered; + part rearWheel_1 subsets rearWheel = rearWheel#(1); + part rearWheel_2 subsets rearWheel = rearWheel#(2); + } + + } + + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/01-Parts Tree/1c-Parts Tree Redefinition.sysml b/src/sysml/src/validation/01-Parts Tree/1c-Parts Tree Redefinition.sysml new file mode 100644 index 0000000000000000000000000000000000000000..c9c35f721934e6b3b72230b2f997269ef1b7f9f3 --- /dev/null +++ b/src/sysml/src/validation/01-Parts Tree/1c-Parts Tree Redefinition.sysml @@ -0,0 +1,86 @@ +package '1c-Parts Tree Redefinition' { + private import SI::kg; + + package Definitions { + part def Vehicle { + attribute mass :> ISQ::mass; + } + part def AxleAssembly; + part def Axle { + attribute mass :> ISQ::mass; + } + part def FrontAxle :> Axle { + attribute steeringAngle: ScalarValues::Real; + } + part def Wheel; + } + + package Usages { + private import Definitions::*; + + part vehicle1: Vehicle { + attribute mass redefines Vehicle::mass default = 1750 [kg] { + doc + /* + * The mass attribute is redefined to give it a default value. + */ + } + + part frontAxleAssembly: AxleAssembly { + part frontAxle: Axle; + part frontWheel: Wheel[2] ordered; + } + part rearAxleAssembly: AxleAssembly { + part rearAxle: Axle; + part rearWheel: Wheel[2] ordered; + } + } + + part vehicle1_c1 :> vehicle1 { + /* + * 'vehicle1_c1' is a specialization of 'vehicle1' (technically + * a subset). It inherits all the parts of 'vehicle1' and + * only needs to specify additional or redefined parts. + */ + + attribute mass redefines vehicle1::mass = 2000 [kg] { + /* + * The mass is further redefined to override the default value + * with a bound value for 'vehicle_c1'. + */ + } + + part frontAxleAssembly_c1 redefines frontAxleAssembly { + part frontAxle_c1: FrontAxle redefines frontAxle { + /* + * 'frontAxle_c1' redefines 'frontAxleAssembly'::'frontAxle' + * to give it a new name and the specialized type + * 'FrontAxle'. + */ + } + + /* + * 'frontWheel' is inherited from 'vehicle1'::'frontAxleAssembly', + * allowing it to be used in the following part declarations. + */ + + part frontWheel_1 subsets frontWheel = frontWheel#(1); + part frontWheel_2 subsets frontWheel = frontWheel#(2); + } + + part rearAxleAssembly_c1 redefines rearAxleAssembly { + part rearAxle_c1 redefines rearAxle { + /* + * 'rearAxle_c1' redefines 'rearAxleAssembly'::'rearAxle' + * to give it a new name. It inherits the type 'Axle' + * from the redefined part. + */ + } + + part rearWheel_1 subsets rearWheel = rearWheel#(1); + part rearWheel_2 subsets rearWheel = rearWheel#(2); + } + } + + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/01-Parts Tree/1d-Parts Tree with Reference.sysml b/src/sysml/src/validation/01-Parts Tree/1d-Parts Tree with Reference.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8eca0e3737d84fede0accca5d44c0738907333f6 --- /dev/null +++ b/src/sysml/src/validation/01-Parts Tree/1d-Parts Tree with Reference.sysml @@ -0,0 +1,51 @@ +package '1d-Parts Tree with Reference' { + + package Definitions { + part def Vehicle; + part def Trailer; + part def TrailerHitch; + part def HitchBall; + part def TrailerCoupler; + } + + package Usages { + private import Definitions::*; + + part vehicle_trailer_system { + + part vehicle1_c1: Vehicle { + ref hitchBall : HitchBall { + /* + * 'vehicle1_c1'::'hitchBall' is a reference property that + * references a hitch ball that is not part of this vehicle. + * If 'vehicle1_c1' is removed or destroyed, this does not + * effect the hitchBall referenced here. + */ + } + } + + bind vehicle1_c1.hitchBall = trailerHitch.hitchBall { + /* + * This is a binding connector between the 'hitchBall' in 'vehicle1_c1' + * and the 'hitchBall' in 'trailerHitch'. + */ + } + + part trailerHitch: TrailerHitch { + part hitchBall: HitchBall; + part trailerCoupler: TrailerCoupler; + } + + part trailer1: Trailer { + ref trailerCoupler : TrailerCoupler = trailerHitch.trailerCoupler { + /* + * This is a shorthand for a binding connector between the + * 'trailerCoupler' here and the 'trailerCoupler' in 'trailerHitch'. + * The binding connector is now contained within the 'trailer1' + * part, though, rather than being at the system level. + */ + } + } + } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/02-Parts Interconnection/2a-Parts Interconnection.sysml b/src/sysml/src/validation/02-Parts Interconnection/2a-Parts Interconnection.sysml new file mode 100644 index 0000000000000000000000000000000000000000..57538dc9bad08e804128e2f9848993aadf722547 --- /dev/null +++ b/src/sysml/src/validation/02-Parts Interconnection/2a-Parts Interconnection.sysml @@ -0,0 +1,206 @@ +package '2a-Parts Interconnection' { + public import Definitions::*; + public import Usages::*; + + package Definitions { + // Port Definitions + + port def FuelCmdPort; + + port def DrivePwrPort; + port def ClutchPort; + + port def ShaftPort_a; + port def ShaftPort_b; + port def ShaftPort_c; + port def ShaftPort_d; + + port def DiffPort; + port def AxlePort; + port def AxleToWheelPort; + port def WheelToAxlePort; + port def WheelToRoadPort; + + port def VehicleToRoadPort { + /* + * A port definition can have nested ports. + */ + + port wheelToRoadPort: WheelToRoadPort[2]; + } + + // Blocks + + part def VehicleA { + port fuelCmdPort: FuelCmdPort; + port vehicleToRoadPort: VehicleToRoadPort; + } + + part def AxleAssembly; + part def RearAxleAssembly :> AxleAssembly { + port shaftPort_d: ShaftPort_d; + } + + part def Axle; + part def RearAxle :> Axle; + + part def HalfAxle { + port axleToDiffPort: AxlePort; + port axleToWheelPort: AxleToWheelPort; + } + + part def Engine { + port fuelCmdPort: FuelCmdPort; + port drivePwrPort: DrivePwrPort; + } + + part def Transmission { + port clutchPort: ClutchPort; + port shaftPort_a: ShaftPort_a; + } + + part def Driveshaft { + port shaftPort_b: ShaftPort_b; + port shaftPort_c: ShaftPort_c; + } + + part def Differential { + /* + * Ports do not have to be defined on part defs. + * They can be added directly to their usages. + */ + } + part def Wheel; + + // Interface Definitions + + interface def EngineToTransmissionInterface { + /* + * The ends of an interface definition are always ports. + */ + + end drivePwrPort: DrivePwrPort; + end clutchPort: ClutchPort; + } + + interface def DriveshaftInterface { + end shaftPort_a: ShaftPort_a; + end shaftPort_d: ShaftPort_d; + + ref driveshaft: Driveshaft { + /* + * 'driveshaft' is a reference to the driveshaft that will + * act as the "interface medium" for this interface. + */ + } + + connect shaftPort_a to driveshaft.shaftPort_b { + /* + * The two ends of 'DriveShaftInterface' are always connected + * via the referenced 'driveshaft'. + */ + } + connect driveshaft.shaftPort_c to shaftPort_d; + } + + } + + package Usages { + + part vehicle1_c1: VehicleA { + + bind fuelCmdPort = engine.fuelCmdPort; + + part engine: Engine; + + interface :EngineToTransmissionInterface + connect engine.drivePwrPort to transmission.clutchPort { + /* + * A usage of an interface definition connects two ports relative to + * a containing context. + */ + } + + part transmission: Transmission; + + part driveshaft: Driveshaft { + /* + * This 'driveshaft' is the part of 'vehicle1_c1' that will act as the + * interface medium in the following 'DriveshaftInterface' usage. + */ + } + + interface :DriveshaftInterface + connect transmission.shaftPort_a to rearAxleAssembly.shaftPort_d { + ref :>> driveshaft = vehicle1_c1.driveshaft { + /* + * The reference property from 'DriveshaftInterface' is redefined + * in order to bind it to the appropriate part of 'vehicle1_c1'. + */ + } + } + + part rearAxleAssembly: RearAxleAssembly { + bind shaftPort_d = differential.shaftPort_d; + + part differential: Differential { + port shaftPort_d: ShaftPort_d { + /* + * If the part def has no ports, then they can be defined directly in + * a usage of the part def. + */ + } + port leftDiffPort: DiffPort; + port rightDiffPort: DiffPort; + } + + interface differential.leftDiffPort to rearAxle.leftHalfAxle.axleToDiffPort { + /* + * A connection can be to a port that is arbitrarily deeply nested, on either end. + */ + } + interface differential.rightDiffPort to rearAxle.rightHalfAxle.axleToDiffPort; + + part rearAxle: RearAxle { + part leftHalfAxle: HalfAxle; + part rightHalfAxle: HalfAxle; + } + + connect rearAxle.leftHalfAxle.axleToWheelPort to leftWheel.wheelToAxlePort; + connect rearAxle.rightHalfAxle.axleToWheelPort to rightWheel.wheelToAxlePort; + + part rearWheel: Wheel[2] ordered; + + /* The two rear wheels of 'rearAxleAssembly' must be given + * their own names in order to be referenced in connections. + * + * (":>" is a shorthand here for "subsets".) + */ + part leftWheel :> rearWheel = rearWheel#(1) { + port wheelToAxlePort: WheelToAxlePort; + port wheelToRoadPort: WheelToRoadPort; + } + + part rightWheel :> rearWheel = rearWheel#(2) { + port wheelToAxlePort: WheelToAxlePort; + port wheelToRoadPort: WheelToRoadPort; + } + + } + + bind rearAxleAssembly.leftWheel.wheelToRoadPort = + vehicleToRoadPort.leftWheelToRoadPort; + + bind rearAxleAssembly.rightWheel.wheelToRoadPort = + vehicleToRoadPort.rightWheelToRoadPort; + + port vehicleToRoadPort redefines VehicleA::vehicleToRoadPort { + port leftWheelToRoadPort :> wheelToRoadPort = wheelToRoadPort#(1); + port rightWheelToRoadPort :> wheelToRoadPort = wheelToRoadPort#(2); + } + + } + + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/02-Parts Interconnection/2c-Parts Interconnection-Multiple Decompositions.sysml b/src/sysml/src/validation/02-Parts Interconnection/2c-Parts Interconnection-Multiple Decompositions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..0df216e141450c810ba2bfb57c75c5e342ef80dc --- /dev/null +++ b/src/sysml/src/validation/02-Parts Interconnection/2c-Parts Interconnection-Multiple Decompositions.sysml @@ -0,0 +1,90 @@ +package '2c-Parts Interconnection-Multiple Decompositions' { + + part def A1; + + part def B11 { + port pe; + } + part def B12 { + port pf; + } + part def B21 { + port pg; + } + part def B22 { + port ph; + } + + part def C1 { + port pa; + port pb; + } + part def C2 { + port pc; + } + part def C3 { + port pd; + } + part def C4; + + part a11: A1 { + doc + /* + * Decomposition 1 - Subsystems b11, b12 + */ + + part b11: B11 { + part c1: C1; + part c2: C2; + + connect c1.pa to c2.pc; + + port :>> pe = c1.pb { + doc + /* + * This combines the definition of a port with a binding + * connector. (It is the same notation used to bind a + * attribute to a attribute property or a reference to a reference + * property.) + */ + } + } + + part b12: B12 { + part c3: C3; + part c4: C4; + + port :>> pf = c3.pd; + } + + connect b11.pe to b12.pf; + } + + part a12: A1 { + doc + /* + * Decomposition 2 - Assemblies b21, b22 + */ + + part b21: B21 { + /* + * The c-level entities are already composite parts within + * a11, so they cannot also be composite parts within a12. + */ + + ref c1: C1 = a11.b11.c1; + ref c3: C3 = a11.b12.c3; + + connect c1.pb to c3.pd; + + port :>> pg = c1.pa; + } + + part b22: B22 { + ref c2: C2 = a11.b11.c2; + ref c4: C4 = a11.b12.c4; + + port :>> ph = c2.pc; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/03-Function-based Behavior/3a-Function-based Behavior-1.sysml b/src/sysml/src/validation/03-Function-based Behavior/3a-Function-based Behavior-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..093218f329cb1938a1d50aece84fe75368171442 --- /dev/null +++ b/src/sysml/src/validation/03-Function-based Behavior/3a-Function-based Behavior-1.sysml @@ -0,0 +1,137 @@ +package '3a-Function-based Behavior-1' { + public import Definitions::*; + public import Usages::*; + + package Definitions { + alias Torque for ISQ::TorqueValue { + /* + * The 'TorqueValue' type is aliased as 'Torque'. + */ + } + + attribute def FuelCmd; + + /* + * There is no special construct for modeling "signals". Data to be + * transmitted asynchronously can simply be modeled using attribute defs. + */ + + attribute def EngineStart; + attribute def EngineOff; + + /* + * Black box definitions for actions include their inputs and outputs. + */ + + action def 'Generate Torque' { in fuelCmd: FuelCmd; out engineTorque: Torque; } + action def 'Amplify Torque' { in engineTorque: Torque; out transmissionTorque: Torque; } + action def 'Transfer Torque' { in transmissionTorque: Torque; out driveshaftTorque: Torque; } + action def 'Distribute Torque' { in driveShaftTorque: Torque; out wheelTorque1: Torque; out wheelTorque2: Torque; } + + action def 'Provide Power' { in fuelCmd: FuelCmd; out wheelTorque1: Torque; out wheelTorque2: Torque; } + + } + + package Usages { + + action 'provide power': 'Provide Power'{ + in fuelCmd: FuelCmd; + out wheelTorque1: Torque; + out wheelTorque2: Torque; + + // ITEM FLOW PART + + bind 'generate torque'.fuelCmd = fuelCmd { + /* + * This is a binding connector, just as was used to + * model delegation between ports. + */ + } + + action 'generate torque': 'Generate Torque' { + /* + * An action usage inherits parameters from its definition. + * They act as its "pins". + */ + } + + flow 'generate torque'.engineTorque + to 'amplify torque'.engineTorque { + /* + * A flow is a connection between two actions that streams items from + * an output parameter of one action to an input parameter of the other. + * Note that streaming is a property of the connection, not the + * actions or their parameters. + */ + } + + action 'amplify torque': 'Amplify Torque'; + + flow 'amplify torque'.transmissionTorque + to 'transfer torque'.transmissionTorque; + + action 'transfer torque': 'Transfer Torque'; + + flow 'transfer torque'.driveshaftTorque + to 'distribute torque'.driveShaftTorque; + + action 'distribute torque': 'Distribute Torque'; + + bind wheelTorque1 = 'distribute torque'.wheelTorque1; + bind wheelTorque2 = 'distribute torque'.wheelTorque2; + + // CONTROL FLOW PART + + first start then continue { + /* + * A first is an assertion that one thing must occur + * before another, acting like a "control flow". 'start' is + * the start snapshot of the action, which acts like an + * "initial node". + */ + } + + merge continue { + /* + * A merge node is necessary to prevent a loop of successions + * from being unsatisfiable. + */ + } + first continue then engineStarted; + + action engineStarted accept engineStart: EngineStart { + /* + * An accept action accepts an incoming transfer of some item + * from outside an action, in this case the "signal" 'EngineStart'. + * Note that 'engineStarted' is the name of the action, while + * 'engineStart' is the name of the received signal attribute. + */ + } + first engineStarted then engineStopped; + + action engineStopped accept engineOff: EngineOff; + first engineStopped then continue; + + /* + * These successions act to "enable" the torque-related actions. + * Each action on the right can only be performed following the + * completion of a performance of 'engineStarted'. + */ + first engineStarted then 'generate torque'; + first engineStarted then 'amplify torque'; + first engineStarted then 'transfer torque'; + first engineStarted then 'distribute torque'; + + /* + * These successions act to "disable" the torque-related actions. + * The performance of the actions on the left cannot continue + * once there is a performance of 'engineStopped'. + */ + first 'generate torque' then engineStopped; + first 'amplify torque' then engineStopped; + first 'transfer torque' then engineStopped; + first 'distribute torque' then engineStopped; + } + + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/03-Function-based Behavior/3a-Function-based Behavior-2.sysml b/src/sysml/src/validation/03-Function-based Behavior/3a-Function-based Behavior-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..2d56d905f111133400b77ae5775a8741cbc46fe0 --- /dev/null +++ b/src/sysml/src/validation/03-Function-based Behavior/3a-Function-based Behavior-2.sysml @@ -0,0 +1,85 @@ +package '3a-Function-based Behavior-2' { + public import Definitions::*; + public import Usages::*; + + package Definitions { + alias Torque for ISQ::TorqueValue; + + // ATTRIBUTE DEFINITIONS + + attribute def FuelCmd; + + attribute def EngineStart; + attribute def EngineOff; + + // ACTION DEFINITIONS + + action def 'Generate Torque' { in fuelCmd: FuelCmd; out engineTorque: Torque; } + action def 'Amplify Torque' { in engineTorque: Torque; out transmissionTorque: Torque; } + action def 'Transfer Torque' { in transmissionTorque: Torque; out driveshaftTorque: Torque; } + action def 'Distribute Torque' { in driveShaftTorque: Torque; out wheelTorque1: Torque; out wheelTorque2: Torque; } + + action def 'Provide Power' { in fuelCmd: FuelCmd; out wheelTorque1: Torque; out wheelTorque2: Torque; } + + } + + package Usages { + + action 'provide power': 'Provide Power'{ + in fuelCmd: FuelCmd; + out wheelTorque1: Torque; + out wheelTorque2: Torque; + + // ITEM FLOW PART + + action 'generate torque': 'Generate Torque'{ + /* + * The binding connector shorthand can be used on action parameters. + */ + in fuelCmd = 'provide power'::fuelCmd; + } + + flow 'generate torque'.engineTorque + to 'amplify torque'.engineTorque; + + action 'amplify torque': 'Amplify Torque'; + + flow 'amplify torque'.transmissionTorque + to 'transfer torque'.transmissionTorque; + + action 'transfer torque': 'Transfer Torque'; + + flow 'transfer torque'.driveshaftTorque + to 'distribute torque'.driveShaftTorque; + + action 'distribute torque': 'Distribute Torque'; + + // CONTROL FLOW PART + + /* + * The following uses a shorthand for a sequence of successions. + * The source of the first first is given by "first start", + * and the target of each succeeding first is indicated by + * using the "then" keyword. + */ + first start; + then merge continue; + then action engineStarted accept engineStart: EngineStart; + then action engineStopped accept engineOff: EngineOff; + then continue; + + /* Enable torque generation. */ + first engineStarted then 'generate torque'; + first engineStarted then 'amplify torque'; + first engineStarted then 'transfer torque'; + first engineStarted then 'distribute torque'; + + /* Disable torque generation. */ + first 'generate torque' then engineStopped; + first 'amplify torque' then engineStopped; + first 'transfer torque' then engineStopped; + first 'distribute torque' then engineStopped; + } + + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/03-Function-based Behavior/3a-Function-based Behavior-3.sysml b/src/sysml/src/validation/03-Function-based Behavior/3a-Function-based Behavior-3.sysml new file mode 100644 index 0000000000000000000000000000000000000000..6727e929a56cec9a00d3ef52b43103979dffaedc --- /dev/null +++ b/src/sysml/src/validation/03-Function-based Behavior/3a-Function-based Behavior-3.sysml @@ -0,0 +1,73 @@ +package '3a-Function-based Behavior-5' { + public import Definitions::*; + public import Usages::*; + + package Definitions { + alias Torque for ISQ::TorqueValue; + + // ATTRIBUTE DEFINITIONS + + attribute def FuelCmd; + + attribute def EngineStart; + attribute def EngineOff; + + // ACTION DEFINITIONS + + action def 'Generate Torque' { in fuelCmd: FuelCmd; out engineTorque: Torque; } + action def 'Amplify Torque' { in engineTorque: Torque; out transmissionTorque: Torque; } + action def 'Transfer Torque' { in transmissionTorque: Torque; out driveshaftTorque: Torque; } + action def 'Distribute Torque' { in driveShaftTorque: Torque; out wheelTorque1: Torque; out wheelTorque2: Torque; } + + action def 'Provide Power' { in fuelCmd: FuelCmd; out wheelTorque1: Torque; out wheelTorque2: Torque; } + + } + + package Usages { + + action 'provide power': 'Provide Power' { + // PARAMETERS + + in fuelCmd: FuelCmd; + out wheelTorque1: Torque; + out wheelTorque2: Torque; + + loop { + accept engineStart : EngineStart; + then action { + action 'generate torque': 'Generate Torque' { + in fuelCmd = 'provide power'::fuelCmd; + out engineTorque: Torque; + } + + flow 'generate torque'.engineTorque + to 'amplify torque'.engineTorque; + + action 'amplify torque': 'Amplify Torque' { + in engineTorque: Torque; + out transmissionTorque: Torque; + } + + flow 'amplify torque'.transmissionTorque + to 'transfer torque'.transmissionTorque; + + action 'transfer torque': 'Transfer Torque' { + in transmissionTorque: Torque; + out driveshaftTorque: Torque; + } + + flow 'transfer torque'.driveshaftTorque + to 'distribute torque'.driveshaftTorque; + + action 'distribute torque': 'Distribute Torque' { + in driveshaftTorque: Torque; + out wheelTorque1: Torque; + out wheelTorque2: Torque; + } + } + then action accept engineOff : EngineOff; + } + } + + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/03-Function-based Behavior/3c-Function-based Behavior-structure mod-1.sysml b/src/sysml/src/validation/03-Function-based Behavior/3c-Function-based Behavior-structure mod-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..3579ddbc6f574e1d5e3079631202ac8191ba3573 --- /dev/null +++ b/src/sysml/src/validation/03-Function-based Behavior/3c-Function-based Behavior-structure mod-1.sysml @@ -0,0 +1,51 @@ +package '3c-Function-based Behavior-structure mod-1' { + + part def Vehicle; + part def VehicleFrame; + + part def HitchBall; + part def TrailerCoupler; + + part def Trailer; + part def TrailerFrame; + + connection def TrailerHitch { + end hitch : HitchBall; + end coupler : TrailerCoupler; + } + + part 'vehicle-trailer system' { + + part vehicle : Vehicle { + part vehicleFrame : VehicleFrame { + part hitch : HitchBall; + } + } + + connection trailerHitch : TrailerHitch[0..1] + connect vehicle.vehicleFrame.hitch to trailer.trailerFrame.coupler; + + part trailer : Trailer { + part trailerFrame : TrailerFrame { + part coupler : TrailerCoupler; + } + } + + action { + // Create a link and assign it as the TrailerHitch connection. + // Link participants are determined from inherited ends. + action 'connect trailer to vehicle' + assign 'vehicle-trailer system'.trailerHitch := TrailerHitch(); + + // Destroy the link object. + then action 'destroy connection of trailer to vehicle' : + OccurrenceFunctions::destroy { + inout occ = 'vehicle-trailer system'.trailerHitch; + } + + // Remove the link from the TrailerHitch connection. + then action 'disconnect trailer from vehicle' + assign 'vehicle-trailer system'.trailerHitch := null; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/03-Function-based Behavior/3c-Function-based Behavior-structure mod-2.sysml b/src/sysml/src/validation/03-Function-based Behavior/3c-Function-based Behavior-structure mod-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f84b7ad4aa7b9d84ad522579f07e1d13939521da --- /dev/null +++ b/src/sysml/src/validation/03-Function-based Behavior/3c-Function-based Behavior-structure mod-2.sysml @@ -0,0 +1,49 @@ +package '3c-Function-based Behavior-structure mod-2' { + + part def Vehicle; + part def VehicleFrame; + + part def HitchBall; + part def TrailerCoupler; + + part def Trailer; + part def TrailerFrame; + + connection def TrailerHitch { + end hitch : HitchBall; + end coupler : TrailerCoupler; + } + + part 'vehicle-trailer system' { + + part vehicle : Vehicle { + part vehicleFrame : VehicleFrame { + part hitch : HitchBall; + } + } + + connection trailerHitch : TrailerHitch[0..1] + connect vehicle.vehicleFrame.hitch to trailer.trailerFrame.coupler; + + part trailer : Trailer { + part trailerFrame : TrailerFrame { + part coupler : TrailerCoupler; + } + } + + perform action { + action 'connect trailer to vehicle' { + // Assert that exactly one connection exists during the + // performance of this action. + abstract ref :>> trailerHitch[1]; + } + then action 'disconnect trailer from vehicle' { + // Assert that exactly no connection exists during the + // performance of this action. + abstract ref :>> trailerHitch[0]; + } + } + + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/03-Function-based Behavior/3c-Function-based Behavior-structure mod-3.sysml b/src/sysml/src/validation/03-Function-based Behavior/3c-Function-based Behavior-structure mod-3.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4c123d494faf66e0650ce36f9c9fecac67fa676d --- /dev/null +++ b/src/sysml/src/validation/03-Function-based Behavior/3c-Function-based Behavior-structure mod-3.sysml @@ -0,0 +1,33 @@ +package '3c-Function-based Behavior-structure mod-3' { + + part def Vehicle; + part def VehicleFrame; + part def HitchBall; + part def Trailer; + part def TrailerFrame; + part def TrailerCoupler; + + part vehicle : Vehicle { + part vehicleFrame : VehicleFrame { + part hitch : HitchBall; + } + } + + part trailer : Trailer { + part trailerFrame : TrailerFrame { + part coupler : TrailerCoupler { + ref part hitch : HitchBall; + } + } + } + + action { + // Insert the vehicle HitchBall into the TrailerCoupler. + action 'connect trailer to vehicle' + assign trailer.trailerFrame.coupler.hitch := vehicle.vehicleFrame.hitch; + + // Remove the HitchBall from the TrailerCoupler. + then action 'disconnect trailer from vehicle' + assign trailer.trailerFrame.coupler.hitch := null; + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/03-Function-based Behavior/3d-Function-based Behavior-item.sysml b/src/sysml/src/validation/03-Function-based Behavior/3d-Function-based Behavior-item.sysml new file mode 100644 index 0000000000000000000000000000000000000000..e645edff282fdf8b426160155b384679dedd37a8 --- /dev/null +++ b/src/sysml/src/validation/03-Function-based Behavior/3d-Function-based Behavior-item.sysml @@ -0,0 +1,83 @@ +package '3d-Function-based Behavior-item' { + private import ScalarValues::Real; + public import Definitions::*; + public import Usages::*; + + package Definitions { + + item def Fuel; + + port def FuelPort { + out item fuel: Fuel; + } + + part def Pump { + port fuelInPort : ~FuelPort; + port fuelOutPort : FuelPort; + } + + part def StorageTank { + port fuelOutPort : FuelPort; + } + + part def FuelTank { + port fuelInPort : ~FuelPort; + } + + part def Vehicle { + port fuelInPort : ~FuelPort; + } + + action def PumpFuel { + in fuelIn : Fuel; + out fuelOut : Fuel; + } + + } + + package Usages { + + part context { + + /* Storage Element */ + part storageTank : StorageTank; + + flow of fuel : Fuel + from storageTank.fuelOutPort.fuel to pump.fuelInPort.fuel { + /* + * Note: Explicitly notating that the flow is "of fuel : Fuel" is optional. + */ + } + + part pump : Pump { + perform action pumpFuel : PumpFuel { + in fuelIn = fuelInPort.fuel; + out fuelOut = fuelOutPort.fuel; + } + } + + flow of fuel : Fuel + from pump.fuelOutPort.fuel to vehicle.fuelInPort.fuel; + + part vehicle : Vehicle { + flow fuelInPort.fuel to fuelTank.fuel { + /* + * Note: The semantics of flowing to a "stored item" is tentative. + */ + } + + /* Storage Element */ + part fuelTank : FuelTank { + attribute volumeMax : Real; + attribute fuelLevel : Real = fuel.volume / volumeMax; + + /* Stored Item */ + item fuel : Fuel { + attribute volume : Real; + /* isConserved = true */ + } + } + } + } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/03-Function-based Behavior/3e-Function-based Behavior-item.sysml b/src/sysml/src/validation/03-Function-based Behavior/3e-Function-based Behavior-item.sysml new file mode 100644 index 0000000000000000000000000000000000000000..c4f96820fcdeade457849c538518b5cd63f31a57 --- /dev/null +++ b/src/sysml/src/validation/03-Function-based Behavior/3e-Function-based Behavior-item.sysml @@ -0,0 +1,64 @@ +package '3e-Function-based Behavior-item' { + public import Definitions::*; + + package Definitions { + + item def VehicleAssembly; + item def AssembledVehicle :> VehicleAssembly; + + part def Vehicle :> AssembledVehicle; + part def Transmission; + part def Engine; + + } + + package Usages { + + part AssemblyLine { + + perform action 'assemble vehicle' { + + action 'assemble transmission into vehicle' { + in item 'vehicle assy without transmission or engine' : VehicleAssembly; + in item transmission : Transmission { + /* Note: A part can be treated as an item. */ + } + + out item 'vehicle assy without engine' : VehicleAssembly = 'vehicle assy without transmission or engine' { + part transmission : Transmission = 'assemble transmission into vehicle'.transmission { + /* Note: An item can become a part of something else. */ + } + } + } + + flow 'assemble transmission into vehicle'.'vehicle assy without engine' + to 'assemble engine into vehicle'.'vehicle assy without engine'; + + action 'assemble engine into vehicle' { + in item 'vehicle assy without engine' : VehicleAssembly { + part transmission : Transmission; + } + in item engine : Engine; + + out item assembledVehicle : AssembledVehicle = 'vehicle assy without engine' { + part engine : Engine = 'assemble engine into vehicle'.engine; + } + } + } + + bind 'assemble vehicle'.'assemble engine into vehicle'.assembledVehicle = vehicle; + + part vehicle : Vehicle { + /* + * Note: An in item one context can become a part in an other. + */ + + part transmission: Transmission; + part engine: Engine; + + perform action providePower; + } + + } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/04-Functional Allocation/4a-Functional Allocation.sysml b/src/sysml/src/validation/04-Functional Allocation/4a-Functional Allocation.sysml new file mode 100644 index 0000000000000000000000000000000000000000..d9d32ac6f350a022eb9642e353848c656008526c --- /dev/null +++ b/src/sysml/src/validation/04-Functional Allocation/4a-Functional Allocation.sysml @@ -0,0 +1,110 @@ +package '4a-Functional Allocation' { + private import '2a-Parts Interconnection'::*; + private import '3a-Function-based Behavior-1'::*; + private import '3a-Function-based Behavior-1'::'provide power'::*; + + part vehicle1_c1_functional_allocation :> vehicle1_c1 { + // Note: The definitions of the port types in '2a-Parts Interconnection' do not include + // flow properties. + port :>> fuelCmdPort { + in fuelCmd: FuelCmd; + } + + perform 'provide power' { + doc + /* + * This allocates the action '3a-Function-based Behavior-1'::'provide power' as an enacted + * performance of 'vehicle_c1_functional_allocation'. + */ + + // This assigns the fuelCmdPort to provide the input to 'provide power'. + in fuelCmd = fuelCmdPort.fuelCmd; + } + + //* + // The above is semantically equivalent to: + + ref action 'provide power' (in fuelCmd = fuelCmdPort::fuelCmd) + :> '3a-Function-based Behavior'::'provide power', performedActions; + + // For a composite enacted performance within the vehicle, replace the above with: + + action 'provide power' (in fuelCmd = fuelCmdPort::fuelCmd) + :> '3a-Function-based Behavior'::'provide power'; + */ + + part :>> engine { + port :>> fuelCmdPort { + in fuelCmd: FuelCmd; + } + + perform 'provide power'.'generate torque' { + /* + * This allocates one of the sub-steps of 'provide power' to a sub-part of vehicle_c1. + */ + + in fuelCmd = fuelCmdPort.fuelCmd; + out engineTorque = drivePwrPort.engineTorque; + } + + port :>> drivePwrPort { + out engineTorque: Torque; + } + } + + part :>> transmission { + port :>> clutchPort { + in attribute engineTorque: Torque; + } + + perform 'provide power'.'amplify torque' { + in engineTorque = clutchPort.engineTorque; + out transmissionTorque = shaftPort_a.transmissionTorque; + } + + port :>> shaftPort_a { + out transmissionTorque: Torque; + } + } + + part :>> driveshaft { + port :>> shaftPort_b { + in transmissionTorque: Torque; + } + + perform 'provide power'.'transfer torque' { + in transmissionTorque = shaftPort_b.transmissionTorque; + out driveshaftTorque = shaftPort_c.driveshaftTorque; + } + + port :>> shaftPort_c { + out driveshaftTorque: Torque; + } + } + + part :>> rearAxleAssembly { + port :>> shaftPort_d { + in driveshaftTorque: Torque; + } + + perform 'provide power'.'distribute torque' { + in driveshaftTorque = shaftPort_d.driveshaftTorque; + out wheelTorque1 = rearAxle.leftHalfAxle.axleToWheelPort.wheelTorque; + out wheelTorque2 = rearAxle.rightHalfAxle.axleToWheelPort.wheelTorque; + } + + part :>> rearAxle { + part :>> leftHalfAxle { + port :>> axleToWheelPort { + out wheelTorque: Torque; + } + } + part :>> rightHalfAxle { + port :>> axleToWheelPort { + out wheelTorque: Torque; + } + } + } + } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/05-State-based Behavior/5-State-based Behavior-1.sysml b/src/sysml/src/validation/05-State-based Behavior/5-State-based Behavior-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f19d5e98cb89cb4434b9ed77a40868194717b46a --- /dev/null +++ b/src/sysml/src/validation/05-State-based Behavior/5-State-based Behavior-1.sysml @@ -0,0 +1,236 @@ +package '5-State-based Behavior-1' { + private import ScalarValues::*; + private import ISQ::*; + private import '3a-Function-based Behavior-1'::*; + + package Definitions { + part def VehicleA { + /* + * The following declare that 'VehicleA' performs a + * 'provide power' action and exhibits some 'vehicle states', + * without giving details about these behaviors. + */ + perform action 'provide power': 'Provide Power'; + exhibit state 'vehicle states': 'Vehicle States'; + } + + part def VehicleController { + exhibit state 'controller states': 'Controller States'; + } + + /* + * Black box specifications for state definitions may also have + * input and output parameters, like activities, though none + * are used here. + */ + + state def 'Vehicle States'; + state def 'Controller States'; + + action def 'Perform Self Test'; + action def 'Apply Parking Brake'; + action def 'Sense Temperature' { out temp: TemperatureValue; } + + attribute def 'Vehicle Start Signal'; + attribute def 'Vehicle On Signal'; + attribute def 'Vehicle Off Signal'; + + attribute def 'Start Signal'; + attribute def 'Off Signal'; + attribute def 'Over Temp'; + attribute def 'Return to Normal'; + } + + package Usages { + private import Definitions::*; + + /* + * These actions are used enabled in the state usage + * 'vehicle states', in addition to 'provide power'. + */ + + action 'perform self test': 'Perform Self Test'; + action 'apply parking brake': 'Apply Parking Brake'; + action 'sense temperature': 'Sense Temperature'; + + state 'vehicle states': 'Vehicle States' parallel { + /* + * This is a usage of the state definition 'Vehicle States'. + * Note that it depends specifically on on the part 'vehicle1_c1'. + */ + + ref vehicle : VehicleA; + + state 'operational states' { + doc + /* + * The state definition for this usage is implicit. + */ + + entry action initial { + doc + /* + * This empty entry action acts like a start pseudo state. + */ + } + + transition initial then off; + + state off; + + transition 'off-starting' + first off + accept 'Vehicle Start Signal' + if vehicle1_c1.'brake pedal depressed' + do send 'Start Signal'() to vehicle1_c1.vehicleController + then starting { + /* + * The transition definition for a transition usage is always implicit. + * "accept" marks the trigger, "if" the guard and "do" the effect. + * + * The notation "'Start Signal'()" constructs a specific instance of the + * 'Start Signal' attribute def to be sent to the 'vehicleController'. If the + * attribute def had properties, their values would be given as arguments + * inside the parhentheses. + */ + } + + state starting; + + transition 'starting-on' + first starting + accept 'Vehicle On Signal' + then on; + + state on { + /* + * A state may have a "entry" action that is performed on entry into + * the state, a "do" action that is performed while in the state + * and an "exit" action that is performed on exit from the state. + */ + + entry 'perform self test'; + do 'provide power'; + exit 'apply parking brake'; + } + + transition 'on-off' + first on + accept 'Vehicle Off Signal' + then off; + } + + state 'health states' { + /* + * 'health states' is concurrent with 'operational states', because the + * containing state usage is "parallel". + */ + + entry action initial; + do 'sense temperature' { out temp; + /* + * State-behavior actions may have input and output parameters. + */ + } + + transition initial then normal; + + state normal; + + transition 'normal-maintenance' + first normal + accept at vehicle1_c1.maintenanceTime + then maintenance; + + transition 'normal-degraded' + first normal + accept when 'sense temperature'.temp > vehicle1_c1.Tmax + do send 'Over Temp'() to vehicle1_c1.vehicleController + then degraded; + + state maintenance; + + transition 'maintenance-normal' + first maintenance + accept 'Return to Normal' + then normal; + + state degraded; + + transition 'degraded-normal' + first degraded + accept 'Return to Normal' + then normal; + } + } + + state 'controller states': 'Controller States' parallel { + state 'operational controller states' { + entry action initial; + + transition initial then off; + + state off; + + transition 'off-on' + first off + accept 'Start Signal' + then on; + + state on; + + transition 'on-off' + first on + accept 'Off Signal' + then off; + } + } + + part vehicle1_c1: VehicleA { + port fuelCmdPort { + in fuelCmd: FuelCmd; + } + + /* + * These attribute properties are used in the specification for + * 'vehicle states'. + */ + attribute 'brake pedal depressed': Boolean; + attribute maintenanceTime: Time::DateTime; + attribute Tmax: TemperatureValue; + + perform 'provide power' :>> VehicleA::'provide power' { + /* + * In the context of the 'vehicle1_c1' part, the 'provide power' action + * that is enabled in 'vehicle states' gets its input from the 'fuelCmdPort'. + */ + + in fuelCmd = fuelCmdPort.fuelCmd; + } + + exhibit 'vehicle states' :>> VehicleA::'vehicle states' { + /* + * This allocates the state usage 'vehicle states' as the detailed + * state-based behavior for 'vehicle1_c1' that fills in the generic + * declaration in 'VehicleA'. + */ + } + + //* + // The above is semantically equivalent to: + + ref state 'vehicle states' :> Usages::'vehicle states', exhibitedStates + :>> VehicleA::'vehicle states'; + + // For a composite state performance within the vehicle, replace the above with: + + state 'vehicle states' :>> Usages::'vehicle states', VehicleA::'vehicle states'; + */ + + part vehicleController: VehicleController { + exhibit 'controller states' :>> VehicleController::'controller states'; + } + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/05-State-based Behavior/5-State-based Behavior-1a.sysml b/src/sysml/src/validation/05-State-based Behavior/5-State-based Behavior-1a.sysml new file mode 100644 index 0000000000000000000000000000000000000000..9428665b976cb8586ee2438b6eb0efb74bf7de62 --- /dev/null +++ b/src/sysml/src/validation/05-State-based Behavior/5-State-based Behavior-1a.sysml @@ -0,0 +1,238 @@ +package '5-State-based Behavior-1a' { + private import ScalarValues::*; + private import ISQ::*; + + package Definitions { + part def VehicleA { + /* + * The following declare that 'VehicleA' performs a + * 'provide power' action and exhibits some 'vehicle states', + * without giving details about these behaviors. + */ + perform action 'provide power': 'Provide Power'; + exhibit state 'vehicle states': 'Vehicle States'; + } + + part def VehicleController { + exhibit state 'controller states': 'Controller States'; + } + + /* + * Black box specifications for state definitions may also have + * input and output parameters, like activities, though none + * are used here. + */ + + state def 'Vehicle States'; + state def 'Controller States'; + + action def 'Provide Power'; + action def 'Perform Self Test'; + action def 'Apply Parking Brake'; + action def 'Sense Temperature' { out temp: TemperatureValue; } + + attribute def FuelCmd; + + attribute def 'Vehicle Start Signal'; + attribute def 'Vehicle On Signal'; + attribute def 'Vehicle Off Signal'; + + attribute def 'Start Signal'; + attribute def 'Off Signal'; + attribute def 'Over Temp'; + attribute def 'Return to Normal'; + } + + package Usages { + private import Definitions::*; + + /* + * These actions are used enabled in the state usage + * 'vehicle states', in addition to 'provide power'. + */ + + action 'provide power': 'Provide Power'; + action 'perform self test': 'Perform Self Test'; + action 'apply parking brake': 'Apply Parking Brake'; + action 'sense temperature': 'Sense Temperature'; + + state 'vehicle states': 'Vehicle States' parallel { + /* + * This is a usage of the state definition 'Vehicle States'. + * Note that it depends specifically on on the part 'vehicle1_c1'. + */ + + state 'operational states' { + doc + /* + * The state definition for this usage is implicit. + */ + + entry action initial { + doc + /* + * This empty entry action acts like a start pseudo state. + */ + } + + transition initial then off; + + state off; + + transition 'off-starting' + first off + accept 'Vehicle Start Signal' + if vehicle1_c1.'brake pedal depressed' + do send 'Start Signal'() to vehicle1_c1.vehicleController + then starting { + /* + * The transition definition for a transition usage is always implicit. + * "accept" marks the trigger, "if" the guard and "do" the effect. + * + * The notation "'Start Signal'()" constructs a specific instance of the + * 'Start Signal' attribute def to be sent to the 'vehicleController'. If the + * attribute def had properties, their values would be given as arguments + * inside the parhentheses. + */ + } + + state starting; + + transition 'starting-on' + first starting + accept 'Vehicle On Signal' + then on; + + state on { + /* + * A state may have a "entry" action that is performed on entry into + * the state, a "do" action that is performed while in the state + * and an "exit" action that is performed on exit from the state. + */ + + entry 'perform self test'; + do 'provide power'; + exit 'apply parking brake'; + } + + transition 'on-off' + first on + accept 'Vehicle Off Signal' + then off; + } + + state 'health states' { + /* + * 'health states' is concurrent with 'operational states', because the + * containing state usage is "parallel". + */ + + entry action initial; + do 'sense temperature' { out temp; + /* + * State-behavior actions may have input and output parameters. + */ + } + + transition initial then normal; + + state normal; + + transition 'normal-maintenance' + first normal + accept at vehicle1_c1.maintenanceTime + then maintenance; + + transition 'normal-degraded' + first normal + accept when 'sense temperature'.temp > vehicle1_c1.Tmax + do send 'Over Temp'() to vehicle1_c1.vehicleController + then degraded; + + state maintenance; + + transition 'maintenance-normal' + first maintenance + accept 'Return to Normal' + then normal; + + state degraded; + + transition 'degraded-normal' + first degraded + accept 'Return to Normal' + then normal; + } + } + + state 'controller states': 'Controller States' parallel { + state 'operational controller states' { + entry action initial; + + transition initial then off; + + state off; + + transition 'off-on' + first off + accept 'Start Signal' + then on; + + state on; + + transition 'on-off' + first on + accept 'Off Signal' + then off; + } + } + + part vehicle1_c1: VehicleA { + port fuelCmdPort { + in fuelCmd: FuelCmd; + } + + /* + * These attribute properties are used in the specification for + * 'vehicle states'. + */ + attribute 'brake pedal depressed': Boolean; + attribute maintenanceTime: Time::DateTime; + attribute Tmax: TemperatureValue; + + perform 'provide power' :>> VehicleA::'provide power' { + doc + /* + * In the context of the 'vehicle1_c1' part, the 'provide power' action + * that is enabled in 'vehicle states' gets its input from the 'fuelCmdPort'. + */ + + in fuelCmd = fuelCmdPort.fuelCmd; + } + + exhibit 'vehicle states' :>> VehicleA::'vehicle states' { + /* + * This allocates the state usage 'vehicle states' as the detailed + * state-based behavior for 'vehicle1_c1' that fills in the generic + * declaration in 'VehicleA'. + */ + } + + //* + // The above is semantically equivalent to: + + ref state 'vehicle states' :> Usages::'vehicle states', exhibitedStates + :>> VehicleA::'vehicle states'; + + // For a composite state performance within the vehicle, replace the above with: + + state 'vehicle states' :>> Usages::'vehicle states', VehicleA::'vehicle states'; + */ + + part vehicleController: VehicleController { + exhibit 'controller states' :>> VehicleController::'controller states'; + } + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/05-State-based Behavior/5-State-based Behavior-2.sysml b/src/sysml/src/validation/05-State-based Behavior/5-State-based Behavior-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..b975025f5630aa13d46c0ff8bbcce4d316d7f839 --- /dev/null +++ b/src/sysml/src/validation/05-State-based Behavior/5-State-based Behavior-2.sysml @@ -0,0 +1,128 @@ +package '5-State-based Behavior-2' { + private import ScalarValues::*; + private import ISQ::*; + private import '3a-Function-based Behavior-1'::*; + + package Definitions { + part def VehicleA { + perform action 'provide power': 'Provide Power'; + exhibit state 'vehicle states': 'Vehicle States'; + } + + part def VehicleController { + exhibit state 'controller states': 'Controller States'; + } + + state def 'Vehicle States'; + state def 'Controller States'; + + action def 'Perform Self Test'; + action def 'Apply Parking Brake'; + action def 'Sense Temperature' { out temp: TemperatureValue; } + + attribute def 'Vehicle Start Signal'; + attribute def 'Vehicle On Signal'; + attribute def 'Vehicle Off Signal'; + + attribute def 'Start Signal'; + attribute def 'Off Signal'; + attribute def 'Over Temp'; + attribute def 'Return to Normal'; + } + + package Usages { + private import Definitions::*; + + action 'perform self test': 'Perform Self Test'; + action 'apply parking brake': 'Apply Parking Brake'; + action 'sense temperature': 'Sense Temperature'; + + state 'vehicle states': 'Vehicle States' parallel { + + state 'operational states' { + entry; then off; + + /* + * The following uses a shorthand for a transition whose source + * is the immediately preceding state. + */ + state off; + accept 'Vehicle Start Signal' + if vehicle1_c1.'brake pedal depressed' + do send 'Start Signal'() to vehicle1_c1.vehicleController + then starting; + + state starting; + accept 'Vehicle On Signal' + then on; + + state on { + entry 'perform self test'; + do 'provide power'; + exit 'apply parking brake'; + } + accept 'Vehicle Off Signal' + then off; + } + + state 'health states' { + entry; then normal; + do 'sense temperature' { out temp; } + + /* + * The shorthand can be used for multiple transitions after + * a single state. + */ + state normal; + accept at vehicle1_c1.maintenanceTime + then maintenance; + accept when 'sense temperature'.temp > vehicle1_c1.Tmax + do send 'Over Temp'() to vehicle1_c1.vehicleController + then degraded; + + state maintenance; + accept 'Return to Normal' + then normal; + + state degraded; + accept 'Return to Normal' + then normal; + } + } + + state 'controller states': 'Controller States' parallel { + state 'operational controller states' { + entry; then off; + + state off; + accept 'Start Signal' + then on; + + state on; + accept 'Off Signal' + then off; + } + } + + part vehicle1_c1: VehicleA { + port fuelCmdPort { + in fuelCmd: FuelCmd; + } + + attribute 'brake pedal depressed': Boolean; + attribute maintenanceTime: Time::DateTime; + attribute Tmax: TemperatureValue; + + perform 'provide power' :>> VehicleA::'provide power' { + in fuelCmd = fuelCmdPort.fuelCmd; + } + + exhibit 'vehicle states' :>> VehicleA::'vehicle states'; + + part vehicleController: VehicleController { + exhibit 'controller states' :>> VehicleController::'controller states'; + } + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/06-Individual and Snapshots/6-Individual and Snapshots.sysml b/src/sysml/src/validation/06-Individual and Snapshots/6-Individual and Snapshots.sysml new file mode 100644 index 0000000000000000000000000000000000000000..2a4eadbd8af2b4c391c443e1978c0e4b742b8cd4 --- /dev/null +++ b/src/sysml/src/validation/06-Individual and Snapshots/6-Individual and Snapshots.sysml @@ -0,0 +1,167 @@ +package '6-Individual and Snapshots' { + private import ScalarValues::Real; + private import Time::DateTime; + private import ISQ::*; + + package 'Part Definitions' { + part def 'Temporal-Spatial Reference' { + attribute referenceTime : DateTime; + attribute referenceCoordinateSystem; + } + + /* + * Note that space and time coordinatization have not + * been fully specified yet. + */ + + part def VehicleRoadContext { + attribute t : TimeValue; + } + + part def VehicleA { + attribute mass : MassValue; + attribute position : Real; + attribute velocity : Real; + attribute acceleration : Real; + exhibit state vehicleStates { + entry; then on; + state on; + then off; + state off; + } + } + + part def Road { + attribute angle : Real; + attribute surfaceFriction : Real; + } + } + + package 'Individual Definitions' { + private import 'Part Definitions'::*; + + /* + * An individual definition restricts the instances of a part def to + * those that are portions of the same life ("identity"). + */ + + individual def 'Temporal-Spatial Reference_ID1' :> 'Temporal-Spatial Reference'; + individual def VehicleRoadContext_ID1 :> VehicleRoadContext; + individual def VehicleA_ID1 :> VehicleA; + individual def Road_ID1 :> Road; + + } + + package Values { + attribute t0 : TimeValue; + attribute t1 : TimeValue; + attribute tn : TimeValue; + + attribute m : MassValue; + + attribute p0 : Real; + attribute p1 : Real; + attribute pn : Real; + + attribute v0 : Real; + attribute v1 : Real; + attribute vn : Real; + + attribute a0 : Real; + attribute a1 : Real; + attribute an : Real; + + attribute theta0 : Real; + attribute theta1 : Real; + attribute thetan : Real; + + attribute sf0 : Real; + attribute sf1 : Real; + attribute sfn : Real; + } + + package 'Individuals and Snapshots' { + private import 'Individual Definitions'::*; + private import Values::*; + + individual reference : 'Temporal-Spatial Reference_ID1' { + /* + * An individual usage must be typed by an individual definition, + * representing the condition of that individual during some or all + * of its life. + */ + + snapshot context_t0 : VehicleRoadContext_ID1 { + :>> t = t0 { + /* + * This is a concise notation for showing the redefinition + * of a attribute property. + */ + } + + snapshot vehicle_ID1_t0 : VehicleA_ID1 { + /* + * A snapshot is a kind of individual usage restricted to + * a single instant of time. + */ + + :>> mass = m; + :>> position = p0; + :>> velocity = v0; + :>> acceleration = a0; + + exhibit vehicleStates.on { + /* + * This asserts that the snapshot exhibits the referenced + * state, which means that the vehicle must me in the state + * at the time of the snapshot. + */ + } + } + + snapshot road_ID1_t0 : Road_ID1 { + :>> angle = theta0; + :>> surfaceFriction = sf0; + } + } + + snapshot context_t1 : VehicleRoadContext_ID1 { + :>> t = t1; + + snapshot vehicle_ID1_t1 : VehicleA_ID1 { + :>> mass = m; + :>> position = p1; + :>> velocity = v1; + :>> acceleration = a1; + + exhibit vehicleStates.on; + } + + snapshot road_ID1_t1 : Road_ID1 { + :>> angle = theta1; + :>> surfaceFriction = sf1; + } + } + + // ... + + snapshot context_tn : VehicleRoadContext_ID1 { + :>> t = tn; + + snapshot vehicle_ID1_tn : VehicleA_ID1 { + :>> mass = m; + :>> position = pn; + :>> velocity = vn; + :>> acceleration = an; + + exhibit vehicleStates.off; + } + + snapshot road_ID1_tn : Road_ID1 { + :>> angle = theta1; + :>> surfaceFriction = sfn; + } + } + } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/07-Variant Configuration/7a-Variant Configuration - General Concept.sysml b/src/sysml/src/validation/07-Variant Configuration/7a-Variant Configuration - General Concept.sysml new file mode 100644 index 0000000000000000000000000000000000000000..cf8b9264ffc5c34c3dfd8c7596261154352acd32 --- /dev/null +++ b/src/sysml/src/validation/07-Variant Configuration/7a-Variant Configuration - General Concept.sysml @@ -0,0 +1,53 @@ +package '7a-Variant Configuration - General Concept' { + + part def Vehicle; + + part part1; + part part2; + part part3; + part part4; + part part5; + part part6; + + abstract part anyVehicleConfig : Vehicle { + + variation part subsystemA { + variant part subsystem1 { + part :>> part1; + part :>> part2; + } + variant part subsystem2 { + part :>> part2; + part :>> part3; + } + } + + variation part subsystemB { + variant part subsystem3 { + part :>> part4; + part :>> part5; + } + variant part subsystem4 { + part :>> part5; + part :>> part6; + } + } + + assert constraint { + subsystemA != subsystemA.subsystem2 | + subsystemB == subsystemB::subsystem3 + } + + } + + part vehicleConfigA :> anyVehicleConfig { + part :>> subsystemA = subsystemA.subsystem1; + part :>> subsystemB = subsystemB::subsystem3; + } + + part VehicleConfigB :> anyVehicleConfig { + part :>> subsystemA = subsystemA.subsystem2; + part :>> subsystemB = subsystemB.subsystem3; + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/07-Variant Configuration/7a1-Variant Configuration - General Concept-a.sysml b/src/sysml/src/validation/07-Variant Configuration/7a1-Variant Configuration - General Concept-a.sysml new file mode 100644 index 0000000000000000000000000000000000000000..e5147e25138ea2b3b2911f7f924c843942bffc9a --- /dev/null +++ b/src/sysml/src/validation/07-Variant Configuration/7a1-Variant Configuration - General Concept-a.sysml @@ -0,0 +1,79 @@ +package '7a1-Variant Configuration - General Concept-a' { + + action doX; + action doY; + + part part1; + part part2; + part part3 { + port p1; + } + part part4; + part part5 { + port p2; + variation perform action doXorY { + variant perform doX; + variant perform doY; + } + } + part part6; + + abstract part def SubsystemA { + abstract part :>> part3[0..1]; + } + + abstract part def SubsystemB { + abstract part :>> part5[1]; + } + + part anyVehicleConfig { + + variation part subsystemA : SubsystemA { + variant part subsystem1 : SubsystemA { + part :>> part1[1]; + part :>> part2[1]; + } + variant part subsystem2 : SubsystemA { + part :>> part2[1]; + part :>> part3[1]; + } + } + + variation part subsystemB : SubsystemB { + variant part subsystem3 : SubsystemB { + part :>> part4[1]; + part :>> part5[1]; + } + variant part subsystem4 : SubsystemB { + part :>> part5[1]; + part :>> part6[1]; + } + } + + connect subsystemA.part3.p1[0..1] to subsystemB.part5.p2[1]; + + assert constraint { + subsystemA != subsystemA.subsystem2 | + subsystemB == subsystemB.subsystem3 + } + + } + + part vehicleConfigA :> anyVehicleConfig { + part :>> subsystemA = subsystemA.subsystem1; + part :>> subsystemB = subsystemB.subsystem3 { + part :>> part5 { + perform action :>> doXorY = doX; + } + } + } + + part VehicleConfigB :> anyVehicleConfig { + part :>> subsystemA = subsystemA.subsystem2; + part :>> subsystemB = subsystemB.subsystem4 { + part :>> part5 { + perform action :>> doXorY = doY; + } + } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/07-Variant Configuration/7b-Variant Configurations.sysml b/src/sysml/src/validation/07-Variant Configuration/7b-Variant Configurations.sysml new file mode 100644 index 0000000000000000000000000000000000000000..3f4f94304b6fe2fca75bfd4acff596aeb88859b1 --- /dev/null +++ b/src/sysml/src/validation/07-Variant Configuration/7b-Variant Configurations.sysml @@ -0,0 +1,140 @@ +package '7b-Variant Configurations' { + private import RequirementsModel::*; + private import DesignModel::*; + private import VariantDefinitions::*; + private import ControlFunctions::forAll; + + package RequirementsModel { + requirement def EnginePerformanceRequirement; + requirement highPerformanceRequirement : EnginePerformanceRequirement; + requirement normalPerformanceRequirement : EnginePerformanceRequirement; + } + + package DesignModel { + part def Vehicle; + part def Engine; + part def Transmission; + part def Clutch; + part def Driveshaft; + part def RearAxleAssembly; + part def Wheel; + + port def FuelCmdPort; + port def ClutchPort; + port def ShaftPort_b; + port def ShaftPort_c; + port def ShaftPort_d; + port def VehicleToRoadPort; + port def WheelToRoadPort; + + part vehicle : Vehicle { + port fuelCmdPort; + + bind fuelCmdPort = engine.fuelCmdPort; + + part engine : Engine[1] { + port fuelCmdPort : FuelCmdPort; + } + + part transmission : Transmission[1] { + part clutch: Clutch[1] { + port clutchPort : ClutchPort; + } + } + + part driveshaft : Driveshaft[1] { + port shaftPort_b : ShaftPort_b; + port shaftPort_c : ShaftPort_c; + } + + part rearAxleAssembly : RearAxleAssembly { + part rearWheels : Wheel[2] { + port wheelToRoadPort : WheelToRoadPort; + } + } + + port vehicleToRoadPort : VehicleToRoadPort { + port wheelToRoadPort : WheelToRoadPort[2]; + } + } + } + + package VariantDefinitions { + part def '4CylEngine' :> Engine; + part def '6CylEngine' :> Engine; + + part def ManualTransmission :> Transmission; + part def AutomaticTransmission :> Transmission; + + part def ManualClutch :> Clutch; + part def AutomaticClutch :> Clutch; + + port def ManualClutchPort :> ClutchPort; + port def AutomaticClutchPort :> ClutchPort; + + part def NarrowRimWheel :> Wheel; + part def WideRimWheel :> Wheel; + } + + package VariabilityModel { + part anyVehicleConfig :> vehicle { + + variation requirement engineRqtChoice : EnginePerformanceRequirement { + variant highPerformanceRequirement; + variant normalPerformanceRequirement; + } + + variation part engineChoice :>> engine { + variant part '4cylEngine' : '4CylEngine'; + variant part '6cylEngine' : '6CylEngine'; + } + + satisfy engineRqtChoice by engineChoice; + + assert constraint 'engine choice constraint' { + if engineRqtChoice == engineRqtChoice::highPerformanceRequirement? + engineChoice == engineChoice::'6cylEngine' + else + engineChoice == engineChoice::'4cylEngine' + } + + variation part transmissionChoice :>> transmission { + variant part manualTransmission : ManualTransmission { + part :>> clutch : ManualClutch { + port :>> clutchPort : ManualClutchPort; + } + } + variant part automaticTransmission : AutomaticTransmission { + part :>> clutch : AutomaticClutch { + port :>> clutchPort : AutomaticClutchPort; + } + } + } + + assert constraint 'engine-transmission selection constraint' { + (engineChoice == engineChoice::'4cylEngine' and transmissionChoice == transmissionChoice::manualTransmission) xor + (engineChoice == engineChoice::'6cylEngine' and transmissionChoice == transmissionChoice::automaticTransmission) + } + + part :>> rearAxleAssembly { + variation part rearWheelChoice :>> rearWheels { + variant part narrowRimWheel : NarrowRimWheel; + variant part wideRimWheel : WideRimWheel; + } + } + + assert constraint 'engine-wheel selection constraint' { + (engineChoice == engineChoice::'4cylEngine' and + rearAxleAssembly.rearWheelChoice->forAll {in ref w; w == rearAxleAssembly::rearWheelChoice::narrowRimWheel}) xor + (engineChoice == engineChoice::'6cylEngine' and + rearAxleAssembly.rearWheelChoice->forAll {in ref w; w == rearAxleAssembly::rearWheelChoice::wideRimWheel}) + } + + } + + variation part vehicleChoice :> anyVehicleConfig { + variant part vehicle_c1; + variant part vehicle_c2; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/08-Requirements/8-Requirements.sysml b/src/sysml/src/validation/08-Requirements/8-Requirements.sysml new file mode 100644 index 0000000000000000000000000000000000000000..36964242a4be558e62f0a4c33cad5f130869ac34 --- /dev/null +++ b/src/sysml/src/validation/08-Requirements/8-Requirements.sysml @@ -0,0 +1,205 @@ +package '8-Requirements' { + private import ScalarValues::Real; + private import ISQ::*; + private import SI::*; + public import 'Vehicle Usages'::*; + public import 'Vehicle Requirements'::*; + + package 'Vehicle Definitions' { + part def Vehicle { + attribute mass: MassValue; + attribute fuelLevel: Real; + attribute fuelTankCapacity: Real; + } + + part def Engine { + port drivePwrPort: DrivePwrPort; + perform action 'generate torque': 'Generate Torque'; + } + + part def Transmission { + port clutchPort: ClutchPort; + } + + port def DrivePwrPort; + port def ClutchPort; + + interface def EngineToTransmissionInterface { + end drivePwrPort: DrivePwrPort; + end clutchPort: ClutchPort; + } + + action def 'Generate Torque'; + } + + package 'Vehicle Usages' { + public import 'Vehicle Definitions'::*; + + action 'provide power' { + action 'generate torque' { /* ... */ } + //... + } + + part vehicle1_c1: Vehicle { + attribute :>> mass = 2000 [kg]; + perform 'provide power'; + + part engine_v1: Engine { + port :>> drivePwrPort; + perform 'provide power'.'generate torque' :>> 'generate torque'; + } + + part transmission: Transmission { + port :>> clutchPort; + } + + interface engineToTransmission: EngineToTransmissionInterface + connect engine_v1.drivePwrPort to transmission.clutchPort; + } + + part vehicle1_c2: Vehicle { + attribute :>> mass = 2500 [kg]; + } + } + + package 'Vehicle Requirements' { + public import 'Vehicle Definitions'::*; + + requirement def <'1'> MassLimitationRequirement { + /* + * The optional requirement ID of this requirement ('1') is given after the keyword "id" (using name syntax). + * Every requirement is parameterized by a "subject". The "subject" of this requirement is implicitly "Anything". + */ + + // The requirement text is given by the documentation in the requirement def body. + doc /* The actual mass shall be less than or equal to the required mass. */ + + attribute massActual: MassValue; + attribute massReqd: MassValue; + + require constraint { + /* + * A constraint can be used to formalize a requirement. + */ + massActual <= massReqd + } + } + + requirement def <'2'> ReliabilityRequirement; + + requirement <'1.1'> vehicleMass1: MassLimitationRequirement { + doc /* The vehicle mass shall be less than or equal to 2000 kg when the fuel tank is full. */ + + subject vehicle : Vehicle { + /* + * The subject of this requirement is redefined to be a "Vehicle". + */ + } + + attribute :>> massActual: MassValue = vehicle.mass { + /* + * This redefinition binds the vehicle mass to the actual mass. + */ + } + + attribute :>> massReqd = 2000 [kg] { + /* + * This redefinition sets the required mass to 2000 kg. + */ + } + + assume constraint fuelConstraint { + /* + * A constraint can also be used to specify an assumption. + */ + + doc /* full fuel tank */ + vehicle.fuelLevel >= vehicle.fuelTankCapacity + } + } + + requirement <'2.1'> vehicleMass2: MassLimitationRequirement { + doc /* The vehicle mass shall be less than or equal to 2500 kg when the fuel tank is empty. */ + + subject vehicle : Vehicle; + + attribute :>> massActual: MassValue = vehicle.mass; + attribute :>> massReqd = 2500 [kg]; + + assume constraint fuelConstraint { + doc /* empty fuel tank */ + vehicle.fuelLevel == 0.0 + } + } + + requirement <'2.2'> vehicleReliability2: ReliabilityRequirement { + subject vehicle : Vehicle; + } + + requirement <'3.1'> drivePowerInterface { + doc /* The engine shall transfer its generated torque to the transmission via the clutch interface. */ + subject drivePwrPort: DrivePwrPort; + } + + requirement <'3.2'> torqueGeneration { + doc /* The engine shall generate torque as a function of RPM as shown in Table 1. */ + subject generateTorque: 'Generate Torque'; + } + + } + + part 'vehicle1_c1 Specification Context' { + private import 'vehicle1-c1 Specification'::*; + private import 'engine-v1 Specification'::*; + + requirement 'vehicle1-c1 Specification' { + doc + /* + * This models a "requirement group" as a requirement that references other requirements. + */ + + subject vehicle : Vehicle; + requirement references vehicleMass1 { + /* + * This is a reference to a requirement defined outside the group. + * By default, the subject of the requirement is bound to that of the group. + */ + } + // ... + } + + requirement 'engine-v1 Specification' { + subject engine : Engine; + /* + * Here the subjects of the referenced requirements are defined to be specific properties of the + * subject of the group. + */ + require torqueGeneration { + in :>> generateTorque = engine.'generate torque'; + } + require drivePowerInterface { + in :>> drivePwrPort = engine.drivePwrPort; + } + } + + satisfy 'vehicle1-c1 Specification' by vehicle1_c1 { + /* + * This asserts that if the assumptions of 'vehicle1-c1 Specification' are true with 'vehicle_c1' as + * the subject, then the required constraints are also true. + */ + } + satisfy 'engine-v1 Specification' by vehicle1_c1.engine_v1; + } + + part 'vehicle1_c2 Specification Context' { + private import 'vehicle1-c2 Specification'::*; + + requirement 'vehicle1-c2 Specification' { + subject vehicle : Vehicle; + require vehicleMass2; + require vehicleReliability2; + } + + satisfy 'vehicle1-c2 Specification' by vehicle1_c2; + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/09-Verification/9-Verification-simplified.sysml b/src/sysml/src/validation/09-Verification/9-Verification-simplified.sysml new file mode 100644 index 0000000000000000000000000000000000000000..3556207d44fc0856a3218395d9c1348ffe9d8ee3 --- /dev/null +++ b/src/sysml/src/validation/09-Verification/9-Verification-simplified.sysml @@ -0,0 +1,115 @@ +package '9-Verification-simplified' { + private import VerificationCases::*; + private import Definitions::*; + + package Definitions { + + requirement def <'2'> MassRequirement { + attribute massActual :> ISQ::mass; + attribute massReqd :> ISQ::mass; + + doc /* The actual mass shall be less than or equal to the required mass limit. */ + + require constraint { massActual <= massReqd } + } + + part def Vehicle { + attribute mass :> ISQ::mass; + } + + part def MassVerificationSystem; + part def Scale; + part def TestOperator; + + individual def TestVehicle1 :> Vehicle; + individual def TestVehicle2 :> Vehicle; + + individual def TestSystem :> MassVerificationSystem; + + verification def MassTest { + objective massVerificationObjective { + verify requirement massRequirement : MassRequirement; + } + } + + } + + package Usages { + + requirement <'2.1'> vehicleMassRequirement : MassRequirement { + subject vehicle : Vehicle; + doc /* The vehicle mass shall be less than or equal to 2500 kg. */ + + :>> massActual = vehicle.mass; + :>> massReqd = 2500 [SI::kg]; + } + + part vehicle1_c2 : Vehicle { + // ... + } + + verification vehicleMassTest : MassTest { + subject testVehicle : Vehicle; + objective vehicleMassVerificationObjective { + // The subject of the verify is automatically bound to 'testVehicle' here. + verify vehicleMassRequirement :>> massRequirement; + } + + action collectData { + in part testVehicle : Vehicle = vehicleMassTest.testVehicle; + out massMeasured :> ISQ::mass; + } + + action processData { + in massMeasured :> ISQ::mass = collectData.massMeasured; + out massProcessed :> ISQ::mass; + } + + action evaluateData { + in massProcessed :> ISQ::mass = processData.massProcessed; + out verdict : VerdictKind = + // Check that 'testVehicle' statisfies 'vehicleMassRequirement' if its mass equals 'massProcessed'. + PassIf(vehicleMassRequirement(vehicle = testVehicle(mass = massProcessed))); + } + + return verdict : VerdictKind = evaluateData.verdict; + } + + part massVerificationSystem : MassVerificationSystem { + perform vehicleMassTest { + in part :>> testVehicle = vehicleUnderTest; + } + + ref part vehicleUnderTest : Vehicle; + + part testOperator : TestOperator; + + part scale : Scale { + perform vehicleMassTest.collectData { + in part :>> testVehicle; + + // In reality, this would be some more involved process. + measurement = testVehicle.mass; + + out :>> massMeasured = measurement; + } + } + } + + individual testSystem : TestSystem :> massVerificationSystem { + timeslice test1 { + ref individual :>> vehicleUnderTest : TestVehicle1 :> vehicle1_c2 { + :>> mass = 2500 [SI::kg]; + } + } + + then timeslice test2 { + ref individual :>> vehicleUnderTest : TestVehicle2 :> vehicle1_c2 { + :>> mass = 2500 [SI::kg]; + } + } + } + + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/10-Analysis and Trades/10a-Analysis.sysml b/src/sysml/src/validation/10-Analysis and Trades/10a-Analysis.sysml new file mode 100644 index 0000000000000000000000000000000000000000..7d50f61b01e1b346ea4d27fdf9f8741f32f5c31e --- /dev/null +++ b/src/sysml/src/validation/10-Analysis and Trades/10a-Analysis.sysml @@ -0,0 +1,74 @@ +package '10a-Analysis' { + private import ISQ::*; + private import SI::*; + private import NumericalFunctions::*; + + package VehicleDesignModel { + part def Vehicle { + mass : MassValue; + } + + part vehicle { + :>> mass : MassValue = sum(( + vehicle.engine.mass, + vehicle.transmission.mass, + vehicle.frontAxleAssembly.mass, + vehicle.rearAxleAssembly.mass + )); + + part engine { + mass : MassValue; + } + + part transmission { + mass : MassValue; + } + + part frontAxleAssembly { + mass : MassValue; + } + + part rearAxleAssembly { + mass : MassValue; + } + } + } + + package VehicleAnalysisModel { + private import VehicleDesignModel::Vehicle; + + requirement def MassAnalysisObjective { + subject mass : MassValue; + doc /* ... */ + } + + analysis def MassAnalysisCase { + subject vehicle : Vehicle; + objective : MassAnalysisObjective; + + // Result + vehicle.mass + } + + analysis def AnalysisPlan { + subject vehicle : Vehicle; + objective { + doc /* ... */ + } + + analysis massAnalysisCase : MassAnalysisCase { + /* + * By default, the subject of a nested analysis case bound to that + * of its containing analysis case or analysis case definition. + */ + return mass; + } + } + + part massAnalysisContext { + analysis analysisPlan : AnalysisPlan { + subject vehicle = VehicleDesignModel::vehicle; + } + } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/10-Analysis and Trades/10b-Trade-off Among Alternative Configurations.sysml b/src/sysml/src/validation/10-Analysis and Trades/10b-Trade-off Among Alternative Configurations.sysml new file mode 100644 index 0000000000000000000000000000000000000000..a66a61d3b517afbcb9f797e133219f0cced1bcef --- /dev/null +++ b/src/sysml/src/validation/10-Analysis and Trades/10b-Trade-off Among Alternative Configurations.sysml @@ -0,0 +1,97 @@ +package '10b-Trade-off Among Alternative Configurations' { + private import ScalarValues::Real; + private import TradeStudies::*; + private import Definitions::*; + private import Usages::*; + + package Definitions { + + part def Vehicle; + + part def Engine { + power : ISQ::PowerValue; + mass : ISQ::MassValue; + efficiency : Real; + reliability : Real; + cost : Real; + } + + part def Piston; + part def Cylinder; + part def ConnectingRod; + part def CrankShaft; + + part def '4CylCrankShaft' :> CrankShaft; + part def '6CylCrankShaft' :> CrankShaft; + + } + + package Usages { + + part engine : Engine { + part cyl[*] : Cylinder { + part p[1] : Piston; + part rod[1] : ConnectingRod; + } + + part cs : CrankShaft; + } + + variation part engineChoice :> engine { + variant part '4cylEngine' { + part :>> cyl[4]; + part :>> cs : '4CylCrankShaft'; + } + + variant part '6cylEngine' { + part :>> cyl[6]; + part :>> cs : '6CylCrankShaft'; + } + } + + part vehicle : Vehicle { + part engine[1] :> engineChoice = engineChoice::'6cylEngine' { + assert constraint engineSelectionRational { + doc /* Selected the best engine based on the 'engineTradeStudy'. */ + engine == Analysis::engineTradeStudy.selectedAlternative + } + } + + } + } + + package Analysis { + + calc def EngineEvaluation { + doc /* Evaluation function with criteria power, mass, efficency and cost. */ + in power : ISQ::PowerValue; + in mass : ISQ::MassValue; + in efficiency : Real; + in cost : Real; + return evaluation : Real; + // Compute evaluation... + } + + analysis engineTradeStudy : TradeStudy { + subject : Engine[1..*] = all engineChoice; + objective : MaximizeObjective; + + calc :>> evaluationFunction { + in part anEngine :>> alternative : Engine; + + calc powerRollup { in engine = anEngine; return power:>ISQ::power; } + calc massRollup { in engine = anEngine; return mass:>ISQ::mass; } + calc efficiencyRollup { in engine = anEngine; return efficiency: Real; } + calc costRollup { in engine = anEngine; return cost: Real; } + + return :>> result : Real = EngineEvaluation( + powerRollup.power, massRollup.mass, efficiencyRollup.efficiency, costRollup.cost + ); + } + + return part :>> selectedAlternative : Engine; + } + + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/10-Analysis and Trades/10c-Fuel Economy Analysis.sysml b/src/sysml/src/validation/10-Analysis and Trades/10c-Fuel Economy Analysis.sysml new file mode 100644 index 0000000000000000000000000000000000000000..a60b862988f0524527cab83640c4491dd34fd712 --- /dev/null +++ b/src/sysml/src/validation/10-Analysis and Trades/10c-Fuel Economy Analysis.sysml @@ -0,0 +1,168 @@ +package '10c-Fuel Economy Analysis' { + private import ScalarValues::*; + private import Quantities::*; + private import MeasurementReferences::*; + private import ISQ::*; + private import USCustomaryUnits::*; + + attribute distancePerVolume : ScalarQuantityValue = length / volume; + attribute gallon : MeasurementUnit = 231.0 * 'in'^3; + + package FuelEconomyRequirementsModel { + + requirement def FuelEconomyRequirement { + attribute actualFuelEconomy :> distancePerVolume; + attribute requiredFuelEconomy :> distancePerVolume; + + require constraint { actualFuelEconomy >= requiredFuelEconomy } + } + + requirement cityFuelEconomyRequirement : FuelEconomyRequirement { + :>> requiredFuelEconomy = 25 [mi/gallon]; + } + + requirement highwayFuelEconomyRequirement : FuelEconomyRequirement { + :>> requiredFuelEconomy = 30 [mi/gallon]; + } + + } + + package VehicleDesignModel { + + part def Vehicle { + attribute fuelEconomy_city :> distancePerVolume; + attribute fuelEconomy_highway :> distancePerVolume; + + attribute cargoWeight : MassValue; + } + + part def Engine; + part def Transmission; + + part vehicle1_c1 : Vehicle { + part engine : Engine; + part transmission : Transmission { + exhibit state transmissionState { + entry; then '1stGear'; + state '1stGear'; + then '2ndGear'; + state '2ndGear'; + then '3rdGear'; + state '3rdGear'; + then '4thGear'; + state '4thGear'; + } + } + } + + } + + package FuelEconomyAnalysisModel { + private import VehicleDesignModel::*; + private import FuelEconomyRequirementsModel::*; + + attribute def ScenarioState { + position : LengthValue; + velocity : SpeedValue; + acceleration : AccelerationValue; + inclineAngle : AngularMeasureValue; + } + + abstract calc def NominalScenario { + in t : TimeValue; + return : ScenarioState; + } + calc cityScenario : NominalScenario; + calc highwayScenario : NominalScenario; + + analysis def FuelEconomyAnalysis { + subject vehicle : Vehicle; + in calc scenario : NominalScenario; + in requirement fuelEconomyRequirement : FuelEconomyRequirement; + return calculatedFuelEconomy : ScalarQuantityValue; + + objective fuelEconomyAnalysisObjective { + doc /* + * The objective of this analysis is to determine whether the + * current vehicle design configuration can satisfy the fuel + * economy requirement. + */ + + assume constraint { + doc /* wheelDiameter == 33 inches + * drive train efficiency == 0.4 + */ + } + + require fuelEconomyRequirement { + :>> actualFuelEconomy = calculatedFuelEconomy; + } + } + + action dynamicsAnalysis { + /* + * Solve for the required engine power as a function of time + * to support the nominal scenarios. + * + * Note: Vehicle force = power/speed + * Note: EngineRPM * EngineGearRatio/WheelRPM = constant + */ + } + + action fuelConsumptionAnalysis { + /* + * Solve the engine equations to determine how much fuel is + * consumed. The engine RPM is a function of the speed of the + * vehicle and the gear state. + */ + } + } + + requirement vehicleFuelEconomyRequirementsGroup { + subject vehicle : Vehicle; + requirement vehicleFuelEconomyRequirement_city :> cityFuelEconomyRequirement { + doc /* The vehicle shall provide a fuel economy that is greater than or equal to + * 25 miles per gallon for the nominal city driving scenarios. + */ + + :>> actualFuelEconomy = vehicle.fuelEconomy_city; + + assume constraint { vehicle.cargoWeight == 1000 [lb] } + } + + requirement vehicleFuelEconomyRequirement_highway :> highwayFuelEconomyRequirement { + doc /* The vehicle shall provide a fuel economy that is greater than or equal to + * 30 miles per gallon for the nominal highway driving scenarios. + */ + + :>> actualFuelEconomy = vehicle.fuelEconomy_highway; + + assume constraint { vehicle.cargoWeight == 1000 [lb] } + } + + } + + part analysisContext { + + analysis cityFuelEconomyAnalysis : FuelEconomyAnalysis { + subject vehicle = vehicle1_c1; + in calc scenario = cityScenario; + in requirement fuelEconomyRequirement = cityFuelEconomyRequirement; + } + + analysis highwayFuelEconomyAnalysis : FuelEconomyAnalysis { + subject vehicle = vehicle1_c1; + in calc scenario = highwayScenario; + in requirement fuelEconomyRequirement = highwayFuelEconomyRequirement; + } + + part vehicle1_c1_analysized :> vehicle1_c1 { + :>> fuelEconomy_city = cityFuelEconomyAnalysis.calculatedFuelEconomy; + :>> fuelEconomy_highway = highwayFuelEconomyAnalysis.calculatedFuelEconomy; + } + + satisfy vehicleFuelEconomyRequirementsGroup by vehicle1_c1_analysized; + } + + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/10-Analysis and Trades/10d-Dynamics Analysis.sysml b/src/sysml/src/validation/10-Analysis and Trades/10d-Dynamics Analysis.sysml new file mode 100644 index 0000000000000000000000000000000000000000..ab531dcc462b2ab06338606bb5656e9fe6abf45d --- /dev/null +++ b/src/sysml/src/validation/10-Analysis and Trades/10d-Dynamics Analysis.sysml @@ -0,0 +1,80 @@ +package '10d-Dynamics Analysis' { + private import ISQ::*; + + package VehicleModel { + + part def Vehicle { + attribute mass :> ISQ::mass; + } + + } + + package DynamicsModel { + + calc def Acceleration { + in p : PowerValue; + in m : MassValue; + in v : SpeedValue; + return : AccelerationValue = p / (m * v); + } + + calc def Velocity { + in v0 : SpeedValue; + in a : AccelerationValue; + in dt : TimeValue; + return : SpeedValue = v0 + a * dt; + } + + calc def Position { + in x0 : LengthValue; + in v : SpeedValue; + in dt : TimeValue; + return : LengthValue = x0 + v * dt; + } + + action def StraightLineDynamics { + in power : PowerValue; + in mass : MassValue; + in delta_t : TimeValue; + in x_in : LengthValue; + in v_in : SpeedValue; + out x_out : LengthValue = Position(x_in, v_in, delta_t); + out v_out : SpeedValue = Velocity(v_in, a_out, delta_t); + out a_out : AccelerationValue = Acceleration(power, mass, v_in); + } + } + + package AnalysisModel { + private import VehicleModel::*; + private import DynamicsModel::*; + private import SampledFunctions::*; + private import ScalarValues::Natural; + private import SequenceFunctions::*; + + analysis def DynamicsAnalysis { + subject vehicle : Vehicle; + in attribute powerProfile :> ISQ::power[*]; + in attribute initialPosition :> ISQ::length; + in attribute initialSpeed :> ISQ::speed; + in attribute deltaT :> ISQ::time; + return attribute accelerationProfile :> ISQ::acceleration[*] := (); + + private attribute position := initialPosition; + private attribute speed := initialSpeed; + + for i in 1..powerProfile->size()-1 { + perform action dynamics : StraightLineDynamics { + in power = powerProfile#(i); + in mass = vehicle.mass; + in delta_t = deltaT; + in x_in = position; + in v_in = speed; + } + then assign position := dynamics.x_out; + then assign speed := dynamics.v_out; + then assign accelerationProfile := accelerationProfile->including(dynamics.a_out); + } + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/11-View and Viewpoint/11a-View-Viewpoint.sysml b/src/sysml/src/validation/11-View and Viewpoint/11a-View-Viewpoint.sysml new file mode 100644 index 0000000000000000000000000000000000000000..63edac782088c02baa8ad7f0a85a10e2bba3cd9b --- /dev/null +++ b/src/sysml/src/validation/11-View and Viewpoint/11a-View-Viewpoint.sysml @@ -0,0 +1,56 @@ +package '11a-View-Viewpoint' { + + package SystemModel { + private import SI::*; + + part def Vehicle; + part def AxleAssembly; + part def Axle; + part def Wheel; + + part vehicle : Vehicle { + attribute mass :> ISQ::mass = 2500[SI::kg]; + part frontAxleAssembly : AxleAssembly[1] { + attribute mass :> ISQ::mass = 150[kg]; + part frontWheel : Wheel[2]; + part frontAxle : Axle[1] { + attribute mass; + attribute steeringAngle; + } + } + part rearAxleAssembly : AxleAssembly[1] { + attribute mass :> ISQ::mass = 250[kg]; + part rearWheel : Wheel[2]; + part rearAxle : Axle[1] { + attribute mass; + } + } + } + + } + + package ViewModel { + private import Views::*; + + part 'systems engineer'; + + concern 'system breakdown' { + stakeholder :>> 'systems engineer'; + } + + viewpoint 'system structure perspective' { + frame 'system breakdown'; + } + + view 'system structure generation' { + satisfy 'system structure perspective'; + expose SystemModel::vehicle::**[@SysML::PartUsage]; + render asElementTable { + view :>> columnView[1] { + render asTextualNotation; + } + } + } + + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/11-View and Viewpoint/11b-Safety and Security Feature Views.sysml b/src/sysml/src/validation/11-View and Viewpoint/11b-Safety and Security Feature Views.sysml new file mode 100644 index 0000000000000000000000000000000000000000..3d5e3474edeaac0d6c128ec9952a4ff7674f2909 --- /dev/null +++ b/src/sysml/src/validation/11-View and Viewpoint/11b-Safety and Security Feature Views.sysml @@ -0,0 +1,65 @@ +private import Views::*; // private import library package, not internal Views package! +package '11b-Safety and Security Feaure Views' { + private import ScalarValues::*; + + package AnnotationDefinitions { + metadata def Safety { + attribute isMandatory : Boolean; + } + metadata def Security; + } + + package PartsTree { + public import AnnotationDefinitions::*; + part vehicle { + part interior { + part alarm {@Security;} + part seatBelt[2] {@Safety{isMandatory = true;}} + part frontSeat[2]; + part driverAirBag {@Safety{isMandatory = false;}} + } + part bodyAssy { + part body; + part bumper {@Safety{isMandatory = true;}} + part keylessEntry {@Security;} + } + part wheelAssy { + part wheel[2]; + part antilockBrakes[2] {@Safety{isMandatory = false;}} + } + } + } + + package ViewDefinitions { + public import AnnotationDefinitions::*; + view def SafetyFeatureView { + /* Parts that contribute to safety. */ + filter @Safety; + render asTreeDiagram; + } + + view def SafetyOrSecurityFeatureView { + /* Parts that contribute to safety OR security. */ + filter @Safety | @Security; + } + } + + package Views { + private import ViewDefinitions::*; + private import PartsTree::vehicle; + + view vehicleSafetyFeatureView : SafetyFeatureView { + expose vehicle::**; + } + + view vehicleMandatorySafetyFeatureView :> vehicleSafetyFeatureView { + filter Safety::isMandatory; + } + + view vehicleMandatorySafetyFeatureViewStandalone { + expose vehicle::**[@Safety and Safety::isMandatory]; + render asElementTable; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/12-Dependency Relationships/12a-Dependency.sysml b/src/sysml/src/validation/12-Dependency Relationships/12a-Dependency.sysml new file mode 100644 index 0000000000000000000000000000000000000000..9d7491a8619860514d3565b1ccc6278aef1fc41a --- /dev/null +++ b/src/sysml/src/validation/12-Dependency Relationships/12a-Dependency.sysml @@ -0,0 +1,16 @@ +package '12a-Dependency' { + + package 'Application Layer'; + package 'Service Layer'; + package 'Data Layer'; + + dependency Use from 'Application Layer' to 'Service Layer'; + dependency from 'Service Layer' to 'Data Layer'; + + attribute x; + attribute y; + attribute z; + + dependency z to x, y; + +} \ No newline at end of file diff --git a/src/sysml/src/validation/12-Dependency Relationships/12b-Allocation-1.sysml b/src/sysml/src/validation/12-Dependency Relationships/12b-Allocation-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..3e996b0a67c0df58e68e8746ada75f8dcb2c1183 --- /dev/null +++ b/src/sysml/src/validation/12-Dependency Relationships/12b-Allocation-1.sysml @@ -0,0 +1,56 @@ +package '12b-Allocation-1' { + private import SI::*; + private import RequirementModel::*; + private import LogicalModel::*; + private import PhysicalModel::*; + + package RequirementModel { + requirement torqueGeneration { + subject generator: TorqueGenerator; + require constraint { + generator.generateTorque.torque > 0.0 [N*m] + } + } + } + + package LogicalModel { + action def GenerateTorque { out torque :> ISQ::torque; } + + part def LogicalElement; + part def TorqueGenerator :> LogicalElement { + perform action generateTorque : GenerateTorque; + } + + action providePower { + action generateTorque : GenerateTorque; + } + + part torqueGenerator : TorqueGenerator { + perform providePower.generateTorque :>> generateTorque; + } + + satisfy torqueGeneration by torqueGenerator; + } + + package PhysicalModel { + part def PhysicalElement; + part def PowerTrain :> PhysicalElement; + + part powerTrain : PowerTrain { + part engine { + perform providePower.generateTorque; + } + } + } + + allocation def LogicalToPhysical { + end logical : LogicalElement; + end physical : PhysicalElement; + } + + allocation torqueGenAlloc : LogicalToPhysical + allocate logical ::> torqueGenerator to physical ::> powerTrain { + + allocate torqueGenerator.generateTorque to powerTrain.engine.generateTorque; + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/12-Dependency Relationships/12b-Allocation.sysml b/src/sysml/src/validation/12-Dependency Relationships/12b-Allocation.sysml new file mode 100644 index 0000000000000000000000000000000000000000..69c2ef89ff6502f06ab65d13507b080a22d0d2f9 --- /dev/null +++ b/src/sysml/src/validation/12-Dependency Relationships/12b-Allocation.sysml @@ -0,0 +1,26 @@ +package '12b-Allocation' { + private import LogicalModel::*; + private import PhysicalModel::*; + + package LogicalModel { + action providePower { + action generateTorque; + } + + part torqueGenerator { + perform providePower.generateTorque; + } + } + + package PhysicalModel { + part powerTrain { + part engine { + perform providePower.generateTorque; + } + } + } + + allocate torqueGenerator to powerTrain { + allocate torqueGenerator.generateTorque to powerTrain.engine.generateTorque; + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/13-Model Containment/13a-Model Containment.sysml b/src/sysml/src/validation/13-Model Containment/13a-Model Containment.sysml new file mode 100644 index 0000000000000000000000000000000000000000..f54d8bed753f42a8832d94347191191776d51e4e --- /dev/null +++ b/src/sysml/src/validation/13-Model Containment/13a-Model Containment.sysml @@ -0,0 +1,62 @@ +package '13a-Model Containment' { + private import '2a-Parts Interconnection'::*; + private import '8-Requirements'::*; + + requirement BodyAndInteriorRequirements { + public import MassLimitationRequirement; + } + + requirement PowerTrainRequirements; + + package 'Vehicle Model' { + doc + /* + * This package is used to represent a top-level "model". + * There is no specific syntax for identifying a package + * used in this way. + */ + + + package 'Vehicle1-Configuration' { + alias 'Sport Sedan' for vehicle1_c1; + + private import 'vehicle1_c1 Specification Context'::'vehicle1-c1 Specification'; + } + + package 'Vehicle Reference Model' { + doc + /* + * This package is used to represent a "model library". + * There is no specific syntax for identifying a package + * used in this way. + */ + + private import VehicleA; + private import VehicleSubsystems; + + //* + // The following would transitively private import all the + // members of the VehicleSubsystems package, rather + // then importing the package itself. + + private import VehicleSubsystems::*; + */ + } + + package VehicleSubsystems { + private import 'Body&Interior'; + private import 'PowerTrain'; + } + + package 'Body&Interior' { + private import BodyAndInteriorRequirements; + } + + package PowerTrain { + private import Engine; + private import Transmission; + private import PowerTrainRequirements; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/13-Model Containment/13b-Safety and Security Features Element Group-1.sysml b/src/sysml/src/validation/13-Model Containment/13b-Safety and Security Features Element Group-1.sysml new file mode 100644 index 0000000000000000000000000000000000000000..41eae144cbf1545851c09bb28041b0e2546817b2 --- /dev/null +++ b/src/sysml/src/validation/13-Model Containment/13b-Safety and Security Features Element Group-1.sysml @@ -0,0 +1,56 @@ +package '13b-Safety and Security Features Element Group-1' { + private import ScalarValues::*; + private import AnnotationDefinitions::*; + private import PartsTree::*; + + package AnnotationDefinitions { + metadata def Safety { + attribute isMandatory : Boolean; + } + metadata def Security; + } + + package PartsTree { + part vehicle { + part interior { + part alarm {@Security;} + part seatBelt[2] {@Safety{isMandatory = true;}} + part frontSeat[2]; + part driverAirBag {@Safety{isMandatory = false;}} + } + part bodyAssy { + part body; + part bumper {@Safety{isMandatory = true;}} + part keylessEntry {@Security;} + } + part wheelAssy { + part wheel[2]; + part antilockBrakes[2] {@Safety{isMandatory = false;}} + } + } + } + + package 'Safety Features' { + /* Parts that contribute to safety. */ + private import vehicle::**; + filter @Safety; + } + + package 'Security Features' { + /* Parts that contribute to security. */ + private import vehicle::**; + filter @Security; + } + + package 'Safety & Security Features' { + /* Parts that contribute to safety OR security. */ + private import vehicle::**; + filter @Safety or @Security; + } + + package 'Mandatory Safety Features' { + /* Parts that contribute to safety AND are mandatory. */ + private import vehicle::**; + filter @Safety and Safety::isMandatory; + } +} diff --git a/src/sysml/src/validation/13-Model Containment/13b-Safety and Security Features Element Group-2.sysml b/src/sysml/src/validation/13-Model Containment/13b-Safety and Security Features Element Group-2.sysml new file mode 100644 index 0000000000000000000000000000000000000000..a0c7be188c0862de5a742c3a5b14d2668264aefc --- /dev/null +++ b/src/sysml/src/validation/13-Model Containment/13b-Safety and Security Features Element Group-2.sysml @@ -0,0 +1,52 @@ +package '13b-Safety and Security Features Element Group-2' { + private import ScalarValues::*; + private import AnnotationDefinitions::*; + private import PartsTree::*; + + package AnnotationDefinitions { + metadata def Safety { + attribute isMandatory : Boolean; + } + metadata def Security; + } + + package PartsTree { + part vehicle { + part interior { + part alarm {@Security;} + part seatBelt[2] {@Safety{isMandatory = true;}} + part frontSeat[2]; + part driverAirBag {@Safety{isMandatory = false;}} + } + part bodyAssy { + part body; + part bumper {@Safety{isMandatory = true;}} + part keylessEntry {@Security;} + } + part wheelAssy { + part wheel[2]; + part antilockBrakes[2] {@Safety{isMandatory = false;}} + } + } + } + + package 'Safety Features' { + /* Parts that contribute to safety. */ + private import vehicle::**[@Safety]; + } + + package 'Security Features' { + /* Parts that contribute to security. */ + private import vehicle::**[@Security]; + } + + package 'Safety & Security Features' { + /* Parts that contribute to safety OR security. */ + private import vehicle::**[@Safety or @Security]; + } + + package 'Mandatory Saftey Features' { + /* Parts that contribute to safety AND are mandatory. */ + private import vehicle::**[@Safety and Safety::isMandatory]; + } +} diff --git a/src/sysml/src/validation/13-Model Containment/13b-Safety and Security Features Element Group.sysml b/src/sysml/src/validation/13-Model Containment/13b-Safety and Security Features Element Group.sysml new file mode 100644 index 0000000000000000000000000000000000000000..7d16f4fb269f2feff1c7b8a0e555ae69f5856dba --- /dev/null +++ b/src/sysml/src/validation/13-Model Containment/13b-Safety and Security Features Element Group.sysml @@ -0,0 +1,40 @@ +package '13b-Safety and Security Features Element Group' { + + part vehicle1_c1 { + part interior { + part alarm; + part seatBelt[2]; + part frontSeat[2]; + part driverAirBag; + } + part bodyAssy { + part body; + part bumper; + part keylessEntry; + } + } + + package 'Safety Features' { + /* Parts that contribute to safety. */ + + private import vehicle1_c1::interior::seatBelt; + private import vehicle1_c1::interior::driverAirBag; + private import vehicle1_c1::bodyAssy::bumper; + } + + package 'Security Features' { + /* Parts that contribute to security. */ + + private import vehicle1_c1::interior::alarm; + private import vehicle1_c1::bodyAssy::keylessEntry; + } + + package 'Safety & Security Features' { + /* Parts that contribute to safety AND + * parts that contribute to security. + */ + + private import 'Safety Features'::*; + private import 'Security Features'::*; + } +} diff --git a/src/sysml/src/validation/14-Language Extensions/14a-Language Extensions.sysml b/src/sysml/src/validation/14-Language Extensions/14a-Language Extensions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..0a7ec10937fb52a2564e594ac467cb1260ebe0ed --- /dev/null +++ b/src/sysml/src/validation/14-Language Extensions/14a-Language Extensions.sysml @@ -0,0 +1,31 @@ +package '14a-Language Extensions' { + private import 'User Defined Extensions'::*; + + package 'User Defined Extensions' { + + enum def ClassificationLevel { + uncl; + conf; + secret; + } + + metadata def Classified { + ref :>> annotatedElement : SysML::PartUsage; + attribute classificationLevel : ClassificationLevel[1]; + } + } + + part part_X { + metadata Classified { + classificationLevel = ClassificationLevel::conf; + } + } + + // Alternative shorthand notation + part part_Y { + @Classified { + classificationLevel = ClassificationLevel::conf; + } + } + +} \ No newline at end of file diff --git a/src/sysml/src/validation/14-Language Extensions/14b-Language Extensions.sysml b/src/sysml/src/validation/14-Language Extensions/14b-Language Extensions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..d88e9e3892af13b78d8ac23c5e9f21661ba35ef6 --- /dev/null +++ b/src/sysml/src/validation/14-Language Extensions/14b-Language Extensions.sysml @@ -0,0 +1,51 @@ +package '14b-Language-Extensions' { + + package LibraryModel { + + part def ECU; + + } + + package UserModel { + + package Definitions { + private import LibraryModel::*; + + part def VehicleControlUnit :> ECU; + part def EngineControlUnit :> ECU; + + part def Vehicle; + part def Engine; + part def CanBus; + + port def BusIF; + } + + package Usages { + private import Definitions::*; + + part vehicle1: Vehicle { + part vehicleControlUnit : VehicleControlUnit { + port busIF: ~BusIF; + } + + connect vehicleControlUnit.busIF to canBus.vehicleControlIF; + + part canBus: CanBus { + port vehicleControlIF: BusIF; + port engineControlIF: BusIF; + port sensorIF: BusIF; + } + + connect engine.engineControlUnit.busIF to canBus.engineControlIF; + + part engine: Engine { + part engineControlUnit: EngineControlUnit { + port busIF: ~BusIF; + } + } + } + } + + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/14-Language Extensions/14c-Language Extensions.sysml b/src/sysml/src/validation/14-Language Extensions/14c-Language Extensions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..7994767ace26c827eb3505e4259e853127122b75 --- /dev/null +++ b/src/sysml/src/validation/14-Language Extensions/14c-Language Extensions.sysml @@ -0,0 +1,208 @@ +package '14c-Language-Extensions' { + private import ScalarValues::*; + + library package FMEALibrary { + + abstract occurrence def Situation; + + abstract occurrence situations : Situation[*] nonunique; + + occurrence def Cause :> Situation { + attribute occurs[0..1]: Real; + } + + abstract occurrence causes : Cause[*] nonunique; + + occurrence def FailureMode :> Situation { + attribute detected[0..1]: Real; + } + + abstract occurrence failureModes : FailureMode[*] nonunique; + + occurrence def Effect :> Situation { + attribute severity[0..1]: String; + } + + abstract occurrence effects : Effect[*] nonunique; + + item def FMEAItem :> Situation { + attribute RPN: Real[0..1]; + + occurrence :>> causes; + occurrence :>> failureModes; + occurrence :>> effects; + } + + abstract item fmeaItems : FMEAItem[*] nonunique; + + connection def Causation :> Occurrences::HappensBefore { + end cause[*]: Situation; + end effect[*]: Situation; + } + + abstract connection causations : Causation[*] nonunique; + + requirement def FMEARequirement; + + abstract requirement fmeaRequirements : FMEARequirement[*] nonunique; + + requirement def RequirementWithSIL :> FMEARequirement { + attribute sil: SIL; + } + + enum def SIL { A; B; C; } + + connection def Violation { + end sit[*]: Situation; + end req[*]: FMEARequirement; + } + + abstract connection violations : Violation[*] nonunique; + + abstract connection def ControllingMeasure { + end sit[*]: Situation; + end req[*]: FMEARequirement; + } + + connection def Prevention :> ControllingMeasure; + + abstract connection preventions : Prevention[*] nonunique; + + connection def Mitigation :> ControllingMeasure; + + abstract connection mitigations : Mitigation[*] nonunique; + + } + + library package FMEAMetadata { + private import Metaobjects::SemanticMetadata; + private import FMEALibrary::*; + + enum def Status { + Approved; + NotApproved; + } + + metadata def StatusHolder { + status: Status; + } + + metadata def SituationMetadata :> SemanticMetadata { + :>> baseType default situations meta SysML::Usage; + } + + metadata def CauseMetadata :> SituationMetadata { + :>> baseType = causes meta SysML::Usage; + } + + metadata def FailureModeMetadata :> SituationMetadata { + :>> baseType = failureModes meta SysML::Usage; + } + + metadata def EffectMetadata :> SituationMetadata { + :>> baseType = effects meta SysML::Usage; + } + + metadata def FMEAItemMetadata :> SituationMetadata { + :> annotatedElement : SysML::ItemDefinition; + :> annotatedElement : SysML::ItemUsage; + :>> baseType = fmeaItems meta SysML::Usage; + } + + metadata def CausationMetadata :> SemanticMetadata { + :>> annotatedElement : SysML::SuccessionAsUsage; + :>> baseType = causations meta SysML::Usage; + } + + metadata def FMEARequirementMetadata :> SemanticMetadata { + :>> annotatedElement : SysML::RequirementUsage; + :>> baseType = fmeaRequirements meta SysML::Usage; + } + + metadata def ViolationMetadata :> SemanticMetadata { + :>> annotatedElement : SysML::ConnectionUsage; + :>> baseType = violations meta SysML::Usage; + } + + abstract metadata def ControllingMeasureMetadata :> SemanticMetadata { + :>> annotatedElement : SysML::ConnectionUsage; + } + + metadata def PreventionMetadata :> ControllingMeasureMetadata { + :>> baseType = preventions meta SysML::Usage; + } + + metadata def MitigationMetadata :> ControllingMeasureMetadata { + :>> baseType = mitigations meta SysML::Usage; + } + + } + + package FMEAUserModel { + private import FMEALibrary::*; + private import FMEAMetadata::*; + + #fmeaspec requirement req1 { + doc /* Meter designed according to ISO00124 */ + } + + #fmeaspec requirement req2 { + doc /* Device working for 1 week without the need to replace batteries */ + } + + #fmeaspec requirement req3: RequirementWithSIL { + @StatusHolder { status = Status::Approved; } + + doc /* Alarm when battery has sank */ + + :>> sil = SIL::A; + } + + #fmea item def 'Glucose FMEA Item' { + + #prevention connect 'battery depleted' to req1; + + #cause occurrence 'battery depleted' { + :>> occurs = 0.005; + } + + #causation first 'battery depleted' then 'battery cannot be charged'; + + #failure occurrence 'battery cannot be charged' { + :>> detected = 0.013; + } + + #causation first 'battery cannot be charged' then 'glucose level undetected'; + + #effect occurrence 'glucose level undetected'; + + #causation first 'glucose level undetected' then 'therapy delay'; + + #effect occurrence 'therapy delay' { + :>> severity = "High"; + } + + } + + #violation connect 'Glucose Meter in Use' to req2; + #mitigation connect 'Glucose Meter in Use' to req3; + + #fmea item 'Glucose Meter in Use' : 'Glucose FMEA Item' { + + part 'glucose meter' { + event 'glucose level undetected'[*]; + part battery { + event 'battery depleted'[*]; + event 'battery cannot be charged'[*]; + } + part pump; + part reservoir; + } + + part patient { + event 'therapy delay'[*]; + } + } + + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_01-Constants.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_01-Constants.sysml new file mode 100644 index 0000000000000000000000000000000000000000..bb04e45dc71d2b48e326cd715f0fa3ee3680eb20 --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_01-Constants.sysml @@ -0,0 +1,55 @@ +package '15_01-Constants' { + private import MeasurementReferences::*; + private import SI::*; + private import RealFunctions::*; + + /* Note: Value properties that are bound to specific values are constants and have the specified + * values in all contexts. It is not legal to redefine them. + */ + + package 'Mathematical Constants' { + doc + /* + * Standard mathematical constants + * + * Irrational constants cannot be represented exactly with finite precision. + * However, they can be required to be implemented with a attribute that is accurate + * to at least a certain precision. + * + * (The decimal literals here should be interpreted as being fixed point and exact.) + */ + + attribute e: Real { + assert constraint { round(e * 1E20) == 271828182845904523536.0 } + } + attribute pi: Real { + assert constraint { round(pi * 1E20) == 314159265358979323846.0 } + } + } + + package 'Fundamental Physical Constants' { + doc + /* + * Standard fundamental physical constants + * + * Physical constants have a standard measured attribute to a finite precision. + * + * The reference source is: + * CODATA - Task Group on Fundamental Physical Constants (TGFC) - 2018 CODATA recommended values + * See https://codata.org/initiatives/strategic-programme/fundamental-physical-constants/ + * For the actual values see https://pml.nist.gov/cuu/Constants/ + */ + + attribute 'fine structure constant' : DimensionOneValue = 7.2973525693E-3[one]; // 2018 CODATA attribute 7.2973525693E-3; uncertainty = 0.0000000011E-3 + attribute 'electron to proton mass ratio': DimensionOneValue = 5.44617021487E-4[one]; // 2018 CODATA attribute 5.44617021487E-4; uncertainty = 0.00000000033E-4 + attribute 'speed of light in vacuum' : SpeedValue = 299792458[m/s]; // 2018 CODATA attribute 299792458 m s^-1; (exact) + } + + package 'Global Context' { + attribute 'nominal earth gravitational acceleration': AccelerationValue = 9.80665['m/s²']; + } + + package 'Model X Context' { + attribute 'amplifier gain': DimensionOneValue = 3.5[one]; + } +} diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_02-Basic Value Properties.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_02-Basic Value Properties.sysml new file mode 100644 index 0000000000000000000000000000000000000000..84a7fe204c1843e7e3e010751e00c1f76a1432ce --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_02-Basic Value Properties.sysml @@ -0,0 +1,25 @@ +package '15_02-Basic Value Properties' { + private import ScalarValues::*; + + attribute def LengthValue :> Real { + doc + /* + * Real world user models would use a quantity type + * from the library model. A attribute def is defined + * here to show that it is possible. + */ + } + + part def Tire { + attribute manufacturer: String; + attribute hubDiameter: LengthValue; + attribute width: Integer; + } + + part frenchTire: Tire { + attribute :>> manufacturer = "Michelin"; + attribute :>> hubDiameter = 18.0; + attribute :>> width = 245; + } + +} diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_03-Value Expression.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_03-Value Expression.sysml new file mode 100644 index 0000000000000000000000000000000000000000..08efaa0a9caefc2875696f01045768e15556b4dd --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_03-Value Expression.sysml @@ -0,0 +1,30 @@ +package '15_03-Value Expression' { + private import SI::*; + private import USCustomaryUnits::*; + + part def Vehicle_1 { + attribute mass: MassValue = 1200 [kg]; + attribute length: LengthValue = 4.82 [m]; + part leftFrontWheel : Wheel; + part rightFrontWheel : Wheel; + } + + part def Wheel { + attribute hubDiameter: LengthValue = 18 ['in']; + attribute width: LengthValue = 245 [mm]; + attribute outerDiameter: LengthValue = (hubDiameter + 2 * tire.height) [mm] { + doc + /* + * This binds 'outDiameter' to the result of a computed attribute. + * There is no need to mark it as "derived". + */ + } + part tire: Tire[1]; + } + + part def Tire { + attribute profileDepth: LengthValue default 6.0 [mm]; + constraint hasLegalProfileDepth {profileDepth >= 3.5 [mm]} + attribute height: LengthValue = 45 [mm]; + } +} diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_04-Logical Expressions.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_04-Logical Expressions.sysml new file mode 100644 index 0000000000000000000000000000000000000000..4bf87321c3322a7d9f653239a7b3c4f6f9cbec4a --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_04-Logical Expressions.sysml @@ -0,0 +1,30 @@ +package '15_04-Logical Expressions' { + private import ScalarValues::*; + + part def Engine; + part def '4CylEngine' :> Engine; + part def '6CylEngine' :> Engine; + + part def Transmission; + part def ManualTransmission :> Transmission; + part def AutomaticTransmission :> Transmission; + + part def Vehicle { + attribute isHighPerformance: Boolean; + + part engine: Engine[1]; + part transmission: Transmission[1]; + + assert constraint { + if isHighPerformance? engine istype '6CylEngine' + else engine istype '4CylEngine' + } + + assert constraint { + (engine istype '4CylEngine' and + transmission istype ManualTransmission) xor + (engine istype '6CylEngine' and + transmission istype AutomaticTransmission) + } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_05-Unification of Expression and Constraint Definition.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_05-Unification of Expression and Constraint Definition.sysml new file mode 100644 index 0000000000000000000000000000000000000000..70d55bc20c9997ebb19064238a5a4503a76d5dcb --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_05-Unification of Expression and Constraint Definition.sysml @@ -0,0 +1,56 @@ +package '15_05-Unification of Expression and Constraint Definition' { + private import '15_03-Value Expression'::*; + private import ControlFunctions::forAll; + private import SI::*; + + constraint def DiscBrakeConstraint { + in wheelAssy : WheelAssy[4]; + + wheelAssy->forAll {in ref w: WheelAssy; + 2 * w.discBrakeAssy.radius < w.wheel.outerDiameter + } + } + + constraint def DiscBrakeFitConstraint_Alt { + in discBrakeAssy : DiscBrakeAssy[1]; + in wheel : Wheel[1]; + + 2 * discBrakeAssy.radius < wheel.outerDiameter + } + + part def Vehicle_2 { + attribute mass : MassValue[1] = 1200 [kg]; + attribute length : LengthValue[1] = 4.82 [m]; + + part wheelAssy : WheelAssy[4]; + + constraint discBrakeConstraint : DiscBrakeConstraint { + doc + /* + * This constraint is computed, but not asserted. This means a tool can identify + * when it is violated without the model being inconsistent. + */ + in wheelAssy = Vehicle_2::wheelAssy; + } + } + + part def WheelAssy { + part wheel : Wheel[1]; + part discBrakeAssy : DiscBrakeAssy[1]; + + assert constraint discBrakeFitConstraint_Alt: DiscBrakeFitConstraint_Alt { + doc + /* + * This constraint is asserted to be true, which means that the model + * is inconsistent if it the constraint is violated. + */ + + in discBrakeAssy = WheelAssy::discBrakeAssy; + in wheel = WheelAssy::wheel; + } + } + + part def DiscBrakeAssy { + attribute radius : LengthValue[1] = 95 [mm]; + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_06-System of Quantities.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_06-System of Quantities.sysml new file mode 100644 index 0000000000000000000000000000000000000000..6e2076b0ca7fba19b772561d596eb6bb9396241e --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_06-System of Quantities.sysml @@ -0,0 +1,40 @@ +package '15_06-System of Quantities' { + private import ISQ::*; + + /* + * A System of Quantities is represented by a model library package. + * + * Its structure is modeled after the International System of Quantities (ISQ): + * - Quantity dimension is defined as the product of powers of a selected set of base quantities. + * - A system of quantities is multi-dimensional space spanned by the powers of its base quantities. + * - Any base quantity is modeled as a specialization of a SimpleUnit. Such a specialized SimpleUnit defines one base unit vector + * (with power one by definition), e.g. MassUnit with symbol M, that establishes a base quantity dimension for the system of quantities, + * without committing yet to a particular choice of measurement unit. + * - To complete the system of quantities any number of derived quantities can be added. + * - A derived quantity is modeled as a specialization of a DerivedUnit. A DerivedUnit is defined in terms of so-called UnitPowerFactors. + * Each UnitPowerFactor is a combination of a base (or other derived) quantity and an exponent. + * - As an example the AccelerationUnit (specialization of DerivedUnit) can be defined as the combination of LengthUnit (symbol L) + * to the power 1 and TimeUnit (symbol T) to the power -2, so having quantity dimension L¹⋅T⁻². + * - A quantity of dimension one is defined as a derived quantity for which the effective exponent for each + * of its base quantity power factors is zero. Historically a quantity of dimension one was also called a dimensionless quantity. + * - A quantity of dimension one may be defined by adding all quantity power factors that cancel out by having positive and negative + * exponents. Doing so enables distinction between different 'kinds of' quantities of dimension one, e.g: + * angle (L¹⋅L⁻¹), mass ratio (L¹⋅L⁻¹), power ratio (L²⋅M⋅T⁻³⋅L⁻²⋅M⁻¹⋅T³), Mach number (L¹⋅T⁻¹⋅L⁻¹⋅T¹). + * + * The International System of Quantities (ISQ) as defined in ISO/IEC 80000 is added as a predefined model library to SysML v2. + * However, this does not prevent to model any other system of quantities in another model library and use it. + */ + + /* + * Above capabilities were implemented in: + * - standard library Quantities: + * TensorQuantityValue, VectorQuantityValue, ScalarQuantityValue, + * tensorQuantities, vectorQuantities, scalarQuantities, + * SystemOfQuantities + * - standard library MeasurementReferences: + * TensorMeasurementReference, VectorMeasurementReference, ScalarMeasurementReference, + * SystemOfUnits + * - standard library ISQBase: + * attribute 'International System of Quantities': SystemOfQuantities in ISQBase + */ +} diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_07-System of Units and Scales.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_07-System of Units and Scales.sysml new file mode 100644 index 0000000000000000000000000000000000000000..cd861d6b17c61c5834fb252c4460327d0993a62e --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_07-System of Units and Scales.sysml @@ -0,0 +1,46 @@ +package '15_07-System of Units and Scales' { + private import ISQ::*; + private import USCustomaryUnits::*; + + /* + * A System of Units and Scales is represented by a model library package. + * + * Its structure is modeled after the International System of Units -- Système Internationale d'Unités, abbreviated to SI -- as defined in ISO/IEC 80000: + * - Measurement units and scales are generalized to a common super type MeasurementReference. + * - A particular quantity is modeled as the tuple of a numerical value (i.e. a mathematical number) and a MeasurementReference. + * - An actual measurement unit is modeled as a usage of a specialization of either SimpleUnit or DerivedUnit, e.g. TimeUnit or ForceUnit, + * see the SI package. + * - The quantity dimension of the actual unit usage must match the quantity dimension of the generic quantity unit definition that it is a usage of. + * - A system of units and scales must define exactly one selected base unit for each base quantity in the associated system of quantities. The collection of + * base units forms the foundation for automated quantity value conversion between any pair of compatible units and/or scales. + * - If only a measurement unit is used on a quantity value, it implies expression on a ratio scale, in other words only the ratio between the actual quantity value, + * and the defined unit value is of importance. On ratio scales for one kind of quantity that only differ in their unit (e.g. metre and inch) + * zero is zero no matter what unit is selected. + * - A unit may carry a conversion factor definition w.r.t. to another reference unit. It can be a conversion by convention (e.g. between metre and foot) or + * via an ISO/IEC 80000 prefix symbol that indicates a decimal or binary multiple or sub-multiple (e.g. kilo, nano, mega, kibi, mebi, ...). See package SIPrefixes. + * - In addition to measurement units / ratio scales also other types of measurement scales are supported. The additional scales are: + * - ordinal scales (e.g. Beaufort wind force, Richter Scale, Rockwell C hardness scale), + * - interval scales (e.g. absolute temperature in deg C or F), + * - cyclic ratio scales (e.g. rotation angle with modulus 360 degree), + * - logarithmic scales (e.g. dB(A) or dBA sound pressure level w.r.t. a reference ambient pressure, dB(m) or dBm power ratio w.r.t. 1 mW). + * - Any base unit quantity is modeled as a specialization of a SimpleUnit. This specialized SimpleUnit (e.g. MassUnit) defines one base unit vector (with power one by definition) + * that establishes a base quantity dimension for the system of quantities, without committing yet to a particular choice of measurement unit. + * + * The International System of Units (SI) as defined in ISO/IEC 80000 as well as the US Customary System of Units as defined by NIST SP 811 + * are added as predefined model libraries to SysML v2. + * However, this does not prevent to model any other system of units and scales in another model library and use it. + */ + + /* + * Above capabilities were implemented in: + * - standard library MeasurementReferences: + * TensorMeasurementReference, VectorMeasurementReference, ScalarMeasurementReference, + * MeasurementUnit, OrdinalScale, IntervalScale, CyclicRatioScale, LogarithmicScale, + * SystemOfUnits + * - standard library SI: + * attribute 'ISO/IEC 80000 International System of Units' : SystemOfUnits + * :>> systemOfQuantities = isq; + * :>> baseUnits = (m, kg, s, A, K, mol, cd); + * } + */ +} diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_08-Range Restriction.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_08-Range Restriction.sysml new file mode 100644 index 0000000000000000000000000000000000000000..d2cc3445ff8e5c65635c6991a55747c3d0621240 --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_08-Range Restriction.sysml @@ -0,0 +1,19 @@ +package '15_08-Range Restriction' { + private import ISQ::*; + private import SI::*; + private import '15_01-Constants'::'Mathematical Constants'::pi; + + part def HeadLightsTiltKnob { + attribute headLightsTile : LightBeamTiltAngleValue[1]; + } + + attribute def LightBeamTiltAngleValue :> PlaneAngleValue { + attribute angle: LightBeamTiltAngleValue :>> self { + doc + /* + * Tilt angle shall be limited to the range between 50 and 80 degrees (inclusive). + */ + } + assert constraint { angle >= 50 ['°'] and angle <= 80 ['°'] } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_10-Primitive Data Types.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_10-Primitive Data Types.sysml new file mode 100644 index 0000000000000000000000000000000000000000..2a03ed0147938786ec6013cad933af5454f56b21 --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_10-Primitive Data Types.sysml @@ -0,0 +1,89 @@ +package '15.10-Primitive Data Types' { + /* + * Primitive data types are defined in normative model libraries. + * Any more specialized data types can be declared in user-defined + * model libraries or models as needed. + */ + + private import ScalarValues::Integer { + doc + /* + * The unqualified Integer is signed, in line with integer numbers in mathematics. + */ + } + + private import ScalarValues::Natural; + attribute def UnsignedInteger :> Natural { + doc /* Mathematically, unsigned integers are just natural numbers (non-negative integers). */ + } + + private import ScalarValues::Real { + doc + /* + * The unqualified Real is signed, in line with real numbers in mathematics. + */ + } + + attribute def UnsignedReal :> Real { + doc + /* + * Example of restriction of the base Real datatype. + */ + attribute x: Real :>> self; + assert constraint { x >= 0.0 } + } + + private import ScalarValues::String { + doc + /* + * String attributes are sequences of characters. + */ + } + + private import ScalarValues::Boolean { + doc + /* + * Boolean type has two legal attributes: true, false. + */ + } + + private import Time::DateTime; + + enum def ConditionColor { + doc + /* + * Enumerations are defined as an implicit restriction of the extent of the + * enumeration type to the listed enumeration values. + * Note: Enumerations are currently limited to attributes. + */ + + enum red; + enum yellow; + enum green; + } + + attribute def ConditionLevel { + attribute associatedColor : ConditionColor; + } + + enum def SeverityEnum :> ConditionLevel { + danger { + :>> associatedColor = ConditionColor::red; + } + warning { + :>> associatedColor = ConditionColor::yellow; + } + normal { + :>> associatedColor = ConditionColor::green; + } + } + + attribute def Diameter :> ISQ::LengthValue; + enum def DiameterChoice :> Diameter { + small = 60 [SI::mm]; + medium = 70 [SI::mm]; + large = 80 [SI::mm]; + } + attribute aperatureDiameter: DiameterChoice = DiameterChoice::small; + +} \ No newline at end of file diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_11-Variable Length Collection Types.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_11-Variable Length Collection Types.sysml new file mode 100644 index 0000000000000000000000000000000000000000..30b57d351840d03b8645c0bfebcb036c4c0abf1f --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_11-Variable Length Collection Types.sysml @@ -0,0 +1,36 @@ +package '15_11-Variable Length Collection Types' { + private import ScalarValues::*; + private import Collections::*; + + part def SparePart; + part def Person; + + /* Examples of declaring syntactic sugar-like names for instantiating collection types. */ + + attribute def 'Bag' :> Bag { + ref part :>> elements: SparePart; + } + + attribute def 'List' :> List { + value :>> elements: Integer; + } + + attribute def 'Set' :> Set { + attribute :>> elements: String; + } + + attribute def 'OrderedSet' :> OrderedSet { + ref part :>> elements: Person; + } + + attribute def 'List>' :> List { + attribute :>> elements: Set { + ref part :>> elements: Person; + } + } + + attribute def 'Array[4]' :> Array { + attribute :>> elements: Real; + attribute :>> dimensions = 4; + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_12-Compound Value Type.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_12-Compound Value Type.sysml new file mode 100644 index 0000000000000000000000000000000000000000..2e412d841697f7a078e231f38fba441eb1e6db5d --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_12-Compound Value Type.sysml @@ -0,0 +1,31 @@ +package '15_12-Compound Value Type' { + private import ScalarValues::*; + private import USCustomaryUnits::'in'; + + /* + * Real world user models would use quantity and vector types + * from library models. They are included here for the purpose + * of showing how such attribute defs can be defined. + */ + + attribute def PositionVector { + attribute x: Real[1]; + attribute y: Real[1]; + attribute z: Real[1]; + } + + attribute def LengthValue :> Real; + + attribute def TireInfo { + attribute manufacturer: String; + attribute hubDiameter: LengthValue; + attribute width: Integer; + attribute placement: PositionVector[0..1]; + } + + attribute frenchTireInfo: TireInfo { + attribute :>> manufacturer = "Michelin"; + attribute :>> hubDiameter = 18.0['in']; + attribute :>> width = 245; + } +} diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_13-Discretely Sampled Function Value.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_13-Discretely Sampled Function Value.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8ad93be6f20ccb2bd82ef231624439a5d782056f --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_13-Discretely Sampled Function Value.sysml @@ -0,0 +1,76 @@ +package '15_13-Discretely Sampled Function Value' { + private import SampledFunctions::SampledFunction; + private import SampledFunctions::SamplePair; + private import Collections::Array; + private import ISQ::*; + private import SI::*; + private import MeasurementReferences::*; + private import Time::*; + + attribute def MissionElapsedTimeScale :> TimeScale { + :>> unit = s; + attribute :>> definitionalEpoch { + :>> num = 0; + :>> definition = "time instant zero at launch"; + } + attribute definitionalEpochInUTC : Iso8601DateTime; + + // Map the definitional epoch (t = 0) of this scale to a reference epoch expressed in UTC + // This modeled as a 1D coordinate transformation (translation only) + attribute :>> transformation : CoordinateFramePlacement { + :>> source = UTC; + :>> origin = definitionalEpochInUTC; + :>> basisDirections = 1 [UTC]; + } + } + + attribute mets: MissionElapsedTimeScale { + doc + /* + * Define mission elapsed time scale starting at given UTC date time (in microsecond resolution) + */ + :>> definitionalEpochInUTC { :>> val = "2020-08-23T22:42:32.924534Z";} + } + + attribute def MissionElapsedTimeValue :> TimeInstantValue { + doc + /* + * Define scalar quantity value type for mission elapsed time + */ + :>> mRef = mets; + } + + attribute spatialCF: CartesianSpatial3dCoordinateFrame[1] { + doc + /* + * Define Cartesian 3D coordinate systems for position and velocity + * Create a velocity coordinate system from the spatial coordinate system through division by second + */ + :>> mRefs = (m, m, m); + } + attribute velocityCF: CartesianVelocity3dCoordinateFrame[1] = spatialCF/s; + + attribute def PositionAndVelocity { + attribute position : CartesianPosition3dVector[1]; + attribute velocity : CartesianVelocity3dVector[1]; + } + + attribute def AscentProfile :> SampledFunction { + attribute def AscentSample :> SamplePair { + attribute :>> domainValue: MissionElapsedTimeValue[1]; + attribute :>> rangeValue: PositionAndVelocity[1]; + } + attribute :>> samples: AscentSample[*] ordered; + } + + attribute ascentProfile1: AscentProfile { + doc /* Example ascent profile */ + attribute sample1: AscentSample { :>> domainValue = 0.0 [mets]; :>> rangeValue = pv1; + attribute pv1: PositionAndVelocity {:>> position = (0, 0, 0) [spatialCF]; :>> velocity = (0, 0, 0) [velocityCF]; } } + attribute sample2: AscentSample { :>> domainValue = 2.5 [mets]; :>> rangeValue = pv1; + attribute pv1: PositionAndVelocity {:>> position = (0.01, 0.03, 8.6) [spatialCF]; :>> velocity = (0, 0, 5.5) [velocityCF]; } } + attribute sample3: AscentSample { :>> domainValue = 5.1 [mets]; :>> rangeValue = pv1; + attribute pv1: PositionAndVelocity {:>> position = (0.04, 0.12, 18.6) [spatialCF]; :>> velocity = (0.05, 0.03, 25.3) [velocityCF]; } } + attribute :>> samples = (sample1, sample2, sample3); + } +} diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_19-Materials with Properties.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_19-Materials with Properties.sysml new file mode 100644 index 0000000000000000000000000000000000000000..65abf474af23688fc641fa24e49457c413c95284 --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_19-Materials with Properties.sysml @@ -0,0 +1,82 @@ +package '15_19-Materials with Properties' { + private import ScalarValues::Real; + private import Quantities::*; + private import MeasurementReferences::*; + private import SI::*; + + attribute def AtomicMassValue :> MassValue; + + attribute def TensileStrengthUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + attribute def TensileStrengthValue :> ScalarQuantityValue { + attribute :>> num: Real; + attribute :>> mRef: TensileStrengthUnit; + } + + attribute <'N/mm²'> 'newton per square millimetre' : TensileStrengthUnit = N / mm^2; + + part def Substance; + part def Material :> Substance; + + /* + * The classification of materials into metals and alloys is grossly simplified and not exhaustive. + * A more complete classification would include: ChemicalSubstance, PureMaterial, MixedMaterial, + * Class, Ceramic, OrganicMaterial, AnorganicMaterial, Polymer, HybridMaterial, CompositeMaterial, + * etc. + */ + + part def Metal :> Material { + attribute atomicMass: AtomicMassValue[1]; + } + + attribute def MaterialFraction { + ref material: Material[1]; + attribute massFraction: MassFractionValue[1]; + } + + attribute def MassFractionValue :> DimensionOneValue; + + part def Alloy :> Material { + attribute fractions: MaterialFraction[2..*]; + } + + individual def Iron :> Metal { + attribute :>> atomicMass = 55.845 [Da]; + } + + individual def Carbon :> Metal { + attribute atomicMass :>> Metal::atomicMass = 12.011[Da]; + } + + individual def Manganese :> Metal { + attribute atomicMass :>> Metal::atomicMass = 54.938[Da]; + } + + individual def Steel_980 :> Alloy { + /* + * Particular example of high tensile strength steel. + */ + + attribute fraction1 :> fractions { + ref :>> material : Iron; + attribute :>> massFraction = 0.9862[one]; + } + + attribute fraction2 :> fractions { + ref :>> material : Carbon; + attribute :>> massFraction = 0.9862[one]; + } + + attribute fraction3 :> fractions { + ref :>> material : Manganese; + attribute :>> massFraction = 0.9862[one]; + } + + attribute tensileStrength: TensileStrengthValue = 980['N/mm²']; + } +} diff --git a/src/sysml/src/validation/15-Properties-Values-Expressions/15_19a-Materials with Properties.sysml b/src/sysml/src/validation/15-Properties-Values-Expressions/15_19a-Materials with Properties.sysml new file mode 100644 index 0000000000000000000000000000000000000000..7704f06faf7786fb778fa703d5950b03e9950c4e --- /dev/null +++ b/src/sysml/src/validation/15-Properties-Values-Expressions/15_19a-Materials with Properties.sysml @@ -0,0 +1,69 @@ +package '15_19a-Materials with Properties' { + private import ScalarValues::*; + private import Quantities::*; + private import MeasurementReferences::*; + private import SI::*; + + attribute def AtomicMassValue :> MassValue; + + /* Example declarations of a quantity and unit that are not specified in ISQ and SI */ + + attribute def TensileStrengthUnit :> DerivedUnit { + private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; } + private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; } + private attribute durationPF: QuantityPowerFactor[1] { :>> quantity = isq.T; :>> exponent = -2; } + attribute :>> quantityDimension { :>> quantityPowerFactors = (lengthPF, massPF, durationPF); } + } + + attribute def TensileStrengthValue :> ScalarQuantityValue { + attribute :>> num: Real; + attribute :>> mRef: TensileStrengthUnit; + } + + attribute <'N/mm²'> 'newton per square millimetre' : TensileStrengthUnit = N / mm^2; + + attribute def Substance; + attribute def Material :> Substance; + + /* + * The classification of materials into metals and alloys is grossly simplified and not exhaustive. + * A more complete classification would include: ChemicalSubstance, PureMaterial, MixedMaterial, + * Class, Ceramic, OrganicMaterial, AnorganicMaterial, Polymer, HybridMaterial, CompositeMaterial, + * etc. + */ + + attribute def Metal :> Material { + attribute atomicMass: AtomicMassValue[1]; + } + + attribute def Alloy :> Material { + attribute fractions: MaterialFraction[2..*]; + } + + attribute def MaterialFraction { + attribute material: Material[1]; + attribute massFraction: MassFractionValue[1]; + } + + attribute def MassFractionValue :> DimensionOneValue; + + /* + * Value properties bound to specifically constructed compound values. + */ + attribute Iron: Metal { :>> atomicMass = 55.845[Da]; } + attribute Carbon: Metal { :>> atomicMass = 12.011[Da]; } + attribute Manganese: Metal { :>> atomicMass = 54.938[Da]; } + + attribute Steel_980: Alloy { + /* + * Value property with redefined/added sub-properties. + * (Particular example of high tensile strength steel.) + */ + + private attribute fraction1: MaterialFraction { :>> material = Iron; :>> massFraction = 0.9862[one]; } + private attribute fraction2: MaterialFraction { :>> material = Carbon; :>> massFraction = 0.0018[one]; } + private attribute fraction3: MaterialFraction { :>> material = Manganese; :>> massFraction = 0.012[one]; } + attribute :>> fractions = (fraction1, fraction2, fraction3); + attribute tensileStrength: TensileStrengthValue = 980 ['N/mm²']; + } +} diff --git a/src/sysml/src/validation/17-Sequence Modeling/17a-Sequence-Modeling.sysml b/src/sysml/src/validation/17-Sequence Modeling/17a-Sequence-Modeling.sysml new file mode 100644 index 0000000000000000000000000000000000000000..a10a525de36c224a28a7afa9136ec50ea630fd0f --- /dev/null +++ b/src/sysml/src/validation/17-Sequence Modeling/17a-Sequence-Modeling.sysml @@ -0,0 +1,42 @@ +package '17a-Sequence-Modeling' { + private import ScalarValues::*; + private import PayloadDefinitions::*; + + package PayloadDefinitions { + item def Subscribe { + attribute topic : String; + ref part subscriber; + } + + item def Publish { + attribute topic : String; + ref publication; + } + + item def Deliver { + ref publication; + } + } + + occurrence def PubSubSequence { + part producer[1] { + event occurrence publish_source_event; + } + + message publish_message of Publish[1] from producer.publish_source_event to server.publish_target_event; + + part server[1] { + event occurrence subscribe_target_event; + then event occurrence publish_target_event; + then event occurrence deliver_source_event; + } + + message subscribe_message of Subscribe[1] from consumer.subscribe_source_event to server.subscribe_target_event; + message deliver_message of Deliver[1] from server.deliver_source_event to consumer.deliver_target_event; + + part consumer[1] { + event occurrence subscribe_source_event; + then event occurrence deliver_target_event; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/17-Sequence Modeling/17b-Sequence-Modeling.sysml b/src/sysml/src/validation/17-Sequence Modeling/17b-Sequence-Modeling.sysml new file mode 100644 index 0000000000000000000000000000000000000000..b7e7649e76b8cfe7c3a80f78bd2f76807f4905e6 --- /dev/null +++ b/src/sysml/src/validation/17-Sequence Modeling/17b-Sequence-Modeling.sysml @@ -0,0 +1,42 @@ +package '17b-Sequence-Modeling' { + private import ScalarValues::*; + private import PayloadDefinitions::*; + + package PayloadDefinitions { + item def Subscribe { + attribute topic : String; + ref part subscriber; + } + + item def Publish { + attribute topic : String; + ref publication; + } + + item def Deliver { + ref publication; + } + } + + occurrence def PubSubSequence { + part producer[1] { + event publish_message.source; + } + + message publish_message of Publish[1]; + + part server[1] { + event subscribe_message.target; + then event publish_message.target; + then event deliver_message.source; + } + + message subscribe_message of Subscribe[1]; + message deliver_message of Deliver[1]; + + part consumer[1] { + event subscribe_message.source; + then event deliver_message.target; + } + } +} \ No newline at end of file diff --git a/src/sysml/src/validation/18-Use Case/18-Use Case.sysml b/src/sysml/src/validation/18-Use Case/18-Use Case.sysml new file mode 100644 index 0000000000000000000000000000000000000000..8c16a69a1ed8c60e3a63910f7e9fe2080a4f5719 --- /dev/null +++ b/src/sysml/src/validation/18-Use Case/18-Use Case.sysml @@ -0,0 +1,87 @@ +package '18-Use Case' { + + part def Vehicle; + part def Person; + part def Environment; + part def 'Fuel Station'; + + use case 'provide transportation' { + subject vehicle : Vehicle; + + actor driver : Person; + actor passengers : Person[0..4]; + actor environment : Environment; + + objective { + doc + /* Satisfy mission requirements to transport driver and passengers + * from starting location to ending location in conformance with + * the driving profile and meet the mission requirements for safety, + * reliability, comfort, and affordability. + */ + } + + ref :>> start { + doc /* Mock-up of a pre-condition. */ + assert constraint { + doc /* Vehicle at starting location */ + } + } + + first start; + + then include 'enter vehicle' { + actor :>> driver = 'provide transportation'::driver; + actor :>> passengers = 'provide transportation'::passengers; + } + + then use case 'drive vehicle' { + include 'add fuel'[0..*] { + doc + /* + * Mock-up of an extension point. + * (But reference to 'add fuel' is in the wrong direction, and it doesn't + * make the extension condition sufficient to trigger the behavior.) + */ + + actor :>> fueler = driver; + ref :>> start { + doc /* Fuel level < 10% max fuel */ + } + } + } + + then include 'exit vehicle' { + actor :>> driver = 'provide transportation'::driver; + actor :>> passengers = 'provide transportation'::passengers; + } + + then done; + + ref :>> done { + doc /* Mock-up of a post-condition. */ + assert constraint { + doc /* Vehicle at ending location */ + } + } + + } + + use case 'enter vehicle' { + subject vehicle : Vehicle; + actor driver : Person; + actor passengers : Person[0..4]; + } + + use case 'exit vehicle' { + subject vehicle : Vehicle; + actor driver : Person; + actor passengers : Person[0..4]; + } + + use case 'add fuel' { + subject vehicle : Vehicle; + actor fueler : Person; + actor 'fuel station' : 'Fuel Station'; + } +} \ No newline at end of file