Docsity

Homework Assignment 4 in ME2016D: Solving Systems of Equations and Electrical Circuits - P, Assignments of Computer Science

Toggle sidebar
bg1
ME2016D, Fall 2008, Dr. Ferri
Homework Assignment 4
Due Wednesday, September 24, 2008
Problem 1.
Given the system of equations
25.1477.0 21 =+ xx
207.12.1 21 =+ xx
(a) Use Matlab to plot the two lines and to solve graphically for x1 and x2.
(b) On the basis of the graphical solution, what do you expect regarding the condition of the
system?
(c) Solve by hand, using Gaussian-Elimination.
(a and b) The slope of the 1st line is -0.77, while the slope of the 2nd line is -1.2/1.7 = -0.7059.
With the slopes being so close, there is the potential of ill-conditioning. Looking at the plot
below, the suspicion is confirmed. The lines can be plotted using the following lines of Matlab:
» x1=0:0.5:100;
» x2_1 = 14.25 - 0.77*x1; x2_2 = (20-1.2*x1)/1.7;
» plot(x1,x2_1,x1,x2_2,'--')
» xlabel('x_1'); ylabel('x_2');
» legend('0.77*x_1 + x_2 = 14.25','1.2*x_1 + 1.7*x_2 = 20')
010 20 30 40 50 60 70 80 90 100
-70
-60
-50
-40
-30
-20
-10
0
10
20
x1
x2
0.77*x1 + x2 = 14.25
1.2*x1 + 1.7*x 2 = 20
pf3
pf4
pf5

Partial preview of the text

Download Homework Assignment 4 in ME2016D: Solving Systems of Equations and Electrical Circuits - P and more Assignments Computer Science in PDF only on Docsity!

ME2016D, Fall 2008, Dr. Ferri Homework Assignment 4 Due Wednesday, September 24, 2008

Problem 1. Given the system of equations

  1. 77 x 1 + x 2 = 14. 25
  2. 2 x 1 + 1. 7 x 2 = 20

(a) Use Matlab to plot the two lines and to solve graphically for x 1 and x 2. (b) On the basis of the graphical solution, what do you expect regarding the condition of the system? (c) Solve by hand, using Gaussian-Elimination.

(a and b) The slope of the 1st line is -0.77, while the slope of the 2nd line is -1.2/1.7 = -0.7059. With the slopes being so close, there is the potential of ill-conditioning. Looking at the plot below, the suspicion is confirmed. The lines can be plotted using the following lines of Matlab: » x1=0:0.5:100;» x2_1 = 14.25 - 0.77x1; x2_2 = (20-1.2x1)/1.7; » plot(x1,x2_1,x1,x2_2,'--')» xlabel('x_1'); ylabel('x_2'); » legend('0.77x_1 + x_2 = 14.25','1.2x_1 + 1.7x_2 = 20')*

-70 0 10 20 30 40 50 60 70 80 90 100

0

10

20

x (^1)

x^2

0.77x 1 + x 2 = 14. 1.2x 1 + 1.7*x 2 = 20

(c) Without pivoting, we can subtract f 21 =1.2/0.77 times equation 1 from equation 2. The second equation changes to:

⎭⎬

x

x 0 0.

2

1

Back-substitution: x 2 =− 02. 14156.^20779 =-15.

x 1 =(^14.^25 −( 0 -. 77 15.59633))= 38.

So, solution is: { } x = ⎩⎨⎧−^3815.^76147. 59633 ⎭⎬⎫

Problem 4. The electrical circuit below can be described by the following system of equations:

5

4

3

2

1 2 3

1 4

1 5 3 E

E

E

i

i

i

i

i R R

R R

R R R

The physical variables are R 1 = 1 Ohm, R 2 = 2 Ohm, R 3 = 2 Ohm, R 4 = 1 Ohm, R 5 = 1 Ohm, E = 10 volts.

(a) Use Gaussian elimination to solve for the currents i 1 through i 5. Use partial pivoting as necessary. (b) What is the voltage drop across R 5 , if the voltage drop is equal to the resistance times the current?

E

R 1

R 5

R 2

R 3

R 4

i 1

i

i 2

i i^4 i 5 i^3

Solution: Substitute numerical values for resistances and voltages:

5

4

3

2

1

i

i

i

i

i

Step k = 3 : Use factors f 43 =1/2; f 53 = -1/2;

5

4

3

2

1

i

i

i

i

i

Step k = 4 : Use factor f 54 =-1/3;

5

4

3

2

1

i

i

i

i

i

End of the elimination phase. Begin back-substitution phase:

i 5 =−− 1025 // 33 = 2. 5

i 4 = (^5 1 +. 5 i^5 )= 17 .. 55 = 5

i 3 = (^ −^10 +− i^42 +^2 i^5 )=(−^10 −+ 25 +^5 )= 0

i 2 = (^10 − 22 i^5 )=(^102 −^5 )= 2. 5

i 1 = (^10 − i^31 −^2 i^5 )=(^10 − 10 −^5 )= 5

Solution: { }

i Part (b): Voltage drop across resistor R5 is zero since i3=0.