A separation process accepts a mixture of water, ethanol and methanol in
certain proportions, and produces two output streams, each with particular
proportions of the component liquids.
The input flow of the combined liquids is 100 L/min, and the output flows are the unknowns b and c. The proportions in each stream are shown in the yellow boxes.The output proportions are known, as is the input proportion of water. The proportion of ethanol in the input stream is the third unknown x.
Since the input and output flow of each material must match, we can
devise three equations in the three unknowns:
Then solve the equations using matrix left division:
x = A \ b
You have worked on the Sea Ice Index data set in Week 11's lab. You are going to use this data set again but this time you are going to use 3D plots to visualise the data.
Among the many data sets used in climate change research, the Sea Ice Index, or the area covered by sea ice in the northern hemisphere shows particularly marked changes.There are normal variations across each year, and trends over the span of years. We can treat these two as x and y variables, and the sea ice extent as the dependent z variable in a 3D plot.
The file NHsea_ice_extents.txt contains monthly northern hemisphere total sea ice data between 1979 and 2013.Each row starts with the year, then has two area samples each month in units of millions of square km.
It doesn't need much processing to display this data effectively. Download the data file, place it in a folder on Matlab's path. Follow these steps, try to understand what each is doing from the comments. Paste the non-comment lines one at a time, not all at once! Matlab's response is not shown.
Note that the pre-processing steps are the same as what you did last week, you can cut and paste that block of commands if you wish. The pre-processing steps are enclosed between "% BEGIN: Pre-processing" and "% END: Pre-processing".
% BEGIN: Pre-processingNow add a title, and x, y and z labels.
load NHsea_ice_extents.txt % the data is tab-separated, load assigns it to a variable named after the file size(NHsea_ice_extents) % rows = number of years, columns = number of elements in a year % what's in the first row? NHsea_ice_extents(1,:) % the first column has the year, the rest is area data. We need to move the years % into a different variable years = NHsea_ice_extents(:,1); % first column, easy NHsea_ice_extents(:,1) = ; % remove the first column by assigning nothing size(NHsea_ice_extents) % should be 35 (years) x 24 (half-monthly samples) % the month range should be 1 to 12 as usual, but we have 24 samples: months = linspace(1,12,24);
% END: Pre-processing
% BEGIN: Plotting
% the months and years vectors are ready to be converted to 3D grid matrices [mG, yG] = meshgrid(months, years); % G for grid size(mG), size(yG) % plotting time surf(mG, yG, NHsea_ice_extents) % default shading is faceted, flat is OK but interp is definitely the best for this data shading interp % autoscaling the axes is sometimes a bit off, we know better what they should be axis([1 12.99 1975 2015 0 20]) % finally we associate red with both danger and heat, and blue with cold, % the default colouring (stored in a special variable colormap, an Nx3 matrix % of RGB values) is opposite to what makes sense to us. flipud inverts rows (up-down). colormap(flipud(colormap))