Mth013 -guruh talabasi Tekshirdi: Rabbim Raxmatov Mavzu: Birinchi tartibli chiziqli differensial tenglamalarni taqribiy yechishning Runge-Kutta usuli. Reja: Birinchi tartribli deferensial tenglamalar. Eyler usuli
ismoilova shohida dt
X
|
U |
u’=f(x,y) |
K=hf(x,y) | ||
u | |||||
1 |
2 |
3 |
4 |
5 |
6 |
|
x0 |
y0 |
f(x0 ,y0) |
K1(0) |
K1(0) |
|
x0+h/2 |
y0+K1(0)/2 |
f(x0+h/2; y0+K1(0)/2) |
K2(0) |
2K2(0) |
0 |
x0+h/2 |
y0+K2(0)/2 |
f(x0+h/2; y0+K2(0)/2) |
K3(0) |
2K3(0) |
|
x0+h |
y0+K3(0) |
f(x0+h; y0+K3(0)) |
K4(0) |
K4(0) |
|
|
|
|
|
|
|
x1 |
y1=y0+ y0 |
f(x1 ,y1) |
K1(0) |
K1(0) |
|
x1+h/2 |
y1+K1(1)/2 |
f(x1+h/2; y1+K1(1)/2) |
K2(0) |
2K2(0) |
1 |
x1+h/2 |
y1+K2(1)/2 |
f(x1+h/2; y1+K2(1)/2) |
K3(0) |
2K3(0) |
|
x1+h |
y1+K3(1) |
f(x1+h; y1+K3(1)) |
K4(0) |
K4(0) |
|
|
|
|
|
|
2 |
x2 |
y2=y1+ y1 |
|
|
|
Misol. Runge-Kutta usuli yordamida quyidagi differensial tenglamaga qo’yilgan boshlang’ich masalaning
y’= , u(1)=0 yechimi [1;1,5] kesmada h=0,1 qadam bilan topilsin.
Yechish. Yechimlar va xisobiy qiymatlar 2-jadvalda keltirilgan.
2-Jadval
i |
xi |
yi |
f(xi, yi) |
K=hf(xi, yi) |
y1 |
0 |
1 1,05 1,05 1,1 |
0 0,05 0,057262 0,115907 |
1 1,145238 1,159071 1,310740 |
0,1 0,114524 0,115907 0,131074 |
0,1 0,229048 0,231814 0,131074 |
|
|
|
|
|
0,115323 |
1 |
1,1 1,15 1,15 1,20 |
0,115323 0,180807 0,188546 0,263114 |
1,309678 1,464447 1,477905 1,638523 |
0,130968 0,146445 0,147791 0,163852 |
0,130968 0,292889 0,295581 0,163852 |
|
|
|
|
|
0,147215 |
2 |
1,2 1,25 1,25 1,3 |
0,262538 0,344416 0,352591 0,443953 |
1,637563 1,801066 1,814146 1,983005 |
0,163756 0,180107 0,181415 0,198301 |
0,163756 0,360213 0,362829 0,198301 |
|
|
|
|
|
0,180805 |
3 |
1,3 1,35 1,35 1,4 |
0,443388 0,524495 0,551073 0,660028 |
1,982135 2,153696 2,166404 2,342897 |
0,198214 0,215370 0,216640 0,234290 |
0,198214 0,430739 0,443281 0,234290 |
|
|
|
|
|
0,216087 |
4 |
1,4 1,45 1,45 1,50 |
0,659475 0,776580 0,785532 0,912824 |
2,342107 2,521146 2,533493 2,717099 |
0,234211 0,252115 0,253349 0,271710 |
0,234211 0,504229 0,506700 0,271711 |
|
|
|
|
|
0,252808 |
5 |
1,5 |
0,912283 |
|
|
|
Berilgan Koshi masalasini (0,1) intervalda yechimining taqribiy qiymatlarini 𝜀=0.0001 aniqlikda Runge-Kutta usulida toping.
24. y’=xy+0.2y2 , y(0)=0.4.
#include
#include
using namespace std;
double f(double x, double y) {
return x * y + 0.2 * y * y;
}
int main() {
double x0 = 0, y0 = 0.4, xn = 1, yn, k1, k2, k3, k4, h = 0.1;
int n = (xn - x0) / h;
for (int i = 0; i < n; i++) {
k1 = h * f(x0, y0);
k2 = h * f(x0 + 0.5 * h, y0 + 0.5 * k1);
k3 = h * f(x0 + 0.5 * h, y0 + 0.5 * k2);
k4 = h * f(x0 + h, y0 + k3);
yn = y0 + (1.0 / 6.0) * (k1 + 2 * k2 + 2 * k3 + k4);
x0 = x0 + h;
y0 = yn;
cout << "x" << i+1 << " = " << x0 << " y" << i+1 << " = " << yn << endl;
}
return 0;
}
Xulosa.
Men bu mavzudan shuni tushindimki Runge-kutta usuli boshqa usullardan aniqroq hisoblashga yordam berar ekan. Differensial tenglamalarni yuqori bo’limlardagidek aniq yechimini topish juda kamdan kam hollardagina mumkin bo’ladi. Amaliyotda uchraydigan ko’plab masalalarga aniq yechish usullarini qo’lashning iloji bo’lmaydi. Shuning uchun bunday differensial tenglamalarni taqribiy yoki sonli usular yordamida yechishga to’g’ri keladi.
Foydalanilgan adabiyotlar:
1.A.A.Abduqodirov “Hisoblash matematikasi”
2.F.B.Badalov “Optimallash nazariyasi”
3.K.Safoyeva, N.Beknazarova “O’quv qo’llanma”
Saytlar Ro’yxati:
1.www.tuit.uz
2.www.edu.uz
3.www.amazon.com
Download 476.7 Kb.
Do'stlaringiz bilan baham:
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling