You are on page 1of 21

Outline

Introduction
Open Source Software Resources
Step ahead

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction
Open Source Software Resources
Step ahead

Web Based Workshop


on
Teaching Physics at the UG & PG Level using
Python
Sandeep S Ghugre

UGC DAE CSR KC

Email : ssg.iuc@gmail.com

July 4, 2020

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction
Open Source Software Resources
Step ahead

Introduction

Open Source Software Resources


GNU Octave
Python

Step ahead
Modules in Python
Get, Set and Go

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction
Open Source Software Resources
Step ahead

Preamble
UGC-DAE Consortium for Scientic Research, Kolkata Centre , is in
the process of developing a range of innovative, low cost experiments
for UG & PG teaching, based on the routinely available resources.

These experiments are expected to be illustrative and contribute in


their understanding of the basics of the subject, apart from rejuve-
nating the fun factor in the learning process. And all this with an
accompanying rigor on the extracted numbers.

For these set of innovative experiments


1. DAQ : Open Source Hardware :
2. Data visualisation and analysis is performed using the Open
Source toolkits (packages) viz. Octave and Python .
Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P
Outline
Introduction GNU Octave
Open Source Software Resources Python
Step ahead

GNU Octave
GNU Octave , is multifunctional toolkit which simplies numerical
analysis.
It uses an interpreter to compile and execute a sequence of user
provided instructions.

Figure: http://www.octave.org.
Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P
Outline
Introduction GNU Octave
Open Source Software Resources Python
Step ahead

Get Going with Octave

Figure: Successfully launching of GNU Octave.


Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P
Outline
Introduction GNU Octave
Open Source Software Resources Python
Step ahead

Survival kit....

To gracefully exit from the software the conventional exit command


will do the needful.

The clc command clears the current contents of the windows and re-
initiates the cursor to the upper left corner. The clear all command
clears all the local (user dened) variables.

We can navigate around the directory structure using the conven-


tional change directory command, cd sandeep will move us to the
sub-directory sandeep.

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction GNU Octave
Open Source Software Resources Python
Step ahead

Packages in Octave

Figure: Getting started.

We need to load a package using the command pkg load ****


Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P
Outline
Introduction GNU Octave
Open Source Software Resources Python
Step ahead

Introduction
The Python programming language combines remarkable power with
very clean, simple, and compact syntax making it the preferable
choice for educational numerical computation.

Python is easy to learn and very well suited at an introductory level


to computer programming especially in the domain of numerical and
graphical data analysis, which is of contemporary relevance in present
day classroom teaching.

One of the challenges of getting started with Python is that you


might have to install Python and related software on your computer.

Besides there are two versions of Python, called Python 2.x . and
Python 3.x .
Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P
Outline
Introduction GNU Octave
Open Source Software Resources Python
Step ahead

Installation

Figure: https://www.python.org/downloads/release/python-2713/

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction GNU Octave
Open Source Software Resources Python
Step ahead

Installation

Figure: select Install for all users , and then click Next .

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction GNU Octave
Open Source Software Resources Python
Step ahead

Installation

Figure: Leave the directory as Python27 and click Next .

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction GNU Octave
Open Source Software Resources Python
Step ahead

Figure: Click Will be installed on local hard drive .

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction GNU Octave
Open Source Software Resources Python
Step ahead

Get, Set & Go for Python


The Python interpreter can be run (activated) by clicking on an icon
(which starts the IDE) , or by typing python on a command line.
When it starts, you should see output similar to the one presented in
Fig.??.

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction GNU Octave
Open Source Software Resources Python
Step ahead

Python IDE

Figure: Invoking the Python IDE.

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction GNU Octave
Open Source Software Resources Python
Step ahead

Saving your work

Figure: Save your work with .py extension.

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction GNU Octave
Open Source Software Resources Python
Step ahead

Using the Command prompt

Figure: Using the command prompt.

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction Modules in Python
Open Source Software Resources Get, Set and Go
Step ahead

Modules In Python

We need to install packages , which essentially refer to a set of


softwares, which have been specically developed for a certain use.

For example, we shall require NumPy, fundamental package for scien-


tic computing with Python. It can be installed using the command
python -m pip install numpy , from a terminal.

Matplotlib the 2D plotting library which produces publication quality


gures is also required frequently, python -m pip install matplotlib .

In addition we shall need the following packages serial, pyrmata

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction Modules in Python
Open Source Software Resources Get, Set and Go
Step ahead

Python As a Calculator

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction Modules in Python
Open Source Software Resources Get, Set and Go
Step ahead

Trignometery in Python
All the Arguments to trignometric functions in Python are in radians

Figure: Trignometric Calculations in Python.

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P


Outline
Introduction Modules in Python
Open Source Software Resources Get, Set and Go
Step ahead

Know your Computer

Sandeep S Ghugre Web Based Workshop on Teaching Physics at the UG & P

You might also like