Hi Amber users,
I'm trying to add ions to make a certain ionic concentration for my system, like 0.15 mol/L KCL.
And I search in the mail list and find Thomas Cheatham III's script:
--tec3
molarity.perl
#!/usr/sbin/perl
$molar = $ARGV[0];
$box_x = $ARGV[1];
$box_y = $ARGV[2];
$box_z = $ARGV[3];
$box_a = $ARGV[4];
$box_b = $ARGV[5];
$box_g = $ARGV[6];
if ($box_x == 0) {
printf("Usage: molarity box-x box-y box-z alpha beta gamma\n");
die;
}
if ($box_y == 0) {
$box_y = $box_x;
}
if ($box_z == 0) {
$box_z = $box_x;
}
if ($box_a == 0) {
$box_a = 90.0;
}
if ($box_b == 0) {
$box_b = $box_a;
}
if ($box_g == 0) {
$box_g = $box_a;
}
$torad = 2 * 3.141592654 / 360.0;
$rad_a = $box_a * $torad;
$rad_b = $box_b * $torad;
$rad_g = $box_g * $torad;
$angles = 1 - cos($rad_a)*cos($rad_a) - cos($rad_b)*cos($rad_b) - cos($rad_g)*cos($rad_g);
$angles += 2 * cos($rad_a)*cos($rad_b)*cos($rad_g);
$angles = sqrt($angles);
$volume = $box_x * $box_y * $box_z * $angles;
$molecules = 6.022 * $volume * $molar / 10000;
printf(" MOLARITY = %8.3f\n", $molar);
printf(" Box size = %8.3f %8.3f %8.3f %8.3f %8.3f %8.3f\n", $box_x, $box_y, $box_z, $box_a, $box_b, $box_g);
printf(" Volume = %8.3f\n", $volume);
printf("\n %8.3f molecules are necessary to make a molarity of %6.2f M\n\n", $molecules, $molar);
I'm wondering how to get the x,y,z and alpha, beta, gamma value?
I reviewed the leap.log files and not sure about what these value are.
Does anyone use this scrip to count the ion number?
Thanks a lot.
Ren Kong Ph.D.
Methodist. Leading Medicine. Ranked by U.S.News & World Report as one of America's "Best Hospitals" in 13 specialties. Named to FORTUNEĀ® Magazine's "100 Best Companies to Work ForĀ®" list seven years in a row. Designated as a Magnet hospital for excellence in nursing. Visit us at methodisthealth.com. Follow us at twitter.com/MethodistHosp and www.facebook.com/MethodistHospital. ***CONFIDENTIALITY NOTICE*** This e-mail is the property of The Methodist Hospital and/or its relevant affiliates and may contain restricted and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender and delete all copies of the message. Thank you.
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Wed Aug 08 2012 - 10:00:06 PDT