matlab实现牛顿迭代法求解非线性方程组.pdf





《matlab实现牛顿迭代法求解非线性方程组.pdf》由会员分享,可在线阅读,更多相关《matlab实现牛顿迭代法求解非线性方程组.pdf(5页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、matlab 实现牛顿迭代法求解非线性方程组 已知非线性方程组如下 3*x1-cos(x2*x3)-1/2=0 x12-81*(x2+2+sin(x3)+=0 exp(-x1*x2)+20*x3+(10*pi-3)/3=0 求解要求精度达到 首先建立函数 fun 储存方程组编程如下将保存到工作路径中:function f=fun(x);%定义非线性方程组如下%变量 x1 x2 x3%函数 f1 f2 f3 syms x1 x2 x3 f1=3*x1-cos(x2*x3)-1/2;f2=x12-81*(x2+2+sin(x3)+;f3=exp(-x1*x2)+20*x3+(10*pi-3)/3;
2、f=f1 f2 f3;建立函数 dfun 用来求方程组的雅克比矩阵将保存到工作路径中:function df=dfun(x);%用来求解方程组的雅克比矩阵储存在 dfun 中 f=fun(x);df=diff(f,x1);diff(f,x2);diff(f,x3);df=conj(df);编程牛顿法求解非线性方程组将保存到工作路径中:function x=newton(x0,eps,N);con=0;%其中 x0 为迭代初值 eps 为精度要求 N 为最大迭代步数 con 用来记录结果是否收敛 for i=1:N;f=subs(fun(x0),x1 x2 x3,x0(1)x0(2)x0(3);
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- matlab 实现 牛顿 迭代法 求解 非线性 方程组

限制150内