Differensial tenglamalar yechimi grafigini chizish.
Differensial tenglamaning sonli yechimi grafigini yasash uchun odeplot(dd, [x,y(x)], x=x1..x2) buyrug’idan foydalaniladi, bu yerda funksiya sifatida sonli yechim buyrug’i dd:=dsolve({eq,cond}, y(x), numeric) qo’llaniladi, undan keyin esa kvadrat qavsda o’zgaruvchi va noma’lum funksiya [x,y(x)], hamda grafik yasash uchun x=x1..x2 interval ko’rsatiladi.
Misollar
1. Koshi masalasining sonli va 6-tartibli darajali qator ko’rinishida taqribiy yechimini toping: , , .
Avval Koshi masalasining sonli yechimini topamiz va uning 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
Izoh: Agar x o’zgaruvchining biror fiksirlangan qiymatida yechimni topish kerak bo’lsa , shu qiymat oldindan berilishi kerak, masalan, x=0.5 da quyidagi teriladi:
> de(0.5);
> with(plots):
> odeplot(de,[x,y(x)],-10..10,thickness=2);
Endi Koshi masalasining darajali qator ko’rinishida taqribiy yechimini topamiz va grafigini yasaymiz.
> dsolve({eq, cond}, y(x), series)
> 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);
Yechimning darajali qatorga yaqinlashuvi taxminan -1<x<1 intervalda ro’y beradi.
2. Differensial tenglamalar sistemasi Koshi masalasining yechimi grafigini yasang: 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): p1:=odeplot(F,[t,x(t)],-3..7, color=black, thicness=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);
1>
Dostları ilə paylaş: |