Commit 86f9f592 authored by John Douglas Veitch's avatar John Douglas Veitch

Merge branch 'fix_eos' into 'fix_eos'

Fix eos

See merge request john-veitch/lalsuite!4
parents e851abf2 a11c0a54
......@@ -905,6 +905,7 @@ LALInferenceModel *LALInferenceInitCBCModel(LALInferenceRunState *state) {
LALInferenceModel *model = XLALMalloc(sizeof(LALInferenceModel));
model->params = XLALCalloc(1, sizeof(LALInferenceVariables));
memset(model->params, 0, sizeof(LALInferenceVariables));
model->eos_fam = NULL;
UINT4 signal_flag=1;
ppt = LALInferenceGetProcParamVal(commandLine, "--noiseonly");
......
......@@ -825,6 +825,26 @@ void LALInferenceTemplateXLALSimInspiralChooseWaveform(LALInferenceModel *model)
k2_2 = XLALSimNeutronStarLoveNumberK2(m2*LAL_MSUN_SI, eos_fam);
lambda2 = (2./3.)*k2_2 * pow(r2/(m2*LAL_MRSUN_SI), 5.0);
}
/* Calculate maximum frequency */
/* If both lambdas are non-zero compute EOS-dependent f_max */
if((lambda1 > 0) && (lambda2 > 0) && (approximant == TaylorF2))
{
/* Start with ISCO */
f_max = 1. / (pow(6,1.5) * LAL_PI * (m1*LAL_MTSUN_SI + m2*LAL_MTSUN_SI));
REAL8 log_lambda1 = log(lambda1);
REAL8 log_lambda2 = log(lambda2);
REAL8 compactness1 = 0.371 - 0.0391 * log_lambda1 + 0.001056 * log_lambda1 * log_lambda1;
REAL8 compactness2 = 0.371 - 0.0391 * log_lambda2 + 0.001056 * log_lambda2 * log_lambda2;
REAL8 rad1 = m1*LAL_MTSUN_SI / compactness1;
REAL8 rad2 = m2*LAL_MTSUN_SI / compactness2;
/* Use the smaller of ISCO and the EOS-dependent termination */
REAL8 fmax_eos = 1. / LAL_PI * pow((m1*LAL_MTSUN_SI + m2*LAL_MTSUN_SI) / pow((rad1 + rad2),3.0),0.5);
if (fmax_eos < f_max)
{
f_max = fmax_eos;
}
}
/* Add derived quantities for output */
LALInferenceAddVariable(model->params, "radius1", &r1, LALINFERENCE_REAL8_t, LALINFERENCE_PARAM_OUTPUT);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment