solve numerically a system of nonlinear equations

Hello guys. I am new to matlab.
Currently i am having a system of two nonlinear equations to solve .I have seen that fsolve can solve nonlinear equations ,but my problem is that i dont possess optimization toolbox ,which is needed to use this function.
The system of nonlinear equations is below :
(1) : x1^2*(9.0214+x2*71.185)-67.7=0
(2) : 1/sqrt(x2)+2*log(0.0001886+0.000003513/(x1*sqrt(x2)))=0 (log base 10 )
So i ended up preferring a numerical approach.I have seen codes that solves numerically ,single equation but not for a system of equations.Can anyone help me find a solution for the above system?
Thanks

 Réponse acceptée

Matt J
Matt J le 24 Avr 2022
Modifié(e) : Matt J le 24 Avr 2022
F2=@(z) z+2*log10(0.0001886+0.000003513*z);
[z,Fsol]=fzero(F2,1)
z = 7.3376
Fsol = 8.8818e-16
x2=1./z.^2
x2 = 0.0186
x1=sqrt(67.7/(9.0214+x2*71.185)) % -x1 is also a solution
x1 = 2.5583
%%%Check
x1^2*(9.0214+x2*71.185)-67.7
ans = 0
1/sqrt(x2)+2*log10(0.0001886+0.000003513/sqrt(x2))
ans = 8.8818e-16

1 commentaire

I am sorry ,i didnt write down the second equation right . The proper system is :
(1) : x1^2*(9.0214+x2*71.185)-67.7=0
(2) : 1/sqrt(x2)+2*log(0.0001886+0.000003513/(x1*sqrt(x2)))=0 (log base 10 )
Thanks for the time spent again.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by