Mavzu: Matlabda tenglamalar sistemasi va tenglamalarni yechish.
1. Nazariy qism
MatLab matematik paketida tenglamalarni yechish uchun solve komandasidan foydalaniladi. Bu funksiya parametri sifatida berilgan tenglama string tipiga tegishli bo’lishi lozim. Masalan:
solve(x-5=8)
??? solve(x-5=8)
I
Error: The expression to the left of the equals sign is not a valid target for an assignment.
shuning uchun tenglamani string tipida kiritishimiz lozim
>> solve('x-5=8') ans =
13
solve komandasi yordamida turli tipdagi: trigonometric, logorifmik, ko’rsatkichli, algebraic tenglamalarni yechishimiz mumkin:
00s(.x)=
V2 ' 2
Berilgan topshiriqning bajarilish qismi
trigonometric tenglamani matlab matematik paketi
Tenglamalar sistemasi yechishda solve yoki linsolve funksiyalaridan foydalanish mumkin.
funksiyalaridan foydalanib yeching.
Yechish:
>> solve('cos(x) = sqrt(2)/2’) ans =
1/4*pi
linsolve komandasidan foydalanib chiziqli tenglamalar sistemasi yechish
quyidagi 3 noma’lumli tenglamalar sistemasi berilgan bo’lsin
2 x + y + z = 2
< - x + y - z = 3 x + 2 y + 3z = -10
Tenglamalar sistemasini AX=B ko’rinishga keltiramiz. A matritsani noma’lumlar oldida turgan koeffitsiyentlar bilan, B matritsani esa ozod hadlar bilan to’ldiramiz.
>> A = [2 1 1; -1 1 -1; 1 2 3]
A =
Mavzu: Matlabda tenglamalar sistemasi va tenglamalarni yechish. 1
1. Nazariy qism 1
Berilgan topshiriqning bajarilish qismi 1
V2 ' 2 1
>> B = [2 3 -10]’
B =
3
-10
Endi linsolve komandasidan foydalanib tenglamalar sistemasining yechimini topamiz
>> X = linsolve(A,B)
X =
3
1
-5
Bu yerda X ustun vector hisoblanadi va unga indeksi orqali murojaat qilib ixtiyoriy ildizning qiymatidan foydalanish mumkin.
Masalan:
>> X(2) ans =
1
Xulosa
Ushbu laboratoriya ishida MatLab matematik paketida tenglama va tenglamalar sistemasni yechish 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
rasshireniy. - M.: Nolidj, 2001.
Dyakonov V. P. MATLAB 6.5 SP1G'7 Q Simulink 5G'6 v. Obrabotka signalov I proektirovanie filtrov. - M.: Solon_R, 2005.
Dyakonov V. P. MATLAB 6.5 SP1G'7 Q Simulink 5G'6 v. Rabota s izobraje_ niyami i videopotokami. - M.: Solon_R, 2005.
Dyakonov V. P., Kruglov V. V. MATLAB 6.5 SP1 7G'7 SP1G'7 SP2 QSimulin
5G'6 v. Instrumento' iskusstvennogo intellekta i bioinformatiki. - M.: Solon_ PRESS, 2006 .
Dyakonov V. P. VisSim+Mathcad+MATLAB. Vizualnoe matematicheskoe modelirovanie. - M.: Solon_Press, 2004.
Potemkin V. G. Sistema MATLAB: Spravochnoe posobie. - M.: Dialog_
MIFI, 1997.
T.Dadajonov, M.Muhitdinov. MATLAB asoslari.”Fan nashriyoti” 2008.
Do'stlaringiz bilan baham: |