Question: function [ A , b ] = Write a function: [ A , b ] = solveProcessGiven ( S R ) that returns a 3

function [A, b]=Write a function:
[A,b]= solveProcessGiven(SR)
that returns a 3030 matrix A(30 variables including flow rates and extent of reaction variables, 30 equations including 8AUx,21MBs,1SF), and the RHS vector b for
Homework 4 Problem 1 given SR, the split ratio of the recycle flow rate to the product output flow rate, as an input parameter. constructMatrix(sr)
%[A, b]= constructMatrix(sr)
% A is a 30x30 matrix for the system of linear equations for the problem
% b is the corresponding RHS vector.
%% Construct A.
%
% Follow the order of variables (columns) and the order of equations (rows) below in your matrix.
% This is a template only. If you have any alternative way to construct the matrix like calling row and column indices, welcome to use it. But follow the orders of vars and eqns.
%
%**Remember, somewhere here you need to use the input variable 'sr' for the split ratio (ratio of the recycle flow rate to the product output flow rate)
%
%123456789101112131415161718192021222324252627282930(variable order)
% Str 1 Str 2 Str 3 Str 4 Str 5 Str 6 Str7 Str8 Str 9 Str 10 Str 11 Reactor (corresponding stream/unit)
% M1 P1 B1 M2 P2 B2 M3 P3 B3 C3 D3 B4 C4 D4 C5 D5 C6 D7 B8 M9 P9 B9 M10 P10 B10 M11 P11 B11 E1 E2(variable name)
A =[100-100000000000000000010000000; ...%Eq 1: M Mixer
%Eq 2: P Mixer
%Eq 3: B Mixer
%Eq 4: M Reactor
%Eq 5: P Reactor
%Eq 6: B Reactor
%Eq 7: C Reactor
%Eq 8: D Reactor
%Eq 9: M Separator
%Eq 10: P Separator
%Eq 11: B Separator
%Eq 12: C Separator
%Eq 13: D Separator
%Eq 14: M Splitter
%Eq 15: P Splitter
%Eq 16: B Splitter
%Eq 17: B Dist I
%Eq 18: C Dist I
%Eq 19: D Dist I
%Eq 20: C Dist II
%Eq 21: D Dist II
%Eq 22: AUX 1: P/B ratio in feed
%Eq 23: AUX 2: P/M ratio in feed
%Eq 24: AUX 3: Benzene split at separator
%Eq 25: AUX 4: Single pass conversion in reactor
%Eq 26: AUX 5: Diisopropyl produced w.r.t. cumene
%Eq 27: AUX 6: Split ratio to recycle
%Eq 28: AUX 7: Split ratio to recycle
%Eq 29: AUX 8: Split ratio to recycle
]; %Eq 30: Specified flow rate for C6
%123456789101112131415161718192021222324252627282930(variable order)
% Str 1 Str 2 Str 3 Str 4 Str 5 Str 6 Str7 Str8 Str 9 Str 10 Str 11 Reactor (corresponding stream/unit)
% M1 P1 B1 M2 P2 B2 M3 P3 B3 C3 D3 B4 C4 D4 C5 D5 C6 D7 B8 M9 P9 B9 M10 P10 B10 M11 P11 B11 E1 E2(variable name)
% construct the corresponding RHS vector
b = ;
end
function [ A , b ] = Write a function: [ A , b ]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!