Matlab code....***to answer, MATLAB software is needed.****Q1 An engineer plans
ID: 3848854 • Letter: M
Question
Matlab code....***to answer, MATLAB software is needed.****Q1
An engineer plans the production of 3 types of components. Materials required for each component are metal, plastic, and rubber, in the following quantities:
Using MATLAB, responde the following:
(a) Setup/calculate the inverse of the matrix required to determine the number of components of each type that can be produced, daily, if total materials available are 3.89, 0.095, 0.282 Kg of metal, plastic and rubber, respectively
(c) Use the inverse to solve the problem.
(d) If the production of component 2 is required to increase by 25%, by how much should supply of rubber be changed?
(e) What would be the corresponding change in the production of components 1 and 3? (f) If the supply of metal is increased by 1%, what is the corresponding change in the
production of component 1?
Explanation / Answer
A= [ 15, 0.3, 1 ; % component1
17, 0.4, 1.2 ; % component2
19, 0.55, 1.5 ;] ; % component3
At= [ 15 17 19 ; % Metal
0.3 0.4 0.55; %plastic
1 1.2 1.5; ] % Rubber
A= A' ; AT= A ;
B= [ 3.89; 0.095; 0.282; ] ; %kilograms [ metal plastic rubber]
BG = B*1000 % [ 3890 95 282 ] %grams
AINV = inv(A)
X= AINV * BG %ANSWER C
%X = [ 90 60 80 ] % Answer % [ component1 component2 component3 ]
%part D%% increase comp2 by 25percent
x2= 60*25/100 +60; % x2 becomes 75 from 60;
%[ 3890 95 282+r] = A*[ x1 75 x3 ]' %
%XNEW = AINV * NEWSUPPLY
[Xnew ]=inv( [ 15 19 ; 0.3 0.55 ; ] ) * [ 3890-17*75 95-0.4*75]'
x1= Xnew(1,1); x3= Xnew(2,1);
% x1=79.706 and x3= 74.706
NEWRUBBERSUPPLY= x1+1.5*x3+1.2*75
%%part F metal increased by 1percent
BG(1,1)= 3890+3890/100 % metal supply
Xnew2 = inv(A) *BG % answer F