Given that:

$$ \nabla V_m = - \bigl( { {\partial}\over {\partial r} } { {m \cos \theta} \over {4 \pi r^2}} + { {1\over r} } { {\partial}\over {\partial \theta} } { { m\cos \theta}\over { 4 \pi r^2} } \bigr) $$it follows that:

Complete this text using LaTeX formatting. see the above example. Notice how stand alone equations look like this: $$ \hbox{Type your equation here} $$ and inline math looks like this: $\alpha,\beta,\gamma$

```
In [3]:
```# code to calculate H_r and H_theta
import numpy as np
deg2rad=np.pi/180. # converts degrees to radians
# write code here to calculate H_r and H_theta and convert to B_r, B_theta
# This is how you print out nice formatted numbers
# floating point variables have the syntax:
# '%X.Yf'%(FP_variable) where X is the number of digits and Y is the
# number of didgets after the decimal.
# uncomment this line to print
#print 'H_r= ','%7.1f'%(H_r), 'H_theta= ', '%7.1f'%(H_theta)
# to format integers: use the syntax:
# '%i'%(INT_variable)
#print 'B_r = ','%i'%(B_r*1e6), 'uT' # B_r in microtesla
#print 'B_theta =','%i'%(B_theta*1e6),'uT' # B_theta in microtesla

Some text to describe what you are doing. (Edit this!)

```
In [4]:
```# write a function here with the form
def myfunc(B_in): # edit this line for your own input variables!
# do some math here to define OUTPUT_VARIABLES
B_out=B_in*1.
return B_out
B=42 # define your input variables here
print myfunc(B)

```
```

```
In [8]:
```# take your program from 2a and modify it to respond to some input flag
# e.g.:
def myfunc(B_in,units):
if units=='cgs':
# do cgs conversion.....
pass
elif units=='SI':
# do SI conversion
pass

a) This problem boils down to finding the value for ${\bf m}$ in Equation 1.8 in Chapter 1 that would give rise to a radial field of 10$\mu$T at a depth of 2890 km (radius of the Earth minus radius of the dipole source).

Write text here about how you solve the problem....

```
In [6]:
``````
# Write code here to calculate the moment, m and print it in ZAm^2
```

b) To compare 10 $\mu$T with the field produced by an axial dipole of 80 ZAm$^2$, we need the second part of Equation 1.8 in the text:

Type your answer here with nice LaTeX formatting.

```
In [7]:
```# Write some code here that calculates H_r, H_theta, the total field
# in H and converted to microtesla. Use nicely formated print statements
# display your results.

```
In [ ]:
```