imagestring($img[$imagenum], 5, $legendx + 15, $legendy - 7, $legendname, $color[12]); } $colornum = 0; $beammass = getthismass($A, $Z); printf("%.1f", $meanQ); echo "</div><div class=\"t4\">\n"; printf("(%d) %.3f", floor($meanQ), ($beammass - floor($meanQ) * $emass) / floor($meanQ)); echo "</div><div class=\"t4\">\n"; printf("(%d) %.3f", ceil($meanQ), ($beammass - ceil($meanQ) * $emass) / ceil($meanQ)); echo "</div><div class=\"buff\"></div>"; for ($j = 0; $j < sizeof($cocktailA); $j++) { for ($k = 1; $k < $cocktailZ[$j]; $k++) { if ($cocktailA[$j] == $A && $cocktailZ[$j] == $Z) { continue; } $thismass = getthismass($cocktailA[$j], $cocktailZ[$j]); if (($thismass - $k * $emass) / $k > ($beammass - $Q * $emass) / $Q - ($beammass - $Q * $emass) / $Q * (0.5 / $Resolve) && ($thismass - $k * $emass) / $k < ($beammass - $Q * $emass) / $Q + ($beammass - $Q * $emass) / $Q * (0.5 / $Resolve)) { for ($ii = 0; $ii < sizeof($BadZ[$Liner]); $ii++) { if ($cocktailZ[$j] == $BadZ[$Liner][$ii]) { echo "<div class=\"t2\">\n"; echo "<SUP>"; echo $cocktailA[$j]; echo "</SUP>"; echo $Element[$cocktailZ[$j]]; echo "</div><div class=\"t3\">\n"; echo $k; echo "</div><div class=\"t3\">\n"; printf("%.3f", ($thismass - $k * $emass) / $k); echo "</div><div class=\"t4\">\n"; $X = 3.86 * sqrt($BeamEnergy * $cocktailA[$j] / $cocktailA[$j] / pow($cocktailZ[$j], 0.45)); $meanQ = $cocktailZ[$j] * pow(1 + pow($X, -1 / 0.6), -0.6);
} echo "\n</TABLE>\n"; echo "<div class=\"buff\"></div>"; echo "<div class=\"t11\">"; $imagenum = 1; //DRAW BORDER AROUND GRAPH $leftx = $plotmarginleft; $rightx = $plotwidth - $plotmarginother - $plotlegendmargin; $topy = $plotmarginother; $bottomy = $plotheight - $plotmarginbottom; imageline($img[$imagenum], $leftx, $topy, $rightx, $topy, $color[12]); imageline($img[$imagenum], $rightx, $topy, $rightx, $bottomy, $color[12]); imageline($img[$imagenum], $rightx, $bottomy, $leftx, $bottomy, $color[12]); imageline($img[$imagenum], $leftx, $bottomy, $leftx, $topy, $color[12]); // Draw RFQ Acceptance $beammass = getthismass($A, $Z); $v = sqrt(2 * $Vbias / (($beammass - $Q * $emass) * 1.66E-27 / ($Q * 1.602E-19))); $t = $l / $v; $x1 = ($t - $RFQaccept / 2 - $xmin[$imagenum]) * $xscale[$imagenum] + $plotmarginleft; $x2 = ($t + $RFQaccept / 2 - $xmin[$imagenum]) * $xscale[$imagenum] + $plotmarginleft; imageline($img[$imagenum], $x1, $topy, $x1, $bottomy, $color[5]); imageline($img[$imagenum], $x2, $topy, $x2, $bottomy, $color[5]); imagestring($img[$imagenum], 5, ($x2 - $x1) / 2 + $x1 - 6, $topy + 15, "B", $color[12]); $x1 = ($t + 1 / 35000000.0 - $RFQaccept / 2 - $xmin[$imagenum]) * $xscale[$imagenum] + $plotmarginleft; $x2 = ($t + 1 / 35000000.0 + $RFQaccept / 2 - $xmin[$imagenum]) * $xscale[$imagenum] + $plotmarginleft; imagestring($img[$imagenum], 5, ($x2 - $x1) / 2 + $x1 - 10, $topy + 15, "B+1", $color[12]); imageline($img[$imagenum], $x1, $topy, $x1, $bottomy, $color[5]); imageline($img[$imagenum], $x2, $topy, $x2, $bottomy, $color[5]); $x1 = ($t - 1 / 35000000.0 - $RFQaccept / 2 - $xmin[$imagenum]) * $xscale[$imagenum] + $plotmarginleft; $x2 = ($t - 1 / 35000000.0 + $RFQaccept / 2 - $xmin[$imagenum]) * $xscale[$imagenum] + $plotmarginleft; imagestring($img[$imagenum], 5, ($x2 - $x1) / 2 + $x1 - 10, $topy + 15, "B-1", $color[12]);
// End of species of interest charge state loop echo "<BR><BR><BR>"; } // End of submit 69 if ($_POST['submit2'] && $AQ > 0) { echo "<BR>\n"; echo "<BR>\n"; echo "<div class=\"buff\"></div>"; echo "This list includes any stable species with an A/Q value within +/- 0.5% (1/100 resolving power of magnet) of the species of interest entered above, "; printf("%.3f", $AQ); echo ". Obviously not all of these stable species will be present and the amount of each species will depend on the operating conditions of the CSB (temperature/pressure etc.) as well as the recent CSB history (i.e. isotopes recently injected into the device).<BR>\n"; echo "<BR>\n"; echo "<BR>\n"; echo "</div><div class=\"t3\">\n"; for ($j = 0; $j < sizeof($StableZ); $j++) { $thismass = getthismass($StableA[$j], $StableZ[$j]); for ($k = 1; $k < $StableZ[$j]; $k++) { if (($thismass - $k * $emass) / $k > $AQ - $AQ * (0.5 / $Resolve) && ($thismass - $k * $emass) / $k < $AQ + $AQ * (0.5 / $Resolve)) { $jj = 0; for ($ii = 0; $ii < sizeof($BadZ[$Liner]); $ii++) { if ($StableZ[$j] == $BadZ[$Liner][$ii]) { echo "<font color='#FF0000'>"; $jj = 1; break; } } echo "<SUP>"; echo $StableA[$j]; echo "</SUP>"; echo $Element[$StableZ[$j]]; echo "<SUP>";