Model_Name  		= "Fitness";
Model_EFV_Type		= "User Defined Vector";
Model_Options 		= 8;
Model_Dimension 	= 20;
Model_Data_Type		= 1;

aaCodes = {{"A",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"K",
"L",
"M",
"N",
"P",
"Q",
"R",
"S",
"T",
"V",
"W",
"Y"}};

function GUIPopulateModelMatrix (ModelMatrixName&, EFV)
{
	ModelMatrixName = {20,20};
	EFV				= {20,1};
	
	commandString = "";
	
	for (rI = 1; rI < 20; rI = rI+1)
	{
		commandString = commandString + "global globalVariable_F_" + aaCodes[rI] + 
						"=0; global globalVariable_FR_" + aaCodes[rI] +
						":>-1e10;\n";
	}
	
	ExecuteCommands (commandString);
	
	for (cI = 1; cI < 20; cI = cI+1)
	{
		commandString = "ModelMatrixName[0]["+cI+"]:=t*(1+(globalVariable_F_" + 
						 aaCodes[cI] + "<0)*(Exp(globalVariable_F_"+
						 aaCodes[cI] + ")-1));\n" + 
						 "ModelMatrixName["+cI+"][0]:=t*(1+(0>" + "globalVariable_F_" + 
						 aaCodes[cI] + ")*(Exp(-globalVariable_F_"+
						 aaCodes[cI] + ")-1));\n"; 
		ExecuteCommands	 (commandString);
	}

	for (rI = 1; rI < 19; rI = rI+1)
	{
		for (cI = rI+1; cI < 20; cI = cI+1)
		{
			commandString = "ModelMatrixName["+rI+"]["+cI+"]:=t*(1+(globalVariable_F_" + 
							 aaCodes[cI] + "<" + "globalVariable_F_" + 
							 aaCodes[rI] + ")*(Exp(globalVariable_F_"+
							 aaCodes[cI] + "-globalVariable_F_"+
							 aaCodes[rI] + ")-1));\n" + 
							 "ModelMatrixName["+cI+"]["+rI+"]:=t*(1+(globalVariable_F_" + 
							 aaCodes[rI] + "<" + "globalVariable_F_" + 
							 aaCodes[cI] + ")*(Exp(globalVariable_F_"+
							 aaCodes[rI] + "-globalVariable_F_"+
							 aaCodes[cI] + ")-1));\n"; 
			ExecuteCommands	 (commandString);
		}
	}
	
	commandString = "global globalVariable_EFV_Norm:=1";
	for (rI = 1; rI < 20; rI = rI+1)
	{
		commandString = commandString+"+Exp(globalVariable_FR_"+aaCodes[rI]+")";
	}
	Model_EFV_Vector = {20,1};
	ExecuteCommands (commandString+";");
	commandString = "Model_EFV_Vector[0]:=1/globalVariable_EFV_Norm;";
	ExecuteCommands (commandString);
	for (rI = 1; rI < 20; rI = rI+1)
	{
		commandString = "Model_EFV_Vector[" + rI + "]:=Exp(globalVariable_FR_" + aaCodes[rI] + ")/globalVariable_EFV_Norm;";
		ExecuteCommands (commandString);
	}
	return 0;
}



