You are on page 1of 7

Date: 31-OCT-2023

LAB MANUAL
CHEMICAL PROCESS OPTIMIZATION (CH-404)

TITLE:
To solve matrices through MATLAB
DESCRIPTION:
In this lab we apply different mathematical operations on matrices.
CODES:
1. m. file:
 A=[1 3 5 7;-8 6 11 20;14 -9 0 5;8 2 -5 -10]
 B=[-17 5 14 2;3 -1 6 15;8 6 4 -7; 10 5 7 -3]
 C=A+B
 D=A-B
 E=A*B
 F=A/B
 G=A.*B
 H=A./B
 I= diag (A)
 J = inv (A)
 K= A.'
 L= transpose(A)
 M=inv(B)
 N=det(A)
 O=det(B)
 %CASE 1%
 P=[1 120 550;1 130 600;1 108 520;1 110 420;1 84 400;1 90 300;1 80 230;1 55
120;1 64 190;1 50 100]
 Q=[310;300;275;250;220;200;190;150;140;100]
 beta=inv(transpose(P)*P)*transpose(P)*Q
 %case 2%
 R=[1 -1 -1 -1;1 1 -1 -1;1 -1 1 -1;1 1 1 -1;1 -1 -1 1;1 1 -1 1;1 -1 1 1;1 1 1
1;1 0 0 0;1 0 0 0;1 0 0 0]
 S=[20.500;60.141;58.890;67.712;22.211;61.541;59.902;69.104;77.870;78.933;70.10
0]
 beta=inv(transpose(R)*R)*transpose(R)*S

2. command window:
Print of command window has been attached. Command window of
case study 1 and 2 also included in attachment.
Date: 31-OCT-2023
LAB MANUAL
CHEMICAL PROCESS OPTIMIZATION (CH-404)
Lab No: 01 Roll No: CH-20313

RESULT & DISCUSSION:


The calculation of these matrices was quite easy using the MATLAB software as it
helps us to calculate simple and complex types of matrices as well Using different
operations. The output of the written code having no error. The values of all the
functions performed have been found accurately.

.
Date: 31-OCT-2023
LAB MANUAL
CHEMICAL PROCESS OPTIMIZATION (CH-404)
Lab No:01 Roll No: CH-20313

CASE STUDY:
1. Example 2.4: Application Of Least Squares to Develop A Cost Model ForThe Cost Of
Heat Exchangers

Labor cost ($) Area (A) No. of tubes (N)


310 120 550
300 130 600
275 108 520
250 110 420
220 84 400
200 90 300
190 80 230
150 55 120
140 64 190
100 50 100

2_Example 2.6: Identification Of Important Variables By ExperimentationUsing An Orthogonal


Factorial Design
Y (Yield) x₂ x₃ x₄
20.500 -1 -1 -1
60.141 1 -1 -1
58.890 -1 1 -1
67.712 1 1 -1
22.211 -1 -1 1
61.541 1 -1 1
59.902 -1 1 1
69.104 1 1 1
77.870 0 0 0
78.933 0 0 0
70.100 0 0 0

2
MATLAB Command Page

>> lab1

A =

1 3 5 7
-8 6 11 20
14 -9 0 5
8 2 -5 -10

B =

-17 5 14 2
3 -1 6 15
8 6 4 -7
10 5 7 -3

C =

-16 8 19 9
-5 5 17 35
22 -3 4 -2
18 7 2 -13

D =

18 -2 -9 5
-11 7 5 5
6 -15 -4 12
-2 -3 -12 -7

E =

102 67 101 -9
442 120 108 -63
-215 104 177 -122
-270 -42 34 111

F =

0.1226 0.9482 1.6079 -1.2624


0.5402 2.5124 4.4939 -4.2304
-0.5540 -1.1936 -5.7525 5.4183
-0.3151 -0.3342 0.7093 -0.2029
MATLAB Command Page

G =

-17 15 70 14
-24 -6 66 300
112 -54 0 -35
80 10 -35 30

H =

-0.0588 0.6000 0.3571 3.5000


-2.6667 -6.0000 1.8333 1.3333
1.7500 -1.5000 0 -0.7143
0.8000 0.4000 -0.7143 3.3333

I =

1
6
0
-10

J =

0.0547 0.0032 0.0341 0.0617


-0.1222 0.1399 -0.0174 0.1855
0.7846 -0.4244 -0.0990 -0.3492
-0.3730 0.2428 0.0733 0.1611

K =

1 -8 14 8
3 6 -9 2
5 11 0 -5
7 20 5 -10

L =

1 -8 14 8
3 6 -9 2
5 11 0 -5
7 20 5 -10
MATLAB Command Page

M =

-0.0299 -0.0014 -0.0499 0.0895


0.0117 0.1943 0.6636 -0.5692
0.0318 -0.0875 -0.3239 0.3394
-0.0059 0.1149 0.1838 -0.1916

N =

3.1100e+03

O =

-6.3880e+03

P =

1 120 550
1 130 600
1 108 520
1 110 420
1 84 400
1 90 300
1 80 230
1 55 120
1 64 190
1 50 100

Q =

310
300
275
250
220
200
190
150
140
100

beta =

38.1773
MATLAB Command Page

1.1637
0.2089

R =

1 -1 -1 -1
1 1 -1 -1
1 -1 1 -1
1 1 1 -1
1 -1 -1 1
1 1 -1 1
1 -1 1 1
1 1 1 1
1 0 0 0
1 0 0 0
1 0 0 0

S =

20.5000
60.1410
58.8900
67.7120
22.2110
61.5410
59.9020
69.1040
77.8700
78.9330
70.1000

beta =

58.8095
12.1244
11.4019
0.6894

>>

You might also like