.Modelica_LinearSystems2.TransferFunction.Import.fromModel

Information

Syntax

tf = TransferFunction.Import.fromModel(modelName, T_linearize, fileName)

Description

Generate a matrix of TransferFunction data records by linearization of a model defined by modelName. The linearization is performed at time T_linearize of the simulation. The system is generated using StateSpace.Import.fromFile followed by a conversion from state space to transfer function representation.

Example

  String modelName = "Modelica_LinearSystems2.Utilities.Plants.DoublePendulum";
  Real T_linearize = 5;

algorithm
  tf = Modelica_LinearSystems2.TransferFunction.Import.fromModel(modelName, T_linearize);

//  tf = [(0.13*s^4 + 0.05558*s^3 + 1.12241*s^2 - 5.16971*s + 9.04744)/(s^6 + 0.09*s^5 + 9.13717*s^4 - 32.0637*s^3 + 58.78*s^2 + 6.3659e-014*s - 1.1703e-014);
          (0.13*s^4 + 0.05558*s^3 + 1.12241*s^2 - 5.16971*s + 9.04744)/(s^5 + 0.09*s^4 + 9.13717*s^3 - 32.0637*s^2 + 58.78*s - 2.7929e-015);
          (-0.014*s^2 + 0.31906*s - 0.8106)/(s^4 + 0.09*s^3 + 9.13717*s^2 - 32.0637*s + 58.78);
          (-0.014*s^3 + 0.31906*s^2 - 0.8106*s)/(s^4 + 0.09*s^3 + 9.13717*s^2 - 32.0637*s + 58.78);
          (-0.1*s^2 - 0.160918*s - 0.21842)/(s^4 + 0.09*s^3 + 9.13717*s^2 - 32.0637*s + 58.78);
          (-0.1*s^3 - 0.160918*s^2 - 0.21842*s)/(s^4 + 0.09*s^3 + 9.13717*s^2 - 32.0637*s + 58.78)]

Interface

function fromModel
  import Modelica;
  import DymolaCommands;
  import Simulator = DymolaCommands.SimulatorAPI;
  import Modelica_LinearSystems2;
  import Modelica_LinearSystems2.StateSpace;
  import Modelica_LinearSystems2.TransferFunction;
  input String modelName "Name of the Modelica model" annotation(
    Dialog(__Dymola_translatedModel(translate = true)));
  input Real T_linearize = 0 "Point in time of simulation to linearize the model";
  input String fileName = "dslin" "Name of the result file";
  output TransferFunction tf[:, :];
end fromModel;

Generated at 2024-11-22T19:25:38Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos