Main Content

使用 Simulink 进行基于模型的设计

建模是为真实系统创建虚拟表示的一种方法。您可以在各种条件下仿真此虚拟表示,以观察其行为。

建模和仿真对于测试单独使用硬件原型时难以重现的情形非常有用。在尚无硬件可用的设计过程早期阶段尤其如此。交替进行建模和仿真可以减少设计过程后期发现的错误数量,从一开始就提高系统设计的质量。

您可以从模型中自动生成代码,当包含软件和硬件实现要求时,还可以创建测试平台进行系统验证。代码生成可以节省时间,并避免引入手动编码错误。

在基于模型的设计中,系统模型是工作流的核心。利用基于模型的设计,可以快速且经济高效地开发动态系统,包括控制系统、信号处理系统和通信系统。

基于模型的设计允许您:

  • 让各个工程团队使用同一个设计环境

  • 将设计与要求直接挂钩

  • 将测试与设计相结合,不断发现并更正错误

  • 通过多域仿真对算法进行细化

  • 自动生成嵌入式软件代码和文档

  • 开发和重用测试套件

A diagram shaped like an arrow is labeled with the steps of model-based design. The left half of the arrowhead, moving from the outside toward the arrow tip, lists these steps: requirements, system-level design, subsystem design, and subsystem implementation. The right half of the arrowhead, moving from the outside toward the arrow tip, lists these steps: complete integration and test, system integration and test, subsystem integration and test, and subsystem implementation. The arrow tail, moving from the outside towards the arrow tip, lists these steps: system specification, high-level design, and low-level design.

Simulink 中基于模型的设计工作流示例

开始基于模型的设计任务之前,请考虑以下工作流。

The flow chart is V-shaped. The listed steps start in the upper left, move towards the tip of the V, and then to the right. The left half of the chart, moving from the outside towards the tip, lists these steps: determine modeling goals, determine components, model system layout model components, analyze model, and design new components. The right half, moving from the tip towards the outside, lists these steps: test designed components, test system components, integrate components, test system model. There is also an arrow connecting the model components step to the test system components step.

本教程中的工作流重点介绍与基于模型的设计相关的基本 Simulink® 任务。

此工作流中的前两个任务为现有系统建模,并建立设计组件的环境。此工作流的下一步是实现新组件。您可以使用快速原型和嵌入式代码生成产品(例如 Simulink Real-Time™ 和 Embedded Coder®)来生成代码,并将设计用于真实的物理系统。

相关主题

外部网站