Skip to main content

Creating a Prefixed Unit Based On QUDV Library

Today (Feb 23, 2012), I was asked by a customer about the way to add SI prefixes to a unit. My customer knows that it is possible to create a new unit, but he or she does not know how to include the information that the new unit is related to the references unit with some multiplier.

I wondered that I have not seen the information about using the QUDV library in any of my SysML books. It seem to be a missing part of them. So, I decided to write this article by hoping that it will help other SysML users to gain more understanding about such library.

The SysML v1.2 Specification [1] has provided the information about quantities, units, dimension and value types in Annex C.5. However, the specification does not provide any examples about using the prefixed unit and other conversion based unit sub-types. This article will show the way to create a prefixed unit which has information about its reference unit and the multiplier.


Figure 1 -- QUDV model of Units and QuantityKinds

A unit element in SysML is an InstanceSpecification applied with the <<Unit>> stereotype. I have seen this stereotype in the SysML Specification since I started using the SysML. However, there is one problem in using this stereotype in SysML v1.1 and earlier versions. The specification said that the stereotype must be applied to an InstanceSpecification, but it did not specify the classifier of the InstanceSpecification. Thus, the QUDV library have been introduced since SysML v1.2 for solving this ambiguous case. A unit should be an InstanceSpecification of Unit block's sub-types (Unit block is an abstract block. So, it cannot be instantiated).

From the QUDV model in Figure 1, there are 6 Unit block's sub-types which can be instantiated, including SimpleUnit, DerivedUnit, PrefixedUnit, LinearConversionUnit, AffineConversionUnit and GeneralConversionUnit (ConversionBasedUnit is also an abstract block). Here, the PrefixedUnit will be used as an example. More information about other Unit block's sub-types can be found in the OMG SysML v1.2 Specification, Annex C.5.

From the Figure 1, the PrefixedUnit have associated with the Prefix block. So, the InstanceSpecification of Prefix block must be created first. Figure 2 shows the milli:Prefix which is an InstanceSpecification of Prefix block. It has three slots which their defining features are the three attributes of Prefix block. The scale multiplier of our create unit can be specified as a value of factor slot (Here we use factor = 0.001).

After the InstanceSpecification of Prefix block has been created, then we will create an InstanceSpecification of PrefixedUnit block, milliAmpere:PrefixedUnit. Specify its slot values as shown in Figure 2, the reference unit (base unit) can be specified as a value of referenceUnit slot.  In this example, this slot value is ampere. It has been defined in the SI Definition of QUDV library provided by OMG (as a machine readable format).

Finally, apply <<Unit>> stereotype to milliAmpere:PrefixedUnit and specify the tagged value of quantityKind tag definition. This tagged value must be the same as the value of quantityKind slot.


Figure 2 -- Shows a prefixed unit, milliAmpere, with its slot values and tagged value.

At this point, a new prefixed unit, milliAmpere:PrefixedUnit, have been defined completely based on QUDV library. The reference unit (base unit) is ampere and the prefix multiplier is 0.001. The steps of creating this prefixed unit can be applied to create other kinds of unit. I hope everyone who have read this article, will gain more understanding about the unit in QUDV and enjoy using SysML  :)

References:
[1] "OMG Systems Modeling Language (OMG SysML™) version 1.2" [Electronic]



Kritsana Uttamang, PhD.

Analyst Manager / SysML Domain Expert
No Magic Inc.





Comments

Popular posts from this blog

Simple Clock Modeling with SysML

It has been a while since I posted my previous article on this blog, because I was busy in making MagicDraw SysML supports for the new OMG SysML v1.3 Specification [1]. Couple weeks ago, I was asked by a customer about how to model a clock which counts every second with SysML. I created the simple clock model for answering. I also posted it to the SysMLForum and found that some people are interested in my clock model. So, I wrote this article to explain about the clock model and show how to model the system operating by a time trigger. Start from defining the clock with a SysML block. The clock block contains only a value property t . This value property represents time in second. Thus, a value type Second must be defined for typing the value property as in Figure 1. Figure 1 - SysML Block Definition Diagram of Clock Model Next, SysML State Machine will be created to describe the behavior of the clock block. Here, the clock state-machine was designed to have only one state

Decomposing Ports and Connectors with Association Blocks

This article was written when SysML v1.3 specification is in releasing process. If you are a big fan of SysML and keep in touch with SysML RTF, you may have seen some documents or books about SysML v1.3 such as [1] and [2]. One of many things that I am impressed in those books and documents, is the way they use SysML to describe nested ports and specify compatibility between connected ports using association blocks.  When two ports connected by a connector, they may have nested ports which themselves can be connected. An association block has been suggested for defining the internal structure of the connector. It could contain a set of connectors that define the connectors between nested ports of association ends. When a connector is typed by an association block, the interaction between roles at both ends of connector will be handled by the internal structure of the association block [1].  This approach give us not only the ability to decompose ports and connectors but also the a

A Common Misunderstanding in Using Connectors

I have been asked many times by customers, that why they cannot use a connector to connect between ports on the boundaries of blocks in SysML Block Definition Diagram (BDD). Is that a tool's problem? After I have answered this question many times, I think it would be helpful for SysML users if there is an article to answer such question. For easy to explain, please see Figure 1. My customers try to use a connector to connect port p1  of SubSystem1 to the port p2  of SubSystem2  but they cannot. So, they have asked me with above question. Figure 1 -- SysML Block Definition Diagram To answer it, we should start by asking ourselves that does it make sense if a connector can connect both ports together? What should be the meaning of that connection? especially when we have multiple instances of SubSystem1 and SubSystem2 . Should the ports p1 of all  SubSystem1  instances be connected to the ports p2 of all  SubSystem2  instances?  I don't think so. BDD is used to