Advertisement
Guest User

work number 1

a guest
Oct 23rd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. 27.
  2. restart;
  3. R:=3;
  4. x:=t->R*(t-sin(t));
  5. y:=t->R*(1-cos(t));
  6. plot([x(t),y(t), t=0..6*Pi], color = black, scaling = constrained);
  7.  
  8. 28.
  9. restart;
  10. f:=x->trunc((((1+sqrt(5))/2)^x-((1-sqrt(5))/2)^x)/sqrt(5));
  11. A:=[seq([x,f(x)], x=0..10)];
  12. plot(A, style = point, color = black);
  13.  
  14. restart;
  15. f:=x-> f(x-2)+f(x-1);
  16. f(0):=0;
  17. f(1):=1;
  18. A:=[seq([x,f(x)], x=0..10)];
  19. plot(A, style = point, color = black);
  20.  
  21. 29.
  22. restart;
  23. y:=x-> -(x^2-4*x)/(x-2)^2;
  24. a:=t-> 2+0*t;
  25. b:=t-> 0+t;
  26. A:=[seq([a(t),b(t)],t=-4..8)];
  27. plot([A,y(x)], x=-4..8, y=-4..8, color = black);
  28.  
  29. 30.
  30. restart;
  31. with(plots):
  32. r:=(s,t)->4+s*cos(t/2);
  33. f:=(s,t)->t;
  34. h:=(s,t)->s*sin(t/2);
  35. plot3d([r(s,t),f(s,t),h(s,t)],s=-Pi..Pi,t=0..2*Pi,color=white, coords = cylindrical);
  36.  
  37. 31.
  38. restart;
  39. with(plots):
  40. a:=1;
  41. implicitplot(r^2=2*a^2*cos(2*h), r=-2..2, h=0..2*Pi, color = black, coords=polar, numpoints = 2000, scaling = constrained);
  42.  
  43. restart;
  44. with(plots);
  45. c := 1;
  46. implicitplot((x^2+y^2)^2 = 2*c^2*(x^2-y^2), x = -2 .. 2, y = -2 .. 2, scaling = constrained, gridrefine = 2, color = blue, numpoints = 2000)
  47.  
  48. 32.
  49. restart;
  50. with(plots);
  51. k := 1;
  52. spiral := polarplot(k*phi, phi = 0 .. 12*Pi, axes = none, color = black):
  53. ball := proc (phi, ro)
  54. pointplot([[phi, ro]], color = red, coords = polar, symbol = circle, symbolsize = 30, axes = none)
  55. end proc:
  56. anim := animate(ball, [phi, k*phi], phi = 0 .. 12*Pi, scaling = constrained, frames = 150);
  57. spiral := polarplot(k*phi, phi = 0 .. 12*Pi, axes = none, color = black);
  58. display(anim, spiral);
  59.  
  60. 33.
  61. restart;
  62. with(plots):
  63. with(plottools):
  64. a :=2:
  65. b := 1:
  66. N := 23:
  67. Ellipse := plot([a*cos(t), b*sin(t), t=0..2*Pi], color = blue):
  68. Ani := [seq(rotate(Ellipse, ((k-1))*Pi/N), k=1..N+1)]:
  69. display(Ani, insequence = true, scaling = constrained, axes = none);
  70.  
  71. 34.
  72. restart;
  73. S:={x^2+2*y^2=17, x^2-2*x*y=-3};
  74. sol:=solve(S,{x,y}, explicit);
  75. assign(sol[1]);
  76. [x,y];
  77.  
  78. 35.
  79. restart;
  80. urav:=x^3-(2*a-1)*x^2+x+(2*a+1)=0;
  81. sol:=solve(urav,x,explicit);
  82. urav2:=sol[1] + sol[2] + sol[3] = sol[1]^2 + sol[2]^2 + sol[3]^2;
  83. sol2:=solve(urav2, a, explicit);
  84.  
  85. 36.
  86. restart;
  87. restart;
  88. result := 0:
  89. num_of_roots := 0:
  90. eqn := (x-1)^2 - (x^2-2*x)^3 = 1;
  91. sol := solve(eqn, x, explicit = true);
  92. sol := [sol];
  93. for i from 1 to nops(sol) do
  94. if trunc(sol[i]) > 0
  95. then result := result + sol[i];
  96. num_of_roots := num_of_roots + 1;
  97. end if:
  98. end do:
  99. result;
  100. num_of_roots;
  101.  
  102. restart;
  103. result := 0;
  104. num_of_roots := 0;
  105. eqn := (x-1)^2-(x^2-2*x)^3 = 1;
  106. sol := solve({eqn, x > 0}, x, explicit = true);
  107. sol := [sol];
  108. sol := map(op, sol);
  109. sol := map(rhs, sol);
  110. for i to nops(sol) do
  111. result := result+sol[i];
  112. num_of_roots := num_of_roots+1
  113. end do;
  114. result;
  115. num_of_roots;
  116.  
  117. 37.
  118. restart;
  119. with(plots):
  120. eqn1 := x^2 - 2*x*y + 2*y^2 = 6:
  121. eqn2 := x^2 - 2*y^2 + 8*x = -6:
  122. eqns := {eqn1, eqn2}:
  123. sol := solve(eqns, {x, y}, explicit = true, real);
  124. first := implicitplot(eqn1, x=-4..4, y=-4..4, color = blue, thickness = 2, gridrefine = 3, numpoints = 5000):
  125. second := implicitplot(eqn2, x=-4..4, y=-4..4, color = red, thickness = 2, gridrefine = 3, numpoints = 5000):
  126. display(first, second);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement