创建自定义组件和库
浏览关于如何创建自定义组件和库的示例。
相关信息
精选示例
车辆暖通空调系统
该示例对车辆暖通空调 (HVAC) 系统中的湿空气流动进行建模。车辆座舱表示为与外部环境交换热量的湿空气体积。湿空气流经再循环风门、鼓风机、蒸发器、混合门和加热器,然后返回座舱。再循环风门选择从座舱或外部环境流动进气。混合门引导加热器周围的气流来控制温度。
飞机环境控制系统
此示例对飞机环境控制系统 (ECS) 进行建模,该系统可调节压力、温度、湿度和臭氧 (O3),以维持舒适安全的机舱环境。空气循环机 (ACM) 提供冷却和除湿,该循环机以逆布雷顿循环方式工作,以去除增压热发动机引气中的热量。一些热引气直接与 ACM 的输出混合以调节温度。机舱内的出流阀负责维持增压状态。此模型模拟 ECS 从热的地面状态到冷的巡航条件再回到冷的地面状态的运行。
PEM 燃料电池系统
此示例展示如何使用自定义 Simscape™ 模块对质子交换膜 (PEM) 燃料电池电堆进行建模。PEM 燃料电池通过消耗氢气和氧气并产生水蒸气来发电。该自定义模块代表膜电极组件 (MEA),并连接两个独立的湿空气网络:一个用于阳极气体流,一个用于阴极气体流。
PEM 电解系统
此示例展示如何使用自定义 Simscape™ 模块对质子交换膜 (PEM) 水电解槽进行建模。PEM 电解槽消耗电能将水分解成氢气和氧气。该自定义模块代表膜电极组件 (MEA),并连接到一个热液体网络和两个独立的湿空气网络:热液体网络对供水进行建模,阳极湿空气网络对氧气流进行建模,阴极湿空气网络对氢气流进行建模。
Ultracapacitor Energy Storage with Custom Component
Use the Simscape™ example library Capacitors_lib. The model is constructed using components from the example library. The circuit charges an ultracapacitor from a constant 0.05 amp current source, and then delivers a pulse of current to a load. The ultracapacitor enables a much higher current to be delivered than is possible directly from the current source. The library contains capacitor models with different levels of fidelity to allow exploration of the effect of losses and nonlinearity.
传输线
此示例展示了一个集总参数传输线模型。它由一个自定义 Simscape™ 组件构建而成,该组件定义了单个 T 形段。该模型将 50 个段连接起来,每段长度为 0.1m,从而实现了对长度为 5m 的同轴电缆的建模。从仿真结果可以观察到传输延迟。
发动机冷却系统
此示例展示如何使用自定义热液体模块对基本发动机冷却系统进行建模。固定排量泵通过冷却电路驱动水。发动机发出的热量被水冷却剂吸收并通过散热器散发。系统温度由恒温器调节,仅当温度高于阈值时,恒温器才会将热流转移到散热器。
使用自定义组件的布雷顿循环(燃气涡轮机)
此示例基于布雷顿循环对燃气涡轮机辅助动力装置 (APU) 进行建模。压缩机和涡轮机模块是基于 Simscape™ Foundation Gas 库的自定义组件。系统的功率输入由注入燃烧室的热量表示;实际的燃烧化学没有建模。一个单轴连接压缩机和涡轮机,以便来自涡轮机的动力驱动压缩机。APU 是一种自由涡轮机,可进一步扩大排气流以产生输出功率。
朗肯循环(汽轮机)
此示例基于朗肯循环对汽轮机系统进行建模。该循环包括过热和再加热,以分别防止高压涡轮和低压涡轮中发生冷凝。该循环还通过将抽取的蒸汽传递到闭环式给水加热器来实现再生,以加热水并提高循环效率。
Battery Cell with Custom Electrochemical Domain
Use the Simscape™ example library ElectroChem_lib. In the model Fe3+ ions are reduced to Fe2+, and Pb is oxidized to Pb2+, thereby releasing chemical energy. The molar flow rate of lead ions is half that of the iron ions as two electrons are exchanged when Pb is oxidized to Pb2+. The chemical potential of the Pb source is by convention zero as it is a solid.
铅酸电池
此示例展示了如何使用 Simscape™ 语言对铅酸电池电芯进行建模,以实现等效电路组件的非线性方程。与完全在 Simulink® 中建模相反,这样能更容易理解模型组件和定义物理方程之间的联系。有关定义方程及其验证,请参阅:Jackey, R."A Simple, Effective Lead-Acid Battery Modeling Process for Electrical System Component Selection", SAE World Congress & Exhibition, April 2007, ref.2007-01-0778。
锂电池电芯 - 单 RC 支路等效电路
此示例展示如何使用 Simscape™ 语言对锂单元进行建模,以实现具有一个 RC 支路的等效电路模型的元件。有关定义方程及其验证,请参阅:T. Huria, M. Ceraolo, J. Gazzarri, R. Jackey."High Fidelity Electrical Model with Thermal Dependence for Characterization and Simulation of High Power Lithium Battery Cells," IEEE International Electric Vehicle Conference, March 2012.
锂电池电芯 - 双 RC 支路等效电路
此示例展示如何使用 Simscape™ 语言对锂单元进行建模,以实现具有两个 RC 支路的等效电路模型的元件。有关定义方程及其验证,请参阅:T. Huria, M. Ceraolo, J. Gazzarri, R. Jackey."High Fidelity Electrical Model with Thermal Dependence for Characterization and Simulation of High Power Lithium Battery Cells," IEEE International Electric Vehicle Conference, March 2012.
使用数组对故障锂离子电池包进行仿真
此示例展示如何对由多个串联单元组成的电池包进行仿真。它还展示了如何在一个单元中引入故障来查看故障对电池性能和单元温度的影响。电池包通过使用数组将单元模型串联起来,采用 Simscape™ 语言进行建模。您可以通过为故障单元定义不同的参数来表示故障。
Variable Transport Delay
Use Simscape™ to model a variable transport delay. The Transport Delay block models signal propagation through media moving between the Input and the Output terminals. The media velocity may vary, thus it is specified through the block port. The distance between the terminals as well as the initial output are constant and they are specified as block parameters.
Asynchronous PWM Voltage Source
How the Simscape™ Foundation Library PS Asynchronous Sample & Hold block can be used to build components with more complex behaviors. The model implements a controllable PWM voltage source where the PWM on-time (the duty cycle) is proportional to the physical signal input u.
Discrete-Time PWM Voltage Source
How the discrete-time Simscape™ Foundation Library PS Counter block can be used to build components with more complex behaviors. The model implements a controllable PWM voltage source where the PWM on-time (the duty cycle) is proportional to the physical signal input u.
Actuation Circuit with Custom Pneumatic Components
Model a controlled actuator using simplified custom pneumatic components. There are two across variables, defined as pressure and temperature, and two through variables, defined as mass flow rate and heat flow rate. The simplified approach means that every node in the circuit must have a volume of gas associated with it. This physical volume of gas in the circuit is represented by the Constant Volume Pneumatic Chamber blocks, the Pneumatic Piston Chamber blocks, and the Pneumatic Atmospheric Reference block. Conversely, the Foundation Library gas components require no such connection rules at every node. See the 气动执行电路 example for a more capable way of modeling pneumatic systems using Foundation Library gas components.
Simscape Functions
Write Simscape™ functions to compute numerical values with Simscape expressions and how to use Simscape functions to improve code reuse across components. The top two Simscape component blocks ( inside the "Use no Simscape functions" box ) are respectively created using two Simscape component files. Comparing these two component files, similar Simscape expressions can be observed on the right hand side of the equation to compute numerical values, which is essentially a modification of exp(i) to provide protection for large magnitude of i. Such expressions are common in standard diode modeling. Using Simscape functions, such expressions are abstracted out into a Simscape function file, and their usages inside the component files are replaced by calls to such Simscape functions. The bottom two Simscape component blocks ( inside the "Use Simscape functions" box ) are created using component files using Simscape functions.
Mass on Cart Using an Ideal Hard Stop
A cart bouncing between the two ends of an ideal hard stop, while a mass slides freely on top of it. The friction between the mass and cart is modeled using an ideal, modechart-based friction block, while the hard stop is modeled using instantaneous modes and entry actions. When the cart hits the bounds of the hard stop, the impulsive force is propagated to the mass above, causing it to be displaced as it transitions from static to dynamic friction modes.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)