January 2020
Intermediate to advanced
880 pages
21h 22m
English
fsolve>MATLAB has the built‐in function ‘fsolve(f,x0)’, which can give us a solution for a system of (nonlinear) equations. Suppose we have the following system of nonlinear equations to solve.
To solve this system of equations, we should rewrite as
and convert it into a MATLAB function defined in an M‐file, say, ‘f_d02.m’ as follows.
Then we type the following statements into the MATLAB Command Window.
>>x0=[0.8 0.2]; % Initial guess [0.8 0.2]>>x=fsolve('f_d02',x0,optimset('fsolve')) % with default parametersx = 2.0000 0.5000
If you see some warning message with the MATLAB solution obtained by using ‘fsolve()’ like this, you can change the value(s) of the optional parameters such as
by using the MATLAB command ‘optimset( )’ as follows.
options = optimset('param1',value1,'param2',value2,...)
For example, if you feel it contributive to better solution to set MaxFunEvals and TolX to 1000 ...
Read now
Unlock full access