VPython applications for Teaching Physics

Rob Salgado (salgado@physics.syr.edu)
/~salgado/software

last updated 3/3/2008 4:05PM
Since Dec 8, 2001, you are visitor number ######

How to run these Python programs

What's New

Most of these programs have been tested on Python 2.3.4 / VPython-Py2.3.4-2003-10-05b.exe. I am trying to gradually update them to work with the newer versions. If you have made any upgrades, please share them with me.

How to run these Python programs

These python programs (pythlets?) are written in
Python with the "visual" module VPython, which provides real-time interactive visualization in 3D.

You can download the current version of VPython here
and read about its development at the visualpython-users mailing list.

The older Python-2.4/VPython-3.2.9 version is here (local copy: python-2.4.1.msi and VPython-Win-Py2.4-3.2.9.exe).

Here is a local copy of the even older version (local copy: Python-2.3.4.exe and VPython-Py2.3.4-2003-10-05b.exe).



Waves

   wave_superposition.py tested with VPython23-2003-10-05

   doppler-wavefront.py tested with with Python-2.3.4.exe and VPython-2003-10-15.exe

Kinematics

   2D-kinematics-with-vectors.py tested with VPython23-2003-10-04
   2D-kinematics-with-vectors-circular.py tested with VPython23-2003-10-04
   2D-kinematics-with-vectors-circular-polar.py tested with VPython23-2003-10-04

1D-kinematics.py tested with VPython23-2003-09-04 1D-kinematics-with-vectors.py tested with VPython23-2003-10-04 1D-kinematics-with-vectors-alt.py tested with VPython23-2003-10-04


Electromagnetism


   EFieldBuilder-09990.py (v0.9990) tested with VPython-2003-10-05.exe
   EFieldBuilder-0997-22.py (v0.9972) requires VPython-2001-12-31.exe
   EFieldBuilder-0997.py (v0.997) requires VPython-2001-10-31.exe
   EFieldBuilder-0996.py requires VPython-2001-10-31.exe	
   EFieldBuilder-099.py	

   Maxwell-Gauss-Coulomb_v275.py tested with Python 2.3/VPython-2003-10-05.exe 
   Maxwell-Gauss-Magnetic_v275.py tested with Python 2.3/VPython-2003-10-05.exe 
   

   Maxwell-Ampere.py (v2.52) tested with VPython-2001-10-31.exe
   Maxwell-Ampere_v275.py tested with Python 2.3/VPython-2003-10-05.exe (includes change in color scheme) 
   Maxwell-Ampere_v276.py tested with Python 2.4/VPython-3.2.9 (includes change in color scheme) 


Maxwell-Faraday.py (v2.52) tested with VPython-2001-10-31.exe Maxwell-Faraday_v275.py tested with Python 2.3/VPython-2003-10-05.exe (includes change in color scheme) Maxwell-Faraday_v276.py tested with Python 2.4/VPython-3.2.9 (includes change in color scheme)

   EMWave-020110.py (v0.5) tested with VPython-2001-10-31.exe
   EMWave-030216.py (v0.51) tested with VPython-2001-10-31.exe
   EMWave.py (v1.00) tested with VPython-2003-10-05.exe
   EMWave-Maxwell.py (v2.51) tested with VPython-2003-10-05.exe
   
   EMWave-Maxwell_v275.py tested with Python 2.3/VPython-2003-10-05.exe (includes change in color scheme)
   NOT YET DONE: EMWave-Maxwell_v276.py tested with Python 2.4/VPython-3.2.9 (includes change in color scheme)


Under development VPython projects (led by Rob)



Relativity

Visualizing Proper Time in Special Relativity




Tensor Calculus and Differential Forms

(under development)
This demonstrates the addition of two covectors (two "1-forms") via the "co-parallelogram rule".

Aa + Ba = Ca


[more to come!]

VPython applications (up)
Programming Notes
Using Python 2.3

Here's a registration-file for Windows 2000 and Windows XP that will fix that problem with the IDLE editor closing completely when terminating an animation you are working on. Python-File-new.reg It assumes that you installed Python in the C:\ drive. If so, you may just "Open" it. Otherwise, download [Right-click->Save Link to...] the appropriate pair to your desktop, then after reading the .reg files and making any desired changes, merge with your registry. Then, "Merge" it by double-clicking on it.

Python-File-new.reg

If you mess up, you can try to clean things up in Explorer via Tools->FolderOptions->FileTypes...->PY Python File->Advanced
..or else use regedit.
Use at your own risk! (Backup your registry before merging!)

Using Python 2.3 and Python 2.4

These registry hacks to allowed me to select which VPython version is used to execute a .py file. They may work for you.
Use at your own risk! (Backup your registry before merging!)
Download [Right-click->Save Link to...] the appropriate pair to your desktop, then after reading the .reg files and making any desired changes, merge with your registry.

My Python installations are on the F:\ drive:

