انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Lecture 4: Newton s Method Matlab

Share |
الكلية كلية التربية للعلوم الصرفة     القسم  قسم الرياضيات     المرحلة 3
أستاذ المادة حوراء عباس فاضل       02/12/2018 07:41:25
Newton’s Method

Write the program in the editor page by clicking on New Script , Save it , then click Run.

Example; Find an approximation root to the following equation with error ? =0.0001, and initial point x0 =3:
f(x)=x^2-4 sin?x

Solution:
f=inline( x^2-4*sin(x) );
d=inline( 2*x-4*cos(x) );
x0=input( x0= );
n=input( n= );
disp( x0 x1 )
for i=1:n
if d(x0)==0
disp( division by zero, can not proceed. )
break
end
x1=x0-f(x0)/d(x0);
disp([x0 x1])
if abs(x1-x0)<=0.0001
break
else
x0=x1;
end
end

Solution:
x0=3
n=9

x0 x1
3.0000 2.1531
2.1531 1.9540
1.9540 1.9340
1.9340 1.9338
1.9338 1.9338

Exercises:
Q1\ Do exercises in your previous Lectures using Newton’s Method
Q2\ Use all three methods in this Section to find solutions to within 10?5 for the following problems.
a. 3xex = 0 for 1 ? x ? 2
b. 2x + 3 cos x ? ex = 0 for 0 ? x ? 1


المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
الرجوع الى لوحة التحكم