4-Stroke Engine Simulation

4-Stroke Engine Simulation
Loading the math board and drawing, please wait…
2013-06-05 03:46
In collections Sine and Cosine Functions
This example demonstrates a graphical simulation of a 4-stroke engine, showing the relationship between piston displacement and time. Key math concepts include function graphs, trigonometry, geometric constructions, and parametric equations. It utilizes commands like Line, Circle, Intersect, Point, If, Angle, OrthogonalLine, Segment, Mirror, Polygon, Midpoint, Vector, Conic, CircleSector, and Sequence in GeoGebra. Suitable for high school students and engineers studying engine mechanics and mathematical modeling.

GeoGebra Commands & Parameters

  1. Line(Crankshaft, Crankshaft + (0, 10)) → Vertical
  2. Circle(Crankpin, (scaleFactor * rodLength)) → ConnectingRodCircle
  3. Intersect(ConnectingRodCircle, Vertical, 2) → Wristpin
  4. Line(Crankpin, Crankshaft) → i
  5. Point(i) → CounterBalCenterPt
  6. If(angleNumAdj > 0 ∧ angleNumAdj < 0.1, ((-1 * 1.5) * angleNumAdj), If[angleNumAdj ≥ 0.1 ∧ angleNumAdj < 0.2, ((-1 * 1.5) * ((-angleNumAdj) + 0.2)), 0]) → valve1MotionVert
  7. Angle(CrankShaftRadius, Crankshaft, Rotate[CrankShaftRadius, α, Crankshaft]) → angle
  8. Line(Wristpin, Crankpin) → b
  9. OrthogonalLine(Crankpin, b) → c
  10. OrthogonalLine(Wristpin, b) → d
  11. Circle(Crankpin, 0.2) → rodbasecircledark
  12. Circle(Wristpin, 0.2) → f
  13. Segment(TopDeadCenter + ((-1 * 0.4), 0), TopDeadCenter + (0.4, 0)) → TDCSeg
  14. Segment(BottomDeadCenter + ((-1 * 0.4), 0), BottomDeadCenter + (0.4, 0)) → BDCSeg
  15. Circle(Crankpin, 0.4) → k
  16. OrthogonalLine(Crankpin, i) → j
  17. OrthogonalLine(Crankshaft, i) → l
  18. Circle(CounterBalCenterPt, 0.9) → q
  19. Intersect(k, j) → C, D
  20. Intersect(q, i, 2) → A
  21. OrthogonalLine(A, i) → m
  22. Circle(A, 0.4) → p
  23. Intersect(p, m, 1) → B
  24. Intersect(rodbasecircledark, c, 1) → rodImageBL
  25. Intersect(rodbasecircledark, c, 2) → rodImageBR
  26. Intersect(f, d, 1) → rodImageTR
  27. Intersect(f, d, 2) → rodImageTL
  28. Circle(CounterBalCenterPt, 0.2) → r
  29. Intersect(r, i, 1) → H
  30. OrthogonalLine(CounterBalCenterPt, i) → s
  31. Intersect(q, s, 1) → I
  32. Intersect(q, s, 2) → J
  33. Circle(H, 0.5) → t
  34. Intersect(t, i, 2) → K
  35. Circle(K, 0.4) → c_1
  36. OrthogonalLine(K, i) → a_1
  37. Intersect(c_1, a_1, 1) → L
  38. Intersect(c_1, a_1, 2) → M
  39. Segment(Crankshaft, Crankpin) → crankPinOffsetSkeleton
  40. Segment(Wristpin, Crankpin) → rodSkeleton
  41. Segment(PistonHeadTop + (0, (-1 * 0.05)), Wristpin) → CompressionHeightSeg
  42. Line(Valve1CamPt, Valve1HalfHeight) → a
  43. OrthogonalLine(Valve1HalfHeight, a) → e
  44. Circle(Valve1HalfHeight, 0.28) → g
  45. Intersect(g, e, 2) → Valve1CamTL
  46. Intersect(g, e, 1) → Valve1CamTR
  47. Mirror(Valve1HalfHeight, Valve1CamPt) → Valve1HalfHeight'
  48. Circle(Valve1HalfHeight', 0.28) → d_1
  49. OrthogonalLine(Valve1HalfHeight', a) → b_1
  50. Intersect(d_1, b_1, 2) → Valve1CamBR
  51. Intersect(d_1, b_1, 1) → Valve1CamBL
  52. Polygon(Crankshaft + (0.22, 0.01 + (scaleFactor * deckHeight) + valve1MotionVert), Crankshaft + (0.61, 0.01 + (scaleFactor * deckHeight) + valve1MotionVert), Crankshaft + (0.56, 0.08 + (scaleFactor * deckHeight) + valve1MotionVert), Crankshaft + (0.27, 0.08 + (scaleFactor * deckHeight) + valve1MotionVert)) → valve1, e_1, f_1, g_1, h_1
  53. Circle(Crankpin, 0.5) → h
  54. Circle(Crankpin, 0.5) → rodbasecirclelargelight
  55. Midpoint(TopDeadCenter, BottomDeadCenter) → StrokeCenter
  56. Polygon(displBL, displBR, displTR, displTL) → polyStroke1, e_2, f_2, g_2, n_1
  57. If(angleNum < 150, 153, If[angleNum < 165, 102, If[angleNum < 180, 51, 0]]) → polyStroke2RdNum
  58. Polygon(displBL, displBR, displTR, displTL) → polyStroke2, displbl, displbr, displtr, displtl
  59. If(angleNum < 180, 255, If[angleNum < 195, 204, If[angleNum < 210, 153, 102]]) → polyStroke2BlueNum
  60. Polygon(displBL, displBR, displTR, displTL) → polyStroke3, displbl_1, displbr_1, displtr_1, displtl_1
  61. Polygon(displBL, displBR, displTR, displTL) → polyStroke4, displbl_2, displbr_2, displtr_2, displtl_2
  62. Point(i) → E
  63. Mirror(D, i) → D'''
  64. If(angleNum < 75, 360 + angleNum, angleNum) → valve4NumAdj
  65. If(valve4NumAdj > 315 ∧ valve4NumAdj < 360, ((-1 * 0.0034) * (valve4NumAdj - 315)), If[valve4NumAdj ≥ 360 ∧ valve4NumAdj < 405, (0.0034 * (valve4NumAdj - 315 - 405)) + 1.07, 0]) → valve4MotionVert
  66. Polygon(Crankshaft + ((-1 * 0.22), 0.01 + (scaleFactor * deckHeight) + valve4MotionVert), Crankshaft + ((-1 * 0.61), 0.01 + (scaleFactor * deckHeight) + valve4MotionVert), Crankshaft + ((-1 * 0.56), 0.08 + (scaleFactor * deckHeight) + valve4MotionVert), Crankshaft + ((-1 * 0.27), 0.08 + (scaleFactor * deckHeight) + valve4MotionVert)) → valve4, i_1, j_1, k_1, l_1
  67. Mirror(Valve4HalfHeight, Valve4CamPt) → Valve4HalfHeight'
  68. Circle(Valve4HalfHeight', 0.28) → p_1
  69. Circle(Valve4HalfHeight, 0.28) → q_1
  70. Line(Valve4HalfHeight', Valve4HalfHeight) → m_1
  71. OrthogonalLine(Valve4HalfHeight', m_1) → r_1
  72. OrthogonalLine(Valve4HalfHeight, m_1) → s_1
  73. Intersect(p_1, r_1, 2) → Valve4CamBR
  74. Intersect(p_1, r_1, 1) → Valve4CamTR
  75. Intersect(q_1, s_1, 1) → Valve4CamTL
  76. Intersect(q_1, s_1, 2) → Valve4CamBL
  77. Polygon(Crankshaft + (0.38, 0.08 + (scaleFactor * deckHeight) + valve1MotionVert), Crankshaft + (0.44, 0.08 + (scaleFactor * deckHeight) + valve1MotionVert), Crankshaft + (0.94, 1.62 + (scaleFactor * deckHeight) + valve1MotionVert), Crankshaft + (0.74, 1.68 + (scaleFactor * deckHeight) + valve1MotionVert)) → valve1Rod, t_1, a_2, b_2, c_2
  78. Polygon(Crankshaft + ((-1 * 0.38), 0.08 + (scaleFactor * deckHeight) + valve4MotionVert), Crankshaft + ((-1 * 0.44), 0.08 + (scaleFactor * deckHeight) + valve4MotionVert), Crankshaft + ((-1 * 0.94), 1.62 + (scaleFactor * deckHeight) + valve4MotionVert), Crankshaft + ((-1 * 0.74), 1.68 + (scaleFactor * deckHeight) + valve4MotionVert)) → valve4Rod, d_2, h_2, i_2, j_2
  79. Vector(StrokeCenter, StrokeCenter + (0, ((-1 * scaleFactor) * crankPin))) → strokeVectorBotom
  80. Vector(StrokeCenter, StrokeCenter + (0, (scaleFactor * crankPin))) → strokeVectorTop
  81. Vector(StrokeCenter, StrokeCenter + (((0.5 * scaleFactor) * bore), 0)) → boreVectorRt
  82. Vector(StrokeCenter, StrokeCenter + ((((-1 * 0.5) * scaleFactor) * bore), 0)) → boreVectorL
  83. Vector(CylModBDC, CylModBDC + ((((-1 * 0.5) * scaleFactor) * bore), 0)) → cylModBoreVectorL
  84. Vector(CylModBDC, CylModBDC + (((0.5 * scaleFactor) * bore), 0)) → cylModBoreVectorRt
  85. Conic(F, G, N, O, P) → k_2
  86. Segment(Wristpin + ((((-1 * 0.5) * scaleFactor) * bore), (scaleFactor * compressionHeight)), Wristpin + (((0.5 * scaleFactor) * bore), (scaleFactor * compressionHeight))) → pistonTopSkeleSeg
  87. Line(Valve4CamBR, Valve4CamBL) → n
  88. Line(Valve4CamTR, Valve4CamTL) → l_2
  89. OrthogonalLine(Valve4CamPt, n) → m_2
  90. Mirror(Valve4CamBL2, m_2) → Valve4CamBL2'
  91. OrthogonalLine(Valve4CamPt, m_2) → n_2
  92. Mirror(Valve4CamBL2, n_2) → Valve4CamBL2'_1
  93. Mirror(Valve4CamBL2'_1, m_2) → Valve4CamBL2'_2
  94. Segment(CylinderTopCenter, CylinderTopCenter + (-1, 0.5)) → ImpactSeg2
  95. Segment(CylinderTopCenter, CylinderTopCenter + ((-1 * 1.75), (-1 * 0.45))) → ImpactSeg3
  96. Segment(CylinderTopCenter, CylinderTopCenter + ((-1 * 0.75), (-1 * 0.75))) → ImpactSeg4
  97. Segment(CylinderTopCenter, CylinderTopCenter + ((-1 * 0.25), (-1 * 1.5))) → ImpactSeg5
  98. Segment(CylinderTopCenter, CylinderTopCenter + (0.4, (-1 * 1.25))) → ImpactSeg1
  99. Segment(CylinderTopCenter, CylinderTopCenter + (1, -1)) → ImpactSeg6
  100. Segment(CylinderTopCenter, CylinderTopCenter + (2, (-1 * 0.75))) → ImpactSeg7
  101. Segment(CylinderTopCenter, CylinderTopCenter + (1.75, (-1 * 0.25))) → ImpactSeg8
  102. Mirror(CylinderTopCenter, CylinderTopCenter) → CylinderTopCenter'
  103. Mirror(CylinderTopCenter + ((-1 * 1.75), (-1 * 0.45)), CylinderTopCenter) → Q
  104. Segment(CylinderTopCenter', Q) → ImpactSeg3'
  105. Mirror(CylinderTopCenter, CylinderTopCenter') → CylinderTopCenter'_1
  106. Mirror(CylinderTopCenter + ((-1 * 0.75), (-1 * 0.75)), CylinderTopCenter') → R
  107. Segment(CylinderTopCenter'_1, R) → ImpactSeg4'
  108. Mirror(CylinderTopCenter, CylinderTopCenter'_1) → CylinderTopCenter'_2
  109. Mirror(CylinderTopCenter + ((-1 * 0.25), (-1 * 1.5)), CylinderTopCenter'_1) → S
  110. Segment(CylinderTopCenter'_2, S) → ImpactSeg5'
  111. Mirror(CylinderTopCenter, CylinderTopCenter'_2) → CylinderTopCenter'_3
  112. Mirror(CylinderTopCenter + (0.4, (-1 * 1.25)), CylinderTopCenter'_2) → T
  113. Segment(CylinderTopCenter'_3, T) → ImpactSeg1'
  114. Mirror(CylinderTopCenter, CylinderTopCenter'_3) → CylinderTopCenter'_4
  115. Mirror(CylinderTopCenter + (1, -1), CylinderTopCenter'_3) → U
  116. Segment(CylinderTopCenter'_4, U) → ImpactSeg6'
  117. Mirror(CylinderTopCenter, CylinderTopCenter'_4) → CylinderTopCenter'_5
  118. Mirror(CylinderTopCenter + (2, (-1 * 0.75)), CylinderTopCenter'_4) → V
  119. Segment(CylinderTopCenter'_5, V) → ImpactSeg7'
  120. Mirror(CylinderTopCenter, CylinderTopCenter'_5) → CylinderTopCenter'_6
  121. Mirror(CylinderTopCenter + (1.75, (-1 * 0.25)), CylinderTopCenter'_5) → W
  122. Segment(CylinderTopCenter'_6, W) → ImpactSeg8'
  123. Vector(Midpoint[CylModBDC, CylModDeckCntr] + ((((-1 * 0.5) * scaleFactor) * bore) - 0.1, 0), CylModBDC + ((((-1 * 0.5) * scaleFactor) * bore) - 0.1, 0)) → cylModSDeckVectorBot
  124. Vector(Midpoint[CylModBDC, CylModDeckCntr] + ((((-1 * 0.5) * scaleFactor) * bore) - 0.1, 0), CylModDeckCntr + ((((-1 * 0.5) * scaleFactor) * bore) - 0.1, 0)) → cylModDeckVectorTop
  125. CircleSector(CounterBalCenterPt, J, I) → counterBalanceBody
  126. Segment(J, I) → counterBalanceSectorSegment
  127. Intersect(counterBalanceBody, counterBalanceSectorSegment, 1) → Z
  128. OrthogonalLine(D, counterBalanceSectorSegment) → counterBalanceLine
  129. Intersect(counterBalanceBody, counterBalanceSectorSegment, 2) → A_1
  130. OrthogonalLine(D''', counterBalanceSectorSegment) → counterBalanceLine2
  131. Mirror(D''', Crankshaft) → D''
  132. Mirror(D, Crankshaft) → D'
  133. Vector(Midpoint[CylModBDC, CylModTDC] + (((0.5 * scaleFactor) * bore) + 0.1, 0), CylModBDC + (((0.5 * scaleFactor) * bore) + 0.1, 0)) → cylModStrokeVectorBottom
  134. Vector(Midpoint[CylModBDC, CylModTDC] + (((0.5 * scaleFactor) * bore) + 0.1, 0), CylModTDC + (((0.5 * scaleFactor) * bore) + 0.1, 0)) → cylModStrokeVectorTop
  135. Vector((0, 0), (10.5, 0)) → x_{Axis}
  136. Sequence(Segment[(i, -0.15), (i, 0.15)], i, 0, 10, 0.25) → x_{Axis-hash}
  137. Sequence(Segment[(i, -0), (i, 6)], i, 0, 10, 0.25) → x_{axis-grid}
  138. Angle(BetaRefPt, Crankpin, Wristpin) → β
  139. Sequence((-0.15, i), i, 0, 6, 10 / graphYaxisScale) → graphYaxisIntervalElements
  140. Sequence(Segment[(-0.15, i), (0.15, i)], i, 0, 6, 10 / graphYaxisScale) → y_{Axis-hash}
  141. Sequence(Segment[(0, i), (10.15, i)], i, 0, 6, 10 / graphYaxisScale) → y_{Axis-grid}
  142. Vector((0, 0), (0, 6.4)) → y_{axis}

AI Drawing Prompt Reference

Create a graphical simulation of a 4-stroke engine showing the relationship between piston displacement and time. Include key components like the crankshaft, connecting rod, piston, and valve. Use function graphs and trigonometry to represent the motion. Start with the geometric construction of the crankshaft and piston, then add the connecting rod and crank connection, and finally use a slider to control the angle and show the engine's working cycle.
The prompt above was compiled from the original drawing commands and is for reference only.