8-laboratoriya ishi
Mavzu: Matlabda simvolli hisoblashlarni bajarish.
Laboratoriya ishining maqsadi:
MatLab dasturida simvolli hisoblashlarni bajarishni o’rganish. Ko’rsatma asosida simvolli hisoblashlarga doir topshiriqlarni bajarish.
Laboratoriya ishini bajarish tartibi:
Laboratoriya topshirig’i mazmuni Laboratoriya ishining bajarilishi Xulosa
1. Nazariy qism
Simvolli hisoblashlar deganda matematik va boshqa amallarni sonlarga asoslanmagan holda, faqatgina ifodalarni qayta ishlashni tushunamiz. Jumladan ifodalarni soddalashtirish, ko’paytmalarni yoyish, ko’paytuvchilarga ajratish, hosila va integral olish, ifodalarni qo’shish ayirish, va hokazo.
MatLabda simvolik hisoblashlarni amalga oshirish uchun Symbolic kutubxonasidan foydalaniladi. Agar Symbolic kutubxonasi kompyuterga o’rnatilgan MatLab dasturida mavjud bo’lmasa, biz bu hisoblashlarni amalga oshira olmaymiz.
Matlabda o’zgaruvchini e’lon qilishda syms kalit so’zidan foydalaniladi. Masalan:
>> syms x y z
Endi bu o’zgaruvchilar yordamida matematik ifodalarni yozishimiz mumkin.
>> syms x y z
>> x^2+2*y-z^3
ans =
x^2+2*y-z^3
Simvolik amallarni va sonli amallarni MatLab turlicha bajaradi.
Masalan:
>> 2/5
ans =
0.4000
>> sym(2)/sym(5)
ans =
2/5
Matematik ifodalar ustida amalga oshiriladigan bir qancha amallar:
>> syms x y a
>> exp1 = x-3*y;
>> exp2 = 3*a+x;
>> sqrt(exp1)
ans =
(x-3*y)^(1/2)
>> log(exp2)
ans =
log(3*a+x)
>> 3*exp1*exp2
ans =
(3*x-9*y)*(3*a+x)
Matematik ifodalarni ko’paytuvchilarga ajratish funksiyasi
>> syms a b
>> exp1 = x^2-5*x+6;
>> exp2 = a^3-3*a^2*b+3*a*b^2-b^3;
>> factor(exp1)
ans =
(x-2)*(x-3)
>> factor(exp2)
ans =
(a-b)^3
Ko’paytmani yoyish funksiyasi
>> exp1 = (x-2)^4;
>> exp2 = (a-b)*(a+3*b)*(2*a+5)*(a-7)*a*b;
>> expand(exp1)
ans =
x^4-8*x^3+24*x^2-32*x+16
>> expand(exp2)
ans =
2*a^5*b-9*a^4*b-35*a^3*b+4*a^4*b^2-18*a^3*b^2-70*a^2*b^2-6*a^3*b^3+27*a^2*b^3+105*a*b^3
Berilgan topshiriqning bajarilish qismi
1-topshiriq. expand va simplify komandalaridan foydalanib, ifodani soddalashtiring
(x-4)*(x-4.5)*(x+3)
Yechish:
>> syms x >> exp=(x-4)*(x-4.5)*(x+3) exp = (x-4)*(x-9/2)*(x+3) >> expand(exp) ans = x^3-11/2*x^2-15/2*x+54 >> simplify(exp) ans = 1/2*(x-4)*(2*x-9)*(x+3)
2-topshiriq. Ifodani ko’paytuvchilarga ajrating
x^3-4*x^2-153*x+468
Yechish:
>> exp1=x^3-4*x^2-153*x+468 exp1 = x^3-4*x^2-153*x+468 >> factor(exp1) ans = (x-13)*(x-3)*(x+12)
Xulosa:
Ushbu laboratoriya ishida MatLab matematik paketida simvolik hisoblashlarni bajarish bo’yicha ko’rsatmalar berildi.
Foydalanilgan adabiyotlar
MATLAB 7.*/R2006/R2007 o’quv qo’llanma.:M.2008.
Mathematica. Wolfram, Stephen, 1959.
Dyakonov V. P., Abramеnkova I. V., Kruglov V. V. MATLAB 5 s pakеtami
rasshirеniy. – M.: Nolidj, 2001.
Dyakonov V. P. MATLAB 6.5 SP1G`7 Q Simulink 5G`6 v. Obrabotka signalov I proеktirovaniе filtrov. – M.: Solon_R, 2005.
Dyakonov V. P. MATLAB 6.5 SP1G`7 Q Simulink 5G`6 v. Rabota s izobrajе_
niyami i vidеopotokami. – M.: Solon_R, 2005.
Dyakonov V. P., Kruglov V. V. MATLAB 6.5 SP1 7G`7 SP1G`7 SP2 QSimulin
5G`6 v. Instrumеnto` iskusstvеnnogo intеllеkta i bioinformatiki. – M.: Solon_
PRЕSS, 2006 .
Dyakonov V. P. VisSim+Mathcad+MATLAB. Vizualnoе matеmatichеskoе
modеlirovaniе. – M.: Solon_Prеss, 2004.
Potеmkin V. G. Sistеma MATLAB: Spravochnoе posobiе. – M.: Dialog_
MIFI, 1997.
T.Dadajonov, M.Muhitdinov. MATLAB asoslari.”Fan nashriyoti”. 2008.
Do'stlaringiz bilan baham: |