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

Ch3-chbr-ch2-chcl-ch3, CH 3 -CHBR-CH 2 -CHCL-CH 3 1     2        3      4...

CH 3 -CHBR-CH 2 -CHCL-CH 3 1     2        3      4    5       Br abd Cl are side chain. numbering is done so that the alphabet that comes first in order get lowest number i.e.,

A covalent bond between two elements, A covalent bond is likely to be form...

A covalent bond is likely to be formed between two elements which: (1) Have similar electronegativities (2) Have low ionization energies (3) Have low melting points (4

Bulk Density, A copper tube 1 inch in diameter and 2 feet long is filled wi...

A copper tube 1 inch in diameter and 2 feet long is filled with steel balls of 1 inch diameter. The space between the balls is filled with water. The specific gravity of steel 7.8.

Colour of sky, Why is the colour of sky blue??

Why is the colour of sky blue??

The total number of orbitals having principle quantum no., For principle q...

For principle quantum numbern= 4 the total number of orbitals having l=3: (1) 3        (2) 7   (3) 5             (4) 9 Ans: 7

Periodic table, solubility of s-block elements to flame test

solubility of s-block elements to flame test

Vulcanization of rubber, Vulcanization: Vulcanization is very widely used ...

Vulcanization: Vulcanization is very widely used in rubber technology to improve the properties such as low tensile strength, plastic nature, thickness etc. by adding some chemica

What do you understand by miller indices of a crystal plane, What do you un...

What do you understand by Miller indices of a crystal plane? Miller Indices are a symbolic vector representation for the orientation of an atomic plane in a crystal lattice an

Gases, a small 0.600ml bubble forms at the bottom of a lake where the tempe...

a small 0.600ml bubble forms at the bottom of a lake where the temperature is 4.0 degrees Celsius and the pressure is 2.40 atm. What volume will the bubble occupy near the surface

Thermodynamics, Calculate the free energy change of following reaction at29...

Calculate the free energy change of following reaction at298 kelvin H2+I2=2HI if the enthalpy change is 51.8816kj and the entropy change is 166.15j is this reaction thermodyanamica

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