Assignment 2 Name: Pranav Kimothi Roll No: 182053: Q1: Code in C For Transformer Design
Assignment 2 Name: Pranav Kimothi Roll No: 182053: Q1: Code in C For Transformer Design
Assignment 2 Name: Pranav Kimothi Roll No: 182053: Q1: Code in C For Transformer Design
The algorithm of this program has been taken by analyzing the design
problems given from page 435-447 in AK Sawhney book.
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<dos.h>
Beep(1500,1000);Beep(1500,1000);Beep(1500,1000);
return;
void single_phase_core_type()
double kVA,HV,LV,frequency;
double flux_density;
if(HV<132)
flux_density = 1.55;
}
flux_density = 1.6;
if(HV>=275)
flux_density = 1.7;
double diameter;
double length_of_largest_stamping;
double length_of_second_stamping;
double length_of_third_stamping;
int choice;
printf("\nWHICH TYPE OF CORE WOULD YOU LIKE TO USE?\nPRESS 1 FOR SQUARE\nPRESS 2 FOR
TWO STEPPED\nPRESS 3 FOR THREE STEPPED\nPRESS 4 FOR FOUR STEPPED\n REMEMBER FOR LOW
RATING TRANSFORMERS YOU MUST GO WITH SQUARE/TWO STEPPED AND FOR HIGH RATING
TRANSFORMER GO WITH THREE/FOUR STEPPED. THE HIGHER THE STEPS, THE MORE WILL BE THE
COST OF YOUR TRANSFOMRER ");
scanf("%d",&choice);
switch(choice)
}
//calculation of Kw
double window_factor;
if(kVA<50)
if(kVA>=500)
double current_density;
if(HV<50)
if(HV>=275)
double window_area;
height_of_window = sqrt(2.5*window_area);
strcpy(HVwinding,"Foil"); strcpy(LVwinding,"Helix");
else if(kVA > 1000 && kVA <= 30000 && HV<= 66 && LV<=11)
strcpy(HVwinding,"Disc"); strcpy(LVwinding,"Disc");
else if(kVA > 30000 && HV<= 500 && LV <= 66)
strcpy(HVwinding,"Multilayer"); strcpy(LVwinding,"Helix");
else
strcpy(HVwinding,"Multilayer"); strcpy(LVwinding,"Helix");
double mean_dia_of_LV_turns;
scanf("%lf",&mean_dia_of_HV_turns);
scanf("%lf",&mean_dia_of_LV_turns);
//CALCULATION OF RESISTANCE
double resistance_of_HV_winding =
0.021*length_of_mean_turn_in_HV*turns_in_HV_winding/(100*current_density); // 0.021 is resistivity in micro-
ohms, length of mean turn is in meter and current density is in A/mm2 so that resistance is in ohms.
double resistance_of_LV_winding =
0.021*length_of_mean_turn_in_LV*turns_in_LV_winding/(100*current_density);
double total_weight_of_iron = 7800*4*net_area_of_core*height_of_window; //only that area where loss would occur
i.e. in the 2 limbs + 2 yokes
double core_loss_in_limbs = 1.2 * total_weight_of_iron; //assuming 1.2 W/kg core loss for the chosen flux density
double Ic = core_loss_in_limbs / HV ;
double Io = pow(pow(Ic,2)+pow(Im,2),0.5);
//CALCULATION OF DUCTS
double new_overall_height = overall_height + 0.6; //0.6 meter or 600 mm for lead oil etc.
double theta;
scanf("%lf",&theta);
printf("\n-----------------------------------------------SPECIFICATION SHEET----------------------------------------------------
-");
printf("\nkVA is: %lf",kVA);
printf("\nNumber of ducts required for maximum allowable temperature %lf oC is: %lf ",theta,number_of_ducts);
getch();
void single_phase_shell_type()
double kVA,HV,LV,frequency;
double flux_density;
if(HV<132)
flux_density = 1.55;
}
flux_density = 1.6;
if(HV>=275)
flux_density = 1.7;
double diameter;
double length_of_largest_stamping;
double length_of_second_stamping;
double length_of_third_stamping;
int choice;
printf("\nWHICH TYPE OF CORE WOULD YOU LIKE TO USE?\nPRESS 1 FOR SQUARE\nPRESS 2 FOR
TWO STEPPED\nPRESS 3 FOR THREE STEPPED\nPRESS 4 FOR FOUR STEPPED\n REMEMBER FOR LOW
RATING TRANSFORMERS YOU MUST GO WITH SQUARE/TWO STEPPED AND FOR HIGH RATING
TRANSFORMER GO WITH THREE/FOUR STEPPED. THE HIGHER THE STEPS, THE MORE WILL BE THE
COST OF YOUR TRANSFOMRER ");
scanf("%d",&choice);
switch(choice)
}
//calculation of Kw
double window_factor;
if(kVA<50)
if(kVA>=500)
double current_density;
if(HV<50)
if(HV>=275)
double window_area;
height_of_window = sqrt(2.5*window_area);
strcpy(HVwinding,"Foil"); strcpy(LVwinding,"Helix");
else if(kVA > 1000 && kVA <= 30000 && HV<= 66 && LV<=11)
strcpy(HVwinding,"Disc"); strcpy(LVwinding,"Disc");
else if(kVA > 30000 && HV<= 500 && LV <= 66)
strcpy(HVwinding,"Multilayer"); strcpy(LVwinding,"Helix");
else
strcpy(HVwinding,"Multilayer"); strcpy(LVwinding,"Helix");
double mean_dia_of_LV_turns;
scanf("%lf",&mean_dia_of_HV_turns);
scanf("%lf",&mean_dia_of_LV_turns);
//CALCULATION OF RESISTANCE
double resistance_of_HV_winding =
0.021*length_of_mean_turn_in_HV*turns_in_HV_winding/(100*current_density); // 0.021 is resistivity in micro-
ohms, length of mean turn is in meter and current density is in A/mm2 so that resistance is in ohms.
double resistance_of_LV_winding =
0.021*length_of_mean_turn_in_LV*turns_in_LV_winding/(100*current_density);
double total_weight_of_iron = 7800*4*net_area_of_core*height_of_window; //only that area where loss would occur
i.e. in the 2 limbs + 2 yokes
double core_loss_in_limbs = 1.2 * total_weight_of_iron; //assuming 1.2 W/kg core loss for the chosen flux density
double Ic = core_loss_in_limbs / HV ;
double Io = pow(pow(Ic,2)+pow(Im,2),0.5);
//CALCULATION OF DUCTS
double new_overall_height = overall_height + 0.6; //0.6 meter or 600 mm for lead oil etc.
double theta;
scanf("%lf",&theta);
printf("\n-----------------------------------------------SPECIFICATION SHEET----------------------------------------------------
-");
printf("\nkVA is: %lf",kVA);
printf("\nNumber of ducts required for maximum allowable temperature %lf oC is: %lf ",theta,number_of_ducts);
getch();
void three_phase_core_type_power()
double kVA,HV,LV,frequency;
double flux_density;
if(HV<132)
flux_density = 1.55;
}
flux_density = 1.6;
if(HV>=275)
flux_density = 1.7;
double diameter;
double length_of_largest_stamping;
double length_of_second_stamping;
double length_of_third_stamping;
int choice;
printf("\nWHICH TYPE OF CORE WOULD YOU LIKE TO USE?\nPRESS 1 FOR SQUARE\nPRESS 2 FOR
TWO STEPPED\nPRESS 3 FOR THREE STEPPED\nPRESS 4 FOR FOUR STEPPED\n REMEMBER FOR LOW
RATING TRANSFORMERS YOU MUST GO WITH SQUARE/TWO STEPPED AND FOR HIGH RATING
TRANSFORMER GO WITH THREE/FOUR STEPPED. THE HIGHER THE STEPS, THE MORE WILL BE THE
COST OF YOUR TRANSFOMRER ");
scanf("%d",&choice);
switch(choice)
}
//calculation of Kw
double window_factor;
if(kVA<50)
if(kVA>=500)
double current_density;
if(HV<50)
if(HV>=275)
double window_area;
height_of_window = sqrt(3*window_area);
strcpy(HVwinding,"Foil"); strcpy(LVwinding,"Helix");
else if(kVA > 1000 && kVA <= 30000 && HV<= 66 && LV<=11)
strcpy(HVwinding,"Disc"); strcpy(LVwinding,"Disc");
else if(kVA > 30000 && HV<= 500 && LV <= 66)
strcpy(HVwinding,"Multilayer"); strcpy(LVwinding,"Helix");
else
strcpy(HVwinding,"Multilayer"); strcpy(LVwinding,"Helix");
double mean_dia_of_LV_turns;
scanf("%lf",&mean_dia_of_HV_turns);
scanf("%lf",&mean_dia_of_LV_turns);
//CALCULATION OF RESISTANCE
double resistance_of_HV_winding =
0.021*length_of_mean_turn_in_HV*turns_in_HV_winding/(100*current_density); // 0.021 is resistivity in micro-
ohms, length of mean turn is in meter and current density is in A/mm2 so that resistance is in ohms.
double resistance_of_LV_winding =
0.021*length_of_mean_turn_in_LV*turns_in_LV_winding/(100*current_density);
double total_weight_of_iron = 7800*4*net_area_of_core*height_of_window; //only that area where loss would occur
i.e. in the 2 limbs + 2 yokes
double core_loss_in_limbs = 1.2 * total_weight_of_iron; //assuming 1.2 W/kg core loss for the chosen flux density
double Ic = core_loss_in_limbs / HV ;
double Io = pow(pow(Ic,2)+pow(Im,2),0.5);
//CALCULATION OF DUCTS
double new_overall_height = overall_height + 0.6; //0.6 meter or 600 mm for lead oil etc.
double theta;
scanf("%lf",&theta);
printf("\n-----------------------------------------------SPECIFICATION SHEET----------------------------------------------------
-");
printf("\nkVA is: %lf",kVA);
printf("\nNumber of ducts required for maximum allowable temperature %lf oC is: %lf ",theta,number_of_ducts);
getch();
void three_phase_core_type_distribution()
double kVA,HV,LV,frequency;
double flux_density;
if(HV<132)
flux_density = 1.55;
}
flux_density = 1.6;
if(HV>=275)
flux_density = 1.7;
double diameter;
double length_of_largest_stamping;
double length_of_second_stamping;
double length_of_third_stamping;
int choice;
printf("\nWHICH TYPE OF CORE WOULD YOU LIKE TO USE?\nPRESS 1 FOR SQUARE\nPRESS 2 FOR
TWO STEPPED\nPRESS 3 FOR THREE STEPPED\nPRESS 4 FOR FOUR STEPPED\n REMEMBER FOR LOW
RATING TRANSFORMERS YOU MUST GO WITH SQUARE/TWO STEPPED AND FOR HIGH RATING
TRANSFORMER GO WITH THREE/FOUR STEPPED. THE HIGHER THE STEPS, THE MORE WILL BE THE
COST OF YOUR TRANSFOMRER ");
scanf("%d",&choice);
switch(choice)
}
//calculation of Kw
double window_factor;
if(kVA<50)
if(kVA>=500)
double current_density;
if(HV<50)
if(HV>=275)
double window_area;
height_of_window = sqrt(2*window_area);
strcpy(HVwinding,"Foil"); strcpy(LVwinding,"Helix");
else if(kVA > 1000 && kVA <= 30000 && HV<= 66 && LV<=11)
strcpy(HVwinding,"Disc"); strcpy(LVwinding,"Disc");
else if(kVA > 30000 && HV<= 500 && LV <= 66)
strcpy(HVwinding,"Multilayer"); strcpy(LVwinding,"Helix");
else
strcpy(HVwinding,"Multilayer"); strcpy(LVwinding,"Helix");
double mean_dia_of_LV_turns;
scanf("%lf",&mean_dia_of_HV_turns);
scanf("%lf",&mean_dia_of_LV_turns);
//CALCULATION OF RESISTANCE
double resistance_of_HV_winding =
0.021*length_of_mean_turn_in_HV*turns_in_HV_winding/(100*current_density); // 0.021 is resistivity in micro-
ohms, length of mean turn is in meter and current density is in A/mm2 so that resistance is in ohms.
double resistance_of_LV_winding =
0.021*length_of_mean_turn_in_LV*turns_in_LV_winding/(100*current_density);
double total_weight_of_iron = 7800*4*net_area_of_core*height_of_window; //only that area where loss would occur
i.e. in the 2 limbs + 2 yokes
double core_loss_in_limbs = 1.2 * total_weight_of_iron; //assuming 1.2 W/kg core loss for the chosen flux density
double Ic = core_loss_in_limbs / HV ;
double Io = pow(pow(Ic,2)+pow(Im,2),0.5);
//CALCULATION OF DUCTS
double new_overall_height = overall_height + 0.6; //0.6 meter or 600 mm for lead oil etc.
double theta;
scanf("%lf",&theta);
printf("\n-----------------------------------------------SPECIFICATION SHEET----------------------------------------------------
-");
printf("\nkVA is: %lf",kVA);
printf("\nNumber of ducts required for maximum allowable temperature %lf oC is: %lf ",theta,number_of_ducts);
getch();
int main()
system("color ED");
sound();
int choice;
while(1)
system("cls");
printf("\n PRESS 1 FOR SINGLE PHASE CORE TYPE TRANSFORMER\n PRESS 2 FOR SINGLE PHASE
SHELL TYPE TRANSFORMER\n PRESS 3 FOR THREE PHASE CORE TYPE POWER TRANSFORMER i.e.
WYE/DELTA connection\n PRESS 4 FOR THREE PHASE CORE TYPE DISTRIBUTION TRANSFORMER i.e.
DELTA/WYE\n PRESS 5 FOR THREE PHASE SHELL TYPE TRANSFORMER\n\n");
scanf("%d",&choice);
switch(choice)
return 0;