How to create a Network Node Incidence Matrix?

Hello guys, I am currently working on an IEEE paper which uses the Data of an IEEE-24 Bus System. I need to construct a Network Node Incidence Matrix (A) which consists of 21 nodes and 38 branches. I know Matlab has a function called incidence, but I am unable to figure out how to use this in order to create the Incidence Matrix. I am giving below the details of the nodes and branches.
from to
1 2
1 3
1 5
2 4
2 6
3 9
3 24
4 9
5 10
6 10
7 8
8 9
8 10
9 11
14 1
9 12
10 11
10 12
11 13
11 14
12 13
12 23
13 23
14 16
15 16
15 21
15 21
15 24
16 17
16 19
17 18
17 22
18 21
18 21
19 20
19 20
20 23
20 23
21 22
I tried to solve it using the Incidence function on matlab, but I am getting the following error: Error using matlab.internal.graph.MLGraph Duplicate edges not supported.
Error in matlab.internal.graph.constructFromEdgeList (line 125) G = underlyingCtor(double(s), double(t), totalNodes);
Error in graph (line 287) matlab.internal.graph.constructFromEdgeList(...
I am not sure where I am going wrong.
Any help would be appreciated. Thank you.

1 Comment

please can share the code here. i have the same problem.

Sign in to comment.

Answers (2)

Hi. It seems like at some point you are creating a graph object with an edge list that has duplicate edges, for example there are two pairs of (20,23). The graph object constructor therefore complains about it.
This project will help you to understand and implement the basics of Graphs and
Networks. You are given a directed graph below. Your task is to construct an
incidence matrix to tell how nodes are connected with edges. Then solve the
resultant m by m matrix n through MATLAB. Think it as an application of KCL
and KVL where the edges represent current flow direction and nodes show the
voltages.

Categories

Find more on Networks in Help Center and File Exchange

Asked:

on 30 Nov 2017

Answered:

on 19 Jun 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!