Need to be solved in MATLAB This question ne Q2. The dissolution of copper sulfi
ID: 3701750 • Letter: N
Question
Need to be solved in MATLAB
This question ne
Q2. The dissolution of copper sulfide in aqueous nitric acid is described by the following chemical equation: where the coefficients a, b, c, d, e,f, and g are the numbers of the various molecules participating in the reaction and are unknown. The unknown coefficients are determined by balancing each atom on left and right and then balancing the ionic charge. The resulting equations are: There are seven unknowns and only six equations. A solution can still be obtained, however, by taking advantage of the fact that all the coefficients must be positive integers. Add a seventh equation by guessing a -1 and solve the system of equations. The solution is valid if all the coefficients are positive integers. If this is not the case, take a 2 and repeat the solution. Continue the process until all the coefficients in the solution are positive integers.Explanation / Answer
clear all
close all
clc;
syms a b c d e f g % define symbols
i = 1; % use to increment each time value of equation 7 which will be a = i
eq1 = a - d; % defining all the equations as given in question
eq2 = a - e;
eq3 = b - f;
eq4 = 3*b - 4*e - f - g;
eq5 = c - 2*g;
eq6 = -b + c - 2*d + 2*e;
eq7 = a - i;
S=solve(eq1,eq2,eq3,eq4,eq5,eq6,eq7); % solving them
% while each coefficient is greater than 0, keep solving
while(S.a > 0 && S.b > 0 && S.c > 0 && S.d > 0 && S.e > 0 && S.f > 0 && S.g > 0 )
i = i + 1; % increment i by 1
eq7 = a - i; % update equation 7
S=solve(eq1,eq2,eq3,eq4,eq5,eq6,eq7); % solve again
end
display('a b c d e f g') % displaying the results
S=[S.a S.b S.c S.d S.e S.f S.g]
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.