混合动力系统建模-油箱加注

说明

这个例子展示了一个同时具有连续时间和离散事件段的混合系统。离散事件部分对由实体表示的储罐进行建模,这些实体正在排队并需要填充。每个坦克都有一个“容量”属性。连续时间部分用积分器模拟加满油箱的过程。当一个油箱装满后,这个事件可以被一个命中交叉块检测到,它将生成一个与此事件相对应的消息。生成的消息将触发服务器释放油箱。

Structure of the Model

模型包括以下组件:

  • 坦克发电机:定期生成每个具有任意指定容量属性的储罐。

  • 等待队列:排队等待填充的储罐

  • 给这个油箱加油: Serves tanks and calls into the Simulink FunctionstartFilling将坦克的“容量”属性传递到模型的基于时间的部分。

  • Tank Filling:模拟每个油箱加注到最大容量的过程

  • Sensor:检测油箱中的加注量何时达到容量,当发生这种情况时,向模式的离散事件部分发送消息l. Sensor serves as a bridge between the time-based section and even-based section.

  • 处理器: Receives message generated from the Sensor and decides which tank to be released from the Server. It then calls the Simulink Function named释放to generate a release message for a specific tank.

  • 选择ion Gate:接收到释放消息,作为响应,打开闸门让特定的储罐通过。

  • Configure Demo:设置加油站的加油机数量,打开/关闭动画。为了显示这个动画,请使用一个在1到20之间的气泵。

时域与事件域的域交叉

SimEvents通过在需要的地方自动插入网关来自动处理跨时间和事件域的任何数据交换。这些位置在模型中使用E.In this model, a gateway has been inserted at the input port of the Entity Queue block that is connected to the Hit Crossing block since it receives a message from the time domain section of the model.

结果

The Scope block labeled "Fill Process" and "Trucks leaving after fill" shows the results of the simulation.

如果Show Animationcheck box is selected inConfigure Demo,将出现一个动画窗口,用于可视化演示。下面是四个气泵的动画截图:

另请参见

||

相关的话题