Modelica标准库基本用法_Blocks_Sources_RealExpression

图标


介绍

The (time varying) Real output signal of this block can be defined in its parameter menu via variable y. The purpose is to support the easy definition of Real expressions in a block diagram. For example, in the y-menu the definition "if time < 1 then 0 else 1" can be given in order to define that the output signal is one, if time ≥ 1 and otherwise it is zero. Note, that "time" is a built-in variable that is always accessible and represents the "model time" and that variable y is both a variable and a connector。

"time"是一个内置变量,指仿真中的时间变量;可在字符串中编写和“time”相关的函数,即

real y = Function(real time);

IO

输入:字符串;

输出:实数;

Modelica.Blocks.Interfaces.RealOutput y=0.0 "Value of Real output"

用例


输出结果


代码

model test1
  Modelica.Blocks.Sources.RealExpression realExpression1(y = if time > 1 then 2.43 else 0)  annotation(
    Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
 
annotation(
    uses(Modelica(version = "3.2.2")));end test1;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值