|
II-BOB. DIFFERENSIALTENGLAMALARNI MAPLE PAKETI YORDAMIDA YECHISH USULLARI
|
bet | 6/10 | Sana | 27.05.2024 | Hajmi | 1,63 Mb. | | #254585 |
Bog'liq Solijonov Barkamoljon KURS 2.1 Differensial tenglamani sonli yechish
Differensial tenglamaning sonli yechimi dsolve komandasi yordamida bajariladi. Differensial tenglama yechimining grafigini chizish odeplot komandasi yordamida bajariladi. Shuning uchun differensial tenglama sonli yechish (Koshi masalasi yoki chegaraviy masala) da dsolve komandasidan keyin type=numeric (yoki qisqacha numeric) parametri ko`rsatiladi. U holda differensial tenglamaning yechimi dsolve(eq, vars, type=numeric, options) komandasi ko`rinishida beriladi, bu yerda eq – tenglama, vars – noma’lum funksiyalar ro`yxati, options – parametrlar, differensial tenglamaning integrali sonli metod bilan ko`rsatilgan. Maple da aniqlangan bunday metod: method=rkf45 Ro`nge-Kutta-Felberg 4-5tartibli darajali metodi (o`rnatilgan); method=dverk78 – Ro`nge-Kutta 7-8 tartibli darajali metodi; mtthod=classical –Ro`nge-Kuttaning 3-tartibli darajali klassik metodi; method=gear i method=mgear – Girning bir qadamli va ko`p qadamli metodi. Differensial tenglamaning sonli yechimining grafigini chizish uchun odeplot(dd, [x,y(x)], x=x1..x2) komandasidan foydalaniladi, bu yerda funksiyani sonli yechimi sifatida dd:=dsolve({eq,cond}, y(x), numeric) komandasidan foydalaniladi, kvadrat qavs ichida o`zgaruvchi va noma’lum funksiya [x,y(x)] va x=x1..x2 interval grafik yasash uchun ko`rsatiladi.
Amaliy misollar yechishda uslubiy ko`rsatma
1. Koshi masalasining y'-xsiny= sin 2x, y(0)=0, y'(0)= 1 sonli va taqribiy yechimini 6-tartibli darajali qator ko`rinishida toping.
Dastlab Koshi masalasining sonli yechimini topamiz va grafigini yasaymiz.
> restart; Ordev=6:
> eq:=diff(y(x),x$2)-x*sin(y(x))=sin(2*x):
> cond:=y(0)=0, D(y)(0)=1:
> de:=dsolve({eq,cond},y(x),numeric); de := proc(rkf45_x) ... end proc
Eslatma: natija chiqqan qatorda rkf45 metodidan yechimda foydalanganlik haqida ma’lumot hosil bo`ladi. Agar x o`zgaruvchi biror-bir fiksirlangan qiymatida yechim qiymatini olish zarur bo`lsa, masalan, x=0.5 bo`lsa, u holda quyidagini terish kerak:
> de(0.5);
[x=.5, y(x)=.544926115386263010, y(x) y(x)= 1.27250308222538000]
> with(plots):
> odeplot(de,[x,y(x)],-10..10,thickness=2);
Endi Koshi masalasining taqribiy yechimini darajali qator ko`rinishida topamiz va grafikni sonli yechim va hosil qilingan darajali qatorning intervalda mos keluvchi grafigini yasaymiz.
> dsolve({eq, cond}, y(x), series); y(x)= x+ x3+ x4- x5+O(x6)
> convert(%, polynom):p:=rhs(%):
> p1:=odeplot(de,[x,y(x)],-2..3, thickness=2,color=black):
> p2:=plot(p,x=-2..3,thickness=2,linestyle=3,color=blue): > display(p1,p2);
Hosil qilingan darajali qator bilan taqribiy yechim -1<x<1 da mos keladi.
2 . Differensial tenglamalar sistemasi (Koshi masalasi) ni yechimining grafigini chizing: x'(t)=2y(t)sin(t) x(t) t, y'(t)=x(t), x(0)=1, y(0)=2.
> restart; cond:=x(0)=1,y(0)=2: sys:=diff(x(t),t)=2*y(t)*sin(t)-x(t)t,diff(y(t),t)=x(t):
> F:=dsolve({sys,cond},[x(t),y(t)],numeric):
> with(plots):
Warning, the name changecoords has been redefined
> p1:=odeplot(F,[t,x(t)],-3..7, color=black, thickness=2,linestyle=3):
> p2:=odeplot(F,[t,y(t)],-3..7,color=green,thickness=2):
> p3:=textplot([3.5,8,"x(t)"], font=[TIMES, ITALIC, 12]):
> p4:=textplot([5,13,"y(t)"], font=[TIMES, ITALIC, 12]):
> display(p1,p2,p3,p4);
Maple paketiga kiruvchi odeplot komandasi differensial tenglamalar va differensial tenglamalar sistemasi yechimlarining grafigini chizish imkoniyatini beradi.
Quyidagi sistemani qaraymiz.
> sys := diff(y(x),x)=z(x),diff(z(x),x)=y(x): fcns := {y(x),
1>
|
| |