主要内容

本页翻译不是最新的。点击此处可查看最新英文版本。

典型 Simscape 语言任务

Simscape™ 模块库包含一套全面、表示工程组件的精选模块,例如阀门、电阻器、弹簧等。但是,这些预置模块可能不足以满足您特定的工程需求。当您需要扩展现有模块库时,请使用 Simscape 语言将自定义组件甚至是新的物理域定义为文本文件。然后将文本组件转换为可在您的模型图中使用的额外 Simscape 模块的库。

下表列出了典型任务以及指向背景信息和示例的链接。

任务背景信息示例
根据方程创建自定义组件模型

Creating Custom Components

Declaring Domains and Components

Defining Component Equations

Model Linear Resistor in Simscape Language

Declare a Spring Component

Mechanical Component — Spring

Electrical Component — Ideal Capacitor

No-Flow Component — Voltage Sensor

Grounding Component — Electrical Reference

创建由其他组件构成的自定义组件模型

About Composite Components

Declaring Member Components

Parameterizing Composite Components

Specifying Component Connections

Composite Component — DC Motor

基于 Simscape 组件文件生成自定义模块

Selecting Component File Directly from Block

Customizing the Block Name and Appearance

Deploy a Component File in Block Diagram

Customize Block Display

将自定义模块库添加到 Simscape 库中

Building Custom Block Libraries

Using Source Protection for Simscape Files

Customizing the Library Name and Appearance

Customizing the Block Name and Appearance

Create a Custom Block Library

Customize Block Display

定义一个新域以及关联的流变量和势变量,然后在自定义组件中使用它

When to Define a New Physical Domain

Declaring Domains and Components

Declare a Mechanical Rotational Domain

Propagation of Domain Parameters

创建一个组件,为模型的其余部分提供域范围的参数(例如流体温度)

Working with Domain Parameters

Custom Library with Propagation of Domain Parameters

创建具有离散的不同操作模式特征的组件,例如汽车离合器

Mode Chart Modeling

Switch with Hysteresis

另请参阅

主题