Question: All problems in this assignment are to be done using MATLAB. You will submit two script ( * . m ) files and two function
All problems in this assignment are to be done using MATLAB.
You will submit two script m files and two function m files, named appropriately and
each containing appropriate comments, containing the solutions to all problems.
a Script files should be named in the following format: HWxPxm
b Function files must be named the same as the function.
Only files with m extensions will be accepted.
It is your responsibility to make sure that your script m file works properly and is free from
errors by utilizing the resources at your disposal.
a DO NOT use the clear command in your code.
b All final answers, and ONLY final answers, should be output to the command window, ie
make sure you use the ; to suppress output of each line that does not need to be
displayed to the command window.HWP points
Ocean water can be approximated as an incompressible fluid for which the equation of state relates the
density to the salinity and the temperature. The equation of state can be written
where and are the density, temperature and salinity, respectively. The parameters and are
the thermal expansion coefficient and the haline contraction coefficient, respectively. The
thermodynamic state at Standard Temperature and Pressure STP and salinity from Gill is
given by The values of parameters are given below
Furthermore, the pressure at a given depth is given by
where is the atmospheric pressure, is the acceleration due to gravity
and is the depth below the surface in meters. The formulae for density and pressure are given in kg
and Pa respectively. Convert the density to grams per and the pressure
to bar You are required to calculate the density and pressure for given salinity,
temperature and depth.
Write a function file EoS which takes and as input arguments and returns
and as output arguments. The function should assign local values to all constants. Usecall the
function to return and determine the values of and in the command window for all inputs of the
table above.
Use the first several lines of your scriptfunctions to describe the problem you are solving in the
comments.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
