MATLAB PROBLEM : Consider the following power supply network, consisting of powe
ID: 2082139 • Letter: M
Question
MATLAB PROBLEM: Consider the following power supply network, consisting of power supply stations (denoted S1 and S2) and power recipient nodes (N1 to N5). The arrows represent lines of power flow between supply stations and demand nodes, where flow (fi) in the direction of the arrow has a positive value (and flow in the opposite direction has a negative value).
Assuming that power supply stations must run at their capacity, that power demand at each node must be met, and that there are no losses in the network, a flow balance on each node gives the following equation Fout = Fin + p where p is the power gained or lost at that node, such the value of p is positive for supply capacity and negative for demand. For example, for supply station S1, the flow balance gives the equation F1 = pS1, while for recipient node N1, it gives the equation F3 +F6 = F4 +pN1. Because there are seven nodes overall, this results in a system of seven linear equations for the seven unknown flows.
Set up this system of equations as a matrix problem, and write a matlab program that will solve it for the unknown flows, given a reasonable set of supply capacities and recipient demand values (such that the sum of all supply capacities equals the sum of all recipient demand). Be sure to check for existence and uniqueness of the solution and use the appropriate numerical approach, (and provide a good user interface that gets additional user information if needed).
Apply the program to solve the case where the supply capacities are 10 MW and demands at each node are 4 MW (remember that p is negative for a demand)
1S2 N1 5 5 4 -. N 6 f 4 3 f f 1 fExplanation / Answer
flow balance equations:
Fout = Fin + p where p is positive for supply nodes, p is negative for demand nodes
f1 = 10e6; % equation for node s1
f4+f5 = 10e6; % equation for node s2
f3+f6 = f4-4e6; % equation for node n1
f7 = f5-4e6; % equation for node n2
f2 = 4e6; % equation for node n3
f2 = f1+f3-4e6; % equation for node n4
f6+f7 = 4e6; % equation for node n5
by rearranging above equations we get
f1 = 10e6;
f4+f5 = 10e6;
f3+f6-f4 = -4e6;
f7-f5 = -4e6;
f2 = 4e6;
f2-f1-f3 = -4e6;
f6+f7 = 4e6;
Above system of linear equations can be solved in matlab
%start of matlab code
clc;
close all;
clear all;
syms f1 f2 f3 f4 f5 f6 f7
eqn1 = f1 == 10e6;
eqn2 = f4 + f5 == 10e6;
eqn3 = f3 - f4 + f6 == -4e6;
eqn4 = -f5 + f7 == -4e6;
eqn5 = f2 == 4e6;
eqn6 = -f1 + f2 - f3 == -4e6;
eqn7 = f6 + f7 == 4e6;
[A,B] = equationsToMatrix([eqn1, eqn2, eqn3, eqn4, eqn5, eqn6, eqn7], [f1, f2, f3, f4, f5, f6, f7])
X = linsolve(A,B)
f1 = X(1)
f2 = X(2)
f3 = X(3)
f4 = X(4)
f5 = X(5)
f6 = X(6)
f7 = X(7)
%end of matlab code
ouputs I have obtained by executing above code is
f1 =
10000000
f2 =
4000000
f3 =
-2000000
f4 =
6000000
f5 =
4000000
f6 =
4000000
f7 =
0
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.