加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

学习SysML空调例子

(2010-01-03 19:34:50)
标签:

杂谈

分类: 论文后记
   聚散皆是缘
   用SysML能够非常准确地对对各种系统建模,那么到底怎么建呢? 
    首先来了解一下SysMl的一些特性,其实SysMl 在UML的基础上进行了拓展(stereotype),就是这个单词,为了理解它,哥们可是花了很长时间,能够画 Requirement diagram、Block Definition Diagram , Internal Block Diagram, Parametric Diagram,有了这些图以后能够更好地描绘系统工程(SE).
    首先简单地了解一下我们要描述的系统,名叫Temperature Regulation Loop(温度调节环),现实生活中的实例是 空调,即可以简单地认为通过空调的调节器 来比较具体的温度和我们想要的温度 , 然后根据比较的结果决定是启动Cooling System 还是 Heating System.
    那么我们现在要做的就是利用SysMl来描述Temperature Regulation Loop,我们的需求是要达到一定的comfort, 一定的 accuracy, 一定的speed,一定的consumption, 一定的Temperature setting(在这里居然没有涉及到软件设计最看重的  什么耦合性降低)。
 
TemperatureRegulationLoop系统的包含的模块有: TemperatureRegulationContext<<System Context Block>>, TemperatureRegulation<<System block>>,ControlPanel <<block>>, Regulator <<block>>,
AllOrNothingRegulator <<block>>, CoolingSystem <<block>>, HeatingSystem <<block>>,TemperatureSensor <<block>>, Room <<block>>, Air <<block>>, Settings <<block>>
, iSettings <<interface>>, User <<actor>>, 在这些模块里面, 具体也包含了一些具体的关键词,
-<<actuator>>-:  categorize the actuator devices。
 
   在这里我们将会看到使用SysML 的几个特有的diagram 来描述我们的系统,并且最后自动生成java代码,
温度调节循环的IBD为:


BDD中包含的ValueTypes and DataTypes 有: Electricity <<ValueType>>, TemkperatureSignal, Temperature, Volume, Heat, Time, Actions , ActuatorSignal , ActuatorState, all of these is in TemperatureRegulationDomain. 

接下来, 我们讨论系统的逻辑运算部分,即约束部分, Subtraction <<constraint>> { o = ct -it}:
parameters ct:Real, o: Real, it:Real. another constraint is : uation <<constraint>>, if  i > 0 then heating = 1 and cooling = 0 if i < 0  then heating  = 0 and cooling  = 1 if i = 0 heating  = 0 and cooling = 0
parameters must also satisfy: i: Real cooling:Real heating : Real


Actually , the AllOrNothingRegulator is composed of one ution ConstraintBlock and one Subtraction ConstraintBlock.


Block Definition Diagram is :
得到了BDD, 接下来 an internal block diagram will be created in the TemperatureRegulation , which shows how the different blocks constituting the system are interconnected. This diagram shows  what really flows through the different Flow Ports of the system.

接下来是在不同的diagram之间进行navigation(导航链接):

Block Definition Diagram of the Java classes simulating the SysML blocks:
模拟最后要用到公式为 Q = Pair * CPair * Vair * 'q ;



0

阅读 收藏 喜欢 打印举报/Report
前一篇:孤鹜齐飞
后一篇:师姐博士答辩
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有