-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlot_Log_Norm_PDFS.m
152 lines (116 loc) · 6.22 KB
/
Plot_Log_Norm_PDFS.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
function [mean_val] = Plot_Log_Norm_PDFS(Data1,Data2,Well_Type, normal_ranges,xx)
if (size(Data1(:,1),1) <15) && (size(Data2(:,1),1) <15)
return
end
if xx==8
stress='apparent stress';
end
if xx==11
stress='stress drop';
end
mean_val = zeros(1,5);
Expected_Vals = zeros(2,2);
n_Data1 = size(Data1(:,1),1);
n_Data2 = size(Data2(:,1),1);
Data1 = log(Data1);
Data2 = log(Data2);
mu1 = zeros(n_Data1,1);
mu2 = zeros(n_Data2,1);
sigma1 = zeros(n_Data1,1);
sigma2 = zeros(n_Data2,1);
mu1(:) = mean(Data1);
Expected_Vals(1,1) = mean(Data1);
mean_val(1,1) = mu1(1,1);
mu2(:) = mean(Data2);
Expected_Vals(2,1) = mean(Data2);
mean_val(1,2) = mu2(1,1);
mean_val(1,3) = mean_val(1,2)./mean_val(1,1);
mean_val(1,4) = n_Data1;
mean_val(1,5) = n_Data2;
sigma1(:) = std(Data1);
Expected_Vals(1,2) = std(Data1);
sigma2(:) = std(Data2);
Expected_Vals(2,2) = std(Data2);
p1 = pdf('Normal',Data1,mu1,sigma1);
p2 = pdf('Normal',Data2,mu2,sigma2);
(figure)
plot(Data1,p1,'.r');
xlabel(sprintf(' %s (Pa)',stress));
ylabel('P(x)');
title(sprintf('LogNormal PDF of %s by Rock Type', stress));
hold on;
plot(Data2,p2,'.k');
hold off
if Well_Type == [3 1]
legend(sprintf('Leonard A Shale (%d)',n_Data1),sprintf('Massive Carbonate (%d)',n_Data2));
sprintf(' ratio of massive carbonate %s to Lnrd A shale %s is %.2f',stress,stress ,mean_val(3)')
if (xx==8);
if mean_val(3)>(normal_ranges(3,1).*.1+(normal_ranges(3,1))) || mean_val(3)<((normal_ranges(3,1)-normal_ranges(3,1).*.1))
sprintf(' ratio of massive carbonate %s to Lnrd A shale %s is outside the expected range. QCing results is reccomended', stress,stress)
else
sprintf(' ratio of massive carbonate %s to Lnrd A shale %s is in the expected range.', stress,stress)
end
end
if (xx==11);
if mean_val(3)>(normal_ranges(4,1).*.1+(normal_ranges(4,1))) || mean_val(3)<((normal_ranges(4,1))-normal_ranges(4,1).*.1)
sprintf(' ratio of massive carbonate %s to Lnrd A shale %s is outside the expected range. QCing results is reccomended', stress,stress)
else
sprintf(' ratio of massive carbonate %s to Lnrd A shale %s is in the expected range.', stress,stress)
end
end
end
if Well_Type == [4 1]
legend(sprintf('Leonard B Upper Shale (%d)',n_Data1),sprintf('Massive Carbonate (%d)',n_Data2));
sprintf(' ratio of massive carbonate %s to Lnrd A shale %s is %.2f', stress,stress,mean_val(3)')
if xx==8;
if mean_val(3)>(normal_ranges(3,1).*.1+(normal_ranges(3,1))) || mean_val(3)<(normal_ranges(3,1)-normal_ranges(3,1).*.1)
sprintf(' ratio of massive carbonate %s to Lnrd A Upper shale %s is outside the expected range. QCing results is reccomended', stress,stress)
else
sprintf(' ratio of massive carbonate %s to Lnrd A Upper shale %s is in the expected range.', stress,stress)
end
if (xx==11);
if mean_val(3)>(normal_ranges(4,1).*.1+(normal_ranges(4,1))) || mean_val(3)<((normal_ranges(4,1)-normal_ranges(4,1).*.1))
sprintf(' ratio of massive carbonate %s to Lnrd A Upper shale %s is outside the expected range. QCing results is reccomended', stress,stress)
else
sprintf(' ratio of massive carbonate %s to Lnrd A Upper shale %s is in the expected range.', stress,stress)
end
end
end
end
if Well_Type == [3 2]
legend(sprintf('Leonard A Shale (%d)',n_Data1),sprintf('Leonard A Carbonate (%d)',n_Data2));
sprintf(' ratio of Massive carbonate %s to Lnrd B Upper shale %s is %.2f',stress,stress, mean_val(3)')
if xx==8;
if mean_val(3)>(normal_ranges(3,1).*.1+(normal_ranges(3,1))) || mean_val(3)<((normal_ranges(3,1)-normal_ranges(3,1).*.1))
sprintf(' ratio of Leonard A carbonate %s to Lnrd A shale %s is outside the expected range. QCing results is reccomended', stress,stress)
else
sprintf(' ratio of Leonard A carbonate %s to Lnrd A shale %s is in the expected range.', stress,stress)
end
end
if xx==11;
if mean_val(3)>(normal_ranges(4,1).*.1+(normal_ranges(4,1))) || mean_val(3)<((normal_ranges(4,1)-normal_ranges(4,1).*.1))
sprintf(' ratio of Leonard A carbonate %s to Lnrd A shale %s is outside the expected range. QCing results is reccomended', stress,stress)
else
sprintf(' ratio of Leonard A carbonate %s to Lnrd A shale %s is in the expected range.', stress,stress)
end
end
end
if Well_Type == [4 2 ]
legend(sprintf('Leonard B Upper Shale (%d)',n_Data1),sprintf('Leonard B Carbonate (%d)',n_Data2));
sprintf(' ratio of Leonard carbonate %s to Leonard B Upper shale %s is %.2f', stress,stress, mean_val(3)')
if xx==8;
if mean_val(3)>(normal_ranges(3,1).*.1+(normal_ranges(3,1))) || mean_val(3)<((normal_ranges(3,1)-normal_ranges(3,1).*.1))
sprintf(' ratio of Leonard B carbonate %s to Lnrd B Upper shale %s is outside the expected range. QCing results is reccomended', stress,stress)
else
sprintf(' ratio of Leonard B carbonate %s to Lnrd B Upper shale %s is in the expected range.', stress,stress)
end
end
if (xx==11);
if mean_val(3)>(normal_ranges(4,1).*.1+(normal_ranges(4,1))) || mean_val(3)<((normal_ranges(4,1)-normal_ranges(4,1).*.1))
sprintf(' ratio of Leonard B carbonate %s to Lnrd B upper shale %s is outside the expected range. QCing results is reccomended', stress,stress)
else
sprintf(' ratio of Leonard B carbonate %s to Lnrd B upper shale %s is in the expected range.', stress,stress)
end
end
end
end