Upload
dominic-paul
View
218
Download
3
Embed Size (px)
Citation preview
Bifröst Physics
Arman J. FrasierChristopher Newport University
Department of Physics, Computer Science, and EngineeringMentor: David Heddle
April 22nd, 2011 Washington Room, David Student Union
Bifröst Physics Christopher Newport University Arman J. Frasier
Roadmap What is Bifröst Physics? The Physics The Programming Future Development Conclusion & Questions
Bifröst Physics Christopher Newport University Arman J. Frasier
What is Bifröst Physics? A two dimensional physics simulator designed
to facilitate long distance physics education through a local network or the internet.
Developed in Java
Bifröst Physics Christopher Newport University Arman J. Frasier
FeaturesPhysics Simulator Kinematics Inelastic Collisions Mutual gravitational and
electric effects Gravitational and Electric
fields Fluidic Resistance
Trajectory tracing Velocity vector display Automatic entity generation Optimized threading Alterable time iteration
Bifröst Physics Christopher Newport University Arman J. Frasier
FeaturesRenderer Accelerated 2D graphics
through AWT Maximum frame rate of 60
frames per second
Networking Integrated chat functions Ability to transfer
simulation data Centralized Relay Low bandwidth usage
Bifröst Physics Christopher Newport University Arman J. Frasier
Physics Steps through each entity, calculating the net
acceleration affecting that entity. Uses these accelerations in basic kinematic
equations, along with a specified time step, to determine the new velocity and position vectors of each entity.
Bifröst Physics Christopher Newport University Arman J. Frasier
Collisions The false positive check helps correct errors from large time steps.
Pseudo-code algorithm:
if(distance > (radius1 + radius2)) {//no collision (too far away)return;} else {rotate frame so that the collision vector becomes the new x axis} if (not false positive) {//collisiondo collision calculations}return frame to normal rotationreturn;
An example of a false positive collision
Bifröst Physics Christopher Newport University Arman J. Frasier
Collision Example
Detect collision Find collision vector Rotate the frame, making the collision vector x’.
Find the x-component of each entity’s velocity
21
212111
2)(
mm
ummmuv
21
111222
2)(
mm
ummmuv
Use the x-components in these 1D inelastic collision formulas to calculate new x-components.
Update the velocity vectors, and then return the frame to its original rotation.
Bifröst Physics Christopher Newport University Arman J. Frasier
Programming Simulation Programming Network Programming
Bifröst Physics Christopher Newport University Arman J. Frasier
Simulation Programming Upon initialization, the simulation control
thread creates as many worker threads as there are logical processors on the host machine.
These threads are synchronized using a sleep/interrupt schema.
Bifröst Physics Christopher Newport University Arman J. Frasier
Simulation Threading
Taskmaster Simulation Control
Worker Threads
(One per logical processor)
Aggregate Data
1 kHz
SimulationCalculations
Sleep
Proceed
Interrupt
Action
Thread
Legend
Update Entity Data
Play?
YesNo
Bifröst Physics Christopher Newport University Arman J. Frasier
Network Programming Central host accepts connections from clients Host sends physics data to clients Host acts as a chat relay for clients Low bandwidth usage
Bifröst Physics Christopher Newport University Arman J. Frasier
Future Development Networked simulation calculations Simulation video capture Further simulation optimization Extension into 3D Abstraction of Physics simulation with API
Bifröst Physics Christopher Newport University Arman J. Frasier
Conclusion Bifröst Physics can help students understand
complex physical concepts through instructor designed experiments, as well as through instructor led networked class sessions.
Bifröst Physics Christopher Newport University Arman J. Frasier
Questions?Resources Project Webpage (Includes jar files, user’s guide, change log, and this presentation)
http://www.pcs.cnu.edu/~afrasier/bifrost Contact: [email protected]