SCRIPT { EnterMode(Run); // Flag all buses as active in Scaling command to be run shortly SetData(Bus, [BusScale], ["Yes"], All); // clear out any existing file and write header for CSV file DeleteFile("c:\MultCTG\SampleOutput.csv"); WriteTextToFile("c:\MultCTG\SampleOutput.csv", "Scenario,Label,CTG: Owner Name,CTG: Owner Number,Cust String 3,Number From,Number To,Name From,Name To,Nom kV From,Nom kV To,Circuit,Viol: Owner Names,Viol: Owner Numbers,Category,Limit,Percent,Reference Value,Value,Change Percent"); //---------------------------------------------------------------- // Process and store results for "Low Load" Scenario //---------------------------------------------------------------- Scale(Load, Factor, [0.80], Bus); // Scale the system load down to 80% SolvePowerFlow; // Solve the power flow CTGSetAsReference; // Set as contingency reference CTGSolveAll; // Solve all contingencies // Append results to a CSV file tacking the "Low Load" string on the front of each result SaveDataWithExtra("c:\MultCTG\SampleOutput.csv", CSVNOHEADER, ViolationCTG, [CTGLabel,OwnerName,OwnerName:1,CustomString:2,BusNum,BusNum:1,BusName,BusName:1, BusNomVolt:1,BusNomVolt:2,LineCircuit,OwnerName:2,OwnerName:3, LimViolCat,LimViolLimit,LimViolPct,LimViolValue:2,LimViolValue,LimViolPct:1], [], "", [], ["Scenario"], ["Low Load"] ); //---------------------------------------------------------------- // Process and store results for "Base Load" Scenario //---------------------------------------------------------------- Scale(Load, Factor, [1.25], Bus); // Scale the system load back up to original value (0.8 * 1.25 = 1.0) SolvePowerFlow; // Solve the power flow CTGSetAsReference; // Set as contingency reference CTGSolveAll; // Solve all contingencies // Append results to a CSV file tacking the "Base Load" string on the front of each result SaveDataWithExtra("c:\MultCTG\SampleOutput.csv", CSVNOHEADER, ViolationCTG, [CTGLabel,OwnerName,OwnerName:1,CustomString:2,BusNum,BusNum:1,BusName,BusName:1, BusNomVolt:1,BusNomVolt:2,LineCircuit,OwnerName:2,OwnerName:3, LimViolCat,LimViolLimit,LimViolPct,LimViolValue:2,LimViolValue,LimViolPct:1], [], "", [], ["Scenario"], ["Base Load"] ); //---------------------------------------------------------------- // Process and store results for "High Load" Scenario //---------------------------------------------------------------- Scale(Load, Factor, [1.20], Bus); // Scale the system load up to 20% higher than base SolvePowerFlow; // Solve the power flow CTGSetAsReference; // Set as contingency reference CTGSolveAll; // Solve all contingencies // Append results to a CSV file tacking the "High Load" string on the front of each result SaveDataWithExtra("c:\MultCTG\SampleOutput.csv", CSVNOHEADER, ViolationCTG, [CTGLabel,OwnerName,OwnerName:1,CustomString:2,BusNum,BusNum:1,BusName,BusName:1, BusNomVolt:1,BusNomVolt:2,LineCircuit,OwnerName:2,OwnerName:3, LimViolCat,LimViolLimit,LimViolPct,LimViolValue:2,LimViolValue,LimViolPct:1], [], "", [], ["Scenario"], ["High Load"] ); }