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

Matlab: Fixed Point Iteration Method

Share |
الكلية كلية التربية للعلوم الصرفة     القسم  قسم الرياضيات     المرحلة 3
أستاذ المادة حوراء عباس فاضل       28/11/2018 06:00:19
Fixed Point Iteration Algorithm
Write the program in the editor page by clicking on New Script , Save it , then click Run.

Example1:
Consider the function g (x) = (x2+3)/(2x-1)= x. Approximate a root of using a ?xed-point method, by taking x0=2.5.
Solution:
g=inline( (x^2+3)/(2*x-1) );
x0=input( x0= );
n=input( n= );
for i=1:n
x1=g(x0);
disp(x0)
if abs(x1-x0)<0.001
break
else
x0=x1;
end
end
Answer:
x0=2.5
n=5
2.5000
2.3125
2.3028
Example2;
Use a fixed-point iteration method to determine a solution accurate to within 10?2 for x4?3x2?3 = 0 on [1, 2]. Use p0 = 1.
Solution: Invert the problem into fixed point problem, then
g=inline( (3*x^2+3)^0.25 );
x0=input( x0= );
n=input( n= );
for i=1:n
x1=g(x0);
disp(x0)
if abs(x1-x0)<0.01
break
else
x0=x1;
end
end
Answer:
x0=1
n=9
1
1.5651
1.7936
1.8859
1.9228
1.9375
Fixed Point Iteration Algorithm
Write the program in the editor page by clicking on New Script , Save it , then click Run.

Example1:
Consider the function g (x) = (x2+3)/(2x-1)= x. Approximate a root of using a ?xed-point method, by taking x0=2.5.
Solution:
g=inline( (x^2+3)/(2*x-1) );
x0=input( x0= );
n=input( n= );
for i=1:n
x1=g(x0);
disp(x0)
if abs(x1-x0)<0.001
break
else
x0=x1;
end
end
Answer:
x0=2.5
n=5
2.5000
2.3125
2.3028
Example2;
Use a fixed-point iteration method to determine a solution accurate to within 10?2 for x4?3x2?3 = 0 on [1, 2]. Use p0 = 1.
Solution: Invert the problem into fixed point problem, then
g=inline( (3*x^2+3)^0.25 );
x0=input( x0= );
n=input( n= );
for i=1:n
x1=g(x0);
disp(x0)
if abs(x1-x0)<0.01
break
else
x0=x1;
end
end
Answer:
x0=1
n=9
1
1.5651
1.7936
1.8859
1.9228
1.9375


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