Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Computational Methods II (CI2-221)

Tutorial 3

Exercise 3a    Mountain slopes

The objective of this exercise is to determine the local slope at each location in space in a mountain area.

 

0                                   y [km]

x [km]

a. Download the startup les from Blackboard, save them to your home-directory, and open ex03 .m. Executing it will produce a surface plot of the region.  The units of X , y and Z are in km.  Study the arrays X , y and Z .  Which dimension (i.e.  index) of the arrays corresponds to the α-direction, the first or the second?

b. Create a gure with 2 x 2 sub-plots. Create annotated plots for

● Z at α = 0.2;

● Z at α = 0.9;

● Z at  = 1;

● Z at  = 1.5.

c. Using for-loops and central dierences, determine the slope g in α-direction and gg  in 夕-direction. Calculate the local slope g = g北(2) + gg(2)  as a function of α and  and plot it with contourf.

d. Calculate the local slope using the gradient function. Create a gure with two subplots, of which the left contains the local slope as calculated in the previous question, and the right as calculated in this question.  Are the two identical?  If not, look carefully at the format of the input-data and x the problem.

e. Find the maximum slope in the domain.