You are on page 1of 13

C++ Major Project Domain: Mathematical Modeling Aim: To calculate equivalent circuit parameters of various types of Power Apparatus.

CODE
#include<iostream> #include<stdio.h> #include<conio.h> #include<math.h> #include<stdlib.h> using namespace std; class machine { public: void one_phIM(void); void three_phIM(void); void one_phTF(void); }; class interaction { public: void welcome(void); void goodbye(void); };

void machine::one_phIM() { float V_nl,I_nl,W_nl,V_br,I_br,W_br; float R1,R2,X1,X2,Xm; int code; interaction I; system("cls"); cout<<endl<<"This program determines circuit parameters of 1ph-IM"<<endl; cout<<endl<<"Enter the data for No Load Test: "<<endl; cout<<endl<<"V_nl: ";cin>>V_nl; cout<<endl<<"I_nl: ";cin>>I_nl; cout<<endl<<"W_nl: ";cin>>W_nl; cout<<endl<<"Enter the data for Blocked Rotor Test: "<<endl; cout<<endl<<"V_br: ";cin>>V_br; cout<<endl<<"I_br: ";cin>>I_br; cout<<endl<<"W_br: ";cin>>W_br; cout<<endl<<"Enter the following data: "<<endl; cout<<endl<<"R1: ";cin>>R1; float x; cout<<endl<<"X1:X2'= x:1, x=?: ";cin>>x; //analyzing the data of Blocked Rotor Test float Z_br=V_br/I_br; float R_br=W_br/(I_br*I_br); float X_br=sqrt((Z_br*Z_br)-(R_br*R_br)); R2=R_br-R1; X2=X_br/(1+x); X1=x*X2; //analyzing the data of No Load Test float Z_nl=V_nl/I_nl; float R_nl=W_nl/(I_nl*I_nl); float X_nl=sqrt((Z_nl*Z_nl)-(R_nl*R_nl)); Xm=2*(X_nl-X1)-X2; cout<<endl<<"Required equivalent circuit parameters are: "<<endl; cout<<"R1: "<<R1<<" ohm"<<endl; cout<<"R2': "<<R2<<" ohm"<<endl; cout<<"X1: "<<X1<<" ohm"<<endl; cout<<"X2': "<<X2<<" ohm"<<endl; cout<<"Xm: "<<Xm<<" ohm"<<endl;

cout<<endl<<"1. Go back to Home Page"<<endl; cout<<endl<<"2. Quit the program"<<endl; cout<<endl<<"Enter code(1 or 2) for above action to take place: "; cin>>code; switch(code) { case 1: {I.welcome(); break; } default: {I.goodbye();} } } void machine::three_phIM(void) { float V_nl,I_nl,W_nl,V_br,I_br,W_br; float R1,R2,X1,X2,Xm; int code; interaction I; system("cls"); cout<<endl<<"This program determines circuit parameters of 3ph-IM"<<endl; cout<<endl<<"Enter per phase data for No Load Test: "<<endl; cout<<endl<<"V_nl: ";cin>>V_nl; cout<<endl<<"I_nl: ";cin>>I_nl; cout<<endl<<"W_nl: ";cin>>W_nl; cout<<endl<<"Enter per phase data for Blocked Rotor Test: "<<endl; cout<<endl<<"V_br: ";cin>>V_br; cout<<endl<<"I_br: ";cin>>I_br; cout<<endl<<"W_br: ";cin>>W_br; cout<<endl<<"Enter the following data: "<<endl; cout<<endl<<"R1: ";cin>>R1; float x; cout<<endl<<"X1:X2'= x:1, x=?: ";cin>>x; //analyzing the data of Blocked Rotor Test float Z_br=V_br/I_br; float R_br=W_br/(I_br*I_br); float X_br=sqrt((Z_br*Z_br)-(R_br*R_br)); X2=X_br/(1+x);

X1=x*X2; //analyzing the data of No Load Test float Z_nl=V_nl/I_nl; float R_nl=W_nl/(I_nl*I_nl); float X_nl=sqrt((Z_nl*Z_nl)-(R_nl*R_nl)); Xm=(X_nl-X1);//observe change in formula as compared to 1ph IM R2=(R_br-R1)*((X2+Xm)/Xm)*((X2+Xm)/Xm);/*observe change in formula as compared to 1ph IM*/ cout<<endl<<"Required equivalent circuit parameters are: "<<endl; cout<<"R1: "<<R1<<" ohm"<<endl; cout<<"R2': "<<R2<<" ohm"<<endl; cout<<"X1: "<<X1<<" ohm"<<endl; cout<<"X2': "<<X2<<" ohm"<<endl; cout<<"Xm: "<<Xm<<" ohm"<<endl; cout<<endl<<"1. Go back to Home Page"<<endl; cout<<endl<<"2. Quit the program"<<endl; cout<<endl<<"Enter code(1 or 2) for above action to take place: "; cin>>code; switch(code) { case 1: {I.welcome(); break; } default: {I.goodbye();} } } void machine::one_phTF() { float V_oc,I_oc,W_oc,V_sc,I_sc,W_sc; float R_eL,R_eH,R_cL,R_cH,X_eL,X_eH,X_mL,X_mH,a; int code; interaction I; system("cls"); cout<<endl<<"This program determines circuit parameters of 1ph-Transformer"<<endl; cout<<endl<<"Enter the data for Open Circuit Test: "<<endl; cout<<endl<<"V_oc: ";cin>>V_oc; cout<<endl<<"I_oc: ";cin>>I_oc; cout<<endl<<"W_oc: ";cin>>W_oc;

cout<<endl<<"Enter the data for Short Circuit Test: "<<endl; cout<<endl<<"V_sc: ";cin>>V_sc; cout<<endl<<"I_sc: ";cin>>I_sc; cout<<endl<<"W_sc: ";cin>>W_sc; cout<<endl<<"Enter the turns ratio(N_H:N_L) of transformer: "; cin>>a; //analyzing the data of Short Circuit Test float Z_eH=V_sc/I_sc; R_eH=W_sc/(I_sc*I_sc); X_eH=sqrt((Z_eH*Z_eH)-(R_eH*R_eH)); R_eL=R_eH/(a*a); X_eL=X_eH/(a*a); //analyzing the data of Open Circuit Test float pf=W_oc/(V_oc*I_oc); float I_c=I_oc*pf; float I_m=I_oc*(sqrt(1-(pf*pf))); R_cL=V_oc/I_c; X_mL=V_oc/I_m; R_cH=R_cL*a*a; X_mH=X_mL*a*a; cout<<endl<<"Required circuit parameters referred to HV side are: "<<endl; cout<<"R_cH: "<<R_cH<<" ohm"<<endl; cout<<"X_mH: "<<X_mH<<" ohm"<<endl; cout<<"R_eH: "<<R_eH<<" ohm"<<endl; cout<<"X_eH: "<<X_eH<<" ohm"<<endl; cout<<endl<<"Required circuit parameters referred to LV side are: "<<endl; cout<<"R_cL: "<<R_cL<<" ohm"<<endl; cout<<"X_mL: "<<X_mL<<" ohm"<<endl; cout<<"R_eL: "<<R_eL<<" ohm"<<endl; cout<<"X_eL: "<<X_eL<<" ohm"<<endl; cout<<endl<<"1. Go back to Home Page"<<endl; cout<<endl<<"2. Quit the program"<<endl; cout<<endl<<"Enter code(1 or 2) for above action to take place: "; cin>>code; switch(code) { case 1: {I.welcome();

break; } default: {I.goodbye();} } } void interaction::welcome(void) { int code; machine M; system("cls"); cout<<endl<<"WELCOME to the domain of MATHEMATICAL MODELLING"<<endl; cout<<endl<<"This program calculates Equivalent Circuit Parameters of:"<<endl; cout<<endl<<"1. Single Phase Single Winding Induction Machine"<<endl; cout<<endl<<"2. Per Phase Parameters of Three Phase Induction Machine"<<endl; cout<<endl<<"3. Single Phase Transformer"<<endl; cout<<endl<<"Enter the code(1,2 or 3) for the required apparatus: "; cin>>code; switch(code) { case 1: {M.one_phIM(); break; } case 2: {M.three_phIM(); break; } case 3: {M.one_phTF(); break; } default: {goodbye();} } } void interaction::goodbye(void) { system("cls"); cout<<endl<<"THANKS and Have a Nice Day..."<<endl; cout<<endl<<"Presented By: "<<endl; cout<<endl<<"SHITIJ KAKKAR 2K8/EE/874"<<endl; cout<<endl<<"SIDHARTH GUPTA 2K8/EE/875"<<endl; cout<<endl<<"UDIT MAHAJAN 2K8/EE/883"<<endl;

cout<<endl<<"VIPUL GUPTA cout<<endl; system("pause"); } int main(void) { interaction I; system("cls"); I.welcome(); return 0; }

2K8/EE/889"<<endl;

OUTPUT

10

11

***************************************************************************** *

12

13

You might also like