Carrying Capacity Tool

<!--Amphibian Population Management Tool
Carrying Capacity Tool Calculation Code Version 1
R. Andrew Odum
Toledo Zoological Society
Toledo, Ohio USA
October 2010 -->
<?php
$T = (float) $_REQUEST['T'];
$Program_Duration_Years = (float) $_REQUEST['Program_Duration']; // This is years of program
$F_Males = (int) $_REQUEST['F_Males']; //founding males
$F_Females = (int) $_REQUEST['F_Females']; // founding females
$Program_Duration_G = floor(($Program_Duration_Years / $T)); // this is progam generation in generations (calculated from years)
// $Program_Duration_G is an integer value, function above floor()
//$N_Breed = $N_Found * $P_F_Breed;
// calculate GD initial from sex ratio, define base carrying capacity
$N = $F_Males + $F_Females; // total foudners
$Ne_i = (4 * $F_Males * $F_Females) / ($F_Males + $F_Females); // sex ratio calculations
$GD_i = 1-(1/(2*$Ne_i)); // intitial GD in founders
$NeN = $Ne_i/$N; //NeN ratio
$K_G = $N; // starting K for groups is number of founders
$K_P = $N; // starting K for Pedigree managed pop is number of founders
if ($GD_i >= 0.9)
{
$Running_GD = $GD_i;
//LOOP for Pedigree
do {
$GD_loss_G = (1 - (1 /(2*$K_P*0.3))); // Genetic diversity lost per generation after founding event for this K
$GD_loss_0 = (1 - (1 /(2*$K_P))); // Gentic lost in first generation increased from founders to this K
$Running_GD = $GD_i * $GD_loss_0; // The initial GD after founders breed to carrying capacity
$Generation_count = 2; // First generation after founding generation set to Generation 2
do
{
$Running_GD = $Running_GD * $GD_loss_G; // Calculate loss for this gernation
$Generation_count = $Generation_count + 1; // increase Count generation until <0.9
}
while ($Running_GD > 0.9); // Check when you reach 0.9
$K_P = $K_P + 1; //Increase K and try again
}
while($Program_Duration_G > $Generation_count and $K_P < 10000); /// Generations for 90% hit Gen_Dur but K is not over 10,000
// LOOP for Group Management SEE COMMENTS ABOVE
do {
$GD_loss_G = (1 - (1 /(2*$K_G*0.15)));
$Running_GD = $GD_i;
$GD_loss_0 = (1 - (1 /(2*$K_P)));
$Running_GD = $GD_i * $GD_loss_0;
$Generation_count = 2;
do
{
$Running_GD = $Running_GD * $GD_loss_G;
$Generation_count = $Generation_count + 1;
}
while ($Running_GD > 0.9);
$K_G = $K_G + 1;
}
while($Program_Duration_G > $Generation_count and $K_G < 10000); /// Generations for 90% hit Gen_Dur
}
else {
$GD_loss_0 = 1;
$K_G = " (Not Possible! Initial GD < 0.9)";
$K_P = " (Not Possible! Initial GD < 0.9)";
}
?>
<p class="style2">&nbsp;<span class="Heading">Results - </span>
<span class="auto-style4">The Amphibian Population Management
Toolbox&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>
<img alt="Pop Frog" height="108" src="Frog/Frog_04%20Small.gif" width="100" /></p>
<hr class="style1" />
<p class="style1"><span class="auto-style1">Carrying Capacity to Maintain at Least 90% GD for Program
Duration</span><span class="auto-style6"> </span> </p>
<p class="auto-style5" />
<?php
if ($K_P < 10000)
{
echo "<p> Carrying Capacity Pedigree Management
$K_P</p>";
}
else {
echo "<p> Carrying Capacity Is Greater Than 10,000!</p>";
}
if ($K_G < 10000)
{
echo "<p> Carrying Capacity Group Management
$K_G</p>";
}
else {
echo "<p> Carrying Capacity Is Greater Than 10,000!</p>";
}
?>
<hr class="style1" />
<p class="auto-style3">Genetic Statistics </p>
<?php
$GD_Gen_1 = ($GD_i * $GD_loss_0); // This is the GD lost in first generation of progeny produced by founders
$Ne_i=round($Ne_i,5);
$NeN=round($NeN,5);
$GD_i=round($GD_i,5);
$GD_Gen_1=round($GD_Gen_1,5);
echo "<p>
echo "<p>
echo "<p>
echo "<p>
?>
Ne of Founding Event
$Ne_i</p>";
Ne/N of Founding Event
$NeN</p>";
GD Represented in Founders
$GD_i</p>";
GD Captured at Founding Event $GD_Gen_1 (Total GD held in the offspring of the founders - Generation 1)</p>";
<p class="style4">It is assumed that the population size can be increased to carrying capacity in the founding generation </p>
<hr />
<p class="auto-style3">Data Entered </p>
<?php
echo "<p>
echo "<p>
echo "<p>
echo "<p>
Male Founders
Female Founders
Gen Time
Program Duration
$F_Males</p>";
$F_Females</p>";
$T</p>";
$Program_Duration_Years</p>";
?>
<p class="style2" ondblclick="FP_callJS('print()')"><strong>&nbsp;<img alt="Print results" height="20" onclick="FP_callJS('print()')"
src="button3.jpg" width="100" /></strong></p>
<p class="style2" ondblclick="FP_callJS('print()')"><a
href="Carry_Cap_Val.php"><strong>Return</strong></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>