Solving for time in 1D Kinematics

Click For Summary
The discussion revolves around solving for time in the equation P = P' + V't + (at^2)/2, where all variables except time are known. The user expresses frustration over not recalling how to isolate time after several years away from mathematics and physics. They are working on a programming project involving collision detection for a bouncing ball and need to account for acceleration in their calculations. Despite initial progress, they encounter challenges in accurately determining collision times due to changing acceleration. The user seeks assistance from the forum community, emphasizing their eagerness to learn and improve their skills.
Selroth
Messages
10
Reaction score
0
Short Version:

It's been several years since I last practiced any mathematics or physics. I'm trying to get my mind as sharp as it was back then. I'm sure the solution is obvious, and just under my nose...

I remember:

P = P' + V't + (at^2)/2

Where P is position, P' is initial position, V' is initial Velocity, a is acceleration, and t is time.

Solve for t. All other variables are known.

I feel so embarrassed I don't remember how to do this.

Long Version (programmers may be interested):

Before I joined the military I had a good hobby of computer programming, and did well with mathematics and physics. Now, my mental capacity is at an all time low, and I thought picking my hobby back up again would do me good. The past few weeks have been great! But then I hit a brick wall, and 2 days of Googling and still no answer is starting to affect my enthusiasm. It's not like me to sign up to a physics forum and create an account just to ask one question, but perhaps it's not so bad to call upon the help of charitable others if you're thankful.

Anyway, my current project is simple, and nothing special. It's not meant to be. It'd not the product I expect to benefit from; it's the journey. So, it's really just a bouncing ball – I wanted to implement some collision detection ideas I've had. My main idea is instead of looking for collision by seeing if collidable objects are overlapping and correct them, calculate when they'll collide. Queue a collision event in a timeline using that time, and execute the collision reaction code once that time comes.

This is my latest build that's a good example: http://selroth.draconity.org/Projects/Active/White Sands/Javascript/20110930/

The vertical chart on the right is the timeline, and you can see the collision events crossing the cyan line at the moment the ball collides with the wall.

However, it's actually flawed/not fully functional in that aspect yet, despite initial impressions. Because the time of collision is always changing when there's an acceleration, it's difficult for the program to move the timeline to the exact time it needs to be at. Currently, it takes the time simply by dividing the distance between the wall and the ball by the ball's velocity.

I'm at a point where I need it to account for the ball's acceleration too – the event marks on the timeline shouldn't move around.

(current version can be found here: http://selroth.draconity.org/Projects/Active/White Sands/Javascript/Current/ which has better comments and cleaner code if you want to look at the sourcecode yourself [Chromers can Shift+Ctrl+J, Firefoxers can FireBug, IE or Safari'ers can get a better browser =P] )

Otherwise, this is the function I'm having trouble with:
Code:
	//Find the time of collision for either the top or bottom walls
	function findYCollision(){ return (yVel < 0) ? "top wall" : "bottom wall"; }	
	function findYCollisionTime(){
		var d = (findYCollision() == "top wall") ? yPos :  400 - yPos;
		var t = gameTime + (d / Math.abs(yVel));
		return (t > gameTime) ? t : gameTime;
	}

I can't figure out how to rewrite t = ______ to where it accounts for acceleration (would be known as yAcc in this case)

I am extremely grateful for any replies, and have marked this topic for email notifications! Thank you!
 
Last edited:
Physics news on Phys.org
Welcome to Physics Forums :smile:
Selroth said:
That makes me want to scream and bang my head against the wall! :mad:
Ah, and welcome (back) to the world of physics :biggrin:
 
Redbelly98 said:
Welcome to Physics Forums :smile:

Ah, and welcome (back) to the world of physics :biggrin:

Thanks! :)
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 13 ·
Replies
13
Views
1K
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
1
Views
2K
  • · Replies 67 ·
3
Replies
67
Views
8K
Replies
34
Views
2K
  • · Replies 21 ·
Replies
21
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K