POLYMATH Report          LEQ 
 Linear Equations 2016-May-30 

Linear Equations Solution
    Variable Value
1 D1 26.25
2 B1 17.5
3 D2 8.75
4 B2 17.5

The equations
[1] 0.07·D1 + 0.18·B1 + 0.15·D2 + 0.24·B2 = 10.5
[2] 0.04·D1 + 0.24·B1 + 0.1·D2 + 0.65·B2 = 17.5
[3] 0.54·D1 + 0.42·B1 + 0.54·D2 + 0.1·B2 = 28
[4] 0.35·D1 + 0.16·B1 + 0.21·D2 + 0.01·B2 = 14

Problem source text
# S. 3 - Linear Eqs.
# Steady State Material Balances
# Verified Solution: D1=26.25, B1 = 17.5, D2 = 8.75, B2=17.5
# Ref.: Comput. Appl. Eng. Educ. 6: 172-173, 1998
.07*D1 + .18*B1 + .15*D2 + .24*B2 = 0.15*70
.04*D1 + .24*B1 + .1*D2 + .65*B2 = 0.25*70
.54*D1 + .42*B1 + .54*D2 + .1*B2 = 0.40*70
.35*D1 + .16*B1 + .21*D2 + .01*B2 = 0.20*70

Coefficients matrix and beta vector
    D1 B1 D2 B2 beta
1 0.07 0.18 0.15 0.24 10.5
2 0.04 0.24 0.1 0.65 17.5
3 0.54 0.42 0.54 0.1 28
4 0.35 0.16 0.21 0.01 14

Matlab formatted problem
Create m file called PolyLEQ.m and paste the following text into it.
% S. 3 - Linear Eqs.
% Steady State Material Balances
% Verified Solution: D1=26.25, B1 = 17.5, D2 = 8.75, B2=17.5
% Ref.: Comput. Appl. Eng. Educ. 6: 172-173, 1998
clc;
A = [ 0.07 0.18 0.15 0.24 ; 0.04 0.24 0.1 0.65 ; 0.54 0.42 0.54 0.1 ; 0.35 0.16 0.21 0.01 ];
beta = [ 10.5 ; 17.5 ; 28 ; 14 ];
x = A \ beta;
fprintf('D1 = %16.6f \n',x(1));
fprintf('B1 = %16.6f \n',x(2));
fprintf('D2 = %16.6f \n',x(3));
fprintf('B2 = %16.6f \n',x(4));

General Settings
Number of equations: 4
Reporting digits: 8