Friday, July 25, 2014

Analysis of an Electrical Network

An electical network is another type of network where analysis is commonly applied. An analysis of such a system uses two properties of electrical networks known as Kirchhoff's Laws.

1. All the current flowing into a junction must flow out of it.
2. The sum of the products IR (I is current and R is resistance) around a closed path is equal to the total voltage     in a path. 

The accompanying figure shows known flow rates of hydrocarbons into and out of a network of pipes at an oil refinery. 

(a) Set up a linear system whose solution provides the unknown flow rates. 

From the system so that the first equation represents node A, the second equation node B, etc. Then take all the variable to one side such that all the constants are on one side and positive. From the equations form the required matrices and enter the appropriate values for A below. 



a) Set up a linear system. Enter the appropriate values for A below 

Flow In = Flow Out 

A: 25 + x1 = x2 
B: x2 + x4 = x6 + 175 
C: x5 + x6 = 200 
D: x3 + 150 = x4 + x5 
E: 200 = x1 + x3 

A: x1 - x2 = -25 
B: x2 + x4 - x6 = 175 
C: x5 + x6 = 200 
D: x3 - x4 - x5 = 150 
E: x1 + x3 = 200 

[ 1 -1 0 0 0 0 -25] 
[ 0 1 0 1 0 -1 175] 
[ 0 0 0 0 1 1 200] 
[ 0 0 1 -1 -1 0 150] 
[ 1 0 1 0 0 0 200] 

= rearrange rows 
[ 1 -1 0 0 0 0 -25] 
[ 1 0 1 0 0 0 200] 
[ 0 1 0 1 0 -1 175] 
[ 0 0 1 -1 -1 0 150] 
[ 0 0 0 0 1 1 200] 

= row2 - row1 → row2 
[ 1 -1 0 0 0 0 -25] 
[ 0 1 1 0 0 0 225] 
[ 0 1 0 1 0 -1 175] 
[ 0 0 1 -1 -1 0 150] 
[ 0 0 0 0 1 1 200] 

= row2 + row1 → row1 
[ 1 0 1 0 0 0 200] 
[ 0 1 1 0 0 0 225] 
[ 0 1 0 1 0 -1 175] 
[ 0 0 1 -1 -1 0 150] 
[ 0 0 0 0 1 1 200] 

= row3 - row2 → row3 
[ 1 0 1 0 0 0 200] 
[ 0 1 1 0 0 0 225] 
[ 0 0 -1 1 0 -1 -50] 
[ 0 0 1 -1 -1 0 150] 
[ 0 0 0 0 1 1 200] 

= row3 + row4 → row4 
[ 1 0 1 0 0 0 200] 
[ 0 1 1 0 0 0 225] 
[ 0 0 -1 1 0 -1 -50] 
[ 0 0 0 0 -1 0 100] 
[ 0 0 0 0 1 1 200] 

= row4 + row5 → row5 
[ 1 0 1 0 0 0 200] 
[ 0 1 1 0 0 0 225] 
[ 0 0 -1 1 0 -1 -50] 
[ 0 0 0 0 -1 0 100] 
[ 0 0 0 0 0 1 300] 

= row3*(-1) → row3 
[ 1 0 1 0 0 0 200] 
[ 0 1 1 0 0 0 225] 
[ 0 0 1 -1 0 1 50] 
[ 0 0 0 0 -1 0 100] 
[ 0 0 0 0 0 1 300] 

= row4*(-1) → row4 
[ 1 0 1 0 0 0 200] 
[ 0 1 1 0 0 0 225] 
[ 0 0 1 -1 0 1 50] 
[ 0 0 0 0 1 0 -100] 
[ 0 0 0 0 0 1 300] 

= row3 - row5 → row3 
[ 1 0 1 0 0 0 200] 
[ 0 1 1 0 0 0 225] 
[ 0 0 1 -1 0 0 -250] 
[ 0 0 0 0 1 0 -100] 
[ 0 0 0 0 0 1 300] 

= row1 - row3 → row1 
[ 1 0 0 1 0 0 450] 
[ 0 1 1 0 0 0 225] 
[ 0 0 1 -1 0 0 -250] 
[ 0 0 0 0 1 0 -100] 
[ 0 0 0 0 0 1 300] 

= row2 - row3 → row2 
[ 1 0 0 1 0 0 450] 
[ 0 1 0 1 0 0 475] 
[ 0 0 1 -1 0 0 -250] 
[ 0 0 0 0 1 0 -100] 
[ 0 0 0 0 0 1 300] 

We now have 

x1 + x4 = 450 
x2 + x4 = 475 
x3 - x4 = -250 
x5 = -100 
x6 = 300 

The equation for A is unsolvable.



Saturday, July 5, 2014

Polynomial Curve Fitting

Suppose a collection of data is represented by n points in the xy-plane,

          ( x1 , y1 ),   ( x2 , y2 ) ,..., ( x n , yn )

and you are asked to find a polynomial function of degree n-1

          p(x) = a0 + a1x + a2x2 + ... + an-1xn-1

whose graph passes through the specified points. This procedure is polynomial curve fitting. If all x-coordinates of the points are distinct, then there is precisely one polynomial function of degree n-1 that fits the n points.
     To solve for the n coefficients of p(x), substitute each of the n points into the polynomial function and obtain n linear equations in n variables.

EXAMPLE: