I need to solve a nonlinear system of equations that looks like this
$$\frac{1}{n_4}(\frac{c_4}{b_4R}-\ln(1-x_1-x_2-x_3))=\frac{1}{n_3}(\frac{c_3}{b_3R}-\ln(x_3))=\frac{1}{n_2}(\frac{c_2}{b_2R}-\ln(x_2))=\frac{1}{n_1}(\frac{c_1}{b_1R}-\ln(x_1)) $$
The numerical equivalent of what i'm trying to solve right now is
$$\frac{4100}{4100/297-1.987\ln(x_1)}=\frac{6200}{6200/303-1.987\ln(x_2)}=\frac{7000}{7000/327.5-1.987\ln(x_3)}=\frac{4100}{4100/404-1.987\ln(1-x_1-x_2-x_3)} $$
What algorithm should i use to solve this? If anyone can solve this, could you post how you did it? I tried using a multivariable newton's algorithm but my jacobian exploded
Ok i actually found the answer and i'm just gonna share it since no one has posted yet
$x_1=.514, x_2=.297, x_3=.107$
Rearrange the equation for easier Jacobian
$$\frac{4100/(1.987*297)-ln(x_1)}{4100/1.987}=\frac{6200/(1.987*303)-ln(x_2)}{6200/1.987}=\frac{7000/(1.987*327.5)-ln(x_3)}{7000/1.987}=\frac{4100/(1.987*404)-ln(1-x_1-x_2-x_3)}{4100/1.987} $$
Construct a system of equations in the form of $f_i(x_1,x_2,x_3)=0$ for $i=1,2,3$
$$f_1(x_1,x_2,x_3)=\frac{4100/(1.987*297)-ln(x_1)}{4100/1.987}-\frac{4100/(1.987*404)-ln(1-x_1-x_2-x_3)}{4100/1.987} $$ $$ f_2(x_1,x_2,x_3)=\frac{6200/(1.987*303)-ln(x_2)}{6200/1.987}-\frac{4100/(1.987*404)-ln(1-x_1-x_2-x_3)}{4100/1.987} $$ $$ f_3(x_1,x_2,x_3)=\frac{7000/(1.987*327.5)-ln(x_3)}{7000/1.987}-\frac{4100/(1.987*404)-ln(1-x_1-x_2-x_3)}{4100/1.987} $$
$$F(X)=[f_1(x_1,x_2,x_3),f_2(x_1,x_2,x_3),f_3(x_1,x_2,x_3)]^T $$ $$X=[x_1,x_2,x_3]^T $$
Construct Jacobian for the system
$$ F'(X)=[\frac{\partial f_1}{\partial x_1},\frac{\partial f_1}{\partial x_2},\frac{\partial f_1}{\partial x_3};\frac{\partial f_2}{\partial x_1},\frac{\partial f_2}{\partial x_2},\frac{\partial f_2}{\partial x_3};\frac{\partial f_3}{\partial x_1},\frac{\partial f_3}{\partial x_2},\frac{\partial f_3}{\partial x_3}] $$
Solve $F(X)=-F'(X)H$ for $H$ using Gaussian elimination
Update $X$ by using $X^{(k+1)}=X^{(k)}+H^{(k)}$, in this case using $X=[.01,.01,.01]^T$
Repeat until reached acceptable error bound
My jacobian exploded because i didn't give a good initial guess, but then i guessed slightly lower and everything worked.