.


:




:

































 

 

 

 


2.1

. . , , , . . . : . . . . , , ; . , , . . . , k-

, , , k :

:

k-e : ,

 

, :

x3+3x2-6x-1=0 , C++.

 

1

 

 

2

 

 

2.2 . .

 

/=f(x,y) - 0, 1, n 0, =F(x), 1, 2,, n,

 

i=F(xi)(i=1,2,, n) F(x0)=y0. (1)

 

, =F(x) . h=xk-xk-1 .

, (). . , , .

(1)

 

x=x0, y(x0)=y0 (2)

 

(1) [,b].

[a, b] n 0, 1, 2,, n, xi=x0+ih (i=0,1,, n), h=(b-a)/n- .

(i)yi i+hf(xi, yi) (i=0,1,2).

=(), 0(0, 0), 012 i(xi, yi) (i=0,1,2,); iMi+1 , , , (1),

i. (1) R{|x-x0|£a, |y-y0|£b} :

 

|f(x, y1)- f(x, y2)| £ N|y1-y2| (N=const), (3)

|df/dx|=|df/dx+f(df/dy)| £ M (M=const),

 

:

 

|y(xn)-yn| £ hM/2N[(1+hN)n-1], (4)

 

(n)- (1) =n, n- , n- .

: h, h/2. n*

|yn-y(xn)||yn*-yn|. (5)

 

. .

=3-3, (0,1)=0,5, [0,1;0,6],h=0,05, C++.

 

3

 

 

4

 

 

2.3

 

, . , - , , -. , - , , -.

, A B , A*B ≠ B*A. , A*B B*A. , A 3*4, B 4*5, A*B 3*5, B*A .

: - A = [a1, a2, a3 an] B n*m, : [b11, b12, b13, b1m; b21, b22, b23, b2m; bn1, bn2, bn3, bnm].

A*B - 1*m, :

Cj = ∑ai*bij (i = 1 n, j = 1 m)

, i- - i- .

, A m*n - B n*1, - m*1, i- - B i- A.

A B, C++.

 

 

5

 

6

 

 

 
 


3.-

 

 
 


3.1. - .

 

 

3.2. -

3.2. -

 

 

 

3.3. -

 

 

 

, . , , . , , . , . . . . . , .

. , , . - .

 

 

 

1. : / .. [ .]; . .. . .: , 2008. 400 .

2. , .. , [ ]/ .. . , 2010. 184 . : http://e.lanbook.com/books/element.php?pl1_cid=258&pl1_id=1108.

3. , .. [ ]/ .. . , 2010.544 . : http://e.lanbook.com/books/element.php?pl1_cid=258&pl1_id=1146.

4. , .. Borland C++ [ ]/ ... . , 2009. 214 .. : http://e.lanbook.com/books/element.php?pl1_cid=258&pl1_id=1230.

5. , ., ., . UML [ ]/ ., . , . . , 2008. 496 . : http: //e.lanbook.com/books/element.php?pl1_cid =258&pl1_id =1246.

6. OpenOffice.org [ ]. , 2009. 448 . : http: //e.lanbook.com/books/ element.php?pl1_cid =258&pl1_id =1223.

7. , .. MATHLAB 9.5 /10/11 , [ ]/ ... , 2010.752 . : http: //e.lanbook.com/books/ element.php?pl1_cid =258&pl1_id =1181.

 

 

 
 

 


 

 

1. #include <iostream>

2. using namespace std;

3.

4. int Function_3() {

5. float h;

6. float a;

7. float b;

8. float n;

9. float x[100]; // .

10. float y[100]; // .

11. cout << "\n \n";

12. cout << " y'=x^3-y^3 y(0.1)=0.5 \n\n\n";

13. y[1]=0.5; // . .

14. cout << " [a;b] h \n";

15. cin >> a;

16. cin >> b;

17. cin >> h;

18. n=(b-a)/h; // .

19. for (int i = 0; i <= n+1; i++) {

20. x[i] = a; //

21. a=a+h;

22. }

23. cout << " " << n << "\n\n"; //

24. for (int i = 0; i <= n; i++) {

25. cout << "X(" << i <<") = " << x[i] <<"\n"; //

26. }

27.

28. cout << "\n\n";

29. for (int i = 1; i <= n+1; i++) {

30. y[i+1]=y[i]+h*(x[i]*x[i]*x[i]-y[i]*y[i]*y[i]); // .

31. cout << "X(" << i-1 <<") = " << x[i-1] << " Y(" << i-1 << ")= " << y[i] <<"\n";

32. }

33. for (int i = 1; i <= n+1; i++) {

34. y[i+1]=y[i]+h*(x[i]*x[i]*x[i]-y[i]*y[i]*y[i]); // .

35. cout << x[i-1] <<"\n";

36. }

37. for (int i = 1; i <= n+1; i++) {

38. y[i+1]=y[i]+h*(x[i]*x[i]*x[i]+y[i]*y[i]*y[i]); // .

39. cout << y[i] <<"\n";

40. }

41. return 0;

42.

43.

44. }

45.

46. int Function_2() {

47. cout << "\n--- ---\n";

48. cout << ", : \n";

49. cout << " 33 - 3x1. \n";

50.

51. float Matrix[3][3]; // 33.

52. float vector[3]; // 3x1

53. float vector_new[3]; // .

54. cout << "\n 1, 3x3: \n";

55. for (int i = 0; i <= 2; i++) {

56. for (int j = 0; j <= 2; j++) {

57. cout << " " << i + 1 << " " << j + 1 << ": "; // , .

58. cin >> Matrix[i][j]; // .

59. cout << "\n";

60. }

61. }

62.

63. cout << "\n \n , ;D.\n\n\n";

64. cout << " 2: \n";

65. cout << " 3x1 (): \n \n \n";

66. for (int x = 0; x <= 2; x++) {

67. cout << ". "<< x + 1 << ": "; // ..

68. cin >> vector[x];

69. cout << "\n";

70. }

71.

 
 


72. cout << " \n .\n\n\n";

73. cout << " ! \n \n \n";

74. for (int j = 0; j <= 2; j++) {

75. for (int i = 0; i <= 2; i++) { // .

76. cout << Matrix[i][j] << " "; // "" .

77. }

78. cout << "\n\n";

79.

80. }

81. cout << "\n\n";

82. for (int x = 0; x <= 2; x++) {

83. cout << ". "<< x + 1 << ": " << vector[x] << "\n"; // "" .

84. }

85. cout << "\n\n\n , \n";

86.

87. cout << " 3x1: \n";

88. for (int j = 0; j <= 2; j++) {

89. float result = 0.0; // result .

90. for (int i = 0; i <= 2; i++) {

91. result = result + Matrix[i][j]*vector[i]; // .

92. }

93. vector_new[j] = result; // .

94. }

95.

96. cout << "\n\n\n";

97. //cout << setprecision(7);

98. /* cout ,

99. - , cout no .

100. , setprecision, . */

101. for (int x = 0; x <= 2; x++) {

102. cout << ". "<< x + 1 << ": " << vector_new[x] << "\n"; // "" .

103. }

104. cout << "\n\n\n , , \n";

105.

106. cout << ", http://reshish.ru \n";

107.

108. return 0; // .

109. }

110.

111. int Function_1() {

112. //

113. float a; //

114. float b; //

115. float a1; //

116. float b1; //

117. float sigma; //

118. float max_step; //

119. float xm; //

120. float f_a; //

121. float f_b; //

122. float f_xm; //

123. int k; // f_xm

124. cout << "\n--- ---\n\n";

125. cout << " 1:\n .\n";

126. cout << " x^3+3*x^2-6x-1=0\n\n";

127.

128. cout << " :\n";

129. cin >> a;

130. a1=a;

131. cout << "\n :\n";

132. cin >> b;

133. b1=b;

134. cout << "\n : , 0.0001 \n";

135. cin >> sigma;

136. cout << "\n : , 1000 \n\n";

137. cin >> max_step;

138. //cout.precision(7); // .

139. cout << " 2:\n :";

140. cout << "\n = " << a << "\n = " << b << "\n = " << sigma << "\n = " << max_step;

141. cout << "\n\n 3:\n:\n";

142. for (int i = 0; i <= max_step; i++) {

143. if (b-a > sigma) { // ,

144. xm=(a+b)/2; //

145. f_a = a*a*a+3*a*a-6*a-1; //

146. // f_b = b*b*b+3*b*b-6*b-1; // ( )

147. f_xm = xm*xm*xm+3*xm*xm-6*xm-1; //

148. k=f_xm; // "0", , "0". "k" "int".

149. if (f_a*f_xm <= 0) { // ,

150. b=xm; //

151. cout << "\nb = " << b << " i = " << i+1 << " ";

152. }

153. else {

154. a=xm; //

155. cout << "\na = " << a << " i = " << i+1 << " ";

156. }

157. }

158. }

159. if (k == 0) {

160. xm=(a+b)/2; //

161. f_xm = xm*xm*xm+3*xm*xm-6*xm-1; //

162. cout << "\n\n " << a1 << " " << b1 << " = " << xm << "\n\n = " << f_xm << "\n\n";

163. }

164. else {

165. cout << "\n\n .\n ,\n .\n\n\n";

166.

 
 


167. }

168. cout << "\n\n , , http://www.wolframalpha.com \n\n\n";

169.

170. return 0;

171. }

172.

173. int main() {

174. setlocale(0,"");

175. int menu = 5; // "menu".

176. if (menu!= 0){

177. cout << "\n \n";

178. cout << "\n";

179. cout << " 1 \n";

180. cout << " 2 \n"; // () "".

181. cout << " 3 \n";

182. cout << " 0 \n";

183.

184. cin >> menu; // 'menu'.

185.

186. switch (menu) { // , .

187.

188.

189. case 1: // "menu" "case".

190. cout << "\n : 1, \n"; //

191. Function_1(); // "Funktion_1".

192. main();

193. break; // "switch - case".

194.

195. case 2:

196. cout << "\n! , , : 2 \n";

197. Function_2();

198. main();

199. break;

200.

201. case 3:

202. cout << "\n : 3 - , \n";

203. Function_3();

204. main();

205. break;

206.

207. case 0:

208. cout << "\n , \n\n";

209. // system("pause"); // ,

210. return 0; // . .

211. break;

212.

213.

214. default: // , " ".

215. cout << "\n , ! \n";

216. cout << " 1, 2 3 \n"; // " ".

217. cout << " , ";

218. cout << "\n";

219. main();

220. }

221. }

222.

223.

224.

225.

226. return 0;

227. }



<== | ==>
| 1.
:


: 2016-07-29; !; : 532 |


:

:

- , - .
==> ...

1698 - | 1613 -


© 2015-2024 lektsii.org - -

: 0.218 .