From: Juca on
I'm totally Newbie in matlab and need to solve this equation,

phi_1=(phi_a1/(1-K_a*phi_a1)^2)*(1+((V_a*K_AB*phi_b1)/(V_b*(1-K_b*phi_b1))

phi_2=(phi_b1/(1-K_b*phi_b1)^2)*(1+((K_AB*phi_a1)/(1-K_a*phi_a1)

I need to find Phi_a1 and Phi_b1 for a range of values of phi_1 and phi_2.

I tried to solve with a piece of code I've found.

%%%%%%%%%%%%%%%%%%

function [A1,B1] = Test

V=[18.068;55.918];
K=[1005;213.2];
KAB=50;

phi1=[0.1;0.2;0.3;0.4;0.5;0.6;0.7;0.8];
phi2=1-phi1;

F = @(C) [-phi1+(C(1)/(1-K(1,1)*C(1))^2)*(1+((V(1,1)*KAB*C(2))/(V(2,1)*(1-K(2,1)*C(2))))); -phi2+(C(2)/(1-K(2,1)*C(2))^2)*(1+((KAB*C(1))/(1-K(1,1)*C(1))))];


InitialGuess = [0.1;0.1];
Options = optimset('Display','iter');
XY = fsolve(F, InitialGuess, Options)

%%%%%%%%%%%%%%%%%%

Thanks in advance for any help.