Py23_HLM_driveF.reg - Py24_HLM_driveF.reg

If your installations are on the C:\ drive, use:

Py23_HLM_driveC.reg - Py24_HLM_driveC.reg

If you mess up, you can try to clean things up in Explorer via Tools->FolderOptions->FileTypes...->PY Python File->Advanced
..or else use regedit.
Use at your own risk! (Backup your registry before merging!)

This program demonstrates a subtlety in the copyobjects() function on http://www.vpython.org/webdoc/visual/options.html
copyobjects-subtlety.py tested with VPython23-2003-09-18

Working example of an improved copyobjects() and a new updatecopyobjects().
copyobjects-example.py tested with VPython23-2003-09-18


related sites:

VRML Gallery of Electromagnetism
The Light Cone

other VPython sites I have found

Got a site to suggest? (salgado@physics.syr.edu)



Google search for "from visual import"
AlltheWeb search for "from visual import"
MSN search for "from visual import"
Yahoo search for "from visual import"

VPython

VPython
Python Programming Language -- Official Website

Resources

Rob Salgado (Syracuse)
VPython projects at Dillard University (Salgado)
/~border/phys1905f02/
Matter & Interactions (Ruth Chabay and Bruce Sherwood, NCSU)
Matter & Interactions (Ruth Chabay and Bruce Sherwood, NCSU) [Wiley]
Vpython - AIMSWiki
VPython: 3D Interactive Scientific Graphics for Students (CISE)
Python Notes

Python Programming

Python_tutorial_uab.pdf
uselessPython
instantPython
Non-Programmers Tutorial For Python
Learning to program
Dive into Python
Python DevCenter
ASPN Cookbook
FAQts
Beazley's Python Slides (javascripted)
Python Tutorials
Python Short Course
Numerical Python
Numeric Python Tutorial
Minimal Python for Scientific Computing
Handbook of the Physics Computing Course (Python language)
Handbook of the Physics Computing Course (Python language)
An Incremental Introduction to Python (Noack) - large pdf
QuickRef
PyOpenGL
PythonApocrypha
Python Patterns - An Optimization Anecdote
Teaching with Python
Python Performance Tips
many Python links
pygsear ~~: Pygame Framework and Examples
PythonD 32bit Python for DOS and Windows
Explorer's Post 631 Learning Ideas
Python Eggs
Jython3D : Python and Java 3D
Movable Python - The Portable Programming Environment

Computational

Computational Biophysics (Drexel)
Computational Physics and the Open Source Physics Project (Gould, Clark U)
PHY 307/607 Codes
Konrad Hinsen's Python Page
Programming for Physical Sciences (Physics, Computer, Computing)
ScientificPython (Konrad Hinsen)
Tutorial in Computational Science using Visual Python (ANU)
Simulating a Gas (ANU)
Using Visual Python to Simulate a Bouncing Ball (ANU)
Introducción a la computación
UCT Physics PHY400W - Computational Physics
PythonD 32bit Python for DOS and Windows

Astrophysics

VPNBody Symplectic Integration Package for VPython
/~andrew/teaching/

Electromagnetism

VPython.html
Physics 271 - Electricity and Magnetism (Sergei Savikhin, Purdue)

Mechanics

KineticsKit (Markus Gritsch)
Classical Mechanics (Eduardo Velasco - Truman State)
Coriolis effect (Peter Bowyer)
Theoretical Mechanics (Schneider, Lawrence Technological University)
Physics241 Labs
Schedule 2004
404 Not Found
Theoretical Mechanics (Scott Schneider, Lawrence Technological University)
UCT Physics PHY110W - Python

Geophysics

3d Earth Science Models (Lensyl Urbano - U Memphis)
Main Page - GeoMod

Mathematics

A Mathematical Canvas (Kirby Urner)
Lorentz Attractor (Kirby Urner)
3D PyArt (Stephen Vashaw)
PyGeo (Arthur Siegel)

Relativity

Visualizing Proper Time in Special Relativity [with LightClocks] (Rob Salgado)

Unsorted

Larry Martin (NorthPark)
UCT Physics PHY321F
Andrew Dougherty's Python Page
Index of /~doughera/phys218-2003/vpython
zwiki: MadCUPViewer
Udell Blogroll exploration
teaching_portfolio.html
CodesVpython - Wiki Python Fr
Highland's VPython programs
PILSNER
evbot.multimania.com

Lost?

Brendan Kiburg (UIUC)
PHYS 3821 Wave function simulator (Brian Quirt)
Herbert Looser (University of Applied Sciences, Aargau)
Object not found!
PyARX (Hoper)
The page cannot be found
Modern Physics Laboratory Software (Carnegie Mellon)
VPython - Animations (Horn, Dortmund)
an hourglass timer (Timothy M. Brauch)
PHY107 General Physics (David Snyder, Gallaudet )
Testing the Law of Gravity with Satellites (Jennifer Buckman, PHY 107 student at Gallaudet)