You are on page 1of 3

SEMILLA, JOLINA S.

Midterm Exam in Computer Application in Chemical


Engineering
Date of Examination: February 14, 2020

1 Provide yourself with a unique ten equations in ten unknowns whose values of the unknowns are all whole numbers
which can either be positive or negative. Solve this set of equations using Matlab command window and Matlab Editor
creating m-file.
A + 2B + 3C + 4D + 5E+ 6F + 7G + 8H + 9I + J = 503
3A + 6B + 9C – 3D – 6E – 9F + 8G + 5H + 2I + 3J = 245
6A + 7B + 3C – 4D – 6E + 3F – 9G – 2H + 5I + 2J = 58
-A + 3B +6C + 2D + 8E + 9F + 5G – 4H – 3I – J = 354
8A + 3B – 4C – 5D + 2E – F + 8G + 6H + 9I +3J = 191
6A + 4B + 7C + 3D – 2E – 9F – 4G – 5H +2I + J = 41
3A + 2B + 6C + D + 9E + 5F – 4G – 2H – 6I + 4J = 298
5A + 5B – 5C + 3D + 3E – 6F – 8G + 2H + 5I – 3J = -188
3A + 6B + 4C – 7D – 8E + 4F + G + 2H + 7I + 3J = 211
4A + B + 2C + 4D + 7E – 8F – 3G – 2H + I + 5J = 116
>> A = [1, 2, 3, 4, 5, 6, 7, 8, 9, 1;
3, 6, 9, -3, -6, -9, 8, 5, 2, 3;
6, 7, 3, -4, -6, 3, -9, -2, 5, 2;
-1, 3, 6, 2 ,8, 9, 5, -4, -3, -1;
8, 3, -4, -5, 2, -1, 8, 6, 9, 3;
6, 4, 7, 3, -2, -9, -4, -5, 2, 1;
3, 2, 6, 1, 9, 5, -4, -2, -6, 4;
5, 5, -5, 3, 3, -6, -8, 2, 5, -3;
3, 6, 4, -7, -8, 4, 1, 2, 7, 3;
4, 1, 2, 4, 7, -8, -3, -2, 1, 5]

A=

1 2 3 4 5 6 7 8 9 1
3 6 9 -3 -6 -9 8 5 2 3
6 7 3 -4 -6 3 -9 -2 5 2
-1 3 6 2 8 9 5 -4 -3 -1
8 3 -4 -5 2 -1 8 6 9 3
6 4 7 3 -2 -9 -4 -5 2 1
3 2 6 1 9 5 -4 -2 -6 4
5 5 -5 3 3 -6 -8 2 5 -3
3 6 4 -7 -8 4 1 2 7 3
4 1 2 4 7 -8 -3 -2 1 5

>> B = [503; 245; 58; 354; 191; 41; 298; -188; 211; 116]
B=

503
245
58
354
191
41
298
-188
211
116

>> A\B

ans =

4.0000
6.0000
23.0000
10.0000
9.0000
15.0000
11.0000
8.0000
9.0000
21.0000
MATLAB EDITOR:
clc;
syms A B
A= [1, 2, 3, 4, 5, 6, 7, 8, 9, 1; 3, 6, 9, -3, -6, -9, 8, 5, 2, 3; 6, 7, 3, -4, -6, 3, -9, -2, 5, 2; -1, 3, 6, 2 ,8, 9, 5, -4, -3, -1; 8, 3,
-4, -5, 2, -1, 8, 6, 9, 3; 6, 4, 7, 3, -2, -9, -4, -5, 2, 1; 3, 2, 6, 1, 9, 5, -4, -2, -6, 4; 5, 5, -5, 3, 3, -6, -8, 2, 5, -3; 3, 6, 4, -7, -8,
4, 1, 2, 7, 3; 4, 1, 2, 4, 7, -8, -3, -2, 1, 5]
B= [503; 245; 58; 354; 191; 41; 298; -188; 211; 116]
linsolve(A,B)

MATLAB COMMAND WINDOW RESULT:


A=

1 2 3 4 5 6 7 8 9 1
3 6 9 -3 -6 -9 8 5 2 3
6 7 3 -4 -6 3 -9 -2 5 2
-1 3 6 2 8 9 5 -4 -3 -1
8 3 -4 -5 2 -1 8 6 9 3
6 4 7 3 -2 -9 -4 -5 2 1
3 2 6 1 9 5 -4 -2 -6 4
5 5 -5 3 3 -6 -8 2 5 -3
3 6 4 -7 -8 4 1 2 7 3
4 1 2 4 7 -8 -3 -2 1 5

B=

503
245
58
354
191
41
298
-188
211
116

ans =

4.0000
6.0000
23.0000
10.0000
9.0000
15.0000
11.0000
8.0000
9.0000
21.0000

2 Provide yourself with unique differential equations. Solve each of this differential equation using matlab built-in functions
in Matlab command window.
< Insert in here the first order differential equation together with the matlab built-in function you used in solving it,
together with its results. Show also the resulting graph. Delete this message after doing so.>
< Insert in here the second order differential equation together with the matlab built-in function you used in solving it,
together with its results. Show also the resulting graph. Delete this message after doing so.>
< Insert in here the third order differential equation together with the matlab built-in function you used in solving it,
together with its results. Show also the resulting graph. Delete this message after doing so.>
< Insert in here the first order differential equation with initial values together with the matlab built-in function you used
in solving it, together with its results. Show also the resulting graph. Delete this message after doing so.>
< Insert in here the second order differential equation with initial values together with the matlab built-in function you
used in solving it, together with its results. Show also the resulting graph. Delete this message after doing so.>
< Insert in here the third order differential equation with initial values together with the matlab built-in function you used
in solving it, together with its results. Show also the resulting graph. Delete this message after doing so.>
< Insert in here a unique system of differential equations. Solve them using matlab built-in functions.Show the results
and the resulting graph. Delete this message after doing so.>

3 Provide yourself with MDAS Problem Solver.


< Insert in here the contents of your m-files together with its results. Delete this message after doing so.>

4 Before the final examination week, you need to submit your own designed laboratory exercise. This will serve as your
final exam.
< Provide in here a discussion about the laboratory exercise that you will design. Start with the title. Delete this
message after doing so.>

You might also like