Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439

One mark is assigned to Part A (Assignment 2 Assessment). Your tutor will reward diligent attempts at assessing the submissions assigned to you or your group for Part A. They will not give a mark if you don't take the exercise seriously. In addition, if the assessment isn't completed or the mark sheets not submitted, then a deduction will be made to the mark assigned to you for Assignment 2.

Part B is worth one mark. The online assessment (the last for the semester) is on curve fitting.

Part C will not be assessed and you can do it in your own time.

Part A: Assignment 2 Assessment

The assessment procedure and criteria are on a separate page, which will only be available from Monday, Week 12. The page is when it is available.

Part B: Solving Linear Equations

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:

  1. Re-arrange these equations so that each is of the form
    z1 x + z2 b + z3 c = k
    where the z coefficients and k are constants.
  2. Express the solution in matrix form A x = b, where
    A is the matrix of coefficients,
    x is the column vector of unknowns and
    b is the column vector of right-hand-side constants.
  3. Write a Matlab script (so you can recall how you solved the problem later) that assigns the matrix A and vector b, using multiple lines continued with ... to align the columns of A neatly. Remember that b is a column vector.

    Then solve the equations using matrix left division:

    x = A \ b
  4. Interpret the results. Confirm that x is no greater than 0.5 (otherwise the methanol input proportion would be negative). What do you expect the sum b + c to be? (Think about overall flows if this isn't clear.)

Part C: 3D plots of experimental data

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 , 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 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-processing

load NHsea_ice_extents.txt % the data is tab-separated, load assigns it to a variable named after the filesize(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 variableyears = NHsea_ice_extents(:,1); % first column, easyNHsea_ice_extents(:,1) = []; % remove the first column by assigning nothingsize(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 gridsize(mG), size(yG) % plotting timesurf(mG, yG, NHsea_ice_extents) % default shading is faceted, flat is OK but interp is definitely the best for this datashading interp % autoscaling the axes is sometimes a bit off, we know better what they should beaxis([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))
Now add a title, and x, y and z labels.
Then use the 3D rotate icon to examine this rich data set. You should be able to show your tutor the overall trend side view,the "end elevation view" and any other one they ask for. Which recent years does the data suggest were the worst for sea ice (we're looking for local dips in the low points)?

A Final Note

We hope you've been able to build up a set of computing skills through this course that you can call on over the coming years. Remember, don't be afraid to experiment with new problem-solving systems, even (or especially!) those that involve Basic, Matlab or similar programming techniques. You'll better understand the capabilities of such applications, and how they can improve your professional productivity.

Next week will be two practice programming exercises for the exam.