Jump to main content

Computer programming

This course is part of the programme
Physics and astrophysics first cycle

Objectives and competences

Students will be introduced to basic computer concepts and computer programs. They will learn the process from preparing to executing a computer program. They will learn the syntax of programming languages: python, C++ and LaTex. They will learn basic numerical methods to solve mathematical problems. They will learn how to prepare programs to read, analyse and present measurements data in a scientific report.

Prerequisites

Analysis I (1FAF01)

Content

  1. Computer basics
    - List of instructions
    - Basic units of a computer
    - Principles of computer memory and storage of numbers (integers, real, complex)
    - Computer program from preparation to execution

  2. Algorithms and programming languages
    - Concept of algorithm
    - Example of searching fixed point of a function with iteration

  3. Introduction to C and C++
    - Basic syntax (data types, arrays, loops, conditions, functions, reading/writing to files)
    - Math library and basic mathematical functions
    - Structures and Object-oriented programming
    - Numerical integration and derivation

  4. Python
    - Introduction to python syntax (data types, arrays, loops, conditions, functions, reading/writing to files, modules)
    - Random numbers and Monte Carlo integration
    - Application of numpy and matplotlib libraries to read, analyse and present measurements
    - Working with matrices (rotation and scalling matrix)
    - Application of scipy.optimize for linear regression and model fitting

  5. LaTex tutorial
    - preparation of scientific report including figures, sctructured text and equations in LaTex

Intended learning outcomes

At the end of the course the student will learn how to prepare programs in python and C++, which:

  • read and analyze text files and find the parameters of the model of the best fit
  • perform calculations using input data
  • present and plot results
  • export figures into standard formats (such as PDF, PNG)
  • prepare scientific report in LaTex, which include equations, structurized text and figures
  • numerically calculate integral and derivative of a function
  • iteratively find a fixed point of a function
  • perform numerical integration using Monte Carlo method
  • numerially calculate projectile trajectory
  • manipulates with matrices
  • solve a set of linear equations using linear algebra and matrices

Assessment

  • homework
  • written exam

Lecturer's references

Dr. Egon Pavlica je izredni profesor za področje fizike na Univerzi v Novi Gorici. Egon Pavlica is an associate professor of physics at the University of Nova Gorica.
1. Marco Carroli, Alex Dixon, Martin Herder, Egon Pavlica, Stefan Hecht, Gvido Bratina, Emanuele Orgiu, Paolo Samorì, "Multiresponsive nonvolatile memories based on optically switchable ferroelectric organic field-effect transistors", Advanced materials, 2021, vol. 33, iss. 14.

  1. Srinivasa Rao Pathipati, Egon Pavlica, Emanuele Treossi, Vincenzo Palermo, Gvido Bratina, "The role of charge transfer at reduced graphene oxide/organic semiconductor interface on the charge transport properties", Organic electronics, 2020, vol. 77.

  2. Vadym Tkachuk, Egon Pavlica, Gvido Bratina, "Molecular alignment on graphene surface determines transport properties of graphene/organic semiconductor transistors", Organic electronics, 2020, vol. 87.

  3. Egon Pavlica, Nadiia Pastukhova, Robert A. Nawrocki, Artur Ciesielski, Vadym Tkachuk, Paolo Samorì, Gvido Bratina, "Enhancement of charge transport in polythiophene semiconducting polymer by blending with graphene nanoparticles", ChemPlusChem, 2019, vol. 84, no. 9.

  4. Gvido Bratina, Egon Pavlica, "Characterisation of charge carrier transport in thin organic semiconductor layers by time-of-flight photocurrent measurements", Organic electronics, Jan. 2019, vol. 64.