Density theory, Chemistry

Assignment Help:

The assignment is basically concerned with the writing of a number of functions which can implement the density theory described above. These functions will then be called by a program which will load data ?les containing the composition of a number of natural waters and make some plots comparing them. The organization of the functions is up to you, but one way of doing this is to have

  • assign2.m containing the "driver" code which reads water composition data and makes plots
  • density.m containing the function density, and subfunctions appmolalvol, and istrength. This will compute the density for a given chemical composition, with the subfunctions computing the apparent molal volume for a particular ion, and the ionic strength of the solution.
  • salinity.m containing the function salinity which will compute the salinity of a given composition.
  • loadcomp.m containing the function loadcomp which will load data in a given ?lename, and return a row vector containing the different molalities mi, as well as the salinities (I suggest the use of structures to keep all information for a particular composition together).

Some other hints are:

  • Since there are 7 different ions, you could use a different variable name for each in your code. However, it is more ef?cient to store their data in row vectors, where each column represents data for a particular ion.
  • Avoid "hard-wiring" numbers (like those in Table 1) into your code more than once. Keep the (?xed) data for molar masses, ionic charges, and so on in row vectors, or in some form of data structure. This makes it much easier to modify your data to take into account changes in the molar masses, number of ions in the compositions, or other factors. Also, it is sometimes helpful to write another function, say myconstants, whose sole purpose is to provide this data structure to any function that needs this information.
  • Above all, resist the tendency to start writing code BEFORE you REALLY understand WHAT you have to code. IN PARTICULAR, use pencil and paper to specify the INPUTS and OUTPUTs of all functions, andspecifyWHERE (in what functions) the different kinds of information in Table 1 is required.

Related Discussions:- Density theory

Simple distillation - purification of organic compounds, Simple Distillatio...

Simple Distillation - Purification of organic compounds Distillation is the joint procedure of vapourisation and condensation. This method is employed for the purification o

Solid state, #questionthe extra Zn +2 ion are arising from wher? 2are they ...

#questionthe extra Zn +2 ion are arising from wher? 2are they from their respective lattice site? 3pls provide animated videos for that..

Physical chemistry, formation of energy bonds in solids are in accordance...

formation of energy bonds in solids are in accordance to? give reasons .

Periodic table, how periodic table is helpful in chemistry give two example...

how periodic table is helpful in chemistry give two example

Benzene- hydrocarbon, Benzene- Hydrocarbon Benzene is the first or init...

Benzene- Hydrocarbon Benzene is the first or initial member of arenes. It was first revealed by Faraday in year 1825 from whale oil. Mitscherllich (1833) acquired it by distill

Number of unpaired electrons in the ground state, Number of unpaired electr...

Number of unpaired electrons in the ground state of beryllium atom is: (1) 2        (2) 1        (3) 0        (4) All the above Ans: 0

Elements, list the elements that have all 3 properties: lustre , malleabbil...

list the elements that have all 3 properties: lustre , malleabbility and conductivity

Electrochemistry, calculate the voltage of the cell mg/mg+//cd2+/cd at 250c...

calculate the voltage of the cell mg/mg+//cd2+/cd at 250c.when[cd2+]=7*10-11 M,[mg2+]=1.0M and standerd electrode potential=1.97V.

How many electron have br+, How many electron have br+ Neutral Br, bei...

How many electron have br+ Neutral Br, being in Group 7A, has 7 valence electrons; therefore, Br+ has 6.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd