Skills in computer science can have great value in studying, doing and communicating physics. As educators, we asked ourselves how to make students aware of that, and how to offer them a new and appealing approach to physics. We also wondered how to increase students' engagement, participation and understanding, particularly when lessons are delivered online. Thus, we began a project to develop study materials for an introductory course in physics for computer science and we chose to use open source software. The materials are organized as a set of Jupyter notebooks hosted on an open GitHub repository. The notebooks deal with fundamental concepts of physics related to everyday life, offering examples of what can be done with a few lines of Python code. In the notebooks we propose activities to observe phenomena, describe problems, experiment, acquire and analyze data, and model the behavior of systems. The contents are suitable for undergraduates, high-school students, and evergreen students. We have used the materials for lectures, guided laboratory activities and presentations to freshmen and younger students, and we plan to continue with this project.
Raspberry Pi (RPi) is a well known single-board computer natively equipped with a Linux-based operating system, Raspbian, and a powerful programming language, Python. In this work, we propose an integrated project on physics and computer science exploiting RPi and Python: a set of lab activities, coding, and discussion related to the study of charging and discharging phases of a capacitor in an RC circuit. In our simple experiments, entirely computer-controlled, the RPi and Python scripts are used to: (i) apply a known constant voltage to the circuit at a desired time; (ii) measure the voltage on selected circuit elements as a function of time; (iii) evaluate and analyze experimental data. This approach is based on inexpensive hardware and open source software. It allows a hands-on experience with electric circuits and with dedicated examples of Python coding. The codes involve Python modules such as Numpy, Scipy, and Matplotlib that prove to be easy to use and efficient for our goals, supporting the choice of Python language for further study or research tasks.