%function gg250_lab2_02_template(n, trendd) % function gg250_lab2_02_template(n, trendd) % Prepares rose diagram showing the effects of sampling bias % The sampling is done for vertical fractures that are assumed % to have a uniform distribution of strikes. The two rose diagram % plots show the actual distribution of fracture strikes and % the distribution of strikes that would be sampled by a horizontal % borehole % Input list % n = number of vertical fractures in original sample % trendd = trend of horizontal borehole (in degrees) % Output list % No output list % Example % gg250_lab2_02_template(1000, 45) % Date: 9/2/04 % Name: your name %%%%%%%%%%%%%% Part 1: Uniform distribution %%%%%%%%%%%%%%%% % Sample n numbers from a uniform distribution between 0 and 1 % using the Matlab function "rand". Use Matlab's help menu % to find out how to use "rand". % Call the array of resulting numbers "sample1". sample1 = ; % Create a new array called "striked" by converting the values of sample1, % which lie between 0 and 1, to a distribution between 0 and 360 % by simple multiplication. % This gives a uniform distribution of fracture strikes in degrees, % hence the name "striked". striked = ; % Create a new array called "striker" by converting the values of striked % from degrees to radians using the Matalb function 'deg2rad'. striker = ; % Create the array "bins" and set it to [5:10:355]. % This is used below for the plots bins = ; % Create a new array called "binr" by converting the values of bins % from degrees to radians using the Matalb function 'deg2rad'. binr = ; % Open up a new figure window, and let this be figure 1 % Use Matlab's "figure" function ; % Clear any pre-existing figure in the window % Use Matlab's clf function ; % Prepare a subplot figure using Matlab's sublot function % Make the subplot the first row in a 2-row plot ; % Plot a histogram of the strikes using the values in striked % and Matlab's histogram function and the array 'bins' ; % Label the horizontal axis "Fracture strike (degrees)" using the % Matlab function xlabel ; % Label the vertical axis "Number of Fractures" using the % Matlab function ylabel ; % Title the histogram with the following title: % n fractures drawn from a uniform distribution of strikes % but have "n" be the actual number in your sample. % Use the Matalb function "num2str" to help prepare your title ; % Prepare a subplot figure using Matlab's sublot function % Make the subplot the second row in a 2-row plot ; % Using Matlab's "rose" function, prepare a rose diagram of the fracture % strikes, using the strike values in radians, and the array 'binr' ; % Title the rose diagram with the following title: % n fractures drawn from a uniform distribution of strikes % but have "n" be the actual number in your sample. % Use the Matalb function "num2str" to help prepare your title ; %%%%%%%%%%%%%% Part 2: Biased distribution %%%%%%%%%%%%%%%% % Create a new array called "deltad" that gives the angular difference, % in degrees, between the trend of the borehole and the fracture strike. deltad = ; % Create a new array called "deltar" by converting the values of deltad % from degrees to radians using the Matalb function 'deg2rad'. deltar = ; % Create a new array called "sin_delta" that is the sine of deltar. sin_delta = ; % Create a new array called "rel_prob", where rel_prob is the % absolute value of sin_delta. % Here, rel_prob is the relative probability of a horizontal borehole % intersecting a vertical fracture (see Martel, 1999). rel_prob = ; % Create a new array called "sample2", which is second sample of random numbers % between 0 and 1. Use Matlab's "rand" function again, and have the number % of samples in smaple2 be the same as the number of samples in sample1. % Don't just say "sample2 = sample1" - that is wrong!! sample2 = ; % Creat a new array called index that contains the indices of all the elements of % sample2 that are less than the corresponding value in rel_prob. Use % Matlab's find commnand and the relational operator "<" for "less than". index = ; % Create a new variable called 'm' that gives the number of elements in the % array called "index". Use Matlab's length command to do this. m = ; % Open up a new figure window, and let this be figure 2 % Use Matlab's "figure" function ; % Clear any pre-existing figure in the window % Use Matlab's clf function ; % Prepare a subplot figure using Matlab's sublot function % Make the subplot the first row in a 2-row plot ; % Plot a histogram that simlulates the fractures intersected by the % borhole. To do this, just plot the elements of striked that are given % by the array "index" and Matlab's histogram function, and the array % 'bins' ; % Label the horizontal axis "Fracture strike (degrees)" using the % Matlab function xlabel ; % Label the vertical axis "Number of Fractures" using the % Matlab function ylabel ; % Title the histogram with the following title: % Simulation results: m fractures from original sample of n % but have "m" and "n" be the actual number in your samples. % Use the Matalb function "num2str" to help prepare your title ; % Prepare a subplot figure using Matlab's sublot function % Make the subplot the second row in a 2-row plot ; % Plot a rose diagram that simlulates the fractures intersected by the % borhole. To do this, just plot the elements of striker that are given % by the array "index". Use the array 'binr' to set the bin size ; % Title the rose diagram with the following title: % Simulation results: m fractures from original sample of n % but have "m" and "n" be the actual number in your samplea. % Use the Matalb function "num2str" to help prepare your title ;