تم الحل ✓
categoryبرمجة وتطوير البرمجيات
schoolبكالوريوس
event_available2026-07-15
السؤال
Transcribed Image Text:
6. For each function below, write a program to do Simpson's rule using the sequence
of mesh sizes h=(b-a), (b-a), (b-a),..., 2048 (b-a), where b-a is the
length of the given interval. Verify that the expected rate of decrease of the error is
observed. Comment on any anomolies that are observed.
(d) f(x)=√1-2, 1-1, 1], I(f) =π/2;
(e) f(x) = e sin(42), [0, ], (f) = (1-e) = 0.2251261368.
7. For each integral Problem 6. how small does h have to ha
Algorithm 5.1 Simpson's Rule
input a, b, n
external f
simp f(a) + f (b)
h (b a)/n
-
sum4 0.0
for i-1 to n-1 by 2 do
xa+i⭑h
sum4 sum4 + f(x)
endfor
sum2 0.0
for i-2 to n-2 by 2 do
xa+i+h
sum2 sum2 + f(x)
endfor
simp
(h/3.0)*(simp+4*sum4 +2*sum2)
end code
I
check_circle الجواب — حل مفصل خطوة بخطوة
hourglass_top
🔒
الحل الكامل متاح للمشتركين
اشترك في أرشيف الأسئلة لعرض هذا الحل وآلاف الحلول المفصلة خطوة بخطوة من معلمين معتمدين.