Computational modeling and visualization with Python (Wiley, 2016)
The latest source programs, library and data files for the book are deposited here and at https://jwang.sites.umassd.edu/
-
Sep. 2017: Updated input() function compatibility between Python 2.xx and 3.xx to affected programs (Original versions can be found in
v1.0
folder). To summarize, all codes (.py and .ipynb) should run under Python 2.7x and 3.xx as follows: -
-
Programs using
matplotlib
now utilize thenotebook
backend, enabling users to interactively manipulate plots such as zoom and save in nearly the same way as the standard .py versions run from a terminal. In addition, programs usingmatplotlib
animation (Programs 8.1, 10.2, and 11.4) work correctly in Jupyter notebook.
-
-
This update fixes the compatibility in spherical Bessel functions between
SciPy
versions 0.x.x and 1.x.x. In version 1.x.x, the name is changed fromsph_jn/yn
tospherical_jn/yn
, its signature is also different. With this fix, the program automatically detects theSciPy
version and should work under either version.
-
-
-
.py codes using classic VPython (
visual
) will generally not run in either Jupyter or in a terminal because of changes in latest vpython versions. While one could slightly modify the .py programs to run from a terminal, the easiest way is to run the corresponding .ipynb programs instead. If you have to run from a terminal, refer to the .ipynb counterpart on necessary modifications (mostly related to vectors and canvas) to make it work.
-
-
Computational modeling forum: https://groups.google.com/forum/#!forum/comphys