Info
This question is closed. Reopen it to edit or answer.
How can I solve the following system of equations?
1 view (last 30 days)
Show older comments
Hello guys,
I am doing some modelling and I have to following code.
qpncal = 0
qpCO2cal = 0
t=1
N = 101
Am = 0.001
n = 10
Amn = Am/n
%PCO2 = 1
pf = 101325
pp = 97000
xr(1) = 0.5
yp(1) = 0.5
%alpha = 2
qp = 1
qr(1) = 2
for j=1:N
qCO2(j)= PCO2/t*Amn*((pf*xr(j))-(pp*yp(j)));
qN2(j)= PCO2/t*Amn*(1/alpha)*((pf*(1-xr(j)))-(pp*(1-yp(j))));
dqpn(j) = qCO2(j) + qN2(j);
dypn(j) = qCO2(j)/(qCO2(j) + qN2(j));
qr(j+1) = qr(j) + dqpn(j);
xr(j+1) = (qr(j)*xr(j) + dqpn(j)*dypn(j))/qr(j + 1);
qp(j+1) = qp(j) - dqpn(j);
yp(j+1) = (qp(j)*yp(j) - dqpn(j)*dypn(j))/qp(j+1);
qpncal = qpncal + dqpn(j);
qpCO2cal = qpCO2cal + qCO2(j);
end
ypcal = qpCO2cal/qpncal = 0.5 %0.5 is the value ypcal has to converge to
qpcal = qpncal = 2 %2 is the value qpncal has to converge to
I need to solve for PCO2 and alpha with the preceding constraints. I am having difficulty doing so because PCO2 and alpha are in the for loop. Does anybody know how to solve this?
Thank you.
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!