Modelica 用变频测量平均值

Modelica 用变频测量平均值,modelica,openmodelica,Modelica,Openmodelica,我想测量具有可变频率的正弦电压的RMS值 实际频率通过锁相环测量 问题是,普通的“平均”块只在频率作为固定参数,而不是变量的情况下工作 是否有任何方法将测量的频率用作任何类型的平均块的频率,该平均块可用于计算RMS值 附有标准OpenModelica块的基本示例代码 model var_rms Modelica.Electrical.Analog.Basic.Ground ground annotation( Placement(visible = true, transform

我想测量具有可变频率的正弦电压的RMS值

实际频率通过锁相环测量

问题是,普通的“平均”块只在频率作为固定参数,而不是变量的情况下工作

是否有任何方法将测量的频率用作任何类型的平均块的频率,该平均块可用于计算RMS值

附有标准OpenModelica块的基本示例代码


 model var_rms
  Modelica.Electrical.Analog.Basic.Ground ground annotation(
    Placement(visible = true, transformation(origin = {-66, -48}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Basic.Resistor resistor(R = 10)  annotation(
    Placement(visible = true, transformation(origin = {8, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Sensors.VoltageSensor voltageSensor annotation(
    Placement(visible = true, transformation(origin = {8, -34}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Blocks.Math.RootMeanSquare rootMeanSquare annotation(
    Placement(visible = true, transformation(origin = {58, -72}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Blocks.Sources.Step Frequency_from_PLL(offset = 50, startTime = 0.5)  annotation(
    Placement(visible = true, transformation(origin = {40, -28}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage(V = 230, freqHz = 50.5) annotation(
    Placement(visible = true, transformation(origin = {50, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(voltageSensor.n, resistor.n) annotation(
    Line(points = {{18, -34}, {18, 50}}, color = {0, 0, 255}));
  connect(voltageSensor.p, resistor.p) annotation(
    Line(points = {{-2, -34}, {-2, 50}}, color = {0, 0, 255}));
  connect(resistor.p, ground.p) annotation(
    Line(points = {{-2, 50}, {-66, 50}, {-66, -38}, {-66, -38}}, color = {0, 0, 255}));
  connect(voltageSensor.v, rootMeanSquare.u) annotation(
    Line(points = {{8, -46}, {8, -72}, {46, -72}}, color = {0, 0, 127}));
  connect(sineVoltage.n, ground.p) annotation(
    Line(points = {{60, 50}, {76, 50}, {76, -4}, {-66, -4}, {-66, -38}, {-66, -38}}, color = {0, 0, 255}));
  connect(sineVoltage.p, resistor.n) annotation(
    Line(points = {{40, 50}, {18, 50}}, color = {0, 0, 255}));
  annotation(
    uses(Modelica(version = "3.2.3")));
end var_rms;

复本,复本。