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

Illustrate law of conservation of mass, Q. Illustrate Law of Conservation o...

Q. Illustrate Law of Conservation of Mass? Ans: Conservation of Mass and Atoms: The Law of Conservation of Mass states that mass is neither created nor destroyed. Th

Iupac system of naming organic compounds, IUPAC System of Naming Organic Co...

IUPAC System of Naming Organic Compounds In the IUPAC (International Union of Pure and Applied Chemistry) system, the name of an organic compound contain three parts that are:

Covalent bond and ionic bond, why water molecule forms covalent bond even t...

why water molecule forms covalent bond even though it dissociates into ions

Electrolysis, In electrochemical series moving down the table the ease of ...

In electrochemical series moving down the table the ease of discharge at cathode increases.why? And what is ease of discharge

Atomic absorption spectrophotometry, Atomic absorption spectrophotometry: ...

Atomic absorption spectrophotometry: Atomic absorption spectrophotometry (AAS) concerns the absorption of radiation by the atomised analyte element in the ground state. The at

Qualitative Analysis of Cations, We are asked to design a qualitative analy...

We are asked to design a qualitative analysis scheme that can be used to determine which cations are present in a solution containing only four of the following cations: Pb2+, Ag+,

The correct sets of the four quantum numbers 4d electron, Which of the fol...

Which of the following represents the correct sets of the four quantum numbers of a 4d  electron: (1)  4,3,2,1/2                        (2) 4, 2, 1, 0 (3)  4,3,-2+1/2

Priming and foaming, Q.   Write short notes on priming and foaming. An...

Q.   Write short notes on priming and foaming. Ans. Priming and foaming: When a boiler produces steam rapidly, some particles of the liquid water are carried along with the s

Pulak, why uranium235 and thorium232 dont participate in nuclear fission

why uranium235 and thorium232 dont participate in nuclear fission

Chemical reactivity of alkynes - hydrocarbon, Chemical reactivity of alkyne...

Chemical reactivity of alkynes - Hydrocarbon C Ξ C is less reactive as compared to the carbon-carbon double bond in the direction of electrophilic addition reaction. This is re

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