O‟zbekiston respublikasi xalq ta‟lim vazirligi toshkent shahar xalq ta‟limi xodimlarini qayta tayyorlash va ularning malakasini oshirish instituti
Download 0.9 Mb. Pdf ko'rish
|
Maple-dasturida-ishlash
> combine(4*sin(x)^3, trig); ( ) sin 3 x 3 ( )
sin x
Faqat kvadrat ildiz, balki boshqa ildizlarga ega bo‟lgan ifodalarni sodalashtirish uchun radnormal(ifoda) buyrug‟i ishlatiladi. Masalan: 1) sqrt(5+sqrt(8)+(5+6*sqrt(3))^(1/2))=radnormal(sqrt(5+sqrt(8)+(5+6*sqrt(3))^ (1/2)));
almashtiriladi, bu yerda y – ifoda, param- ko‟rsatilgan tur.
Umuman olganda, convert buyrug‟idan juda keng miqyosda foydalanish mumkin. U bir turdagi ifodani boshqa turga o‟tkazadi.
Agar barcha buyruqlarning imkoniyatlari to‟g‟risida to‟liq ma‟lumotga ega bo‟lmoqchi bo‟lsangiz, ma‟lumotlar tizimiga murojoat qilish kerak bo‟ladi: >? buyruq;. Masalan: ?convert; Misollar. Ko‟phadni ko‟paytuvchilarga ajratish uchun Maple dasturida factor buyrug‟i kiritiladi. 1) :=
p
x 3 4 x 2 2 x 4 ko‟phadni ko‟paytuvchilarga ajrating: > factor(x^3+4*x^2+2*x-4); ( ) x 2 (
)
x 2 2 x 2 .
24
x x x x x p 6 7 : 2 3 4 5 > factor(p); ) 1 )( 2 )( 3 )( 1 (
x x x x
Masalan:
1 ( ) sin 2 x ( )
1 ( ) sin 2 x ( ) cos 2 x . Buyruqlar satrida teramiz: > y:=(1+sin(2*x)+cos(2*x))/(1+sin(2*x)-cos(2*x)): > convert(y, tan): > y=normal(%);
1 ( ) sin 2 x ( ) cos 2 x
1 ( ) sin 2 x ( )
1 ( )
tan x . Ifodani soddalashtiring:
3 ( ) sin x 4 3 ( ) cos x 4 2
sin x 6 2 ( ) cos x 6 .
Buning uchun quyidagini teramiz: > y:=3*(sin(x)^4+cos(x)^4)-2*(sin(x)^6+cos(x)^6): > y=combine(y, trig);
3 ( ) sin x 4 3 ( ) cos x 4 2
sin x 6 2 ( ) cos x 6 1
x x x x 2 cos 2 sin
1 2 cos 2 sin
1 ifodani soddalashtiring. Quyidagi ifodani kiriting: >eq:=(1+sin(2*x)+cos(2*x))/(1+sin(2*x)-cos(2*x)): > convert(eq, tan): > eq=normal(“); ) tan( 1 ) 2 cos( ) 2 sin( 1 ) 2 cos(
) 2 sin( 1 x x x x x . Maple muhitida trigonometric funksiyalar va ular bilan amallar
logarifmik, eksponensional, trigonometrik, teskari trigonometrik, giperbolik va boshqa funksiyalar ishlatiladi (standart funksiyalar jadvaliga qarang). Ularning 25
hammasi bir argumentli. U butun, rasional, haqiqiy va kompleks bo‟lishi mumkin. Funksiyalarda argumentlar qavs ichiga olinadi. “Maple” dasturida trigonometrik finksiyalarning yozilishi sinx sin(x)
chx cosh(x)
cosx cos(x)
thx tanh(x)
tgx tan(x)
cthx coth(x)
ctgx cot(x)
secx sec(x)
Masalan: > sin(Pi/3); Enter tugmasi bosing va natija :
>cos(Pi/3) Enter : 1/2
> cos(Pi); Enter : -1
sin(Pi/3)+cos(Pi/2)+2*sin(Pi/12); Enter :
> cot(Pi/2); Enter : 0 > tan(Pi/3); Enter : 3
> x:=Pi/2:y:=sin(x)+cos(x); Enter : :=
y 1
> exp(1.); Enter : 2.718281828
> ln(1); Enter : 0 > arcsin(1); Enter : 1 2
> arccos(1/2); Enter : 1 3
26
1) cos(π/3)*sin(π/12)+tg(π/5) berilgan trigonometrik funksiyani hisoblang. 2*cos(Pi/3)*sin(Pi/15)+tan(Pi/5); Enter tugmasini bosing va natija:
Berilgan sonnnig faktorialini hisoblash uchun Maple dasturida factorial buyrug‟i tanlanadi. Masalan. > factorial(10); Enter tugmasini bosing natija: 3628800 > factorial(23); Enter tugmasini bosing natija: 25852016738884976640000
tanlanadi. > max(44,47,-60); Enter tugmasini bosing natija: 47 > max(414,-620,-60,548,-56); Enter tugmasini bosing natija: 548 >max(414*9,-620+5,-60-5,548*3,-56*5); Enter tugmasini bosing natija:3726 Berilgan sonnnig eng kichigini hisoblash uchun Maple dasturida min buyrug‟i tanlanadi. > min(44,47,-60); Enter tugmasini bosing natija: -60 > min(414,-620,-60,548,-56); Enter tugmasini bosing natija: -620 >min(414*9,-620+5,-60-5,548*3,-56*5); Enter tugmasini bosing natija:-615
Maple muhitida tenglamalarni yechish uchun universal buyruq solve(t,x) mavjud, bu yerda t – tenglama, x – tenglamadagi noma‟lum o‟zgaruvchi. Bu buyruqning bajarilishi natijasida chiqarish satrida ifoda paydo bo‟ladi, bu ana shu tenglamaning yechimi hisoblanadi. Masalan:
27
b c a
Agar tenglama bir nechta yechimga ega bo‟lsa va undan keyingi hisoblashlarda foydalanish kerak bo‟lsa, u holda solve buyrug‟iga biror-bir nom name beriladi.. Tenglamaning qaysi yechimiga murojoat qilish kerak bo‟lsa, uning nomi va kvadrat qavs ichida esa yechim nomeri yoziladi: name[k]. Masalan: > x:=solve(x^2-a=0,x); :=
,
> x[1]; a
> x[2]; a
Tenglamalar sistemasini yechish. Tenglamalar sistemasi ham xuddi shunday solve({t1,t2,…},{x1,x2,…}) buyrug‟i yordami bilan yechiladi, faqat endi buyruq parametri sifatida birinchi figurali qavsda bir- biri bilan vergul bilan ajratilgan tenglamalar, ikkinchi figurali qavsda esa noma‟lum o‟zgaruvchilar ketma-ketligi yoziladi.
1)Tenglamalar sistemasini yeching.
>eq:={x-y=1,x+y=3}; eq := {x - y = 1, x + y = 3} > s:=solve(eq,{x,y}); Enter tugmasini bosib natija: s := {y = 1, x = 2}.
28
2)Tenglamalar sistemasini yeching.
> eq:={2*x-2*y=4,x+4*y=6}; eq := {x + 4 y = 6, 2 x - 2 y = 4} > s:=solve(eq,{x,y}); Enter tugmasini bosib natija: s := {y = 4/5, x = 14/5} 3)Tenglamalar sistemasini yeching.
“Maple” dasturida quyidagicha kiritiladi: eq:={sqrt(x)-2*sqrt(y)=4,sqrt(x)+4*sqrt(y)=6};
> s:=solve(eq,{x,y}); Enter tugmasini bosib natija: s := {y = 1/9, x = 196/9}
foydalanish yoki ular ustida ba‟zi arifmetik amallarni bajarish zarur bo‟lsa, u holda solve buyrug‟iga biror bir name nomini berish kerak bo‟ladi. Keyin esa ta‟minlash buyrug‟i assign( name) bajariladi. Shundan keyin yechimlar ustida arifmetik amallarni bajarish mumkin.
:= s { } ,
y
a 5 a 2 5 x
1 a
a 2 5 > assign(s); simplify(x-y); 29
6 1
a 2 5 Tenglamalarning sonli yechimini topish. Agar transsentdent tenglamalar analitik yechimga ega bo‟lmasa, u holda tenglamaning sonli yechimini topish uchun maxsus buyruq fsolve(eq,x) dan foydalaniladi, bu yerda ham parametrlar
f butun funksiya uchun t rekurrent tenglamani yechish mumkin. f(n) funksiya uchun ba‟zi bir boshlang‟ich shartlarni berish mumkin, u holda berilgan rekurrent tenglamaning xususiy yechimi hosil bo‟ladi
>eq:=5+f(n)=21*f(n)-f(n); eq := 5+f(n) = 20*f(n) rsolve({eq,f(1)=0,f(2)=1},f); {f(2) = 1, f(1) = 0, f(n) = 5/19}
Natijada oshkor bo‟lmagan ko‟rinishdagi yechim paydo bo‟ladi. Lekin Maple muhitida bunday yechimlar ustida ishlash imkoni ham mavjud. Funksional tenglamalarning oshkor bo‟lmagan yechimlarini convert buyrug‟i yordamida biror elementar funksiyaga almashtirib olish mumkin. Yuqorida keltirilgan misolni davom ettirgan holda , oshkor ko‟rinishdagi yechimni olish mumkin: > f:=convert(F(x),radical); :=
f
3 2 1 2
9 8 x
Trigonometrik tenlamani echish uchun qo‟llanilgan solve buyrug‟i faqat bosh yechimlarni, ya‟ni [0, 2] intervaldagi yechimlarni beradi. Barcha
yechimlarni olish
uchun oldindan EnvAllSolutions:=true qo‟shimcha buyruqlarni kiritish kerak bo‟ladi . Masalan: > _EnvAllSolutions:=true: 30
1
_Z1~
Maple muhitida _Z~ belgi butun turdagi o‟zgarmasni anglatadi, shuning uchun ushbu tenglama yechimining odatdagi ko‟rinishi x:=π/4+πn bo‟ladi, bu yerda n – butun son.
da yechimni oshkor ko‟rinishda olish uchun solve buyrug‟idan oldin qo‟shimcha _EnvExplicit:=true buyrug‟ini kiritish kerak bo‟ladi.
Murakkab transsendent tenglamalar sistemasini yechish va uni soddalashtirishga misol qaraymiz: > t:={ 7*3^x-3*2^(z+y-x+2)=15, 2*3^(x+1)+3*2^(z+y-x)=66, ln(x+y+z) - 3*ln(x)-ln(y*z)=-ln(4) }: > _EnvExplicit:=true: > s:=solve(t,{x,y,z}): > simplify(s[1]);simplify(s[2]); {x =2, y =3, z =1}, {x =2, y =1, z =3} Yuqorida keltirilgan fikrlar asosida quyidagi misollarni qaraymiz.
1.Tenglamalar sistemasining barcha yechimlarini toping Buyruqlar satrida tering: >eq:={x^2-y^2=1,x^2+y=2}; _EnvExplicit:=true: >s:=solve(eq,{x,y});
Enter tugasini bosib natija: 2. Endi topilgan yechimlar majmuasining yig‟indisini toping.
Buyruqlar satrida tering: > x1:=subs(s[1],x): y1:=subs(s[1],y): 2 1 2 2 2
x y x 31
> x1+x2; y1+y2;
3. x 2 ( ) cos x tenglamaning sonli yechimini toping.
Buyruqlar satrida tering: : > x=fsolve(x^2=cos(x),x); x=.8241323123
4.
( ) f x 2 2 ( )
f x x tenglamani qanoatlantiruvchi f(x) funksiyani toping.
> F:=solve(f(x)^2-2*f(x)=x,f); F:= proc(x) RootOf(_Z^2- 2*_Z- x) end > f:=convert(F(x), radical); :=
f
1
1 x
5. 5sinx + 12cosx=13 tenglamaning barcha yechimlarini toping. Buyruqlar satrida tering: > _EnvAllSolutions:=true: > solve(5*sin(x)+12*cos(x)=13,x); arctan
5 12
“Maple” dasturida oddiy tengsizliklarni yechish Su bilan birga solve buyrug‟i oddiy tengsizliklarni hisoblashda ham ishlatiladi. Tengsizlik yechimi izlanayotgan o‟zgaruvchining o‟zgarish intervali ko‟rinishida beriladi. Bunday holda, agar tengsizlik yechimi yarim o‟qdan iborat bo‟lsa, u holda chiqarish joyida RealRange(–∞ , Open(a)) ko‟rinish-dagi konstruksiya paydo bo‟ladi, ya‟ni xЄ (–∞ , a), a – biror son. Open so‟zi interval ochiq chegarali degan ma‟noni bildiradi. Agar bu so‟z bo‟lmasa , u holda mos chegaralar ham yechimlar to‟plamiga kiradi. Masalan: > s:=solve(sqrt(x+3) 32
RealRange , Op en 2 3 21
Agar siz tengsizlik yechimini xЄ (a, b) turdagi intervalli to‟plamlar ko‟rinishida emas , a<x, x< b turdagi izlanayotgan o‟zgaruvchini chegaralanganlik ko‟rinishida olmoqchi bo‟lsangiz, u holda tengsizlik yechiladigan o‟zgaruvchi figurali qavsda ko‟rsatilishi lozim. Masalan: > solve(1-1/2*ln(x)>2,{x}); { } ,
0 x
x e ( ) -2
Tengsizliklar sistemasini yechish. solve buyrug‟i yordamida tengsizliklar sistemasini ham yechish mumkin. Masalan : ; tengsizliklar sistemasini yeching. “Maple” dasturida ushbu tengsizlik quyidagicha kiritiladi: >solve({2*x+y>=4, x-2*y<=1, 8*x-y>=16, x-2*y>=1},{x,y});
{8/15 <= y, x = 2 y + 1} > solve({x+y>=2,x-2*y<=1,x-y>=0,x-2*y>=1},{x,y}); { } ,
x
2 y 1 1 3
1. Tengsizlikni yeching: 13x 3 -25x 2 -x 4 -129x > 0.
Buning uchun buyruqlar satrida quyidagilarni terish kerak: > solve(13*x^3-25*x^2-x^4-129*x+270>0,x); RealRange(Open(-3), Open(2)), RealRange(Open(5), Open(9)) 2. Tengsizlikni yeching: (2x-3) < 1.
Buning uchun buyruqlar satrida quyidagilarni terish kerak: solve((2*x-3)<1,x); 33
3.Tengsizlikni yeching: (x-3) >(6-x) Buning uchun buyruqlar satrida quyidagilarni terish kerak: >solve((x-3)>(6-x),x);
Agar tengsizlik yechimini x (a, b) kabi interval kо„rinishda emas, a<x, x< b shakldagi cheklanishlar kо„rinishida olmoqchi bо„lsangiz, buyruq parametridagi izlanuvchi о„zgaruvchini figurali qavsda kо„rsatish lozim bо„ladi. Masalan: > solve(1-1/2*ln(x)>2,{x}); } , 0 { ) 2 (
x x
Chiziqli algebra masalalarini yechish buyruqlarining asosiy qismi linalg kutubxonasiga (paketiga) tegishli. Shu sababli matritsalar va vektorlarga oid masalalarni yechishdan oldin linalg kutubxonasini with(linalg)buyrug„i orqali yuklab olishimiz lozim.
bu kvadrat qavslarda vektor koordinatalari vergullar ajratib ko„rsatiladi.Masalan: > x:=vector([1,0,0]);
Koordinatalari aniq x vektorning ixtiyoriy koordinatini natijalar satrida hosil qilish uchun buyruqlar satriga x[i] buyrug„ini kiritish kifoya, bu yerda i koordinata tartibi. Masalan, yuqoridagi misoldagi vektorning birinchi koordinatini quyidagicha hosil qilish mumkin: > x[1]; 34
Vektorni ruyhat ko„rinishga keltirish va aksincha ro„yhatni vektor ko„rinishga keltirishda convert(vector, list) ili convert(list, vector).Vektor mojno preobrazovat v spisok i, naoborot, s pomoshyu komandi convert(vector, list) yoki Download 0.9 Mb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling