Calculations Concerning Paths, Closed Loops and Transfer Functions

This section shows an interesting way to calculate paths and closed loops. It is a tool to compute routes in oriented graphs.

It is possible to Save/Load files in the menu Arquivo -> Salvar (to save) and Arquivo -> Carregar (to load).

To access the module, choose Grafos de Fluxo de Sinais in menu Equações Diferenciais (like shown in the picture).

I suggest going straight to the examples and check the commands below when necessary.

The graph commands to create and link nodes are:

Change node name
Double-click the node and write the new name

Create new node
Click button Adicionar Nó

Select node
Click the node. Selected node now has blue background

Unselect node
Click on the selected node

Link node A (origin) to node B (destination)
Select node A and click node B. The associated transfer function will be the one in the textbox Função de Transferência.

Modify transfer function
Change the textbox Função de Transferência

Move node
Select the node to move and click the desired position

Remove link between origin A and destination B
Select node A and click node B (as if you were going to create link)

Remove node
Select node and click button Remover Nó

The signal graph has some implementations for oriented graphs, such as:

  • All closed loops detection

  • Identification of closed loops that don’t touch each other (2 on 2, 3 on 3, etc.)

  • Detection of all paths from a given node to a destination node

  • Implementation of Mason’s formula for calculating the transfer function of a dynamic system represented by its signal graph


Example 1. A seller wants to go from city A to city B, without going two times through the same city, but going through as many cities as possible to sell his products, as shown:

Create the arrangement:

1 – Click Adicionar Nó;
2 – Double-click the created node and type the new name;
3 – Click the node to select it. Its background turns blue (means node is selected);
4 – Click somewhere on the screen to move the node;
5 – Repeat steps 1 to 4 until all nodes have been added;
6 – To create a link, click on the origin node. Its background becomes blue. Then click the destination node. Notice that the link has an orientation.
7 – Repeat step 6 until all links are created.
8 – To delete a link, click the origin node. Its background becomes blue. Then click the already linked node. The link disappears.

To know the paths that link A to B:

1 – Click Análise -> Caminhos entre nós.
2 – Choose origin node: “Escolha o nó de origem:” A
3 – Choose destination: “Escolha o nó de destino:” B

The result is:

Caminhos partindo de A que chegam em B:  (Means: Paths from origin A to destination B)
Caminho 1: A->C1->C4->B br /> Caminho 2: A->C1->C2->C5->B
Caminho 3: A->C2->C5->B
Caminho 4: A->C3->C6->B
CCaminho 5: A->C3->C5->B

The second path (Caminho 2) should be chosen.

Example 2: How many closed loops are there? How many don’t touch each other? In a real world problem, these answers could bee used to calculate how many distribution points should exist.

Click Análise -> Malhas fechadas:

Total de malhas fechadas: 2  (Means total closed loops: 2)
Malha 1: A->C1->A
Malha 2: B->C4->B

Malhas fechadas que não se tocam: (Means closed loops that do not touch each other)
2 a 2:1 e 2

Transfer Function Example

Example 3: Consider the following dynamic system, as per Massa-mola.mcg file (you can load it using Arquivo -> Carregar):

Calculate the system determinant and transfer function E1/x.
1 – Click Análise -> Determinante do Sistema;
2 – Copy the expression to some symbolic manipulation software (MATLAB symbolic, Maple or Mathematica, for examplee) to simplify it;
3 – Click Análise -> Função de Transferência;
4 – Pick entrada E1 and saída x (entrada = origin, saída = destination);
5 – Simplify the expression as in 2.

One thought on “Calculations Concerning Paths, Closed Loops and Transfer Functions”

Leave a Reply

Your email address will not be published. Required fields are marked *