楼主: ReneeBK
1163 0

Using Newton's Method to Solve Nonlinear Equation in Matlab [推广有奖]

  • 1关注
  • 62粉丝

VIP

已卖:4900份资源

学术权威

14%

还不是VIP/贵宾

-

TA的文库  其他...

R资源总汇

Panel Data Analysis

Experimental Design

威望
1
论坛币
49655 个
通用积分
55.9937
学术水平
370 点
热心指数
273 点
信用等级
335 点
经验
57805 点
帖子
4005
精华
21
在线时间
582 小时
注册时间
2005-5-8
最后登录
2023-11-26

楼主
ReneeBK 发表于 2015-11-29 06:02:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
  1. A MATLAB function fnewton is supplied for Newton’s method. The function that forms
  2. the left side of the equation we wish to solve and its derivative must be supplied by the
  3. user as functions; these become the first and second parameters of the function. The third
  4. parameter is an initial approximation to the root. The convergence criterion used is that
  5. the difference between successive approximations to the root is less than a small preset
  6. value. This value must be supplied by the user and is given as the fourth parameter of the
  7. function.
  8. function [res, it] = fnewton(func,dfunc,x,tol)
  9. % Finds a root of f(x) = 0 using Newton
  10. s method.
  11. % Example call: [res, it] = fnewton(func,dfunc,x,tol)
  12. % The user defined function func is the function f(x).
  13. % The user defined function dfunc is df/dx.
  14. % x is an initial starting value, tol is required accuracy.
  15. it = 0; x0 = x;
  16. d = feval(func,x0)/feval(dfunc,x0);
  17. while abs(d) > tol
  18. x1 = x0-d; it = it+1; x0 = x1;
  19. d = feval(func,x0)/feval(dfunc,x0);
  20. end
  21. res = x0;
  22. We will now find a root of the equation
  23. x3 􀀀10x2 C29x􀀀20 D 0
  24. To use Newton’s method we must define the function and its derivative as follows:
  25. >> f = @(x) x.^3-10*x.^2+29*x-20;
  26. >> df = @(x) 3*x.^2-20*x+29;
  27. We may call the function fnewton as follows:
  28. >> [x,it] = fnewton(f,df,7,0.00005)
  29. x =
  30. 5.0000
  31. it =
  32. 6
复制代码
Reference
  • Numerical Methods using Matlab Abhishek Gupta Apress

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Nonlinear equation nonlinea Nonline Linear difference function equation supplied between

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-24 08:49