Sunteți pe pagina 1din 5

Name:

Assignment number:

Date:

QUESTION 1

Matrix A
15 -3 -1
a) -3 18 -6
-4 -1 12

Inverse Matrix a
0.072539 0.012781 0.012435
0.020725 0.060794 0.032124
0.025907 0.009326 0.090155

b)
Matrix B
4000
1500
2400

solution
c1= 339.171
c2= 251.1917
c3= 333.9896

consider the rate of mass input to reactor 3 be


c) ΔW3

ΔW3= Δc1
a13

ΔW3= 804.1667

Hence, rate of mass input must be


increased to 804.1667 g/day
consider the reduced rate of mass input to
d) reactor 1 be
ΔW1= -250 g/day
ΔW3= -500 g/day

Reduced concentration of ractor 3 is

Δc3= a31ΔW1 + a32ΔW2

Δc3= -15.285

QUESTION 2

clc

a)

A = [13.422 0 0 0;...
-13.422 12.252 0 0;...
0 -12.252 12.377 0;...
0 0 -12.377 11.797];

B = [750.5; 300; 102; 30];

AI = inv(A) % find matrix of the matrix

AI =

Columns 1 through 3

0.074504544777231 0 0
0.081619327456742 0.081619327456742 0
0.080795023026582 0.080795023026582 0.080795023026582
0.084767313723828 0.084767313723828 0.084767313723828

Column 4

0
0
0
0.084767313723828

conc = AI * B % calculating concentrations

conc =
1.0e+02 *

0.559156608553122
0.857411034933072
0.931162640381352
1.002373484784267

The concentrations are 55.9157, 85.7411, 93.1163, 100.2373

b) concentration of Lake Havasu is to be reduced to 75

the matrix element relating to concentration of Havasu in the inverse matrix is found by indexing AI(4,1)
= 0.0848.

New_L_Havasu = 75;

Old_L_Havasu = conc(4,1);

Amount_reduced = (Old_L_Havasu - New_L_Havasu)/AI(4,1)

Amount_reduced =

2.977249999999998e+02

The amount of loading to Lake Powell that must be reduced in order for the chloride
concentration of Lake Havasu to be 75 is 297.7250

c)

%c)
AN = normr(A);% normalize the matrix

AI = inv(AN);

column_sum = AI(1,1)+AI(2,1)+AI(3,1)+AI(4,1)

column_sum =

4.317672296988386

Absolute column sum of norm matrix above is 2. Find the condition number by multiplying this
by the column sum.

condition_number = 2 * column_sum
condition_number =

8.635344593976772

wrong_number = log10(condition_number)

wrong_number =

0.936279672798274

Therefore less than one digit is wrong

Question 3

clc

a) i)

A = [1 2 3;...
4 5 6;...
7 8 9];...

Inverse_A = inv(A) % find inverse matrix of the matrix

% ii)
condition = cond(A)

clear all

Warning: Matrix is close to singular or badly scaled. Results may be


inaccurate. RCOND = 1.541976e-18.

Inverse_A =

1.0e+16 *

-0.450359962737050 0.900719925474099 -0.450359962737049


0.900719925474100 -1.801439850948198 0.900719925474099
-0.450359962737050 0.900719925474099 -0.450359962737050

condition =

3.813147060626918e+16

b) i)
A = [1 2 3;...
4 5 6;...
7 8 9.1];...

Inverse_A = inv(A) % find inverse matrix of the matrix

% ii)
condition = cond(A)

Inverse_A =

8.333333333333396 -19.333333333333449 10.000000000000057


-18.666666666666789 39.666666666666899 -20.000000000000114
10.000000000000064 -20.000000000000117 10.000000000000057

condition =

9.948786540216839e+02

In the first instance (a), an error message suggests that the matrix is ill-conditioned. When
element a33 is changed slightly, the matrix becomes well-conditioned.

S-ar putea să vă placă și