"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"deletable": false,
"editable": false
},
"source": [
"In this module, you will work a lot with scalar and vector fields. We will expect you to be able to use pen and paper to do tasks such as sketching vector fields and contours of scalar fields. However, it is also useful to be able to use a computer to do these things. In this workshop, you will explore how fields can be plotted in Python. \n",
" If you don't have your 1st year Python book with you, then you may need to refer to the online notes from the first year computing web pages to remind yourself of the basic syntax."
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"deletable": false,
"editable": false
},
"source": [
"# Scaler Fields"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"deletable": false,
"editable": false
},
"source": [
"In lecture $1$, you saw that a scalar field is any function of position which has a scalar value at each point $\\bm{r}=(x, y, z)$. We usually visualize scalar fields by plotting contours over which the scalar function is a constant. You should be familiar with contour lines on maps, so we will consider geographical contours as our examples. \n",
"A particular hill is described mathematically in plane polar co-ordinates $(r, θ)$ by the expression\n",
"$$F=he^{-r^2}$$\n",
"where $F$ is the height above sea level $(F = 0)$, $h$ is the height of the summit and $r=\\sqrt{x^2+y^2}$. "
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"deletable": false,
"editable": false
},
"source": [
"\n",
"
Geographical maps plot contours corresponding to regular increments in height. For example, on the OS map of the campus area in the lecture notes, you can see that contours of the hill in Wollaton Park are drawn at $45m$, $50m$ and $55m$ above sea level. Contours are closer together where hills are steepest, because it is not necessary to move as far horizontally for a given change in height than it is where ground is less steep. \n",
" Write a Python program to plot $F$ as a function of $x$ for $y = 0$ and $h=1$. Using this plot, try to identify where a map would have contours close together and where they would be further apart. Note that for this module, you will not need to worry about relative separations of contours unless explicitly asked to do so. \n",
"