Python libraries used: Numpy, Matplotlib.pyplot.
In this Coursework/Project:
-
Wrote a program to represent a scalar field h as discrete contours in 2d using .contour function of matplotlib.pyplot.
-
Used analytically deduced expressions for 'Grad h' to plot the vector field as arrows (using .quiver function of matplotlib.pyplot).
-
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.
-
Compared the plots of analytically determined 'grad h' and numerically computed 'grad h'.
-
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.