07-Jan-2022 20:10:05
fsolve_test():
MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2
fsolve() seeks a solution x of one or more nonlinear
equations f(x)=0.
In MATLAB, fsolve() is in the Optimization toolbox.
In Octave, fsolve() is directly available.
In Python, fsolve() is scipy.optimize.
In R, fsolve() is available in the pracma library.
fsolve_test01
Use fsolve() to solve 1 nonlinear equation.
Initial X and F(X)
1: 0 -5
Final X and F(X)
1: 4.27523 -1.3356e-13
fsolve_test02
Use fsolve() to solve 2 nonlinear equations.
Initial X and F(X)
1: 3 -13
2: 0 11
Final X and F(X)
1: 1 8.14786e-08
2: 1 1.22806e-07
fsolve_test03
Use fsolve() to solve 4 nonlinear equations.
Initial X and F(X)
1: 0 1
2: 0 4
3: 0 9
4: 0 16
Final X and F(X)
1: 0.998075 3.70635e-06
2: 1.99632 1.3563e-05
3: 2.99489 2.60634e-05
4: 3.99398 3.62998e-05
fsolve_test04
Use fsolve() to solve 8 nonlinear equations.
Initial X and F(X)
1: 0 1
2: 0 1
3: 0 1
4: 0 1
5: 0 1
6: 0 1
7: 0 1
8: 0 1
Final X and F(X)
1: -0.57047 0
2: -0.681141 -2.22045e-16
3: -0.700428 -2.66454e-15
4: -0.700672 -6.88338e-15
5: -0.691736 -1.82077e-14
6: -0.665767 -2.06501e-14
7: -0.596029 -6.21725e-15
8: -0.416411 -5.55112e-16
fsolve_test():
Normal end of execution.
07-Jan-2022 20:10:06