Oltin qism usuli
Download 241.99 Kb.
|
14-maruza
x= x i -1/2 =x-( x i -x i -1)/2= x-x i/2 -x i -1 /2= x- x i -1 + x i -1 /2-x i/ 2 \u003d t-h men/2
Keyin menkiritilgan intervallarni hisobga olgan holda integralning qiymati yozilishi mumkin: Qiymatni ifodasida almashtiring a, b koeffitsientlari va v Shunday qilib, S men - bu integralning qiymati menth segment. A dan b gacha bo'lgan segmentda integralni olish uchun barcha S ni qo'shish kerak men Agar h menhar qanday kishi uchun \u003d h men\u003d 1, ..., N, keyin Simpson formulasini soddalashtirish mumkin (4) Formulani (4) soddalashtirish mumkin, buning uchun biz yig'indilar belgisi ostida ifodadagi qavslarni ochamiz Birinchi yig'indidan funktsiyaning nuqtadagi qiymatini tanlaymiz x=a , va oxirgi yig'indidan - funktsiyaning nuqtadagi qiymati x=b Natijada, biz bir xil tarmoq uchun ishlaydigan Simpson formulasini olamiz. Shuni hisobga olaylik, , biz Simpson formulasining yakuniy ifodasini olamiz (5) formulaning birinchi yig'indisida segmentning barcha ichki tugunlaridagi funktsiya qiymatlari yig'indisi, ikkinchi yig'indisi funktsiyalarning o'rta nuqtalaridagi yig'indisi hisoblanadi men- segmentlar. Agar segmentlarning o'rta nuqtalari tugunlar bilan birga katakchaga kiritilgan bo'lsa, unda yangi qadam h 0 \u003d h / 2 \u003d (b-a) / (2 * n) bo'ladi va (5) formulani quyidagicha yozish mumkin: Ko'rib chiqing ... Ushbu integralning qiymatini analitik usulda topish oson va u -0,75 ga teng. 3 va undan past darajadagi polinom ko'rinishidagi integral uchun Simpson usuli aniq qiymat beradi. Ushbu integralni Simpson usuli bilan hisoblash algoritmi (formula (5)). 1-dan n-1gacha i bo'yicha pastadir tsikl tugashi i-da tsikl 1 dan n gacha tsikl tugashi s \u003d h * (f0 + 2 * s1 + 4 * s2 + fn) / 6 funktsiya f1 parametrlar x x ^ 3 + 3 * x ^ 2 + x * 4 - 4 ga qaytish Tilda Simpson usuli bilan integralni hisoblash dasturining misoli VFP((6) formulaga muvofiq): O'nlikni 10 ga o'rnating ? "I \u003d" simpson (0,2,20) TARTIBI simpson PARAMETRALAR a, b, n S_even \u003d 0 S_ toq \u003d 0 x \u003d a + h TO b-h QADAM 2 * h uchun S_ g'alati \u003d S_ g'alati + 4 * f (x) x \u003d a + 2 * h TO b-h QADAM 2 * h uchun S_even \u003d S_even + 2 * f (x) S \u003d f (a) * h / 3 + (S_even + S_even) * h / 3 + f (b) * h / 3 Tilda misol echimi VBA: "integralning qiymatini antidivivativ bilan hisoblashning to'g'riligini tekshirish tartibi s_ juft \u003d 0 s_ toq \u003d 0 X \u003d a + h uchun b - h qadam 2 * h s_ g'alati \u003d s_ g'alati + 4 * f (x) Debug.Print "s_ odd \u003d" & s_ g'alati X \u003d a + 2 * h uchun b - h qadam 2 * h s_ juft \u003d s_ juft + 2 * f (x) Debug.Print "s_even \u003d" & s_even s \u003d h / 3 * (f (a) + (s_ juft + s_ toq) + f (b)) Debug.Print "Simpson Method: s \u003d" & s Debug.Print "Antiderivative value: s_test \u003d" & s_test (b-a) VBA dasturini ishga tushirish natijasi: s_ g'alati \u003d 79.9111111111111 s_ juft \u003d 36.0888888888889 Simpson usuli: s \u003d 2.66666666666667 Antivivativ qiymat: s_test \u003d 2.66666666666667 Download 241.99 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling