Advertisement
jovanovski

k2lv1

Mar 1st, 2012
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. Задача 1:
  2. \!\(f[x_] = Log[x + 1]\[IndentingNewLine]
  3. \(a = 0;\)\[IndentingNewLine]
  4. \(b = 1;\)\[IndentingNewLine]
  5. \(n1 = 10;\)\[IndentingNewLine]
  6. \(n2 = 50;\)\[IndentingNewLine]
  7. \(n3 = 100;\)\[IndentingNewLine]
  8. \(dx1 = \((b - a)\)/n1;\)\[IndentingNewLine]
  9. \(dx2 = \((b - a)\)/n2;\)\[IndentingNewLine]
  10. \(dx3 = \((b - a)\)/n3;\)\[IndentingNewLine]
  11. \(xzve1 = a + \((k - \((1/2)\))\)*dx1;\)\[IndentingNewLine]
  12. \(xzve2 = a + \((k - \((1/2)\))\)*dx2;\)\[IndentingNewLine]
  13. \(xzve3 = a + \((k - \((1/2)\))\)*dx3;\)\[IndentingNewLine]
  14. \(g1[x_] = dx1*f[xzve1];\)\[IndentingNewLine]
  15. \(g2[x_] = dx2*f[xzve2];\)\[IndentingNewLine]
  16. \(g3[x_] = dx3*f[xzve3];\)\[IndentingNewLine]
  17. ∑\+\(k = 1\)\%n1 g1[x] // N\[IndentingNewLine]
  18. ∑\+\(k = 1\)\%n2 g2[x] // N\[IndentingNewLine]
  19. ∑\+\(k = 1\)\%n3 g3[x] // N\[IndentingNewLine]
  20. \(r = Plot[f[x], {x, 0, 1}];\)\[IndentingNewLine]
  21. \(j1 = Graphics[Table[Rectangle[{\((x - 1)\)/n1, 0}, {\((\((x)\)/n1)\), f[
  22. dx1*x]}], {x, 1, n1, 1}]];\)\n
  23. \(j2 = Graphics[Table[Rectangle[{\((x - 1)\)/n2,
  24. 0}, {\((\((x)\)/n2)\), f[dx2*x]}], {x, 1,
  25. n2, 1}]];\)\[IndentingNewLine]
  26. \(j3 = Graphics[Table[Rectangle[{\((x - 1)\)/n3, 0}, {\((\((
  27. x)\)/n3)\), f[dx3*x]}], {x, 1, n3, 1}]];\)\[IndentingNewLine]
  28. Show[r, j1]\[IndentingNewLine]
  29. Show[r, j2]\[IndentingNewLine]
  30. Show[r, j3]\)
  31.  
  32.  
  33. Задача 2:
  34. \!\(df[x_] = Log[2 x]/x\n
  35. \(df[\[ExponentialE]/2] = 3/2;\)\n
  36. f[x_, y_] = ∫df[x]\ \[DifferentialD]x + y\n
  37. NSolve[f[\[ExponentialE]/2, y] == 3/2, y]\[IndentingNewLine]
  38. funk[x_] = ∫df[x]\ \[DifferentialD]x + 1\)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement