Block Diagram Components - S0 - DISO

Gallery
Tutorial
Click on the image to view it full size
The Modelica By Example tutorial actually has Product and Sum as vector MISO extensions, and its Feedback does not extend a DISO (because the Modelica library doesn't have one):

The Modelica By Example target code for Feedback is:


within ModelicaByExample.Components.BlockDiagrams.Components;
block Feedback "A block to compute feedback terms"
  Interfaces.RealInput u1
    annotation ...
  Interfaces.RealInput u2 annotation ...
  Interfaces.RealOutput y
    annotation ...
equation
  y = u1-u2;
end Feedback;
And for its MISO versions of Sum and Product it has:

within ModelicaByExample.Components.BlockDiagrams.Components;
block Sum "Block that sums its inputs"
  extends Interfaces.MISO;
equation
  y = sum(u);
end Sum;

within ModelicaByExample.Components.BlockDiagrams.Components;
block Product "Block that outputs the product of its inputs"
  extends Interfaces.MISO;
equation
  y = product(u);
end Product;

In this SysML/SysPhS trail version, to keep things simple for now, instead of using the MISO here a DISO is introduced along with an extending Add and Multiplyfrom the SysPhS Library directly they are extended so custom stereotype icons can be introduced.

The exported complete Modelica code for the SysML/SysPhS blocks is:


  model DISO
    Modelica.Blocks.Interfaces.RealInput u1;
    Modelica.Blocks.Interfaces.RealOutput y;
    Modelica.Blocks.Interfaces.RealInput u2;
  end DISO;

  model Add
    extends DISO;
  equation
    y=u1+u2;
  end Add;

  model Multiply
    extends DISO;
  equation
    y=u1*u2;
  end Multiply;

  model Feedback
    extends DISO;
  equation
    y=u1-u2;
  end Feedback;
Up next
Notes
Snippets (quotes/extracts)
Visit also
Visit also (backlinks)
Related slides (includes other tutorials)
Related slides (backlinks, includes other tutorials)
External links