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

Gillman reagent, rectivtiy of gillman reagent on cyclic alkyl halides is go...

rectivtiy of gillman reagent on cyclic alkyl halides is govern by what factors,,what is the product bicyclo[2,2,1] dibromide reacts with gillman reagent

Quantitative Test for Sucrose in Honey, Please give a stepwise procedure in...

Please give a stepwise procedure in carrying out quantitative test for Sucrose in Honey to determine its quality. Please also include Pure honey sucrose acceptable quantity.

Alkyl nitrites and nitro alkanes, Alkyl nitrites and nitro alkanes In t...

Alkyl nitrites and nitro alkanes In two tautomeric types Nitrous acid found. Corresponding to these two forms, nitrous acid provides two types of derivatives, that is n

Soaps and detergents, Soaps and detergents Sodium and pottasium salts of...

Soaps and detergents Sodium and pottasium salts of fatty acids such as palmitic acid, stearic acid, oleic acid etc are called soaps, while detergents are ammonium or sulphonate

Practicals, graph for the titration of barium chloride versus sodium sulpha...

graph for the titration of barium chloride versus sodium sulphate

Calculate the ideal rm ratio for cation-anion, Calculate the ideal rM/rX ra...

Calculate the ideal rM/rX ratio for cation-anion and anion-anion contacts of an octahedral arrangement of anions around a cation as show in one plane in the figure below.

Test for hydrocyanic acid, Q. Test for hydrocyanic acid? Hydrocyanic ac...

Q. Test for hydrocyanic acid? Hydrocyanic acid is present as an impurity in synthetic ethyl isothiocyanate, which is employed to make the flavour of mustard oil more pungent. T

Dalons Law Practice Problems? , Hello,">http://misterguch.brinkster.net/WKS...

Hello,">http://misterguch.brinkster.net/WKS001_033_418188.pdf Hello, I''m Ronnie. I don''t know how to do problem number 1. Could you help me with just this one?

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