Skip to content
Snippets Groups Projects
Commit a76df6f9 authored by nadolski's avatar nadolski
Browse files

ÂÍŀÄ?ÊÊÑÅþ€€Ñ>€êÑ>ŬåÁÈÄÇÊ?_€ø?ÍʀÌр€Ž

parent 2571e8ad
No related branches found
No related tags found
No related merge requests found
......@@ -477,10 +477,12 @@ void Cell_Twiss(long i0, long i1, ss_vect<tps> &Ascr, bool chroma, bool ring,
16/10/03 Modified convergence test: now done for both planes
01/09/10 Modify the convergence criteria on relative diff of the chroma value
The previous test does not work well for non zero chromaticities
Test convergence changed if chroma closed to zero
****************************************************************************/
#define n 4
#define chromeps 1e-6 /* convergence condition for chromaticity computation */
#define LOG10 log(10.0)
#define ZEROCHRO 0.1
void Ring_Getchrom(double dP) {
long int lastpos = 0;
......@@ -546,6 +548,10 @@ void Ring_Getchrom(double dP) {
Norm_TEMP = sqrt(TEMP[0] * TEMP[0] + TEMP[1] * TEMP[1]);
NORMchro = sqrt(globval.Chrom[0] * globval.Chrom[0] + globval.Chrom[1]
* globval.Chrom[1]);
// if chroma closed to zero, norm is one for avoiding divergence of convergence test
if (NORMchro < ZEROCHRO){
NORMchro = 1.0;
}
// TEST CHROMA convergence
if (trace) {
......@@ -572,6 +578,7 @@ void Ring_Getchrom(double dP) {
#undef n
#undef chromeps
#undef LOG10
#undef ZEROCHRO
/****************************************************************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment