dryfriction.yml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. !!omap
  2. - name: unknown
  3. - parts:
  4. - name: head
  5. shapes:
  6. libraries: ['from math import tan, radians, sin, cos', from pysketcher import
  7. *]
  8. - name: constants
  9. shapes:
  10. fontsize: 18 # size of the characters
  11. g: 9.81 # constant gravity
  12. theta: 30.0 # inclined plane angle
  13. L: 10.0 # sketch sizing parameter
  14. a: 1.0 #
  15. xmin: 0.0 # sketech min Abscissa
  16. ymin: -3.0 # sketech min Ordinate
  17. rl: 2.0 # rectangle width
  18. rL: 1.0 # rectangle length
  19. - name: frame
  20. shapes:
  21. setframe: # sketch setup
  22. action: drawing_tool.set_coordinate_system(xmin=xmin-L/5, xmax=xmin+1.5*L,ymin=ymin,
  23. ymax=ymin+1.5*L,instruction_file='tmp_mpl_friction.py')
  24. setblackline: # default frame values and actions
  25. action: drawing_tool.set_linecolor('black')
  26. B: point(a+L,0) # wall right end
  27. A: point(a,tan(radians(theta))*L) # wall left end
  28. normal_vec: point(sin(radians(theta)),cos(radians(theta))) # Vector normal to wall
  29. tangent_vec: point(cos(radians(theta)),-sin(radians(theta))) # Vector tangent to wall
  30. help_line: Line(A,B) # wall line
  31. x: a + 3*L/10. # contact point Abscissa
  32. y: help_line(x=x) # contact point Ordinate
  33. contact: point(x, y) # contact point: middle of the rectangle bottom edge
  34. c: contact + rL/2*normal_vec
  35. - name: body
  36. shapes:
  37. rectangle:
  38. formula: Rectangle(contact, rl, rL)
  39. style:
  40. linecolor: blue
  41. filled_curves: blue
  42. transform: ['rotate(-theta, contact)', translate(-rl/2*tangent_vec)]
  43. N:
  44. formula: Force(contact - rl*normal_vec, contact, r'$N$', text_pos='start')
  45. style:
  46. linecolor: black
  47. wheel:
  48. formula: "Composition({'outer': rectangle})"
  49. style:
  50. shadow: 1
  51. mc:
  52. formula: Text(r'$c$', c)
  53. body:
  54. formula: "Composition({'wheel': wheel, 'N': N, 'mc': mc})"
  55. style:
  56. linecolor: black
  57. - name: plan
  58. shapes:
  59. mB:
  60. formula: Text(r'$B$',B)
  61. mA:
  62. formula: Text(r'$A$', A)
  63. wall:
  64. formula: Wall(x=[A[0], B[0]], y=[A[1], B[1]], thickness=-0.25,transparent=False)
  65. style:
  66. linecolor: black
  67. x_const:
  68. formula: Line(contact, contact + point(0,4))
  69. style:
  70. linestyle: dotted
  71. transform: rotate(-theta, contact)
  72. x_axis:
  73. formula: Axis(start=contact+ 2*rl*normal_vec, length=2*rl,label='$x$', rotation_angle=-theta)
  74. plan:
  75. formula: "Composition({'body': body, 'inclined wall': wall, 'x start': x_const,\
  76. \ 'x axis': x_axis, 'mA': mA, 'mB': mB})"
  77. - name: friction
  78. shapes:
  79. mg:
  80. formula: Gravity(c, rl, text='$Mg$')
  81. style:
  82. linecolor: black
  83. angle:
  84. formula: Arc_wText(r'$<bslash>theta$', center=B, radius=3, start_angle=180-theta,
  85. arc_angle=theta, fontsize=fontsize)
  86. style:
  87. linecolor: black
  88. linewidth: 1
  89. ground:
  90. formula: Line((B[0]-L/10., 0), (B[0]-L/2.,0))
  91. stlye:
  92. linecolor: black
  93. linestyle: dashed
  94. linewidth: 1
  95. friction:
  96. formula: "Composition({'plan': plan, 'ground': ground, 'mg': mg, 'angle':\
  97. \ angle})"