Working with Arrays
This exercise asks you to write a program to give you some experience
of working with arrays, vectors and matrices in MATLAB. However, you
must make sure your program is reusable, and you should ensure that it
can be used to solve systems with different numbers of components.
Calculating the properties of streams
A stream consists of a set of components for which we have
the following information:
- fi = the molar flow, in kmol/s, of the i-th component
- mwi = the molecular weight, in kg/kmol, of the i-th
component
You are to write a program which, given this information for a
particular stream, calculates and outputs the following properties:
- F, the total flow, in kmol/s, of the stream where:
and where nc is the number of components in the stream.
- wi, the mass flow of each component in kg/s, where:
- W, the total mass flow:
- and xi, the mole fraction of each component, where:
Try this program out for the following 5 component stream:
- 0.1 kmol/s of Propane, molecular weight 44.1 kg/kmol
- 0.2 kmol/s of Butane, molecular weight 58.1 kg/kmol
- 0.08 kmol/s of Pentane, molecular weight 72.2 kg/kmol
- 0.3 kmol/s of Hexane, molecular weight 86.2 kg/kmol
- 0.025 kmol/s of Heptane, molecular weight 100.25 kg/kmol
Now run your program to solve the same problem but for a 6
component stream which is the same as the one above but with one
other component: 0.13 kmol/s of Water, molecular weight of 18.
Hint : You should use the input function
to request the mass flowrates and molecular weights of each component.