Skip to content

Latest commit

 

History

History
20 lines (10 loc) · 1.01 KB

README.md

File metadata and controls

20 lines (10 loc) · 1.01 KB

Scalar and Vector fields in Python

Python libraries used: Numpy, Matplotlib.pyplot.

In this Coursework/Project:

  1. Wrote a program to represent a scalar field h as discrete contours in 2d using .contour function of matplotlib.pyplot.

  2. Used analytically deduced expressions for 'Grad h' to plot the vector field as arrows (using .quiver function of matplotlib.pyplot).

  3. Used Numpy's gradient function to compute 'Grad h' numerically and then plotted the numerically calculated vector field 'grad h' as arrows using .quiver function of matplotlib.pyplot.

  4. Compared the plots of analytically determined 'grad h' and numerically computed 'grad h'.

  5. Wrote a program so that the vector field arrows only originate from contour lines.

I have attached the relevant question sheet and recommend that it be read while you're looking at the code. The programs were written in a Jupyter Notebook which has also been attached.

If you need any more information/explanation related to the code, don't hesitate to contact me.