Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Commit

Permalink
fixed bug in toro et al 2002 for periods equal to 3 and 4 s
Browse files Browse the repository at this point in the history
  • Loading branch information
monellid committed Jul 11, 2012
1 parent 5c0c714 commit 76da55a
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 10 deletions.
Expand Up @@ -126,22 +126,22 @@ public double[] computeStyleOfFaultingTerm(final int iper, final double rake) {
f[0] = 1.0;
f[1] = 0.0;
f[2] = f[0]
* Math.pow(AdjustFactorsSHARE.Frss[iper],
* Math.pow(AdjustFactorsSHARE.Frss_CAMPBELL2003[iper],
(1 - AdjustFactorsSHARE.pR))
* Math.pow(AdjustFactorsSHARE.Fnss, -AdjustFactorsSHARE.pN);
} else if (rake > AdjustFactorsSHARE.FLT_TYPE_REVERSE_RAKE_LOWER
&& rake <= AdjustFactorsSHARE.FLT_TYPE_REVERSE_RAKE_UPPER) {
f[0] = 0.0;
f[1] = 1.0;
f[2] = f[1]
* Math.pow(AdjustFactorsSHARE.Frss[iper],
* Math.pow(AdjustFactorsSHARE.Frss_CAMPBELL2003[iper],
-AdjustFactorsSHARE.pR)
* Math.pow(AdjustFactorsSHARE.Fnss,
(1 - AdjustFactorsSHARE.pN));
} else {
f[0] = 0.0;
f[1] = 0.0;
f[2] = Math.pow(AdjustFactorsSHARE.Frss[iper],
f[2] = Math.pow(AdjustFactorsSHARE.Frss_CAMPBELL2003[iper],
-AdjustFactorsSHARE.pR)
* Math.pow(AdjustFactorsSHARE.Fnss, -AdjustFactorsSHARE.pN);
}
Expand Down
Expand Up @@ -133,7 +133,7 @@ public double[] computeStyleOfFaultingTerm(final int iper, final double rake) {
f[0] = 1.0;
f[1] = 0.0;
f[2] = f[0]
* Math.pow(AdjustFactorsSHARE.Frss[iper],
* Math.pow(AdjustFactorsSHARE.Frss_TORO2002[iper],
(1 - AdjustFactorsSHARE.pR))
* Math.pow(AdjustFactorsSHARE.Fnss,
-AdjustFactorsSHARE.pN);
Expand All @@ -142,14 +142,14 @@ public double[] computeStyleOfFaultingTerm(final int iper, final double rake) {
f[0] = 0.0;
f[1] = 1.0;
f[2] = f[1]
* Math.pow(AdjustFactorsSHARE.Frss[iper],
* Math.pow(AdjustFactorsSHARE.Frss_TORO2002[iper],
-AdjustFactorsSHARE.pR)
* Math.pow(AdjustFactorsSHARE.Fnss,
(1 - AdjustFactorsSHARE.pN));
} else {
f[0] = 0.0;
f[1] = 0.0;
f[2] = Math.pow(AdjustFactorsSHARE.Frss[iper],
f[2] = Math.pow(AdjustFactorsSHARE.Frss_TORO2002[iper],
-AdjustFactorsSHARE.pR)
* Math.pow(AdjustFactorsSHARE.Fnss,
-AdjustFactorsSHARE.pN);
Expand Down
Expand Up @@ -10,7 +10,7 @@ public class AdjustFactorsSHARE {
*/
public static final double[] AFrock_TORO2002 = { 0.735106, 0.419632,
0.477379, 0.888509, 1.197291, 1.308267, 1.30118, 1.265762,
1.215779};
1.215779, 1.215779, 1.215779};

public static final double[] AFrock_CAMPBELL2003 = { 0.735106, 0.474275,
0.423049, 0.550323, 0.730061, 0.888509, 1.094622, 1.197291,
Expand All @@ -25,7 +25,7 @@ public class AdjustFactorsSHARE {
*/
public static final double[] sig_AFrock_TORO2002 = { 0.338916, 0.289785,
0.320650, 0.352442, 0.281552, 0.198424, 0.1910745, 0.154327,
0.155520};
0.155520, 0.155520, 0.155520};

public static final double[] sig_AFrock_CAMBPELL2003 = { 0.338916,
0.283461, 0.289785, 0.345375, 0.365490, 0.352442, 0.315477,
Expand All @@ -35,7 +35,11 @@ public class AdjustFactorsSHARE {
* Style-of-faulting adjustment coefficients, obtained from Table 7 (Drouet
* et al 2010) and using a cubic spline interpolation
*/
public static final double[] Frss = { 1.220000, 1.080745, 0.986646,
public static final double[] Frss_TORO2002 = {1.220000, 0.935198, 0.907936,
1.080000, 1.190000, 1.230000, 1.230000, 1.177500, 1.140000, 1.140000,
1.140000};

public static final double[] Frss_CAMPBELL2003 = { 1.220000, 1.080745, 0.986646,
0.931209, 0.910332, 0.985998, 1.080000, 1.150000, 1.190000,
1.230000, 1.191702, 1.177500, 1.194705, 1.140000, 1.140000,
1.140000 };
Expand Down Expand Up @@ -66,7 +70,7 @@ public class AdjustFactorsSHARE {
public static void main(String[] args) {
System.out.println(AFrock_TORO2002.length);
System.out.println(sig_AFrock_TORO2002.length);
System.out.println(Frss.length);
System.out.println(Frss_CAMPBELL2003.length);
}

}
Expand Up @@ -140,6 +140,48 @@ public void checkSetPeriodIndexGetStd(){
assertTrue(toro2002SHARE.getStdDev()==
toro2002SHARE.getStdDev(iper, mag, rJB, stdDevType));
}

/**
* Check SA at T = 3 s
*/
@Test
public final void sa3s(){
double mag = 5.0;
double rJB = 10.0;
double rake = 0.0;
double period = 3.0;
String stdDevType = StdDevTypeParam.STD_DEV_TYPE_TOTAL;
int iper = ArrayUtils.indexOf(ToroEtAl2002Constants.PERIOD,period);
toro2002SHARE.getParameter(MagParam.NAME).setValue(mag);
toro2002SHARE.getParameter(DistanceJBParameter.NAME).setValue(rJB);
toro2002SHARE.getParameter(RakeParam.NAME).setValue(rake);
toro2002SHARE.getParameter(PeriodParam.NAME).setValue(period);
toro2002SHARE.getParameter(StdDevTypeParam.NAME).setValue(stdDevType);
toro2002SHARE.setIntensityMeasure(SA_Param.NAME);
assertTrue(toro2002SHARE.getStdDev()==
toro2002SHARE.getStdDev(iper, mag, rJB, stdDevType));
}

/**
* Check SA at T = 4 s
*/
@Test
public final void sa4s(){
double mag = 5.0;
double rJB = 10.0;
double rake = 0.0;
double period = 4.0;
String stdDevType = StdDevTypeParam.STD_DEV_TYPE_TOTAL;
int iper = ArrayUtils.indexOf(ToroEtAl2002Constants.PERIOD,period);
toro2002SHARE.getParameter(MagParam.NAME).setValue(mag);
toro2002SHARE.getParameter(DistanceJBParameter.NAME).setValue(rJB);
toro2002SHARE.getParameter(RakeParam.NAME).setValue(rake);
toro2002SHARE.getParameter(PeriodParam.NAME).setValue(period);
toro2002SHARE.getParameter(StdDevTypeParam.NAME).setValue(stdDevType);
toro2002SHARE.setIntensityMeasure(SA_Param.NAME);
assertTrue(toro2002SHARE.getStdDev()==
toro2002SHARE.getStdDev(iper, mag, rJB, stdDevType));
}

private void validateMedian(double rake, double[][] table) {
String[] columnDescr = TABLE_HEADER_MEDIAN[0].trim().split("\\s+");
Expand Down

0 comments on commit 76da55a

Please sign in to comment.