3-Misol. Faraz qilaylik, ushbu
f1x, y xy y3 1 0;
f x, y x2 y2 y3 5 0
2
nochiqli tenglamalar sistemasining aniq yechimi (x,y)=(2;1) bo‘lib, uni dastlab analitik usulda Maple dasturi yordamida, keyin esa uning taqribiy yechimini Nyuton usulida topaylik.
Yechish. Dastlab berilgan nochiqli tenglama- lar sistemasining yechimi mavjudligini Maple dasturi yordamida grafik usulda aniqlaylik (3.14- rasm):
plots[implicitplot]({x*y-y^3-1=0,x^2*y^2+y^3- 5=0},x=-5..5,y=0..2);
Berilgan nochiqli tenglamalar sistemasining aniq yechimi analitik usulda Maple dasturi yordamida quyidagicha topiladi:
solve({x*y-y^3-1=0,x^2*y^2+y^3-5=0},{x,y});
{ x 2, y 1 }
|
3.14-rasm. 3-misolda berilgan tenglamalar sistemasi ildizining boshlang‘ich yaqinlashishini grafik usul bilan aniqlash.
|
Shu yechimni Nyuton usuli yordamida Maple dasturida taqribiy hisoblaymiz:
Avvalo Yakob matritsasini linalg paketining jacobian funksiyasi yordamida hisoblaymiz, keyin esa uning teskarisini linalg paketining inverse funksiyasidan foy-
139
dalanib hisoblaymiz. eval funksiyasi ifodaning son qiymatini beradi. evalm funksiyasi esa matritsa va vektorlar ustida amal bajarib, son natija beradi. Bosh- lang‘ich vektorni xx:=[0.5;1.5] va eps:=0.001 aniqlik darajasi deb, Nyuton usuli bo‘yicha taqribiy hisoblashlarni bajaramiz:
F:=(x,y)->[x*y-y^3-1,x^2*y^2+y^3-5];
FP:=jacobian(F(x,y),[x,y]); FPINV:=inverse(FP);
xx:=[0.5,1.5]; eps:=0.001; Err:=1000; v:=xx; v1:=[1e10,1e10]; j:=0;
for i while Err>eps do
v1:=eval(v); M:=eval(eval(FPINV),[x=v[1],y=v[2]]):
v:=evalm(v-M&*F(v[1],v[2])); Err:=max(abs(v1[1]-v[1]),abs(v1[2]-v[2])); j:=j+1;
end do;
Natijalar quyidagicha:
F := ( x, y ) [ x y y3 1, x2 y2 y3 5 ]
y x 3 y2
FP := 2 x y2 2 x2 y 3 y2
2 x2 3 y x 3 y2
FPINV := 3 y2 ( 1 2 x y ) 3 y3 ( 1 2 x y )
2 x 1
3 y ( 1 2 x y )
3 y2 ( 1 2 x y )
xx := [ 0.5, 1.5 ]
eps := 0.001
Err := 1000
v := [ 0.5, 1.5 ]
v1 := [ 0.1 10 11, 0.1 10 11 ]
j := 0
v1 := [ 0.5, 1.5 ]
M := 0.2962962963 0.2469135803
-0.08888888887 0.05925925927
v := [ 1.836419753, 1.240740741]
Err := 1.336419753
j := 1
v1 := [ 1.836419753, 1.240740741]
M := 0.4078488757 0.08736397583
-0.1775644435 0.03896485017
|
v := [ 1.910372475, 1.046712441]
Err := 0.194028300
j := 2
v1 := [ 1.910372475, 1.046712441]
M := 0.6353135777 0.08003024373
-0.2433868149 0.06085855173
v := [ 1.992251965, 1.002053670]
Err := 0.081879490
j := 3
v1 := [ 1.992251965, 1.002053670]
M := 0.7276965560 0.06768724860
-0.2654774883 0.06649093770
v := [ 1.999976663, 1.000005095]
Err := 0.007724698
j := 4
v1 := [ 1.999976663, 1.000005095]
M := 0.7333182897 0.06666959200
-0.2666635987 0.06666633793
v := [ 2.000000000, 1.000000000]
Err := 0.000023337
j := 5
|
Iteratsion jarayonning 5-qadamida berilgan aniqlikdagi yechimga erishildi.
Do'stlaringiz bilan baham: |