Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Modelica模型中设置DynamicSelect表达式_Modelica_Dymola - Fatal编程技术网

如何在Modelica模型中设置DynamicSelect表达式

如何在Modelica模型中设置DynamicSelect表达式,modelica,dymola,Modelica,Dymola,我计划在文本字符串中显示变量的数量,因此我在中检查了DynamicSelect表达式的用法,如下所示: 这里是我制作的一个示例,它只包含一个Modelica.Blocks.Sources.Sine组件和一个文本标签,但我不确定为什么文本在模拟过程中没有更改。看起来DynamicSelect表达式根本不起作用。 我的问题是: 如何设置DynamicSelect表达式以使其工作 model fsdaf Modelica.Blocks.Sources.Sine sine(amplitude=1

我计划在文本字符串中显示变量的数量,因此我在中检查了DynamicSelect表达式的用法,如下所示:

这里是我制作的一个示例,它只包含一个Modelica.Blocks.Sources.Sine组件和一个文本标签,但我不确定为什么文本在模拟过程中没有更改。看起来DynamicSelect表达式根本不起作用。
我的问题是:
如何设置DynamicSelect表达式以使其工作

model fsdaf

  Modelica.Blocks.Sources.Sine sine(amplitude=100, freqHz=1)
    annotation (Placement(transformation(extent={{-124,-10},{-104,10}})));
equation 

  annotation (Diagram(graphics={
          Text(
          extent={{-22,60},{98,10}},
          lineColor={28,108,200},
          fillColor={238,46,47},
          fillPattern=FillPattern.None,
          textString=DynamicSelect(10,string(sine.y)))}),
          uses(Modelica(version="3.2.3")));
end fsdaf;

  • 请使用
    String()
    将数值转换为字符串
  • 浏览在不同位置使用DynamicSelect的
  • 以下是Modelica标准库版本4的一个改进示例,模拟速度减慢:
  • 请使用
    String()
    将数值转换为字符串
  • 浏览在不同位置使用DynamicSelect的
  • 以下是Modelica标准库版本4的一个改进示例,模拟速度减慢:

结果是我需要使用
String()
而不是
String()
。结果是我需要使用
String()
而不是
String()
model TestDynamicSelect
  Modelica.Blocks.Sources.Sine sine(amplitude=100, f=1) annotation(Placement(transformation(extent={{-80,40},{-60,60}})));
  Modelica_DeviceDrivers.Blocks.OperatingSystem.RealtimeSynchronize realtimeSynchronize annotation(Placement(transformation(extent={{-80,0},{-60,20}})));
  annotation(experiment(StopTime=10), Diagram(graphics={
   Text(
     extent={{-22,60},{98,10}},
     lineColor={28,108,200},
     fillColor={238,46,47},
     fillPattern=FillPattern.None,
     textString=DynamicSelect(10,String(sine.y)))}),
   uses(Modelica(version="4.0.0"), Modelica_DeviceDrivers(version="2.0.0")));
end TestDynamicSelect;