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

Determination of acid insoluble ash of flour sample., I want to know how to...

I want to know how to determine the acid insoluble ash of a flour sample with principle,procedure as well as calculations.

Determine atom which sub-shell will have the highest energy, In any atom wh...

In any atom which sub-shell will have the highest energy in the following : (1) 3p                    (2) 3d         (3) 4s                 (4) 3s Ans: 3d

F block element, why Zn metal regarded other element

why Zn metal regarded other element

What is piezoelectricity, What is piezoelectricity Piezoelectricity pr...

What is piezoelectricity Piezoelectricity provides us a means of converting electrical energy to presume new geometric positions and mechanical dimensions of the substance are

Aromatic carbonyl compounds - aldehydes and ketones, Aromatic Carbonyl Comp...

Aromatic Carbonyl Compounds - Aldehydes and Ketones Aromatic aldehydes are of two types: The compounds where - CHO group is attached directly to an aromatic ring, like benza

Vbt, limitation of vbt

limitation of vbt

Explain fully the potential health hazards, An analysis of the state of the...

An analysis of the state of the Brazilian chemical industry in 1998 revealed that the actually used technologies were transferred in a period where industrial waste generation, tre

Determine unpaired d-electrons, Which of the following has more unpaired  ...

Which of the following has more unpaired  d-electrons: (1)  Zn +                  (2) Fe 2+                          (3) N 3+                         (4) Cu + An

Jim, If 4.5 grams of Nitrogen reacted with 2.6 grams of Hydrogen, identify ...

If 4.5 grams of Nitrogen reacted with 2.6 grams of Hydrogen, identify the following: Limiting Reactant- Excess Reactant- and Theoretical Yield:

Canizzaro rex., Why 2-methyl propanal gives canizzaro Rex.

Why 2-methyl propanal gives canizzaro Rex.

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