Guruh talabasi G’aniyev Nurmuhammadni it/Mutaxassislik tanlov fani (matlabda dasturlash) fanidan topshiriqlari
Download 103.39 Kb.
|
mathlab
- Bu sahifa navigatsiya:
- 2 - topshiriq.
- 3 – topshiriq.
- 2. Berilgan tenglamalar sistemasining Simulink dasturida modili a) Solve bloki yordamida
652-19 guruh talabasi G’aniyev Nurmuhammadni IT/Mutaxassislik tanlov fani (MATLABda dasturlash) fanidan topshiriqlari 1- topshiriq Berilgan funksiyani x va y ning 0 dan 2*pi gacha bo'lgan qiymatlari uchun hisoblash va uning grafigini qurish dasturini m-fayl ko'rinishida yozing va ishlashini tekshirib ko'ring. Fayl funktsiya fun1 function z=fun1(2x,2y) %Berilgan funksiyani x va y ning 0 dan 2*pi gacha bo'lgan qiymatlari uchun hisoblash va uning grafigini qurish z=sin(2x).*cos(2y); plot(x,z) end >> x=0:0.1:2*pi; >> y=x; >> fun1(2x,2y) ans = Columns 1 through 13 0 0.1947 0.3587 0.4660 0.4998 0.4546 0.3377 0.1675 -0.0292 -0.2213 -0.3784 -0.4758 -0.4981 Columns 14 through 26 -0.4417 -0.3156 -0.1397 0.0583 0.2471 0.3968 0.4840 0.4947 0.4273 0.2925 0.1114 -0.0872 -0.2720 Columns 27 through 39 -0.4139 -0.4905 -0.4896 -0.4114 -0.2683 -0.0828 0.1158 0.2960 0.4296 0.4953 0.4828 0.3941 0.2432 Columns 40 through 52 0.0539 -0.1440 -0.3191 -0.4438 -0.4985 -0.4744 -0.3755 -0.2173 -0.0248 0.1717 0.3410 0.4565 0.4999 Columns 53 through 63 0.4644 0.3556 0.1906 -0.0044 -0.1988 -0.3617 -0.4676 -0.4996 -0.4528 -0.3345 -0.1633
%Berilgan funksiyani x va y ning 0 dan 2*pi gacha bo'lgan qiymatlari uchun hisoblash va uning grafigini qurish x=0:0.1:2*pi; y=x; z=sin(2x).*cos(2y); plot(x,z) >> sf1
z = Columns 1 through 13 0 0.1947 0.3587 0.4660 0.4998 0.4546 0.3377 0.1675 -0.0292 -0.2213 -0.3784 -0.4758 -0.4981 Columns 14 through 26 -0.4417 -0.3156 -0.1397 0.0583 0.2471 0.3968 0.4840 0.4947 0.4273 0.2925 0.1114 -0.0872 -0.2720 Columns 27 through 39 -0.4139 -0.4905 -0.4896 -0.4114 -0.2683 -0.0828 0.1158 0.2960 0.4296 0.4953 0.4828 0.3941 0.2432 Columns 40 through 52 0.0539 -0.1440 -0.3191 -0.4438 -0.4985 -0.4744 -0.3755 -0.2173 -0.0248 0.1717 0.3410 0.4565 0.4999 Columns 53 through 63 0.4644 0.3556 0.1906 -0.0044 -0.1988 -0.3617 -0.4676 -0.4996 -0.4528 -0.3345 -0.1633
y=(n^3/16.3*sin(a)*sin(2*a))^(1/2); end >> y=fun2(3.1516*10^(-2),pi/36) y = 1.7048e-04 Skript fayl sf2 %2 - topshiriq. Ifodani berilgan qiymatlar bo'yicha hisoblash dasturini tuzish va olingan natijani tekshirib ko'rish. n=3.1516*10^(-2); a=pi/36; y=(n^3/16.3*sin(a)*sin(2*a))^(1/2); y y = 1.7048e-04 3 – topshiriq. Berilgan tenglamalar sistemasini: 1) yechish dasturini m – fayl ko'rinishida tuzing; 2) modilini Simulink dasturida tuzing. Skript fayl sf3 %yechish dasturi m – fayl ko'rinishida a=[2 1 3 0;2 -1 -1 -2;1 -1 -4 0;1 2 1 3] b=[0;-3;-3;-6] s=a\b a = 2 1 3 0 2 -1 -1 -2 1 -1 -4 0 1 2 1 3 b = 0 -3 -3 -6 s =
-25.5000 7.5000 12.0000 2. Berilgan tenglamalar sistemasining Simulink dasturida modili a) Solve bloki yordamida b)
x2=2x1-1 x3=x1+2x2+2 ifodalar bo'yicha Download 103.39 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling