Answer To: Your assignment will be assigned the grade corresponding to the column that best describes your...
Shivinder answered on May 18 2021
import pylab
def sal_of_seawater(latitude):
'''Since salinity is a linear function on latitude,
if latitude = 0 i.e. at equator, salinity is 36
by using euqation of a straight line, y =mx+c, here y(salinity) = 36, x(latitude) = 0, we get c(intercept) = 36
and at poles, we have salinity = 34 and latitude = 90, putting that in same equation,
we get y = 34, x = 90, c= 36, we get m (slope) = -1/45 = -0.22'''
slope = -0.022 #Slope of the linear relationship between salinity and latitude
intercept = 36 #Intercept
salinity = (slope * latitude) + intercept #Calculates salinity
return salinity #Return Salinity
def temp_of_seawater(latitude, depth):
if 0 < depth <= 200:
'''When depth is between range 0 and 200 metres, the summer temperatue is
a linear function of latitude.
When latitude = 0(equator), temperature = 24, using the equation of line, y = mx+c
here y = 24, x = 0 gives c = 24
Now when temperature is 2 at poles i.e, y = 2 and x = 90, which gives m(slope) = -22/90 = -0.244'''
slope = -0.244
intercept = 24
temperature = (slope*latitude) + intercept #Temperatur value
elif 200 < depth < 1000:
'''Here temperature is a linear function of depth
to find this, first we will find the surface temperatur at a given latitude
using the eqaution derived above'''
t1 = (-0.244*latitude) + 24 #Temperature at surface at depth 0
t2 = 2.0 #Temperature at depth 2
#Now we will get temperatur as a function of depth
'''Since temperatur is a function of depth, we have two temperatures,
t1 at surface and t2 at depth 1000
using t1 and t2, we will derive a relationship between temperatur and depth'''
'''Consider the relationship bw temperature and depth as y = mx+c,
where y is temperature, x is depth and x and c are slope and intercept.
At t1, i.e, depth = 0, c will be equal to...