QuantityKind vs. ValueType

81 views
Skip to first unread message

Dan George

unread,
May 5, 2012, 3:14:32 PM5/5/12
to sysml...@googlegroups.com
Indicated airspeed and true airspeed are both speeds but are not compatible with each other. E.g, the result of adding the two is not meaningful. Should I create:
  1. ValueType for each having quantityKind=Speed
  2. specialization of QuantityKind Speed for each and also a ValueType for each having the corresponding quantityKind (e.g., quantityKind=TAS)?
Of course, #1 looks simpler but I wonder if #2 will offer benefits that, under the right circumstances, would outweigh the complexity.

There are other cases such as altitude: baro, pressure, msl, WGS-84 geoid, WGS-84 ellipsoid, AGL, etc.. Even length can be broken down several ways: height, width, distance, depth, ...

The goal would be to specify interconnection in such a way as to operate on quantities only in meaningful ways and flag an error, otherwise.

Thanks,
Dan

Remy Fannader

unread,
May 6, 2012, 10:27:35 PM5/6/12
to SysML Forum
Providing format and semantics are the same, users can use them as
they like, e.g: device accuracy = Indicated airspeed -true airspeed.
Remy

On May 5, 10:14 pm, Dan George <dgeorge83...@gmail.com> wrote:
> Indicated airspeed and true airspeed are both speeds but are not compatible
> with each other. E.g, the result of adding the two is not meaningful.
> Should I create:
>
>    1. ValueType for each having quantityKind=Speed
>    2. specialization of QuantityKind Speed for each and also a ValueType

Murray Woodside

unread,
May 7, 2012, 8:02:25 AM5/7/12
to sysml...@googlegroups.com
MARTE introduced a modifier as part of the ValueType specifically for this
problem... we were
thinking of "required" and "provided" and "simulated" as examples, for
timing values, but the principle is the same. This modifier was called the
"value source" (see section 8.2.4 of the MARTE spec for an explanation,
and Figure D.5 for a definition).

Another modifier that is mentioned there is a 'statisticalQualifier" which
allows
specification of the mean or the variance or a percentile, using the same
type.

Murray Woodside

Distinguished Research Professor
Dept of Systems and Computer Engineering,
Carleton University, 1125 Colonel By Drive, Ottawa K1S 5B6, Canada.
(613)-520-5721.....fax (613)-520-5727....cmw@sce.carleton.ca
(http://www.sce.carleton.ca/faculty/woodside.html)


On Sat, 5 May 2012, Dan George wrote:

> Indicated airspeed and true airspeed are both speeds but are not compatible with each other.
> E.g, the result of adding the two is not meaningful. Should I create:
> 1. ValueType for each having quantityKind=Speed
> 2. specialization of QuantityKind Speed for each and also a ValueType for each having the
> corresponding quantityKind (e.g., quantityKind=TAS)?
> Of course, #1 looks simpler but I wonder if #2 will offer benefits that, under the right
> circumstances, would outweigh the complexity.
>
> There are other cases such as altitude: baro, pressure, msl, WGS-84 geoid, WGS-84 ellipsoid,
> AGL, etc.. Even length can be broken down several ways: height, width, distance, depth, ...
>
> The goal would be to specify interconnection in such a way as to operate on quantities only in
> meaningful ways and flag an error, otherwise.
>
> Thanks,
> Dan
>
> --
> You received this message because you are subscribed to the Google
> Groups "SysML Forum" group.
> Public website: http://www.SysMLforum.com
> To post to this group, send email to sysml...@googlegroups.com
> To unsubscribe from this group, send email to
> sysmlforum+...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sysmlforum?hl=en_US?hl=en
>
>

Dan George

unread,
May 7, 2012, 10:32:18 AM5/7/12
to sysml...@googlegroups.com
Remy, the point is to restrict the use to avoid mistakes. "Device accuracy" is a great example of inappropriate usage of the two concepts IAS and TAS. By constraining the ValueTypes I can flag this error in the model.

I'm thinking I should be able to model a complete type system or hierarchy of abstract data types but I'm not sure how to do it in SysML.

Dan

Remy Fannader

unread,
May 7, 2012, 11:28:18 AM5/7/12
to SysML Forum
Dan,
Why "device accuracy" should be inappropriate if that is what users
need ? It's not difficult to think of such a requirement.
Rémy

Dan George

unread,
May 7, 2012, 11:44:44 PM5/7/12
to sysml...@googlegroups.com
Rémy, sorry but the example requires knowledge of the subject matter. If you are interested you can learn a bit about the aviation terms on wikipedia. I chose these quantities because mixing the types is sure to be a mistake. Thus, accurately representing the incompatibility in the model elements is beneficial. The more obvious, and already handled by SysML, example is a mismatch in units. Remember the Mars probe mission that went poorly because of units mismatch? Users might need "device accuracy" but finding it by computing the difference between IAS and TAS is not valid. My users will agree with that statement. The rules I'd like to formalize in a SysML model would flag such a mistake.

Dan

Remy Fannader

unread,
May 8, 2012, 1:29:12 AM5/8/12
to SysML Forum
Dan,
Then, one may ask about the purpose of such specific rules...
IMHO software engineering rules should be independent of any specific
domain.
Remy.

Dan George

unread,
May 8, 2012, 1:59:56 AM5/8/12
to sysml...@googlegroups.com
Answering my own question, it looks like the purpose of quantity kind is to provide an index into a list of allowable units. Since the units for TAS are the same as for IAS, there isn't any benefit to having a QuantityKind for each. The constraints on operators would be handled in the operations defined in the ValueType hierarchy. Option 1 is the simple and sufficient choice. Please correct me if I've got it wrong.

Dan

Dan George

unread,
May 8, 2012, 2:03:14 AM5/8/12
to sysml...@googlegroups.com
Agree. I'm not modeling software or software engineering. I'm modeling an aviation problem.

Dan

Michael Jesse Chonoles

unread,
May 8, 2012, 8:02:39 AM5/8/12
to sysml...@googlegroups.com
I probably wouldn't generally allow speeds to be added, for two reasons:
 
1) They are really a measure/projection of a vector quantity (velocity) and require a more sophisticated approach to add or subtract them.
2) They are really a derived quantity that doesn't support adding. Many rank beginner errors in physics occur because people try to add or subtract speeds. E.g., The car went  30 mph (or kph) for the 1st 30 miles, hour fast does it have to go  for the next 30 miles  to average 60 mph.

--

Dan George

unread,
May 8, 2012, 6:36:06 PM5/8/12
to sysml...@googlegroups.com, Michael Jesse Chonoles
My example is almost contrived. IAS and TAS are concepts used in aviation and addition makes does make sense on these scalar values. My real question was about the role of QuanityKind in a type system. I think I figured it out as I mentioned in a separate post.

Thanks for commenting, though.

Dan

Michael Jesse Chonoles

unread,
May 9, 2012, 6:08:43 AM5/9/12
to sysml...@googlegroups.com
yes, the type system has to support the domain concepts.

Reply all
Reply to author
Forward
0 new messages