Guest User

Untitled

a guest
Jun 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. Ima3PC2
  2.  
  3. n=[1:10];
  4. an=1./n.^2;
  5. sum(an)
  6.  
  7. n=[1:100];
  8. an=1./n.^2;
  9. sum(an)
  10.  
  11. n=[1:200];
  12. an=1./n.^2;
  13. sum(an)
  14.  
  15. n=[1:300];
  16. an=1./n.^2;
  17. sum(an)
  18.  
  19. syms k
  20. S=symsum(1/k^2,k,1,inf)
  21. double(S)
  22.  
  23. n=[1:10];
  24. an=1./n;
  25. sum(an)
  26.  
  27. n=[1:100];
  28. an=1./n;
  29. sum(an)
  30.  
  31. n=[1:200];
  32. an=1./n;
  33. sum(an)
  34.  
  35. n=[1:300];
  36. an=1./n;
  37. sum(an)
  38.  
  39. syms x
  40. c = 1;
  41. n = 2;
  42. f=x/(x^2+1)
  43. Pn=taylor(f,n+1,c)
  44.  
  45. syms x
  46. c = 1;
  47. f=x/(x^2+1)
  48.  
  49. X=[0.5:0.01:1.5]
  50. Y=subs(f,x,X)
  51. plot(X,Y,'g')
  52.  
  53. syms x
  54. c = 1;
  55. n = 3;
  56. f=x/(x^2+1)
  57. Rn=taylor(f,n+1,c)
  58.  
  59. syms x
  60. c = 1;
  61. n = 4;
  62. f=x/(x^2+1)
  63. Qn=taylor(f,n+1,c)
  64.  
  65. X=[0.5:0.01:1.5]
  66. Y=subs(Pn,x,X)
  67. plot(X,Y,'k')
  68.  
  69. hold on
  70.  
  71. X=[0.5:0.01:1.5]
  72. Y=subs(Rn,x,X)
  73. plot(X,Y,'b')
  74.  
  75. X=[0.5:0.01:1.5]
  76. Y=subs(Qn,x,X)
  77. plot(X,Y,'r')
Add Comment
Please, Sign In to add comment