Homework_2_2011

Homework_2_2011 - and the tangential velocity is damped by...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 111 - Introduction to Computational Science Homework 2 The goal of this homework is to simulate the motion of a ball bouncing off the walls of a closed container, as described in class. The main force acting on the ball is the weight ( f w = m g ) so that the equation of motion is given by the ODE: ± d v /dt = g v (0) = v 0 , (1) where v 0 is the given initial velocity. Note that the solution v is a vector with two components, i.e. v = ( u,v ), where u is the horizontal component of the velocity v and v is the vertical component of the velocity v . When the ball interacts with the walls, friction forces apply. In particular, the normal velocity is damped by a factor
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: and the tangential velocity is damped by a factor . 1. Write a code to simulate the problem above. You should use a RK2 or RK4 scheme with t = . 03 to solve (1). Set the size of the closed container to be [0 , 1] [0 , 1], an initial velocity of v = ( . 3 , 0) m.s-1 , the ball radius r = . 05 m , the initial location of the ball at ( x,y ) = ( . 5 , 1-r ) m , = . 8, = . 99 and g = . 0981 m.s-2 (Thats right, lets be on another planet! After all this is simulation.). What to turn in: your codes as well as a movie of the animation should be sent to your TA. 1...
View Full Document

This note was uploaded on 12/29/2011 for the course CS 111 taught by Professor Staff during the Fall '08 term at UCSB.

Ask a homework question - tutors are online