- Parent Category: Engineering Assignments' Solutions
We Helped With This Engineering Homework: Have A Similar One?
|More Info||Engineering Math Homework Help Online|
Short Assignment Requirements
This coursework for ENG2106 consists of three exercises where you need to apply numerical methods in MATLAB. The purpose of this coursework is to develop and demonstrate your independence in the use of numerical methods. You will need to do your own research into the methods and write your own implementation in MATLAB.
Most of the methods that you will apply for this coursework have not been covered in the lectures or lecture notes. You will not be tested on these new methods in the final exam paper.
This coursework is done in groups of four students. Please form groups and submit the list of four group members as well as a name for your group by email (...) by Monday 12 March 2018, 4pm. Anybody not in a group by that time will be allocated to a group automatically and the formed groups will be announced on Tuesday 13 March.
The report should include all MATLAB code used. The coursework should be submitted as a single pdf-file through the Assignment folder on SurreyLearn. The deadline for the submission is Monday 30 April 2018, 4pm. Beware, even though these questions are short, they do entail a substantial amount of work each, and require planning.
The coursework will be marked on demonstrated understanding of methods and correctness of results (60%), as well as the quality of the MATLAB code (25%) and the presentation of the report (15%).
Conciseness in explanation and presentation is important, and the whole report should not take more than 12 pages. However, if you do not manage to meet this limit, you should prioritize being complete, clear and correct over being concise and sticking to the word limit.
Understanding of methods is demonstrated by:
- Crisp and correct language when discussing mathematical concepts
- Correct and consistent use of equations and terms
- Consistency between described methods, associated equations and implementation in MATLAB
- Correct solution to problems and verification of results - Correct interpretation of, and reflection on, results
Quality of MATLAB code is demonstrated by:
- Correctness, readability and conciseness of the code
- The appropriate use of comments
- The use of MATLAB techniques introduced in the lecture notes and tutorials. In particular these are the use of scripts and functions, function functions and anonymous functions
- Where appropriate it is preferred to develop generic and reusable solutions on the basis of user-defined functions. See also Section 8 of the Introduction to MATLAB lecture notes
© Alex Hagen-Zanker, University of Surrey
The presentation of the report will be expected to be professional, which entails the following:
- Title page including group number, names and URN’s of the group members - Consistent numbering of sections, pages, equations, tables and figures.
- Consistent use of styles (fonts and sizes) for headers and body text.
- Well-formatted and appropriately sized figures and tables
- All figure axes labelled. A descriptive caption for each table and figure.
- Well-formatted and numbered equations
- Correct and to the point language
- Inclusion of a reference section and correct use of references and citations
The style and formatting must be consistent over the whole report and not vary per question.
One of the transferable skills that you develop in this module is teamwork. Your work will be assessed as a team effort and each team member will receive the same grade. In exceptional circumstances, it may be necessary to assess each individual contribution. For instance, when one or more team members do not make sufficient effort. Individual assessment will only take place when the exceptional circumstances have been brought to the attention of the Module Leader before 23 April 2018, 4pm.
Plagiarism and attribution
All work must be done within your group. The usual rules for plagiarism, citation and attribution apply and also extend to the use of MATLAB code. If you are at some point inspired by code from an external source, this must be clearly indicated and justified in the written report. Any failure to do so will be referred to the Department’s Academic Integrity Committee. Avoiding plagiarism should be common sense; when in doubt consult the learning materials in the Student Common Room section on SurreyLearn.
Any externally inspired code must be fully adapted to the standards and techniques used and recommended in the module. In other words, you have to make it your own. Any failure to do so will result in the lowest possible marks for Understanding of Methods and Quality of MATLAB Code.
This means, for instance, that the MATLABand functions should not be used. Functions should not be passed as string literals; e.g., is not an acceptable alternative for .
1 Ordinary Differential Equations (20 points)
Consider the following system of Ordinary Differential Equations
dz1 1.2z1 0.3z z1 2
dz2 0.05z z1 2 0.1z2 dt
Initially, z1 10 and z2 3.
The Midpoint Method belongs to the family of Runge Kutta methods.
a) Give a concise description of the Midpoint Method
b) Implement the Midpoint Method as a function function in Matlab
c) Use the Midpoint Method to plot the trajectory for z1 and z2 until t 100. Use different step sizes and give insight in the development of the error. Does this meet theoretical expectations?
d) This model is a form of the Lotka-Volterra model, or preditor-prey model. In that context describe what z1 and z2 represent. How would you adjust the model to a situation in which the fertility of the prey has reduced?
Hint: You can use the solutions to the tutorial solutions of Week 3 as a starting point
Hint: The midpoint method may be unstable for large step sizes. If at first your results come out as NaN (Not a Number) this may be due to a too large step size, and not necessarily your implementation of the midpoint method.
2 Root finding (30 points)
This exercise requires you to use the Bisection Method to find all roots of the following functions:
f x( ) sin( )x 0.15x
0.025x (2) g x( ) 1.3cos(2 )x e
a) Plot the functions and discuss what difficulties you would expect to encounter when searching for roots using the bisection method, as well as the strategy for dealing with these difficulties.
b) Write and present a MATLAB function to find all roots of a function using the bisection method to an estimated absolute precision of 10-6. Write and present a MATLAB script that applies your root-finding function to the above two functions.
c) Give the roots, and discuss whether you are confident that all roots have been found.
Hint: To avoid duplication, you need to implement the bisection method as a function function.
3 Braided rivers (50 points)
You are tasked to implement the braided-stream model by Murray and Paola (1994, 1997). Both of these papers can be accessed through the University Library.
The braided stream model was developed in order to investigate the mechanisms that underlie the formation of braided streams. These are rivers that flow over a wide river plain and within the river plain dynamically form channels and meanders.
The Murray and Paola model is considered attractive because it uses minimalistic assumptions and simple mechanics to replicate the essence of a highly complex process.
The model represents the river on a grid. For each grid cell it keeps track of two variables: the elevation level (h ) and the discharge (Qo ).
The model includes three processes: (1) Water flow in downstream direction; (2) Sediment flow along with water flow; (3) Sediment flow in lateral direction
Water flow in downstream direction goes to three possible grid cells: the one immediately downstream, the one diagonally downstream to the left and the one diagonally downstream to the right. The discharge is distributed over these three locations using the following equation:
wi Qo , (3)
where wi is a weight factor detailed below and Qo is the total discharge of the grid cell. Note that the notation by Murray and Paola (1997) is slightly different and, in fact, incorrect.
The weight factors are a function of the slope to each of these grid cells, three possible situations are treated separately (Table 1):
Table 1: Conditional equations for discharge weights
Equation for wi
The maximum slope is greater than zero
wi Si 0:Sin
The maximum slope is exactly zero
wi i 0:1
The maximum slope is smaller than zero
wi Si n
where Si is the slope from the source cell to the target cell. The exponent n is a model parameter.
For the definition of Si and the value of n see the Murray and Paola (1994, 1997).
Murray and Paola present various equations (called rules) for the sediment flow along the water flow. Here, you are asked to apply rule 3:
Qs i, K Q S C i i m (4)
Where Qs i, is the sediment flow along with Qi . K ,C and m are parameters, as introduced in the referenced papers.
These are the main equations. However, you will need to refer to the papers for the treatment of boundary conditions and further details.
a) Give the equations for the full model, include boundary conditions.
b) Taking the template in Appendix A as a starting point, implement the Murray and Paola cellular model for braided rivers (using Rule 3).
c) Apply the model with various settings, aiming to reproduce, qualitatively, Figure 5 of Murray and Paola (1997).
d) Create more insight in sensitivity of the model by applying it for with a wider variety of settings, outside the scope of the given papers. Did you encounter any numerical difficulties?
e) Critically reflect on the model. What do you consider its strengths and weaknesses?
Hint: This model is calculation intensive. When debugging your work reduce the dimensions to avoid waiting for results all the time.
Hint: When implementing the model, you will need to choose between iterating over the grid cells and for each grid cell the adjacent grid cells, or implementing the methods in terms of operations on vectors and matrices. The advantage of using vectors and matrices is computational efficiency, and in the end possibly neater code. However, the nested conditional function of Table 1 will make this a challenging task. Iterating explicitly over grid cells, on the other hand, will lead to code that can be more directly related to the equations in the papers. It will make the model a lot slower. Either approach is justified and can gain you full points.
Hint: The template gives the outline of a script. Keep in mind though that you can write a function and apply it from within your script: you don’t have to write all your code inside the script.
Hint: The template produces two plots, but it is up to you modify the script and make the plots appear just the way you want to.
Murray, A.B. and Paola, C., 1994. A cellular model of braided rivers. Nature, 371(6492), pp.54-57.
Murray, A.B. and Paola, C., 1997. Properties of a cellular braided‐stream model. Earth Surface Processes and Landforms, 22(11), pp.1001-1025.
Appendix A Template for Q3
% Implementing Murray and Paola's cellular model for braided rivers clear all, close all, clc
rows = 500; %(reduce when debugging)
cols = 22; %(reduce when debugging) num_iterations = 16000; %(reduce when debugging) q_in = 10000; n = 0.5;
K = 1e-21; % 1 x 10^-21
Kl = 1e-7; m = 2.5; S = 100000;
C = 300000;
% specify a seed so the pseudo random realizations are the same for every run rng(1)
% create white noise noise = random('normal',0, S/2, [rows, cols]);
% create a slope
[~,slope] = meshgrid( 1:cols, linspace(rows * S, 0, rows));
% create initial elevation h = slope + noise;
% boundary condition is a steep wall on either side h(:,[1,end]) = 1e100;
% start empty of water q = zeros(rows, cols);
% let in a stream of water from the top q(1, 7:13) = q_in;
for i = 1:num_iterations
% this is where your work comes in...
% calculate slopes, water flows, sediment flows
% update h and q matrices end
% plot h without average slope plot_h = h - slope;
% plot only 250 rows, and not the boundary cells plot_h = plot_h(1:250, 2:end-1); plot_q = q(1:250,2:end-1);
image(plot_h,'CDataMapping','scaled'), axis equal, xlim([0,cols-2]) colormap(gray); % plot B&W
image(plot_q,'CDataMapping','scaled'), axis equal, xlim([0,cols-2]) colormap(flipud(gray));