没有合适的资源?快使用搜索试试~ 我知道了~
matlab求解非线性方程组.pdf 里面有实例,源代码!
资源推荐
资源详情
资源评论
下面提供了 fsolve 函数 help,但要有几点需要注意
1.方程组的有解性
2.方程组解是否唯一
3.x0 的选取,如果解不唯一,不同的 x0 可能会得到不同的解
fsolve - Solve system of nonlinear equations
Equation
Solves a problem specified by
F(x) = 0
for x, where x is a vector and F(x) is a function that returns a vector value.
Syntax
x = fsolve(fun,x0)
x = fsolve(fun,x0,options)
x = fsolve(problem)
[x,fval] = fsolve(fun,x0)
[x,fval,exitflag] = fsolve(...)
[x,fval,exitflag,output] = fsolve(...)
[x,fval,exitflag,output,jacobian] = fsolve(...)
Description
fsolve finds a root (zero) of a system of nonlinear equations.
x = fsolve(fun,x0) starts at x0 and tries to solve the equations described in fun.
x = fsolve(fun,x0,options) solves the equations with the optimization options specified in the
structure options. Use optimset to set these options.
x = fsolve(problem) solves problem, where problem is a structure described in Input Arguments.
Create the structure problem by exporting a problem from Optimization Tool, as described in
Exporting to the MATLAB® Workspace.
[x,fval] = fsolve(fun,x0) returns the value of the objective function fun at the solution x.
[x,fval,exitflag] = fsolve(...) returns a value exitflag that describes the exit condition.
[x,fval,exitflag,output] = fsolve(...) returns a structure output that contains information about the
optimization.
[x,fval,exitflag,output,jacobian] = fsolve(...) returns the Jacobian of fun at the solution x.
Passing Extra Parameters explains how to parameterize the objective function fun, if necessary.
Input Arguments
Function Arguments contains general descriptions of arguments passed into fsolve. This section
provides function-specific details for fun and problem:
fun
The nonlinear system of equations to solve. fun is a function that accepts a vector x and returns a
vector F, the nonlinear equations evaluated at x. The function fun can be specified as a function
handle for an M-file function
x = fsolve(@myfun,x0)
where myfun is a MATLAB® function such as
function F = myfun(x)
F = ... % Compute function values at x
fun can also be a function handle for an anonymous function.
x = fsolve(@(x)sin(x.*x),x0);
If the user-defined values for x and F are matrices, they are converted to a vector using linear
indexing.
If the Jacobian can also be computed and the Jacobian option is 'on', set by
options = optimset('Jacobian','on')
then the function fun must return, in a second output argument, the Jacobian value J, a matrix, at
x.
If fun returns a vector (matrix) of m components and x has length n, where n is the length of x0,
then the Jacobian J is an m-by-n matrix where J(i,j) is the partial derivative of F(i) with respect to
x(j). (Note that the Jacobian J is the transpose of the gradient of F.)
problem objective
Objective function
x0
Initial point for x
solver
'fsolve'
options
Options structure created with optimset
Output Arguments
Function Arguments contains general descriptions of arguments returned by fsolve. For more
information on the output headings for fsolve, see Function-Specific Output Headings.
This section provides function-specific details for exitflag and output:
exitflag
Integer identifying the reason the algorithm terminated. The following lists the values of exitflag
and the corresponding reasons the algorithm terminated.
1
Function converged to a solution x.
2
Change in x was smaller than the specified tolerance.
3
Change in the residual was smaller than the specified tolerance.
4
Magnitude of search direction was smaller than the specified tolerance.
0
Number of iterations exceeded options.MaxIter or number of function evaluations exceeded
options.FunEvals.
-1
Algorithm was terminated by the output function.
-2
Algorithm appears to be converging to a point that is not a root.
-3
Trust radius became too small.
-4
Line search cannot sufficiently decrease the residual along the current search direction.
output
Structure containing information about the optimization. The fields of the structure are
剩余10页未读,继续阅读
资源评论
birdmanq
- 粉丝: 1
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功