-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProbabilities.cs
More file actions
234 lines (195 loc) · 6.8 KB
/
Copy pathProbabilities.cs
File metadata and controls
234 lines (195 loc) · 6.8 KB
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
using System;
namespace AlphaChain
{
/// <summary>
/// This class calculates probabilities of one-quasiparticle transitions.
/// Shura
/// </summary>
public class Probabilities
{
public Probabilities()
{
IN = 0;
IZ = 0;
}
public Probabilities(int IN, int IZ)
{
this.IN = IN;
this.IZ = IZ;
}
private readonly int IZ, IN;
public static int Levels, Nuclei;
private double TE1, TE2, TE3, TE4, TE5;
private double TM1, TM2, TM3, TM4, TM5;
private void SetParameters(int nucleus)
{
int N = IN - 2 * nucleus;
int Z = IZ - 2 * nucleus;
double IA = Z + N;
double BE1 = 6.446E-2 * Math.Pow(IA, (2.0 / 3.0));
double BE2 = 5.940E-2 * Math.Pow(IA, (4.0 / 3.0));
double BE3 = 5.940E-2 * Math.Pow(IA, (2.0));
double BE4 = 6.285E-2 * Math.Pow(IA, (8.0 / 3.0));
double BE5 = 6.928E-2 * Math.Pow(IA, (10.0 / 3.0));
double BM1 = 1.790;
double BM2 = 1.650 * Math.Pow(IA, (2.0 / 3.0));
double BM3 = 1.650 * Math.Pow(IA, (4.0 / 3.0));
double BM4 = 1.746 * Math.Pow(IA, (2.0));
double BM5 = 1.924 * Math.Pow(IA, (8.0 / 3.0));
TE1 = 1.587E15 * BE1;
TE2 = 1.223E9 * BE2;
TE3 = 5.698E2 * BE3;
TE4 = 1.694E-4 * BE4;
TE5 = 3.451E-11 * BE5;
TM1 = 1.779E13 * BM1;
TM2 = 1.371E7 * BM2;
TM3 = 6.387E0 * BM3;
TM4 = 1.899E-6 * BM4;
TM5 = 3.868E-13 * BM5;
}
private double GetProbability(int state1, int state2, int nuclei, ref string tr)
{
int spin1 = new int();
int spin2 = new int();
double E1 = new double();
double E2 = new double();
double parity1 = new double();
double parity2 = new double();
ReadData rd = new ReadData(IN, IZ);
SetParameters(nuclei);
rd.ReadString(state1, nuclei, ref E1, ref spin1, ref parity1);
rd.ReadString(state2, nuclei, ref E2, ref spin2, ref parity2);
int spin = Math.Abs((spin1 - spin2) / 2);
double parity = parity1 * parity2;
double DeltaE = Math.Abs(E1 - E2);
double Probability;
switch (spin)
{
case 1:
if (parity.Equals(-1.0))
{
Probability = this.TE1 * Math.Pow(DeltaE, 3.0);
tr = "E1";
}
else
{
Probability = this.TM1 * Math.Pow(DeltaE, 3.0);
tr = "M1";
}
break;
case 2:
if (parity.Equals(-1.0))
{
Probability = this.TM2 * Math.Pow(DeltaE, 5.0);
tr = "M2";
}
else
{
Probability = this.TE2 * Math.Pow(DeltaE, 5.0);
tr = "E2";
}
break;
case 3:
if (parity.Equals(-1.0))
{
Probability = this.TE3 * Math.Pow(DeltaE, 7.0);
tr = "E3";
}
else
{
Probability = this.TM3 * Math.Pow(DeltaE, 7.0);
tr = "M3";
}
break;
case 4:
if (parity.Equals(-1.0))
{
Probability = this.TM4 * Math.Pow(DeltaE, 9.0);
tr = "M4";
}
else
{
Probability = this.TE4 * Math.Pow(DeltaE, 9.0);
tr = "E4";
}
break;
case 5:
if (parity.Equals(-1.0))
{
Probability = this.TE5 * Math.Pow(DeltaE, 11.0);
tr = "E5";
}
else
{
Probability = this.TM5 * Math.Pow(DeltaE, 11.0);
tr = "M5";
}
break;
default:
{
Probability = 0;
tr = "isomeric";
}
break;
}
return Probability;
}
public double GetMaxProbability(int state, int nuclei, ref int EndState, ref string tr)
{
double probability;
double MaxProb = new double();
string tr1 = "null";
if (state > 0)
{
for (int i = state - 1; i >= 0; i--)
{
probability = GetProbability(state, i, nuclei, ref tr1);
if (probability > MaxProb)
{
MaxProb = probability;
EndState = i;
tr = tr1;
}
}
}
return MaxProb;
}
public bool IsIsomeric(int state, int nuclei, ref double Qatr,
ref double Talpha)
{
double ltGamma, ltAlpha, Qalpha;
int EndState = new int();
int N = IN - 2 * nuclei;
int Z = IZ - 2 * nuclei;
double Ep = new double(), Ed = new double();
string tr = "null";
ReadData rd = new ReadData(IN, IZ);
Qalpha = rd.Qa(N, Z);
for (int i = 0; i < ReadData.nLevels; i++)
{
if (rd.Nils[nuclei, state].Equals(rd.Nils[nuclei + 1, i]))
{
Ep = rd.E[nuclei, state];
Ed = rd.E[nuclei + 1, i];
}
}
Qatr = Qalpha + Ep - Ed;
ltAlpha = rd.Ta(Z, N, Qatr);
ltGamma = 1.0 / GetMaxProbability(state, nuclei, ref EndState, ref tr);
Talpha = ltAlpha;
if (ltGamma < ltAlpha) return false;
else
return true;
}
public int GetTransitionWay(int state, int nuclei)
{
ReadData rd = new ReadData(IN, IZ);
int ind = new int();
for (int i = 0; i < ReadData.nLevels; i++)
{
if (rd.Nils[nuclei, state].Equals(rd.Nils[nuclei + 1, i])) ind = i;
}
return ind;
}
}
}