Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
homogenines.wxmx 1 / 9
Homogeninės pirmosios eilės diferencialinėslygtys
1 pavyzdys
(%i1) eq:2·x·y·'diff(y,x)=y^2−x^2;
(eq) 2 x y⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟d
d xy = y 2−x2
(%i2) ode2(eq,y,x);
(%o2) −x
y 2+ x2=%c
(%i3) %^−1;
(%o3) −y 2+ x2
x=
1
%c
(%i4) %·(−x);
(%o4) y 2+ x2= −x
%c
Atsakymas:
(%i5) ats:subst(%c=−1/C,%);
(ats) y 2+ x2= C x
Integralinės kreivės yra apskritimai, kurių lygtys yra:
(%i6) (x−C/2)^2+y^2=C^2/4;
(%o6) y 2+⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟x −
C
2
2=
C2
4
(%i7) kr:makelist(ev(ats),C,[−4,−2,−1,1,2,4]);
(kr) [y 2+ x2= −4 x,y 2+ x2= −2 x,y 2+ x2= −x,y 2+ x2= x,y 2+ x2= 2 x,y 2+ x2= 4 x]
(%i8) load(implicit_plot)$
(%i9) wximplicit_plot(kr,[x,−4,4],[y,−2,2],same_xy);
(%t9)
(%o9)
(%i10) load(drawdf)$
(%i11) f:rhs(eq/(2·x·y));
(f)y 2−x2
2 x y
homogenines.wxmx 2 / 9
(%i12) wxdrawdf(f,[x,−4,4],[y,−2,2],color=magenta, implicit(kr[1],x,−4,4,y,−2,2),implicit(kr[2],x,−4,4,y,−2,2), implicit(kr[3],x,−4,4,y,−2,2), implicit(kr[4],x,−4,4,y,−2,2), implicit(kr[5],x,−4,4,y,−2,2),implicit(kr[6],x,−4,4,y,−2,2), proportional_axes = 'xy )$
(%t12)
2 pavyzdys
(%i13) eq:'diff(y,x)=(x^2+2·x·y−5·y^2)/(2·x^2−6·x·y);
(eq)d
d xy =
−5 y 2+ 2 x y + x2
2 x2−6 x y
(%i14) ode2(eq,y,x);
(%o14) %c x=x6 %e
2 atan⎛ ⎞⎝ ⎠⎜ ⎟y
x
( )y 2+ x23
(%i15) %/x;
(%o15) %c=x5 %e
2 atan⎛ ⎞⎝ ⎠⎜ ⎟y
x
( )y 2+ x23
Atsakymas:
(%i16) ats:reverse(%);
(ats)x5 %e
2 atan⎛ ⎞⎝ ⎠⎜ ⎟y
x
( )y 2+ x23=%c
Sprendinio patikrinimas:
(%i17) depends(y,x);
(%o17) [y( )x ]
(%i18) diff(ats,x);
(%o18) −
3 x5 %e2 atan⎛ ⎞
⎝ ⎠⎜ ⎟y
x ⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟2 y
⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟
d
d xy + 2 x
( )y 2+ x24
+
2 x5 %e2 atan⎛ ⎞
⎝ ⎠⎜ ⎟y
x⎛ ⎞
⎝ ⎠
⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟
d
d xy
x−
y
x2
( )y 2+ x23 ⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟y 2
x2+ 1
+5 x4 %e
2 atan⎛ ⎞⎝ ⎠⎜ ⎟y
x
( )y 2+ x23
= 0
(%i19) solve(%,'diff(y,x));
(%o19) [d
d xy =
5 y 2−2 x y −x2
6 x y −2 x2]
homogenines.wxmx 3 / 9
(%i20) subst(%,eq);
(%o20) 5 y 2−2 x y −x2
6 x y −2 x2=
−5 y 2+ 2 x y + x2
2 x2−6 x y
(%i21) ratsimp(%);
(%o21) 5 y 2−2 x y −x2
6 x y −2 x2=
5 y 2−2 x y −x2
6 x y −2 x2
(%i22) is(%);
(%o22) true
➔ ;
Nubrėšime keletą integralinių kreivių ir krypčių lauką:
(%i23) kr:makelist(ev(ats),%c,[−4,−2,−1,1,2,5]);
(kr) [x5 %e
2 atan⎛ ⎞⎝ ⎠⎜ ⎟y
x
( )y 2+ x23= −4,
x5 %e2 atan⎛ ⎞
⎝ ⎠⎜ ⎟y
x
( )y 2+ x23= −2,
x5 %e2 atan⎛ ⎞
⎝ ⎠⎜ ⎟y
x
( )y 2+ x23= −1,
x5 %e2 atan⎛ ⎞
⎝ ⎠⎜ ⎟y
x
( )y 2+ x23= 1,
x5 %e2 atan⎛ ⎞
⎝ ⎠⎜ ⎟y
x
( )y 2+ x23= 2,
x5 %e2 atan⎛ ⎞
⎝ ⎠⎜ ⎟y
x
( )y 2+ x23= 5]
(%i24) load(implicit_plot)$
(%i25) wxplot_size;
(%o25) [600,400]
(%i26) wximplicit_plot(kr,[x,−2,2],[y,−1,1.5],same_xy),wxplot_size=[800,600];
(%t26)
(%o26)
Nubrėšime paskutinę kreivę atskirai.
(%i27) last(kr);
(%o27) x5 %e
2 atan⎛ ⎞⎝ ⎠⎜ ⎟y
x
( )y 2+ x23= 5
homogenines.wxmx 4 / 9
(%i28) wximplicit_plot(last(kr),[x,−0.2,0.4],[y,−0.15,0.2],same_xy);
(%t28)
(%o28)
(%i29) load(drawdf)$
(%i30) f:rhs(eq);
(f)−5 y 2+ 2 x y + x2
2 x2−6 x y
(%i31) wxdrawdf(f,[x,−2,2],[y,−1,1],color=magenta, implicit(kr[1],x,−2,2,y,−1,1),implicit(kr[2],x,−2,2,y,−1,1), implicit(kr[3],x,−2,2,y,−1,1), implicit(kr[4],x,−2,2,y,−1,1), implicit(kr[5],x,−2,2,y,−1,1),implicit(kr[6],x,−2,2,y,−1,1), proportional_axes = 'xy ),wxplot_size=[800,600]$
(%t31)
3 pavyzdys
(%i32) eq:'diff(y,x)=(y+2)/(2·x+y−4);
(eq)d
d xy =
y + 2
y + 2 x −4
(%i33) ats:ode2(eq,y,x);
(ats) −y + x −1
y 2+ 4 y + 4=%c
homogenines.wxmx 5 / 9
Sprendinio patikrinimas:
(%i34) depends(y,x);
(%o34) [y( )x ]
(%i35) diff(ats,x);
(%o35)
( )y + x −1⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟2 y
⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟
d
d xy + 4
⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟
d
d xy
( )y 2+ 4 y + 42
−
d
d xy + 1
y 2+ 4 y + 4= 0
(%i36) solve(%,'diff(y,x));
(%o36) [d
d xy =
y + 2
y + 2 x −4]
(%i37) subst(%,eq);
(%o37) y + 2
y + 2 x −4=
y + 2
y + 2 x −4
(%i38) is(%);
(%o38) true
Nubrėšime keletą integralinių kreivių ir krypčių lauką:
(%i39) kr:makelist(ev(ats),%c,[−4,−2,−1,0,1,2,4]);
(kr) [−y + x −1
y 2+ 4 y + 4= −4,−
y + x −1
y 2+ 4 y + 4= −2,−
y + x −1
y 2+ 4 y + 4= −1,−
y + x −1
y 2+ 4 y + 4= 0,−
y + x −1
y 2+ 4 y + 4= 1,−
y + x −1
y 2+ 4 y + 4
= 2,−y + x −1
y 2+ 4 y + 4= 4]
(%i40) load(implicit_plot)$
(%i41) wximplicit_plot(kr,[x,1,6],[y,−3,0],same_xy),wxplot_size=[800,600];
(%t41)
(%o41)
(%i42) load(drawdf)$
(%i43) f:rhs(eq);
(f)y + 2
y + 2 x −4
homogenines.wxmx 6 / 9
(%i44) wxdrawdf(f,[x,1,6],[y,−3,0],color=red,line_width=2, implicit(kr[1],x,1,6,y,−3,0),implicit(kr[2],x,1,6,y,−3,0), implicit(kr[3],x,1,6,y,−3,0), implicit(kr[4],x,1,6,y,−3,0), implicit(kr[5],x,1,6,y,−3,0),implicit(kr[6],x,1,6,y,−3,0), proportional_axes = 'xy ),wxplot_size=[800,600]$
(%t44)
4 pavyzdys
(%i45) eq:'diff(y,x)=(x+6·y−7)/(8·x−y−7);
(eq)d
d xy =
6 y + x −7
−y + 8 x −7
(%i46) ode2(eq,y,x);
(%o46) false
Nepavyko išspręsti su ode2, todėl spręsime "žingsnis po žingsnio" metodu nesinaudodamiode2
(%i47) L1:num(rhs(eq))=0;
(L1) 6 y + x −7= 0
(%i48) L2:denom(rhs(eq))=0;
(L2) −y +8 x −7= 0
(%i49) solve([L1,L2]);
(%o49) [[y = 1,x= 1]]
(%i50) [x0,y0]:subst(%[1],[x,y]);
(%o50) [1,1]
(%i51) keit:u(x)=(y−y0)/(x−x0);
(keit) u( )x =y −1
x −1
(%i52) akeit:solve(keit,y)[1];
(akeit) y = ( )x −1 u( )x +1
(%i53) subst(akeit,eq),ratsimp;
(%o53) d
d x( )( )x −1 u( )x +1 = −
6 u( )x + 1
u( )x −8
homogenines.wxmx 7 / 9
(%i54) ev(%,diff);
(%o54) ( )x −1⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟d
d xu( )x +u( )x = −
6 u( )x + 1
u( )x −8
(%i55) eq1:%−u(x),factor;
(eq1) ( )x −1⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟d
d xu( )x = −
( )u( )x −12
u( )x −8
(%i56) eq1/rhs(eq1)/(x−1);
(%o56) −
( )u( )x −8⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟
d
d xu( )x
( )u( )x −12
=1
x −1
(%i57) partfrac(lhs(%),u(x))=rhs(%);
(%o57)
7⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟
d
d xu( )x
( )u( )x −12
−
d
d xu( )x
u( )x −1=
1
x −1
(%i58) integrate(%,x);
(%o58) − log( )u( )x −1 −7
u( )x −1= log( )x −1 +%c1
(%i59) subst(keit,%);
(%o59) −7
y −1
x −1−1
− log⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟y −1
x −1−1 = log( )x −1 +%c1
(%i60) %−log(x−1);
(%o60) −7
y −1
x −1−1
− log⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟y −1
x −1−1 − log( )x −1 =%c1
(%i61) logcontract(%);
(%o61) − log( )y −x −7
y −1
x −1−1
=%c1
(%i62) map(factor,lhs(%))=rhs(%);
(%o62) − log( )y −x −7 ( )x −1
y −x=%c1
Atsakymas:
(%i63) ats:lhs(%·(−1))=C;
(ats) log( )y −x +7 ( )x −1
y −x= C
Patikrinimas:
(%i64) depends(y,x);
(%o64) [y( )x ]
(%i65) diff(ats,x);
(%o65)
d
d xy −1
y −x−
7 ( )x −1⎛ ⎞
⎝ ⎠⎜ ⎟⎜ ⎟
d
d xy −1
( )y −x 2+
7
y −x= 0
(%i66) solve(%,'diff(y,x,1));
(%o66) [d
d xy = −
6 y + x −7
y −8 x+ 7]
(%i67) subst(%,eq);
(%o67) −6 y + x −7
y −8 x+ 7=
6 y + x −7
−y + 8 x −7
homogenines.wxmx 8 / 9
(%i68) ratsimp(%);
(%o68) −6 y + x −7
y −8 x+ 7= −
6 y + x −7
y −8 x+ 7
(%i69) is(%);
(%o69) true
Brėžiniai:
(%i70) kr:makelist(ev(ats),C,[−2,−1,0,1,2]);
(kr) [ log( )y −x +7 ( )x −1
y −x= −2, log( )y −x +
7 ( )x −1
y −x= −1, log( )y −x +
7 ( )x −1
y −x= 0, log( )y −x +
7 ( )x −1
y −x= 1,
log( )y −x +7 ( )x −1
y −x= 2]
(%i71) load(implicit_plot);
(%o71) C:\maxima−current\share\maxima\branch_5_41_base_531_g39e125c_dirty\share\contrib\implicit_plot.lisp
(%i72) wximplicit_plot(kr,[x,x0−5,x0+5],[y,y0−5,y0+5],[gnuplot_preamble, "set key center right out"]),wxplot_size=[900,600];
(%t72)
(%o72)
Pastebėsime, kad y=x taip pat yra sprendinys.
Krypčių laukas:
(%i73) load(drawdf);
(%o73) C:\maxima−current\share\maxima\branch_5_41_base_531_g39e125c_dirty\share\diffequations\drawdf.mac
(%i74) f:rhs(eq);
(f)6 y + x −7
−y + 8 x −7
homogenines.wxmx 9 / 9
(%i75) wxdrawdf(f,[x,−4,6],[y,−4,6],implicit(kr[1],x,−4,6,y,−3,6));
(%t75)
(%o75) 0
Pastebėsime, kad brėžiant tik vieną kreivę log(y-x)+(7*(x-1))/(y-x)=-2, nusibrėžė dar tiesė y=x.Kai y=x funkcijos log(y-x) ir (7*(x-1))/(y-x) virsta begalybe.