# Mechanics of the YoYo by 0G37k53J

VIEWS: 0 PAGES: 16

• pg 1
```									Mechanics of the YoYo
Rotational & Translational
Energy

Seth T Chase
Understand Energy in Motion
• Energy of any particle is constant
• Kinetic (T) + Potential (U) = Constant (E)
• U = mgh
• K = 2mv2 + 2Iω2
• I = 2mr2ω2

• E = mgh + 2mv2 + 3mr2ω2
Goals
• Derive formula translational acceleration
• Apply Euler algorithm to create relationships
of motion and apply Leapfrog algorithm
method to update visual
• Relate rotational motion to derived formula for
translational motion
• Show energy is conserved by calculating
forces within code
Derivation of Energy & Motion
Euler & Leapfrog Algorithm
Creating Motion due to Gravity
yoyoAccCM = ((2.0/3.0)*9.81)
yoyo.acceleration = yoyoAccCM * vector(0,-1,0)
yoyo.velocity.y = yoyo.velocity.y +
yoyo.acceleration.y*dt
yoyo.pos = yoyo.pos + yoyo.velocity*dt +
yoyo.acceleration*dt*dt*0.5

Changing Direction
yoyo.velocity.y = -yoyo.velocity.y -
yoyo.acceleration.y*dt
Translational & Rotational
Determining Angular Velocity (ω)
w = yoyo.omega*direction

Rotating Frame on Changing Position
ypos = yoyo.pos.y
origin=(0,ypos,0))
Calculating Forces
Total Energy
Energy = (Potential + Kinetic) -(Energy*dt)

Kinetic Energy
K1 = Kinetic
Kinetic =(.5*yoyo.mass*yoyo.velocity.y**2)+
K2 = Kinetic

Potential Energy
P1=Potential
Potential = -(yoyo.mass*yoyoGravCM*(8.8-yoyo.pos.y+
changeINposition))
P2=Potential
• Introduction to frames
• Scenes and there benefits
• Adding visual components of Energy
Conservation
Frames and their use
Creating Frames
lever=frame(pos=(2,0,0))
handle=arrow(frame=lever,pos=(0,10,0),axis=(-
yoyo=frame(pos=(0,8.8,0))

Connecting Frames
left_side=ring(frame=yoyo, pos=(-.50,0,0),
length=2.5,thickness=0.3,color=color.yellow)
top_left_ball=sphere(frame=yoyo, pos=(-0.7,0.8,0),
middle_left=cylinder(frame=yoyo, pos=(0,0,0),
color=color.green)
Creating a Scene vs. Conditional
statements
Creating Scene
scene.width = 1000
scene.height = 1000
scene.center = (0,5.5,0)

Creating Objects with Variable Components
mass1 = box(pos=(3.5,12.5,.2) ,length=.6, height=.6,
width=.6,color=color.red)
mass1.mass = .005
message = "Click to add 1.0 gram."
mass1Label = label(pos=(4,12.3,.2),   text=message,xoffset=20)

Detecting and Implementing Mouse Click
if scene.mouse.events: # detect mouse events
mouse = scene.mouse.getclick()
if mouse.pick == mass1 or mouse.pick==mass2:
Sliding Bars of Kinetic & Potential
Energy
Creating Boxes and Bars
PBar = box(pos=(5.5,6.65,.1), length=.9, height=.1,
width=.9)
PBox=box(pos=(5.5,6.465,0),length=1, height=1.34, width=1,
color=color.red)
message = "Potential Energy"
PboxLabel = label(pos=(4.9,6.7,0),text=message,xoffset=-17)

Updating Bars to Move in Box
PBar.pos.y = (PBox.pos.y+(PBox.height/2)-(PBar.height/2))-
((PBox.height*(P2/P_mag))/(2*handle.pos.y))
Problems within Code

• Bouncing at same height
• Eliminating errors by increasing rate and
decreasing dt
• Finding right proportions of position change
when increasing mass and showing via
thickness
Conservation of Energy
Calculating Drag
Effects of Drag
Drag Force with Increasing
Temperature over Time

```
To top