Physics 202 - Spring 2019
Python codes and notebooks for Physics 202
basic.py / basic.ipynb
- Read data (in x,y format) from a data file and plot as a scatter plot.
basic_fit.py / basic_fit.ipynb
- Read data (in x,y format) from a file, fit with a user-defined function, and display fit parameters with uncertainties on a graph.
charge.py / charge.ipynb
- Expert TA Assignment 1 Problem 12: calculate force due to two lines of caharge, and compare to point charge approximation
charge_splitting.py / charge_splitting.ipynb
- Expert TA Assignment 1 Problem 7: For a given charge, Qtotal,solve for way of splitting this charge between two point charges, q1 and q2, so as to maximize the electric force.
linecharge.py / linecharge.ipynb / linechargeintegration.py / linechargeintegration.ipynb
- Expert TA Assignment 2 Problem 7: A given amount of charge, Q, is distributed evenly over a rod of length, L. Calculate the total electric field at a point that is a distance, a, from one end of the rod, as a funtion of a. Compare this to the approximate value calculated by assuming that the charge is a point charge located at the center of the rod.
ramanunjan*.py / ramanujan*.ipynb
- Investigation of Ramanujan's 1914 formula for caluculating pi (for Pi Day 2019).