Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Chemistry Expert

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.

Chemistry, Academics

  • Category:- Chemistry
  • Reference No.:- M9529009

Have any Question?


Related Questions in Chemistry

1 a beaker contains a clear colorless liquidnbspit has

1. A beaker contains a clear, colorless liquid. It has three chemical substances in it, two are liquid and one of them is a solid. How could you determine if it has water, ethanol, and table salt? Remember you're not all ...

A 41 kg person walking 56 kmhr requires 758 kj of energy

A 41 kg person walking 5.6 km/hr requires 758 kJ of energy per hour. How much further does he have to walk to consume the addition energy contained i 320 g of ground beef relative to 320 g of broiled chicken? The energy ...

A student prepared a stock solution by dissolving 200 g of

A student prepared a stock solution by dissolving 20.0 g of NaOH in enough water to make 150. mL of solution. She then took 15.0 mL of the stock solution and diluted it with enough water to make 65.0 mL of a final soluti ...

Calculate the number of moles of barium chloride in 427g of

Calculate the number of moles of barium chloride in 427g of a 3.17% by mass barium chloride solution?

Suppose 17 g of zinc is treated with 62 g of pure hydrogen

Suppose 1.7 g of zinc is treated with 6.2 g of pure hydrogen chloride. What is the maximum mass (in g) of hydrogen gas that can be produced?

Does dissolved solids such as sugar and salt modifychange

Does dissolved solids such as sugar and salt modify/change the boiling point of water; do mixtures have the same boiling point as pure substances?

For the reaction 2ch4gc2h2g3h2g knbsp 0170 at 1725nbspc

For the reaction 2CH4(g)?C2H2(g)+3H2(g) K  = 0.170 at 1725 °C. What is  K p for the reaction at this temperature? Express your answer numerically. For the reaction N2(g)+3H2(g)?2NH3(g) K p= 3.95×10 -3  at 325 °C . What i ...

A compound contains only carbon hydrogen and oxygen

A compound contains only carbon, hydrogen, and oxygen. Combustion of 10.68 mg of the compound yields 15.48 mg CO2 and 7.39 mg H2O. The molar mass of the compound is 182.2 g/mol. What are the empirical and molecular formu ...

Assessmenttaskyou have been tasked to prepare a report for

Assessment Task You have been tasked to prepare a report for potential investors that allows them to understand the potential social, ethical and legal opportunities and risks of a technology, selected from a list of top ...

Consider two acids hcn and Consider two acids HCN and HNO2:                     

Consider two acids HCN and HNO2:                      HNO2   +   H2O      NO2-    +   H3O+ Ka = 5.1 x 10-4          HCN   +   H2O        CN-     +  H3O+   Ka = 2.1 x 10-9  Which of the following statements is/are true? A ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As