summaryrefslogtreecommitdiff
path: root/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion
diff options
context:
space:
mode:
Diffstat (limited to 'An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion')
-rw-r--r--An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/1-What_machines_and_transformers_have_in_common.ipynb271
-rw-r--r--An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/2-Synchronous_Machines.ipynb470
-rw-r--r--An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/3-Transformers.ipynb840
-rw-r--r--An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/4-Induction_or_Asynchronous_Machines.ipynb552
-rw-r--r--An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/5-Direct_Current_Machines.ipynb278
-rw-r--r--An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/6-Single_Phase_Machines.ipynb184
-rw-r--r--An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/8-Forces_And_Torques_In_Electromagnetic_Systems.ipynb64
7 files changed, 2659 insertions, 0 deletions
diff --git a/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/1-What_machines_and_transformers_have_in_common.ipynb b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/1-What_machines_and_transformers_have_in_common.ipynb
new file mode 100644
index 0000000..21efef4
--- /dev/null
+++ b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/1-What_machines_and_transformers_have_in_common.ipynb
@@ -0,0 +1,271 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1: What machines and transformers have in common"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.1: EX1_1.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"\n",
+"horsepower=2.5 //rating of induction motor in horsepower at half load\n",
+"Vl=230 //terminal voltage of motor in volts\n",
+"Il=7 //load current of motor in amperes\n",
+"pf=0.8 //power factor of the machine\n",
+"Pin=sqrt(3)*Vl*Il*pf //input power in watts\n",
+"mprintf('Pin=%f W\n',Pin)//The answer may vary due to roundoff error\n",
+"Whp=746 //watts per hp\n",
+"Pout=horsepower*Whp //output power in watts\n",
+"mprintf('Pout=% f W\n',Pout)\n",
+"mprintf('η=%f\n',Pout/Pin)//The answer may vary due to roundoff error //efficiency of the machine\n",
+"mprintf('Losses=Pin-Pout=%f W\n',Pin-Pout)//The answer may vary due to roundoff error //losses in the machine in watts\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.2: Calculate_efficiency_and_output_power_when_losses_are_365_Watts_in_Example1.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"\n",
+"//the below exmaple is an extension of Ex1_1.sce\n",
+"Vl=230 //terminal voltage of machine in volts\n",
+"Il=7 //current drawn by machine in amperes\n",
+"pf=0.8 //power factor of machine\n",
+"Pin=sqrt(3)*Vl*Il*pf //from Ex1_1 //input power in watts\n",
+"Losses=365 //in watts\n",
+"Pout=Pin-Losses //output power in watts\n",
+"Whp=746 //watts per hp\n",
+"mprintf('η=1-(Losses/Input)=%f\n',1-(Losses/Pin)) //The answer may vary due to roundoff error //efficiency of the machine\n",
+"mprintf('Pout=%f W\n',Pout)//The answer may vary due to roundoff error\n",
+"mprintf('Pout=%fhp',Pout/Whp)//The asnwer may vary due to roundoff error //output power in horsepower\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.3: Find_hysteresis_loss_in_core_A_and_B.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"f=60 //frequency of voltage source in Hz\n",
+"x=1.9 //Steinmetz coefficient\n",
+"V=80 //applied sinusoidal voltage in volts\n",
+"t=100 //no of turns wound on a coil\n",
+"hc=500 //hysteresis coefficient \n",
+"w=2*%pi*f //angular frequency in rads/sec\n",
+"phimax=(sqrt(2)*V)/(t*w)//maximum value of flux in the core in webers\n",
+"mprintf('phimax=%fWb\n',phimax)//the answer may vary due to roundoff error\n",
+"A1=0.0025 //cross-sectional area of core in metre square\n",
+"Bmax1=phimax/A1 //flux density in core A in tesla\n",
+"mprintf('Bmax=%fT\n',Bmax1)//the answer may vary due to roundoff error\n",
+"lfe1=0.5 //mean flux path length of core A in meters\n",
+"VolA=A1*lfe1 //volume of core A in metre cube\n",
+"mprintf('VolA=%f metre cube\n',VolA)\n",
+"//for core A\n",
+"Ph1=VolA*f*hc*(Bmax1^x) //hysteresis loss in core A in watts\n",
+"mprintf('Ph=%f W\n',Ph1)//the answer may vary due to roundoff error\n",
+"//for core B\n",
+"A2=A1*3 //cross sectional area of core B in metre square\n",
+"lfe2=0.866 //mean flux path length of core B in metres\n",
+"Bmax2=phimax/A2 //flux density in core B in tesla\n",
+"VolB=A2*lfe2 //volume of core B in metre cubes\n",
+"Ph2=VolB*f*hc*(Bmax2^x) //hysteresis loss of core B in watts\n",
+"mprintf('Ph=%f W\n',Ph2)//the answer may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.4: Find_voltage_induced_at_30Hz_eddycurrent_loss_at_60Hz_hysteresis_loss_at_60Hz.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"V1=240 //voltage applied to a winding of transformer(three phase) in volts\n",
+"f1=60 //initial applied frequency in Hz\n",
+"f2=30 //reduced frequency in Hz\n",
+"Phe1=400 //core loss in watts at f1 frequency\n",
+"Phe2=169 //core losses in watts at f2 frequency\n",
+"mprintf('V2=%dV\n',(f2*V1)/f1)//voltage at 30 Hz frequency\n",
+"mprintf('Ph+e/f=Ch+Ce*f\n')//equation for claculating hysteresis and eddy current loss coefficients\n",
+"a=[1 f1;1 f2] //left hand side matix for the equation above\n",
+"b=[Phe1/f1;Phe2/f2] //right hand side matrix for the equation above\n",
+"c=inv(a)*b\n",
+"Ch=c(1,:)//hysteresis loss coefficient in W/Hz\n",
+"Ce=c(2,:)//eddy current loss coefficient in W/(Hz*Hz)\n",
+"mprintf('Ph=%fW\n',Ch*f1)//ans may vary due to roundoff error //hysteresis loss in watts at 60 Hz\n",
+"mprintf('Pe=%fW\n',Ce*f1*f1)//ans may vary due to roundoff error //eddy current loss at 60 Hz in watts\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.5: Find_the_kVA_load_for_the_transformer_to_operate_at_maximum_effifciency.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"Pk=75 //core loss of transfomer in watts\n",
+"R=0.048 //internal resistance in ohms\n",
+"V2=240// secondary voltage in volts\n",
+"I2=sqrt(Pk/R)//secondary current in amperes\n",
+"mprintf('I2=%f A\n',I2)//ans may vary due to roundoff error\n",
+"mprintf('|S|=V2*I2=%d VA',V2*I2)//The answer in the textbook is wrong //output volt ampere of transformer\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.6: Find_full_load_speed_regulation_of_the_motor.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"sfl=1746 //speed at full load in rev/min\n",
+"snl=1799.5 //speed at no load in rev/min\n",
+"mprintf('Voltage Regulation=%f',(snl-sfl)/sfl) //the ans may vary due to round of error\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.7: Find_voltage_regulation_for_unity_power_factor_and_zero_point_seven_pf_lagging.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"Vnl=27.3 //no load voltage in volts\n",
+"Vfl1=24 //full load voltage at power factor 1 in volts\n",
+"mprintf('(Vnl-Vfl/Vfl)=%f\n',(Vnl-Vfl1)/Vfl1) //ans may vary due to roundoff error\n",
+"Vfl2=22.1 //full load voltage at power factor 0.7 in volts\n",
+"mprintf('Voltage Regulation=%f',(Vnl-Vfl2)/Vfl1)\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/2-Synchronous_Machines.ipynb b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/2-Synchronous_Machines.ipynb
new file mode 100644
index 0000000..027ff2f
--- /dev/null
+++ b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/2-Synchronous_Machines.ipynb
@@ -0,0 +1,470 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2: Synchronous Machines"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.10: Find_initial_current_and_current_at_the_end_of_two_cycles.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"xd=1 //in ohms per unit\n",
+"xd1=0.3 //in ohms per unit\n",
+"xd2=0.2 //in ohms per unit\n",
+"Td2=0.03 //time in seconds\n",
+"Td1=1 //time in seconds\n",
+"MVA=100 //rating in mega volt ampere\n",
+"V=16000 //voltage in volts\n",
+"I2pu=1/xd2\n",
+"mprintf('Ipú́=%dper unit\n',I2pu)\n",
+"Ib=(MVA*(10^6))/(sqrt(3)*V)\n",
+"mprintf('Ib=%fA\n',Ib)//ans may vary due to roundoff error\n",
+"mprintf('Í́=%fA\n',I2pu*Ib)//ans in textbook is wrong\n",
+"I1=1/xd1 //current in per unit\n",
+"mprintf('Í=Efo/xd́=%fper unit\n',I1)//ans may vary due to roundoff error\n",
+"Iss=1/xd//current in per unit\n",
+"mprintf('Iss=Efo/xd=1 per unit\n')\n",
+"t=2/60 //time in seconds\n",
+"mprintf('I=%fper unit\n',(I2pu-I1)*exp(-t/Td2)+(I1-Iss)*exp(-t/Td1)+1)//ans may vary due to roundoff error\n",
+"t=10 //time in seconds\n",
+"mprintf('I=%fper unit\n',(I2pu-I1)*exp(-t/Td2)+(I1-Iss)*exp(-t/Td1)+1)//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.1: Find_flux_per_pole_off_the_synchronous_machine.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"L=0.25 //length of stator stack in metre\n",
+"r=0.15 //radius of stator stack in metres\n",
+"BImax=0.96 //peak value of air gap flux density in tesla\n",
+"P=6 //no of machine poles\n",
+"phi=(4*L*r*BImax)/P //flux per pole in webers\n",
+"mprintf('Φ=%fWb',phi)\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.2: Determine_the_coil_pitch_and_pitch_factor.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//the example below is an extension of Ex2_1\n",
+"L=0.25 //length of stator stack in metres\n",
+"r=0.15 //radius of stator stack in metres\n",
+"BImax=0.96 //peak value of air gap flux density in tesla\n",
+"P=6 //no of machine poles\n",
+"phi=(4*L*r*BImax)/P //flux per pole in webers\n",
+"//above comes from Ex2_1\n",
+"span=5 //span of each coil given by no of slots\n",
+"edps=30 //electrical degrees per slot in degrees\n",
+"p=span*edps//coil pitch in degrees\n",
+"mprintf('p=%d°\n',span*edps)\n",
+"Nc=2//turns of coil\n",
+"Kp=sin(((p/2)*%pi)/180) //pitch factor //degree being converted to radians before calculation\n",
+"mprintf('Kp=sin(p/2)=%f\n',Kp) //the ans may vary due to roundoff error\n",
+"mprintf('λcmax=Nc*Kp*Φ=%fWb turns\n',Nc*Kp*phi)//max flux linkage //ans may vary due to roundoff error\n",
+"ns=1000 //machine speed in rev/min\n",
+"p=6 //no of poles\n",
+"f=(p*ns)/120 //frequency at given speed in Hertz\n",
+"mprintf('f=%dHz\n',f)\n",
+"mprintf('Ec=sqrt(2)*Π*f*Nc*kp*Φ=%fV\n',sqrt(2)*%pi*f*Nc*Kp*phi)//ans may vary due to roundoff error //voltage induced at above frequency\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.3: EX2_3.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//the example below is an extension of Ex2_1 and Ex2_2\n",
+"S1=36 //no of slots\n",
+"q1=3 //no of phases\n",
+"p=6 //no of poles\n",
+"Nc=2 //no of turns per coil\n",
+"L=0.25 //length of stator stack in metres\n",
+"r=0.15 //radius of stator stack in metres\n",
+"BImax=0.96 //peak value of air gap flux density in tesla\n",
+"P=6 //no of machine poles\n",
+"phi=(4*L*r*BImax)/P //flux per pole in webers\n",
+"span=5 //span of each coil given by no of slots\n",
+"edps=30 //electrical degrees per slot in degrees\n",
+"p=span*edps//coil pitch in degrees\n",
+"Nc=2//turns of coil\n",
+"kp=sin(((p/2)*%pi)/180) //pitch factor //degree being converted to radians before calculation\n",
+"ns=1000 //machine speed in rev/min\n",
+"p=6 //no of poles\n",
+"f=(p*ns)/120 //frequency at given speed in Hertz\n",
+"Ec=sqrt(2)*%pi*f*Nc*kp*phi//voltage induced at above frequency\n",
+"n=S1/(q1*p)\n",
+"mprintf('n=S1/(q1*p)=%f\n',n) //coils per group\n",
+"edps=30 //electrical degrees per slot //equal to γ as per textbook\n",
+"kd=(sin((n*edps*%pi)/(180*2)))/(n*sin((edps/2)*%pi/180)) //distribution factor of the machine //degree converted to radian for calculation\n",
+"mprintf('kd=sin(n*γ/2)/n*sin(γ/2)=%f\n',kd)//ans may vary due to roundoff error\n",
+"mprintf('|Egroup|=n*Ec*kd=%fV\n',n*Ec*kd)//ans may vary due to roundoff error\n",
+"mprintf('|EΦ|=p*|Egroup|=%fV\n',p*n*Ec*kd)//ans may vary due to roundoff error\n",
+"mprintf('sqrt(3)*EΦ=%dV\n',sqrt(3)*n*Ec*kd*p)//ans may vary due to roundoff error\n",
+"stp=n*Nc*p //series turns per phase //equal to NΦ in textbook\n",
+"mprintf('NΦ=n*Nc*p=%dturns\n',stp)\n",
+"mprintf('|EΦ|=sqrt(2)*Π*NΦ*f*Φ*kp*kd=%fV',sqrt(2)*%pi*stp*f*kp*kd*phi) //ans may vary due to round off error //induced phase winding\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4: EX2_4.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"Vl=2300 //terminal voltage of synchronous motor in volts\n",
+"Il=8.8 //minimum line current in ampere\n",
+"P=sqrt(3)*Vl*Il\n",
+"mprintf('P=%fKW\n',P/1000)//power drawn from the line //ans may vary due to round off error\n",
+"pf=0.8 //operating power factor\n",
+"mprintf('HP=P/746=%fhp\n',P/746)//ans may vary due to round off error //conversion of power to hp requires division by 746\n",
+"S=P/(pf*1000) //total volt amperes of motor in kVA\n",
+"mprintf('Q=|S|sinθΦm=|S|sin cos-1(pf)=%fkVAR',S*sin(acos(pf))) //kVAR supplied by motor to the system //ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.5: EX2_5.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//the following code contains userdefined fucntion complexstring \n",
+"function s=complexstring(a)\n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"Load=5000 //load of the plant in kW\n",
+"pf1=0.8 //power factor of load(lagging)\n",
+"pf2=0.9 //power factor of induction motor\n",
+"pf3=0.8 //power factor of synchronous motor\n",
+"Hp=500 //rating of induction motor to be replaced in hp\n",
+"Pout=0.746*Hp //output power of induction motor in kW\n",
+"Eta=0.96 //efficiency of the induction motor equal to η in textbook\n",
+"Sp=Load+(Load*tan(acos(pf1)))*%i //original complex power of load in kVA\n",
+"disp('Sp=' + complexstring(Sp)+'kVA')\n",
+"Pin=Pout/Eta //input power in kW\n",
+"mprintf('Pin=%fkW\n',Pin)//complex power of induction motor //the ans may vary due to round off error\n",
+"Sm=Pin+(Pin*tan(acos(pf2)))*%i\n",
+"disp('Sm='+complexstring(Sm)+'kVA')//the ans may vary due to round off error //complex power of induction motor\n",
+"mprintf('\n')\n",
+"Ss=Pin-(Pin*tan(acos(pf3)))*%i\n",
+"disp('Ss='+complexstring(Ss)+'kVA')//complex power of synchronous machine //the ans may vary due to round off error\n",
+"mprintf('\n')\n",
+"Qm=(Pin*tan(acos(pf2)))*%i//reactive power of induction motor in kVAR\n",
+"Qs=(-1*(Pin*tan(acos(pf3)))*%i)//reactive power of synchronous motor in kVAR\n",
+"Sp1=Sp-Qm+Qs\n",
+"disp('Sp1='+complexstring(Sp1)+'kVA')//new plant requirement,equal to Sp` in textbook\n",
+"mprintf('\n')\n",
+"pha=acos(real(Sp1)/abs(Sp1)) //phase angle of Sp1 in radians\n",
+"mprintf('New power factor=%f\n',cos(pha))//new power factor //the ans may vary due to round off error\n",
+"invl=abs(Sp)//initial value of complex power in kVA\n",
+"fnvl=abs(Sp1) //final value of complex power in kVA \n",
+"mprintf('Percent reduction=%f%c\n',(((invl-fnvl)/invl)*100),'%')//the ans may vary due to round off error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.6: EX2_6.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//the example below is an extension of Ex2_5\n",
+"//the following code contains userdefined fucntion complexstring \n",
+"function s=complexstring(a)\n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"Load=5000 //load of the plant in kW\n",
+"pf1=0.8 //power factor of load(lagging)\n",
+"Sp=Load+(Load*tan(acos(pf1)))*%i //original complex power of load in kVA\n",
+"disp('Sp='+complexstring(Sp)+'kVA')\n",
+"pf2=0.9 //new power factor\n",
+"Qp1=real(Sp)*tan(acos(0.9)) //reactive power,equal to Qp` in textbook\n",
+"mprintf('Qp`=%fkVAR\n',Qp1)//the ans vary due to roundoff error\n",
+"Qp=imag(Sp)\n",
+"mprintf('Qs=%fkVAR',Qp1-Qp)//KVAR to be supplied by synchronous condenser\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7: Calculate_the_excitation_requirement_for_the_alternator.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"\n",
+"//the code below uses userdefined complexstring function\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"VLB=2400 //line to base voltage in volts\n",
+"V1=VLB/sqrt(3) //reference phasor in volts //ans may vary due to roundoff error\n",
+"mprintf('V1=%fV\n',V1)\n",
+"kVAB=9375 //rated kVA\n",
+"I1B=(kVAB*1000)/(sqrt(3)*VLB)\n",
+"pf=0.8 //power factor\n",
+"mprintf('I1B=%fA\n',I1B) //ans may vary due to roundoff error\n",
+"I1=I1B*exp((-1)*%i*(acos(pf)))\n",
+"disp('I1='+complexstring(I1)+'A')//ans may vary due to roundoff error\n",
+"mprintf('\n')\n",
+"x1=0.1//in ohms\n",
+"disp('EΦ=V1+jI1x1='+complexstring(V1+%i*I1*x1)+'V')//ans may vary due to roundoff error\n",
+"mprintf('\n')\n",
+"disp('sqrt3*|EΦ|='+complexstring((abs(V1+%i*I1*x1))*sqrt(3))+'V')\n",
+"Ifu=110 //value in ampere,dc\n",
+"Ifs=149 //value in ampere,dc\n",
+"ks=Ifs/Ifu\n",
+"mprintf('ks=%f\n',ks) //ans may vary due to roundoff error\n",
+"m1=(abs((V1+%i*I1*x1)))/Ifs //equal to m` in textbook\n",
+"mprintf('ḿ́=|EΦ|/Ifs=%fΩ\n',m1)//ans may vary due to roundoff error\n",
+"xdu=0.8 //in ohms\n",
+"xd=x1+((xdu-x1)/ks)\n",
+"mprintf('xd=x1+(xdu-x1)/ks=%fΩ\n',xd)//ans may vary due to roundoff error\n",
+"Ef=V1+(%i*I1*xd)\n",
+"disp('Ef='+complexstring(Ef)+'V')//ans may vary due to roundoff error\n",
+"mprintf('\n')\n",
+"mprintf('If=%fA\n',abs(Ef)/m1)//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.8: Find_filed_current_and_open_circuit_voltage_and_maximumkVAR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"VLB=2400 //line to base voltage in volts\n",
+"Ix=2005 //current in amperes\n",
+"xda=VLB/(sqrt(3)*Ix)\n",
+"mprintf('xda=%fΩ\n',xda)//ans may vary due to roundoff error\n",
+"Ifv=116 //current in amperes\n",
+"ma1=VLB/(sqrt(3)*Ifv)//equal to ma` in textbook\n",
+"mprintf('má=V1B/Ifv=%fΩ\n',ma1)//ans may vary due to roundoff error\n",
+"//from ex 2_7\n",
+"V1=VLB/sqrt(3) //reference phasor in volts \n",
+"kVAB=9375 //rated kVA\n",
+"I1B=(kVAB*1000)/(sqrt(3)*VLB)//current in amperes\n",
+"pf=0.8 //power factor\n",
+"I1=I1B*exp((-1)*%i*(acos(pf)))//current in amperes\n",
+"Ef=V1+%i*I1*xda\n",
+"disp('Ef='+complexstring(Ef)+'V')//ans may vary due to roundoff error\n",
+"mprintf('If=|Ef|/má=%fA\n',abs(Ef)/ma1)//ans may vary due to roundoff error\n",
+"Voc=2960 //line to line volatge in Volts\n",
+"mprintf('V1oc=%fV\n',Voc/sqrt(3))//ans may vary due to roundoff error\n",
+"If=240 //current in amperes\n",
+"Efmax=ma1*If\n",
+"mprintf('Efmax=%dV\n',Efmax)//ans in textbook is wrong\n",
+"I1max=(Efmax-V1)/xda //ans in textbook is wrong\n",
+"mprintf('I1max=%fA\n',I1max)//ans may vary due to roundoff error\n",
+"mprintf('Qmax=%fMVAR',sqrt(3)*VLB*I1max*(10^-6))//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/3-Transformers.ipynb b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/3-Transformers.ipynb
new file mode 100644
index 0000000..0f52c33
--- /dev/null
+++ b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/3-Transformers.ipynb
@@ -0,0 +1,840 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 3: Transformers"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.10: EX3_10.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"SB=10000000 //rating of transformer\n",
+"VL1B=230000 //voltage rating\n",
+"IL1B=SB/(sqrt(3)*VL1B)\n",
+"mprintf('ILIB=%fA\n',IL1B)\n",
+"VL2B=4160\n",
+"IL2B=SB/(sqrt(3)*VL2B)\n",
+"mprintf('IL2B=%fA\n',IL2B)\n",
+"//star delta connected\n",
+"mprintf('Rated kVA=SB/1000=%fkVA\n',SB/1000)\n",
+"mprintf('Rated 11=I1B=ILIB=%fA\n',IL1B)\n",
+"mprintf('Rated I2=I2B=IL2B/sqrt(3)=%fA\n',IL2B/sqrt(3))\n",
+"VL1=230 //rating in kV\n",
+"VL2=4160//rating in kV\n",
+"mprintf('Rated V1=V1B=VL1/sqrt(3)=%fkV\n',VL1/sqrt(3))\n",
+"mprintf('V2=V2B=%fV\n',VL2)\n",
+"mprintf('turns ratio=V1B/V2B=%f\n',(VL1*1000)/(VL2*sqrt(3)))\n",
+"mprintf('kVA per phase=%dkVA\n',3333)\n",
+"//delta star connected\n",
+"mprintf('Rated kVA=%fkVA\n',SB/1000)\n",
+"mprintf('kVa per phase=%dkVA\n',3333)\n",
+"mprintf('V1B=VL1B=%fkV\n',VL1)\n",
+"mprintf('V2B=VL2B/sqrt(3)=%fV\n',VL2/sqrt(3))\n",
+"mprintf('I1B=IL1B/sqrt(3)=%fA\n',IL1B/sqrt(3))\n",
+"mprintf('I2B=IL2B=%fA\n',IL2B)\n",
+"mprintf('a=V1B/V2B=%f\n',(VL1B*sqrt(3))/VL2B)\n",
+"\n",
+"//delta delta connected\n",
+"mprintf('Rated kVA=%fkVA\n',SB/1000)\n",
+"mprintf('kVA per phase=%dkVA\n',3333)\n",
+"mprintf('V1B=%fKV\n',VL1B/1000)\n",
+"mprintf('V2B=%fV\n',VL2B)\n",
+"mprintf('I1B=%fA\n',IL1B/sqrt(3))\n",
+"mprintf('IL2B=%fA\n',IL2B/sqrt(3))\n",
+"mprintf('a=%f\n',VL1B/VL2B)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.11: Find_the_voltage_regulation_at_full_load_and_zero_point_eight_pf_lagging.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//the code uses userdefined function complexstring\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"//delta connected\n",
+"// sol 1\n",
+"V1B=7200 //primary voltage in volts\n",
+"VL1B=7200 //primary voltage in volts\n",
+"kVA=50 //kva rating \n",
+"IL1B=(kVA*1000)/((sqrt(3))*VL1B)//ans may vary due to roundoff error\n",
+"mprintf('IL1B=%fA\n',IL1B)\n",
+"I1B=IL1B/sqrt(3)//ans may vary due to roundoff error\n",
+"mprintf('I1B=%fA\n',I1B)\n",
+"//star connected\n",
+"VL2B=208 //seconadry voltage in volts\n",
+"V2B=VL2B/sqrt(3)//ans may vary due to roundoff error\n",
+"mprintf('V2B=%fV\n',VL2B/sqrt(3))\n",
+"IL2B=(kVA*1000)/(sqrt(3)*VL2B)//ans may vary due to roundoff error\n",
+"mprintf('IL2B=%fA\n',IL2B)\n",
+"I2B=IL2B\n",
+"a=V1B/V2B//ans may vary due to roundoff error\n",
+"mprintf('a=%f\n',a)\n",
+"Z2B=V2B/I2B//ans may vary due to roundoff error\n",
+"mprintf('Z2B=V2B/I2B=%fΩ\n',Z2B)\n",
+"Reqpu=0.012 //percent resistance in ohms\n",
+"Xeqpu=0.05 //percent reactance in ohms\n",
+"Zeqpu=Reqpu+(%i*Xeqpu)\n",
+"mprintf('Zeqpu=%f Ω with phase angle of %f degrees\n',abs(Zeqpu),(acos(Reqpu/(abs(Zeqpu))))*180/%pi)//ans may vary due to roundoff error,conversion of radians to degree\n",
+"Zeq2=Z2B*Zeqpu//ans may vary due to roundoff error\n",
+"mprintf('Zeq2=%fΩ with a phase angle of %f degrees\n',abs(Zeq2),(acos(real(Zeq2)/abs(Zeq2)))*180/%pi)//ans may vary due to roundoff error,conversion of radians to degree\n",
+"pf=0.8 //power factor of load\n",
+"I2=IL2B*exp(%i*(-1)*acos(pf))//ans may vary due to roundoff error,-1 comes due to the lagging power factor\n",
+"mprintf('I2=%fA with a phase angle of %f degress\n',abs(I2),(-1)*(acos(real(I2)/abs(I2)))*180/%pi)//ans may vary due to roundoff error,conversion of radians to degree\n",
+"V2=120 //seconadry voltage in volts\n",
+"V1=a*(V2+(I2*Zeq2))//ans may vary due to roundoff error\n",
+"mprintf('V1=%fV with a phase angle of %f degrees\n',abs(V1/a),(acos(real(V1)/abs(V1)))*180/%pi)//ans may vary due to roundoff error,conversion of radians to degree\n",
+"Regulation=(abs(V1/a)-V2)/V2//ans may vary due to roundoff error\n",
+"mprintf('Regulation=%f\n',Regulation)\n",
+"//sol 2(per unit method)\n",
+"I2pu=exp(%i*(-1)*acos(pf)) //seconadry current in per unit in amperes\n",
+"V2pu=1 //seconadry voltage in per unit in volts\n",
+"V1pu=V2pu+(I2pu*Zeqpu)\n",
+"mprintf('V1pu=%fV with a phase angle of %f degrees\n',abs(V1pu),(acos(real(V1pu)/abs(V1pu)))*180/%pi)//ans may vary due to roundoff error\n",
+"Regulation=(abs(V1/(a*V2B))-(V2B/V2B))/(V2B/V2B)\n",
+"mprintf('Regulation=%f\n',Regulation)//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.12: Find_Magnitude_of_current_in_secondary_of_each_transfomer.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//the code uses a userdefined function complexstring\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"kVAL=100 //kva required for supply\n",
+"kVAM=20 //kVA rating of motor of the air conditioning compressor\n",
+"V=220 //supply voltage in volts\n",
+"IL3=(kVAM*1000)/(sqrt(3)*V)\n",
+"mprintf('IL3=%fA=|I2| of small transformer\n',IL3)\n",
+"//abc sequence\n",
+"ph1=36.9 //phase angle of motor current\n",
+"IL3=IL3*exp(%i*(-1)*ph1*%pi/180)//-1 comes due to the lagging power factor,conversion of degree to radian for calculation\n",
+"mprintf('Il3=%fA with a phase angle of %f degrees\n',abs(IL3),(-1)*ph1)//-1 comes due to the lagging power factor\n",
+"disp('IL3='+complexstring(IL3)+'A')\n",
+"ph2=30-25.8 //phase angle of Il1\n",
+"IL1=((kVAL*1000)/V)*exp(%i*(ph2)*%pi/180)\n",
+"disp('IL1='+complexstring(IL1)+'A')\n",
+"mprintf('IL1=%f with a phase angle of %f degrees\n',abs(IL1),ph2)\n",
+"I2=IL3+IL1\n",
+"disp('I2='+complexstring(I2)+'A')\n",
+"mprintf('I2=%fA with a phase angle of %f degrees\n',abs(I2),(acos(real(I2)/abs(I2)))*180/%pi)\n",
+"//acb sequence\n",
+"ph3=30+25.8 //phase angle of Il1 in degrees\n",
+"IL1=abs(IL1)*exp(%i*(-1)*(ph3)*%pi/180) //-1 comes due to lagging power factor\n",
+"disp('IL1='+complexstring(IL1)+'A')\n",
+"mprintf('IL1=%f with a phase angle of %f degrees\n',abs(IL1),(-1)*ph3)//-1 comes due to the lagging power factor\n",
+"I2=IL3+IL1\n",
+"disp('I2='+complexstring(I2)+'A')\n",
+"mprintf('I2=%fA with a phase angle of %f degrees\n',abs(I2),(acos(real(I2)/abs(I2)))*180/%pi)\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.13: EX3_13.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"SB=300 //rating in kVA at full load\n",
+"S=150 //kVA at half load\n",
+"Phe=2.7 //core loss in kW\n",
+"Phepu=Phe/SB //ans may vary due to roundoff error\n",
+"mprintf('Phepu=%f\n',Phepu)\n",
+"Reqpu=0.0140 //per unit resistance in ohms=per unit copper loss at full load in watts\n",
+"pf=0.9 //power factor at full load\n",
+"//efficiency at full load\n",
+"mprintf('ηfl=%f\n',pf/(pf+Phepu+Reqpu))//ans may vary due to roundoff error\n",
+"//efficiency at half load\n",
+"a=S/SB //ratio of kVA at half and full load\n",
+"mprintf('ηfl=%f\n',(a*pf)/((a*pf)+Phepu+(a*a*Reqpu)))//ans may vary due to roundoff error\n",
+"//for max efficiency\n",
+"mprintf('|S|/SB=sqrt(Phepu/Reqpu)=%fA\n',sqrt(Phepu/Reqpu))//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.14: Open_circuit_and_short_circuit_test_on_transformer.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//open ckt short ckt test\n",
+"//code uses userdefined function complexstring\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"kVA=50 //kVA rating\n",
+"Poc=500 //core loss in watts\n",
+"Voc=208 //open ckt voltage in volts\n",
+"Vphioc=Voc/sqrt(3)\n",
+"mprintf('VΦoc=Voc/sqrt(3)=%fV\n',Vphioc)//ans may vary due to roundoff error\n",
+"Pphioc=Poc/3\n",
+"mprintf('PΦoc=Poc/3=%fW\n',Pphioc)//ans may vary due to roundoff error\n",
+"Ioc=8 //open ckt current in amperes\n",
+"mprintf('RcLV=VΦ*VΦ/PΦ=%fΩ\n',(Vphioc*Vphioc)/Pphioc)//ans may vary due to roundoff error\n",
+"mprintf('Voc^2/Poc=%fΩ\n',(Voc^2)/Poc)//ans may vary due to roundoff error\n",
+"mprintf('sinθoc=%f\n',sin(acos(Poc/(sqrt(3)*Ioc*Voc))))//ans may vary due to roundoff error\n",
+"mprintf('IΦ=IΦoc *sinθoc=%fA\n',Ioc*sin(acos(Poc/(sqrt(3)*Ioc*Voc))))//ans may vary due to roundoff error\n",
+"mprintf('XmLV=VΦoc/IΦ=%fΩ\n',(Voc/sqrt(3))/(Ioc*sin(acos(Poc/(sqrt(3)*Ioc*Voc)))))//ans may vary due to roundoff error\n",
+"//short ckt \n",
+"Psc=600 //copper loss in watts\n",
+"Isc=4.011 //short circuit current in amperes\n",
+"Vsc=370 //short circuit voltage in volts\n",
+"ReqHV=(Psc/3)/((Isc/sqrt(3))^2)\n",
+"mprintf('ReqHV=PΦsc/IΦsc^2=%fΩ\n',ReqHV)//ans may vary due to roundoff error\n",
+"ZeqHV=Vsc/(Isc/sqrt(3))\n",
+"mprintf('|ZeqHV|=VΦsc/IΦsc=%fΩ\n',ZeqHV)//ans may vary due to roundoff error\n",
+"XeqHV=sqrt((ZeqHV^2)-(ReqHV^2))\n",
+"mprintf('XeqHV=%fΩ\n',XeqHV)//ans may vary due to roundoff error\n",
+"VHVB=7200//secondary side voltage in volts\n",
+"VLVB=208/sqrt(3)//primary side voltage in volts\n",
+"aV=VHVB/VLVB\n",
+"mprintf('NHV/NLV=VHVB/VLVB=%f\n',aV)//ans may vary due to roundoff error\n",
+"mprintf('RcHV=RcLV*aV*aV=%fΩ\n',((Vphioc*Vphioc)/Pphioc)*aV*aV)//ans in the textbook is wrong\n",
+"mprintf('XmHV=XmLV*aV*aV=%fΩ\n',(Voc/sqrt(3))/(Ioc*sin(acos(Poc/(sqrt(3)*Ioc*Voc))))*aV*aV)//ans in the textbook is wrong\n",
+"ZeqLV=(ReqHV+(%i*XeqHV))/(aV*aV)\n",
+"disp('ZeqLV='+complexstring(ZeqLV)+'Ω')//ans may vary due to roundoff error\n",
+"mprintf('ZeqLV=%f ohms with a phase angle of %f degrees\n',abs(ZeqLV),(acos(real(ZeqLV)/abs(ZeqLV)))*180/%pi)\n",
+"SB=50000 //rating of transformer\n",
+"ZLVB=(Voc*Voc)/SB\n",
+"mprintf('ZLVB=%fΩ\n',ZLVB)//ans may vary due to roundoff error\n",
+"Reqpu=(ReqHV/(aV*aV))/ZLVB\n",
+"mprintf('Reqpu=%fΩ\n',Reqpu)//ans may vary due to roundoff error\n",
+"Xeqpu=(XeqHV/(aV*aV))/ZLVB\n",
+"mprintf('Xeqpu=%fΩ\n',Xeqpu)//ans may vary due to roundoff error\n",
+"Zeqpu=Reqpu+(%i*Xeqpu)\n",
+"disp('Zeqpu='+complexstring(Zeqpu)+'Ω')//ans may vary due to roundoff error\n",
+"mprintf('Zeqpu=%fohms with a pgase angle of %f degrees\n',abs(Zeqpu),(acos(real(Zeqpu)/abs(Zeqpu)))*180/%pi)\n",
+"V1pu=1+((exp(%i*(-1)*acos(0.8)))*Zeqpu)\n",
+"disp('V1pu='+complexstring(V1pu))//ans may vary due to roundoff error\n",
+"mprintf('V1pu=%fV with a phase angle of %f degrees\n',abs(V1pu),(acos(real(V1pu)/abs(V1pu)))*180/%pi)\n",
+"mprintf('Regulation=%f\n',(abs(V1pu)-1))//ans may vary due to roundoff error\n",
+"//full load efficiency\n",
+"pf=0.8 //power factor of load\n",
+"Phepu=Poc/SB\n",
+"mprintf('η=cosθ/cosθ+Reqpu+Phepu=%f\n',pf/(pf+Reqpu+Phepu))//ans may vary due to roundoff error\n",
+"//second method\n",
+"mprintf('η=%f\n',(SB*pf)/((SB*pf)+Poc+Psc))\n",
+"//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.1: EX3_1.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//code uses userdefined function complexstring\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"X11=20 //in ohm\n",
+"x1=0.05 //in ohm\n",
+"X22=2000 //in ohm\n",
+"x2=5 //in ohm\n",
+"Xm1=X11-x1\n",
+"Xm2=X22-x2\n",
+"mprintf('Xm1=X11-x1=%fΩ\n',Xm1)\n",
+"mprintf('Xm2=X22--x2=%fΩ\n',Xm2)\n",
+"X12=sqrt(Xm1*Xm2)\n",
+"mprintf('X12=sqrt(Xm1*Xm2)=%fΩ\n',X12)//ans may vary due to roundoff error\n",
+"kVA=10 //rated kVA\n",
+"V2=1000 //secondary voltage in volts\n",
+"I2=(kVA*(10^3))/V2 //rated current\n",
+"mprintf('I2=ratedkVA*1000/raated V2=%dA\n',I2)\n",
+"Zl=V2/I2 //load impedence\n",
+"I1=((Zl+r2+(%i*X22))*I2)/(%i*X12)//ans may vary due to roundoff error\n",
+"disp('I1=(Zl+r2+jwL22)*I2/wL12*I1='+complexstring(I1)+'A')\n",
+"r1=0.01 //in ohm\n",
+"V1=((r1+(%i*X11))*I1)-(%i*X12*I2)\n",
+"disp('V1=(r1+jwL11)I1-jwL12I2='+complexstring(V1)+'V')//ans may vary due to roundoff error\n",
+"k1=Xm1/X11\n",
+"k2=Xm2/X22\n",
+"mprintf('k1=%f\n',k1)\n",
+"mprintf('k2=%f\n',k2)\n",
+"k=sqrt(k1*k2)\n",
+"mprintf('k=sqrt(k1*k2)=%f\n',k)\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.2: EX3_2.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//code contains user defined function complexstring\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"i2=141.4 //load current max val in amperes\n",
+"r2=0.02 //secondary resistance in ohms\n",
+"V2=707/sqrt(2)\n",
+"pha=-30 //phase angle of load current with reference with reference voltage in degrees\n",
+"I2=(i2/sqrt(2))*exp(%i*pha*3.14/180)//ans may vary due to roundoff error,conversion of degrees in radian for calculation\n",
+"mprintf('V2=%dV\n',V2)\n",
+"disp('I2='+complexstring(I2)+'A')\n",
+"disp('Secondary drop I2r2 is='+complexstring(I2*r2)+'V')//ans may vary due to roundoff error\n",
+"L12=3*(10^(-4))//secondary leakage inductance in henry\n",
+"w=377 //angular frequency of the supply in rad/sec\n",
+"x2=w*L12 //secondary leakage reactance\n",
+"mprintf('x2=%fΩ\n',x2)\n",
+"E12=(I2*%i*x2)//ans may vary due to roundoff error\n",
+"disp('-E12=I2jx2='+complexstring(E12)+'V')\n",
+"E2=V2+(r2+(%i*x2))*I2//ans may vary due to roundoff error\n",
+"disp('E2='+complexstring(E2)+'V')\n",
+"N1=300//primary winding turns\n",
+"N2=30 //secondary turns\n",
+"a=N1/N2\n",
+"mprintf('a=N1/N2=%d\n',a)\n",
+"E1=a*E2//ans may vary due to roundoff error\n",
+"disp('E1=aE2='+complexstring(E1)+'V')\n",
+"Iex1=0.707 //magnitude of exciting current of transformer in amperes\n",
+"paex=-80 //phase angle of exciting current in degrees with reference voltage\n",
+"Iex=(Iex1/sqrt(2))*exp(%i*paex*3.14/180)//ans may vary due to roundoff error,conversion of degrees to radians for calculation\n",
+"I1=(I2/a)+Iex//ans may vary due to roundoff error\n",
+"disp('I1='+complexstring(I1)+'A')\n",
+"mprintf('Actual ratio=I2/I1=%f\n',abs(I2)/abs(I1))//ans may vary due to roundoff error\n",
+"L11=0.03 //leakage inductance of primary in henry\n",
+"E11=%i*w*L11*I1//ans may vary due to roundoff error\n",
+"disp('E11=jwL11I1='+complexstring(E11)+'V')\n",
+"r1=2 //primary winding resistance in ohms\n",
+"I1r1=I1*r1//ans may vary due to roundoff error\n",
+"disp('I1r2='+complexstring(I1r1)+'V')\n",
+"V1=E1+I1r1+E11//ans may vary due to roundoff error\n",
+"disp('V1=E1+I1r2+E11='+complexstring(V1)+'V')\n",
+"mprintf('Actual voltage ratio is V1/V2=%f\n',abs(V1)/abs(V2))//ans may vary due to roundoff error"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.3: EX3_3.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//the code uses userdefined function complexstring\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"E1=2400 //primary voltage rating in volts\n",
+"E2=240 //secondary voltage rating in volts\n",
+"z=2 //magnitude of impedance connected to secondary terminals in ohms\n",
+"pha1=36.9 //phase angle of impedance connected with reference in degrees\n",
+"a=E1/E2\n",
+"mprintf('a=%d\n',a)\n",
+"V1=2200 // applied primary voltage to transformer in volts\n",
+"V2=V1/a\n",
+"mprintf('|V2|=|V1|/a=%dV\n',V2)\n",
+"I2=V2/(z*exp(pha1*%i*3.14/180))//ans in textbook is wrong,conversion of degree to radian for calculation\n",
+"disp('I2='+complexstring(I2)+'A')\n",
+"I1=I2/a //ans may vary due to roundoff error\n",
+"disp('I1=I2/a='+complexstring(I1)+'A')\n",
+"Zin=V1/I1\n",
+"disp('Zin=V1/I1='+complexstring(Zin)+'Ω')\n",
+"S2=V2*I2\n",
+"pf=0.8 //power factor of load\n",
+"mprintf('|S2|=|V2||I2|=%fkVA\n',(abs(V2)*abs(I2))/1000)\n",
+"mprintf('P2=|S2|*cosθ2=%fkW\n',(abs(S2)*pf)/1000)\n",
+"mprintf('|S1|=|V2||I1|=%fkVA\n',(abs(V1)*abs(I1))/1000)\n",
+"mprintf('P1=|S1|cosθ1=%fkW\n',((abs(V1)*abs(I1))*cos(pha1*3.14/180))/1000)//ans may vary due to roundoff error,conversion of degree to radian for calculation\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.4: EX3_4.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"Z=4 //impedance of loudspeaker in ohms\n",
+"Zin=500 //impedance of audio line in ohms\n",
+"a=sqrt(Zin/Z)//ans may vary due to roundoff error\n",
+"mprintf('a=sqrt(Zin/Z)=%f\n',a)//ans may vary due to roundoff error\n",
+"P2=10 //audio power in watts\n",
+"V2=sqrt(40)//ans may vary due to roundoff error\n",
+"mprintf('V2=4*P2=%fV\n',V2) //ans may vary due to roundoff error\n",
+"V1=a*V2\n",
+"mprintf('V1=aV2=%fV\n',V1)\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.5: Find_core_and_copper_losses_and_efficiency.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//code uses a userdefined function complexstring\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"V2=120 //reference voltage in volts\n",
+"kVA=16.67*(10^3) //kVA rating of transformer\n",
+"I2=kVA/V2 //secondaary current aat unity pf \n",
+"mprintf('I2=kVA/V2=%fA\n',I2)//ans may be wrong due to roundoff error\n",
+"r2=0.00519 //secondary winding resistance in ohms\n",
+"x2=0.0216 //secondary winding reactance in ohms\n",
+"a=7200/120\n",
+"E2=V2+(I2*(r2+(%i*x2)))//secondary induced voltage //ans may be wrong due to roundoff error\n",
+"disp('E2=V2+I2(r2+jx2)='+complexstring(E2)+'V')\n",
+"E1=a*E2//ans may be wrong due to roundoff error\n",
+"disp('E1='+complexstring(E1)+'V')\n",
+"Rc=311000\n",
+"Ihe=E1/Rc\n",
+"disp('core loss current='+complexstring(Ihe)+'A')\n",
+"Phe=((abs(Ihe))^2)*Rc//ans may be wrong due to roundoff error\n",
+"mprintf('Core loss Ph+e=|Ih+e|^2*Rc=%fW\n',Phe)\n",
+"Xm=54800\n",
+"disp('IΦ=E1/jXm='+complexstring(E1/(%i*Xm))+'A')//ans may be wrong due to roundoff error\n",
+"Iex=Ihe+(E1/(%i*Xm))\n",
+"disp('Iex=Ih+e+IΦ='+complexstring(Iex)+'A')//ans may be wrong due to roundoff error\n",
+"I1=Iex+(I2/a)\n",
+"disp('I1=Iex+I2/a='+complexstring(I1)+'A')//ans may be wrong due to roundoff error\n",
+"r1=18.7 //primary side resistaance\n",
+"x1=77.8\n",
+"V1=E1+(I1*(r1+(%i*x1)))\n",
+"disp('V1=E1+I1(r1+jx1)='+complexstring(V1)+'V')//ans in the textbook is wrong\n",
+"Pcu=(((abs(I1))^2)*r1)+(((abs(I2))^2)*r2)//copper loss\n",
+"mprintf('Pcu=%fW\n',Pcu)//ans may be wrong due to roundoff error\n",
+"mprintf('Efficiencyη=output watts/output+losses=%f\n',16670/(16670+Pcu+Phe))//ans may be wrong due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.6: Find_the_primary_terminal_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//extension of Ex3_1\n",
+"//uses a userdefined function complexstring\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"I2=10\n",
+"V2=1000\n",
+"r2=1\n",
+"X11=20 //in ohm\n",
+"x1=0.05 //in ohm\n",
+"X22=2000 //in ohm\n",
+"x2=5 //in ohm\n",
+"Xm1=X11-x1\n",
+"Xm2=X22-x2\n",
+"X12=sqrt(Xm1*Xm2)\n",
+"V12=V2+I2*(r2+(%i*(X22-X12)))//ans may vary due to roundof error\n",
+"disp('V12='+complexstring(V12)+'V')\n",
+"I1=I2+(V12/(%i*X12))//ans may vary due to roundof error\n",
+"disp('I1='+complexstring(I1)+'A')\n",
+"r1=0.01\n",
+"V1=V12+(I1*(r1+(%i*(X11-X12))))//ans may vary due to roundof error\n",
+"disp('V1='+complexstring(V1)+'V')\n",
+"a=0.1\n",
+"Zeq1=r1+(a*a*r2)+(%i*(x1+(a*a*x2)))//ans may vary due to roundof error\n",
+"disp('Zeq1='+complexstring(Zeq1)+'Ω')\n",
+"V1=(a*V2)+(I2^Zeq1/a)//ans may vary due to roundof error\n",
+"disp('V1='+complexstring(V1)+'V')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.7: EX3_7.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//the code uses a userdefined function complexstring\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"r1=3\n",
+"r2=0.03\n",
+"x1=15\n",
+"x2=0.15\n",
+"V1B=2400 //primary side voltage\n",
+"V2B=240 //secondary side voltage\n",
+"a=V1B/V2B\n",
+"Zeq2=(r1/(a^2))+r2+(%i*((x1/(a^2))+x2))//ans may vary due to roundoff error\n",
+"disp('Zeq2='+complexstring(Zeq2)+'Ω')\n",
+"SB=10000// rated kva of the trnsformer\n",
+"V2B=240\n",
+"I2B=SB/V2B\n",
+"mprintf('I2B=%fA\n',I2B)//ans may vary due to roundoff error\n",
+"//with V2 reference\n",
+"//0.8 pf lagging\n",
+"I2=I2B*exp(%i*(-1)*acos(0.8))//ans may vary due to roundoff error\n",
+"disp('I2='+complexstring(I2)+'A')\n",
+"V2=240\n",
+"V1=a*(V2+I2*Zeq2)//ans may vary due to roundoff error\n",
+"disp('V1/a='+complexstring(V1/a)+'V')\n",
+"mprintf('|V1|=%fV\n',abs(V1))\n",
+"//0.8 pf leading\n",
+"I2B=SB/V2B\n",
+"I2=I2B*exp(%i*acos(0.8))//ans may vary due to roundoff error\n",
+"V1=a*(V2+(I2*Zeq2))//ans may vary due to roundoff error\n",
+"disp('V1='+complexstring(V1/a)+'V')\n",
+"mprintf('|V1|=%fV\n',abs(V1))//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.8: Find_the_full_voltage_regulation_at_zero_point_eight_pf_lagging_and_leading.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//example below is an extension of Ex3_7\n",
+"//values below from Ex3_7\n",
+"V2B=240 //secndary side voltage\n",
+"a=10\n",
+"//0.8 pf lagging\n",
+"V1=2496.44\n",
+"V=V1/a //secondary voltage at full load\n",
+"mprintf('|V1/a|=%fV\n',V)\n",
+"Regulation=(V-V2B)/V2B //ans may vary due to roundoff error\n",
+"mprintf('Regulation=(|V1/a|-V2B)/V2B=%f\n',Regulation)\n",
+"//0.8 pf leading\n",
+"V1=2347.8 \n",
+"V=V1/a\n",
+"mprintf('V at 0.8 pf leading=%fV\n',V)\n",
+"mprintf('Regulation=%f\n',(V-V2B)/V2B)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.9: Find_voltage_regulation_at_full_load_and_zero_point_eight_pf_lagging.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//code uses usedefined function\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"pf=0.8 //power factor of full load\n",
+"I2=1 //magnitude of load current in amperes in per unit system\n",
+"I2pu=I2*exp(%i*(-1)*acos(pf))//-1 comes due to lagging power factor\n",
+"disp('I2pu='+complexstring(I2pu)+'A')\n",
+"pres=2 //percent resistance in ohms\n",
+"preact=5 //percent reactance in ohms\n",
+"Zeqpu=(pres/100)+(%i*(preact/100))\n",
+"disp('Zeqpu='+complexstring(Zeqpu)+'Ω')\n",
+"V1pu=1+(I2pu*Zeqpu)\n",
+"disp('V1pu='+complexstring(V1pu)+'V')\n",
+"Regulation=abs(V1pu)-1\n",
+"mprintf('|V1pu|-1=%f\n',Regulation)\n",
+"\n",
+""
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/4-Induction_or_Asynchronous_Machines.ipynb b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/4-Induction_or_Asynchronous_Machines.ipynb
new file mode 100644
index 0000000..37d1c28
--- /dev/null
+++ b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/4-Induction_or_Asynchronous_Machines.ipynb
@@ -0,0 +1,552 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4: Induction or Asynchronous Machines"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.1: EX4_1.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"SCL=1000 //stator copper loss in watts\n",
+"V=460 //line voltage of induction motor in volts\n",
+"I=25 //line current of motor in amperes\n",
+"pf=0.85 //power factor of motor\n",
+"Pin=sqrt(3)*V*I*pf //ans may vary due to roundoff error\n",
+"mprintf('Pin=%fW\n',Pin)\n",
+"Pg=Pin-SCL //air gap power\n",
+"mprintf('Pg=%fW\n',Pg)//ans may vary due to roundoff error\n",
+"RCL=500 //rotor copper loss in watts\n",
+"Phe=800 //core loss in watts\n",
+"Pfw=250 //winding and friction loss in Watts\n",
+"PLL=200 //stray load loss in watts\n",
+"DMP=Pg-RCL ///developed mechanical power in watts\n",
+"mprintf('DMP=%fW\n',DMP)//ans may vary due to roundoff error\n",
+"Prot=Phe+Pfw+PLL //power loss in rotor in watts\n",
+"Pout=DMP-Prot\n",
+"mprintf('Pout=DMP-Prot=%fW\n',Pout)//ans may vary due to roundoff error\n",
+"mprintf('Horsepower=Pout/746=%fhp\n',Pout/746)//ans may vary due to roundoff error,conversion of watts to hp needs division by 746\n",
+"mprintf('η=Pout/Pin=%f\n',Pout/Pin)//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.2: Find_slip_and_operating_speed_and_developed_torque_and_output_torque.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//this is an extension of Ex4_1\n",
+"//following comes from Ex4_1\n",
+"SCL=1000 //stator copper loss in watts\n",
+"V=460 //line voltage of induction motor in volts\n",
+"I=25 //line current of motor in amperes\n",
+"pf=0.85 //power factor of motor\n",
+"Pin=sqrt(3)*V*I*pf //ans may vary due to roundoff error\n",
+"Pg=Pin-SCL //air gap power\n",
+"RCL=500 //rotor copper loss in watts\n",
+"Phe=800 //core loss in watts\n",
+"Pfw=250 //winding and friction loss in Watts\n",
+"PLL=200 //stray load loss in watts\n",
+"DMP=Pg-RCL ///developed mechanical power in watts\n",
+"Prot=Phe+Pfw+PLL //power loss in rotor in watts\n",
+"Pout=DMP-Prot\n",
+"//above is from Ex4_1\n",
+"s=RCL/Pg\n",
+"p=4 //no of poles\n",
+"mprintf('s=RCL/Pg=%f\n',s)//ans may vary due to roundoff error\n",
+"ws=(4*%pi*60)/p //synchronous angular frequency \n",
+"mprintf('ws=%frad/s\n',ws)//ans may vary due to roundoff error\n",
+"ns=(120*60)/p\n",
+"mprintf('ns=%drev/min\n',ns)//ans may vary due to roundoff error\n",
+"w=ws*(1-s)\n",
+"n=ns*(1-s)\n",
+"mprintf('w=ws(1-s)=%frad/s\n',w)//ans may vary due to roundoff error\n",
+"mprintf('n=ns(1-s)=%frev/min\n',n)//ans may vary due to roundoff error\n",
+"mprintf('τd=DMP/w=%fN-m\n',DMP/w)//ans may vary due to roundoff error\n",
+"mprintf('τ=Pout/w=%fN-m\n',Pout/w)//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.3: Calculate_performance_at_1746_rev_per_min_and_starting_current_and_torque.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//code uses userdefined function complexstring\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"\n",
+"//induction machine parameters in ohms\n",
+"r1=0.39 //primary resistance\n",
+"r2=0.14 //secondary resistance\n",
+"x1=0.35//primary reactance\n",
+"x2=0.35//secondary reactance\n",
+"Xm=16//manetizing reactance\n",
+"VL=220 //supply volatge in volts\n",
+"f=60 //frequency in Hz\n",
+"//part a\n",
+"p=4 //no of poles\n",
+"ns=(120*f)/p \n",
+"mprintf('ns=%drev/min\n',ns)\n",
+"n=1746 //runnimg speed of motor in rev/min\n",
+"s=(ns-n)/ns\n",
+"mprintf('s=%f\n',s)\n",
+"z2=(r2/s)+(%i*x2)//ans may vary due to roundoff error\n",
+"disp('Z2='+complexstring(z2)+'Ω')\n",
+"mprintf('Z2=%fohm having a phase angle of %f degrees\n',abs(z2),(acos(real(z2)/abs(z2)))*180/%pi)\n",
+"Zf=(%i*Xm*z2)/(z2+(%i*Xm))//ans may vary due to roundoff error\n",
+"disp('Zf='+complexstring(Zf)+'Ω')\n",
+"mprintf('Zf=%fohms having a phase angle of %f degrees\n',abs(Zf),(acos(real(Zf)/abs(Zf)))*180/%pi)\n",
+"Rf=real(Zf)//ans may vary due to roundoff error\n",
+"mprintf('Rf=%fΩ\n',Rf)\n",
+"Zin=r1+(%i*x1)+Zf//ans may vary due to roundoff error\n",
+"disp('Zin=r1+jx1+Zf='+complexstring(Zin)+'Ω')\n",
+"mprintf('Zin=%fohms having a phase angle of %f degrees\n',abs(Zin),(acos(real(Zin)/abs(Zin)))*180/%pi)\n",
+"Powerfctor=real(Zin)/abs(Zin)//ans may vary due to roundoff error\n",
+"mprintf('Power facto=%f\n',Powerfctor)\n",
+"I1=VL/(sqrt(3)*abs(Zin))\n",
+"mprintf('|I1|=%fA\n',I1)//ans may vary due to roundoff error\n",
+"Pin=sqrt(3)*I1*VL*Powerfctor\n",
+"mprintf('Pin=%fW\n',Pin)//ans in the textbook is wrong\n",
+"Pg=3*I1*I1*Rf\n",
+"mprintf('Pg=%fW\n',Pg)//ans in the textbook is wrong\n",
+"DMP=(1-s)*Pg\n",
+"mprintf('Developed power=(1-s)Pg=%fW\n',DMP)//ans in the textbook is wrong\n",
+"Prot=s*Pg //rotor copper losses\n",
+"Pout=DMP-Prot//ans in the textbook is wrong\n",
+"mprintf('Output power=%fW\n',Pout)\n",
+"mprintf('Output horsepower=%f\n',Pout/746)//ans may vary due to roundoff error,1 hp=746 watts\n",
+"mprintf('Developed torque=%flb-ft\n',7.04*(Pg/ns))//ans may vary due to roundoff error,1 N-m=7.04 lb-ft ot torque\n",
+"n=(1-s)*ns//ans may vary due to roundoff error\n",
+"mprintf('Output torque=%flb-ft\n',7.04*(Pout/n))\n",
+"mprintf('Efficiency=%f\n',Pout/Pin)\n",
+"//part b\n",
+"s=1 //machine at stanstill\n",
+"z2=r2+(%i*x2)//ans may vary due to roundoff error\n",
+"disp('Z2='+complexstring(z2)+'Ω')\n",
+"mprintf('Z2=%fohm having a phase angle of %f degrees\n',abs(z2),(acos(real(z2)/abs(z2)))*180/%pi)\n",
+"Zf=(%i*Xm*z2)/(z2+(%i*Xm))//ans may vary due to roundoff error\n",
+"disp('Zf='+complexstring(Zf)+'Ω')\n",
+"mprintf('Zf=%fohms having a phase angle of %f degrees\n',abs(Zf),(acos(real(Zf)/abs(Zf)))*180/%pi)\n",
+"Zin=r1+(%i*x1)+Zf//ans may vary due to roundoff error\n",
+"disp('Zin='+complexstring(Zin)+'Ω')\n",
+"mprintf('Zin=%fohms having a phase angle of %f degrees\n',abs(Zin),(acos(real(Zin)/abs(Zin)))*180/%pi)\n",
+"I1=VL/(sqrt(3)*abs(Zin))//ans may vary due to roundoff error\n",
+"Rf=real(Zf)\n",
+"mprintf('Starting current=%fA\n',I1)\n",
+"Pg=3*I1*I1*Rf\n",
+"mprintf('Pg=%fW\n',Pg)//ans in the textbook is wrong\n",
+"mprintf('τd=7.04*(Pg/ns)=%flb-ft\n',7.04*(Pg/ns))//ans may vary due to roundoff error,1 N-M=7.04 lb-ft of torque\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4: Find_the_pull_out_torque_and_slip_at_which_it_occurs.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//below is an extension of Ex4_3\n",
+"//code uses userdefined function complexstring \n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"x1=0.35 //primary reactance in ohms\n",
+"r1=0.39 //primary resistance in ohms\n",
+"Xm=16 //magnetizing reactance\n",
+"r2=0.14 //secondary resistance in ohms \n",
+"x2=0.35 //secondary reactance in ohms\n",
+"ws=188.5 //angular frequency in rad/sec\n",
+"V=220 //rated voltage in volts\n",
+"//part a\n",
+"V1m=V/sqrt(3)//ans may vary due to roundoff error\n",
+"VTH=V1m*(Xm/(Xm+x2))\n",
+"mprintf('VTH=V1m=%fV\n',VTH)//ans may vary due to roundoff error\n",
+"X1=x1\n",
+"mprintf('X1=%fΩ\n',X1)\n",
+"R1=r1*(Xm/(x1+Xm))//ans may vary due to roundoff error\n",
+"mprintf('R1=%fΩ\n',R1)\n",
+"mprintf('τmax=%fN-m\n',((3/ws)*(VTH^2))/(2*(R1+sqrt((R1^2)+((2*X1)^2)))))//ans may vary due to roundoff error\n",
+"//part b\n",
+"sM=r2/sqrt((R1^2)+((X1+x1)^2))//ans may vary due to roundoff error\n",
+"mprintf('sM=%f\n',sM)\n",
+"mprintf('r2/sM=%fΩ\n',r2/sM)//ans may vary due to roundoff error\n",
+"Zf=((%i*Xm)*((r2/sM)+(%i*x2)))/((r2/sM)+(%i*(x2+Xm)))//ans may vary due to roundoff error\n",
+"disp('Zf='+complexstring(Zf)+'Ω')\n",
+"mprintf('Zf=%fohm having a phase angle of %f degrees\n',abs(Zf),(acos(real(Zf)/abs(Zf)))*180/%pi)\n",
+"z1=r1+(%i*x1)\n",
+"Zin=z1+Zf\n",
+"disp('Zin='+complexstring(Zin)+'Ω')//ans may vary due to roundoff error\n",
+"mprintf('Zin=%fohm having a phase angle of %f degrees\n',abs(Zin),(acos(real(Zin)/abs(Zin)))*180/%pi)\n",
+"I1=V1m/abs(Zin)\n",
+"mprintf('I1=%fA\n',I1)//ans may vary due to roundoff error\n",
+"Rf=real(Zf) //resistance in ohms\n",
+"Pg=3*I1*I1*Rf//ans in the textbook is wrong\n",
+"mprintf('Pg=%fW\n',Pg)\n",
+"mprintf('τmax=Pg/ws=%fN-m\n',Pg/ws)//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.5: Find_speed_at_half_of_the_load_and_the_corresponding_outpt_in_horsepower.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"ns=1800 //synchronous speed in rev/min\n",
+"n=1745 //initial speed in rev/min\n",
+"hp=10 //hp rating of the motor horsepower(1 hp=746 Watts)\n",
+"s=(ns-n)/ns\n",
+"mprintf('s=%f\n',s)//ans may vary due to roundoff error\n",
+"s=s/2 //slip at half torque\n",
+"n1=ns*(1-s)//ans may vary due to roundoff error\n",
+"mprintf('n=ns(1-s)=%frev/min\n',n1)\n",
+"//output at half torque\n",
+"mprintf('New horsepower output=%fhp\n',(0.5*hp*n1)/n)//ans may vary due to roundoff error,0.5 factor comes due to half torque\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.6: Will_the_mootor_run_hotter_or_cooler_if_voltage_drops_to_90_percent.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"V1m(1)=1 //reference voltage in volts\n",
+"V1m(2)=0.9//reduced voltage in volts\n",
+"ratio=(V1m(1)/V1m(2))^2 //ratio of s2/s1\n",
+"mprintf('s2/s1=%f\n',ratio)//ans may vary due to roundoff error\n",
+"mprintf('I2(2)/I2(1)=s2*V1m(2)/s1*V1m(1)=%f\n',(V1m(2)/V1m(1))*ratio)//ans may vary due to roundoff error\n",
+"mprintf('(copperloss)2/(copperloss)1=(I2(2)/I2(1))^2=%f\n',(V1m(1)/V1m(2))^2)//ans may vary due to roundoff error\n",
+"s=0.03 //at 60Hz slip\n",
+"ns=1800 //synchronous speed in rev/min\n",
+"mprintf('Speed at 90 percent voltage=%frev/min\n',ns*(1-(ratio*s)))//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.7: Calculate_performance_of_motor_at_given_slip.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//code uses userdefined function complexstring\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"//dc test\n",
+"Vdc=13.8 //dc voltage in volts\n",
+"Idc=13 //direct current in amperes\n",
+"//no load test\n",
+"Vnl=220 //applied no voltage in volts\n",
+"f=60 //applied frequency in Hz\n",
+"//blocked rotor test\n",
+"VBR=23.5 //blocked rotor voltage in volts\n",
+"f1=15 //frequency in Hz\n",
+"Ia=12.8 //current of phase A\n",
+"Ib=13.1 //current of phase B\n",
+"Ic=12.9 //current of phase C\n",
+"//from blocked rotor\n",
+"IBR=(Ia+Ib+Ic)/3 //ans may vary due to roundoff error\n",
+"mprintf('IBR=%fA\n',IBR)\n",
+"ZBR=VBR/(sqrt(3)*IBR)\n",
+"mprintf('|ZBR|=%fΩ\n',ZBR)//ans may vary due to roundoff error\n",
+"P1=179 //power in watts\n",
+"P2=290 //power in watts\n",
+"PBR=P1+P2\n",
+"mprintf('PBR=%fW\n',PBR)\n",
+"RBR=PBR/(3*(IBR^2))//ans may vary due to roundoff error\n",
+"mprintf('RBR=%fΩ\n',RBR)\n",
+"mprintf('θBR=%f\n',(acos(PBR/(sqrt(3)*VBR*IBR)))*(180/%pi))//ans may vary due to roundoff error\n",
+"mprintf('X`BR=|ZBR|*sinθBR=%fΩ\n',ZBR*sin(acos(PBR/(sqrt(3)*VBR*IBR))))//ans may vary due to roundoff error\n",
+"XBR=(f/f1)*(ZBR*sin(acos(PBR/(sqrt(3)*VBR*IBR))))\n",
+"mprintf('XBR=(fB/f1)*X`BR=%fΩ\n',XBR)//ans may vary due to roundoff error\n",
+"x1=0.4*XBR //designed reactance\n",
+"x2=0.6*XBR //designed reactance\n",
+"mprintf('x1=%fΩ\n',x1)//ans may vary due to roundoff error\n",
+"mprintf('x2=%fΩ\n',x2)//ans may vary due to roundoff error\n",
+"//from dc test\n",
+"r1=0.5*(Vdc/Idc)\n",
+"mprintf('r1=%fΩ\n',r1)//ans may vary due to roundoff error\n",
+"r2=RBR-r1\n",
+"mprintf('r2=%fΩ\n',r2)//ans may vary due to roundoff error\n",
+"//from no load test\n",
+"Ia=3.86 //current of phase A in amperes\n",
+"Ib=3.86 //current of phase B in amperes\n",
+"Ic=3.89 //current of phase C in amperes\n",
+"Inl=(Ia+Ib+Ic)/3\n",
+"mprintf('Inl=%fA\n',Inl)//ans may vary due to roundoff error\n",
+"Znl=Vnl/(sqrt(3)*Inl)\n",
+"mprintf('Znl=x1+Xm=%fΩ\n',Znl)//ans may vary due to roundoff error\n",
+"Xm=Znl-x1\n",
+"mprintf('Xm=Znl-x1=%fΩ\n',Xm)//ans may vary due to roundoff error\n",
+"P1=550 //power in watts \n",
+"P2=-350 //power in watts\n",
+"Pnl=P1+P2\n",
+"mprintf('Pnl=%fW\n',Pnl)//ans may vary due to roundoff error\n",
+"Pfwc=Pnl-(3*Inl*Inl*r1)\n",
+"mprintf('Pfwc=%fW\n',Pfwc)//ans may vary due to roundoff error\n",
+"Prot=Pfwc\n",
+"s=0.03\n",
+"z2=(r2/s)+(%i*x2)\n",
+"disp('z2='+complexstring(z2)+'Ω')//ans may vary due to roundoff error\n",
+"mprintf('Z2=%fohms with a phase angle of %fdegrees\n',abs(z2),(acos(real(z2)/abs(z2)))*180/%pi)\n",
+"Zf=(z2*(%i*Xm))/(z2+(%i*Xm))\n",
+"disp('Zf='+complexstring(Zf)+'Ω')//ans may vary due to roundoff error\n",
+"mprintf('Zf=%fohms with a phase angle of %fdegrees\n',abs(Zf),(acos(real(Zf)/abs(Zf)))*180/%pi)\n",
+"Rf=real(Zf)\n",
+"Zin=r1+Zf+(%i*x1)\n",
+"disp('Zin='+complexstring(Zin)+'Ω')//ans may vary due to roundoff error\n",
+"mprintf('Zin=%fohms with a phase angle of %fdegrees\n',abs(Zin),(acos(real(Zin)/abs(Zin)))*180/%pi)\n",
+"mprintf('power factor=%f\n',(real(Zin)/abs(Zin)))//ans may vary due to roundoff error\n",
+"I1=Vnl/(sqrt(3)*abs(Zin))\n",
+"mprintf('|I1|=%fA\n',I1)//ans may vary due to roundoff error\n",
+"Pin=(sqrt(3)*(real(Zin)/abs(Zin))*I1*Vnl)//ans is wrong in textbook\n",
+"mprintf('power drawn from line=sqrt(3)*VL*|I|*cosθΦ=%fW\n',Pin)\n",
+"Rf=real(Zf)\n",
+"Pg=3*I1*I1*Rf\n",
+"mprintf('Pg=%fW\n',Pg)//ans is wrong in textbook\n",
+"DMP=Pg*(1-s)\n",
+"mprintf('DMP=%fW\n',DMP)//ans is wrong in textbook\n",
+"Pout=DMP-Prot\n",
+"mprintf('output horsepower=%fhp\n',Pout/746)//ans may vary due to roundoff error,1 hp=746 watts\n",
+"mprintf('η=Pout/Pin=%f\n',Pout/Pin)//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.8: Upper_limit_of_the_starting_current_at_230v.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"kVA=6.3 //upper limit for kVA per horsepower\n",
+"hp=10 //rating of induction motor in hp.(1 hp=746 watts)\n",
+"V=230 //voltage rating of the motor\n",
+"I=(kVA*hp*1000)/(sqrt(3)*V)\n",
+"mprintf('I=%fA\n',I)//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.9: Find_the_starting_line_current_and_torque_with_provided_compensation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"vtap=0.8 //percantage voltage tap of compensator\n",
+"hp=100 //rating of motor in horsepower,I hp=746 watts\n",
+"n=1750 //rated speed of motor in rev/min\n",
+"a=1/vtap //compensator turns ratio\n",
+"V=2300 //voltage rating of induction motor in volts\n",
+"I1=150 //current rating in amperes\n",
+"mprintf('a=%f\n',a)\n",
+"mprintf('Voltage applied at starting of motor=%fV\n',V/a)\n",
+"I1start=I1/a\n",
+"mprintf('I1start=(1840/2300)*150A=150/a=%fA\n',I1start)\n",
+"IL=I1start/a\n",
+"mprintf('IL=I1start/a=%fA\n',IL)\n",
+"tfl=hp*5252/n\n",
+"mprintf('τfl=(hp*5252)/(rev/min)=%flb-ft\n',tfl)//ans may vary due to roundoff error\n",
+"t=1.2*tfl //120 percent of the full load torque in lb-ft\n",
+"mprintf('τst=360/a*a=%flb-ft\n',t/(a*a))//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/5-Direct_Current_Machines.ipynb b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/5-Direct_Current_Machines.ipynb
new file mode 100644
index 0000000..44353ee
--- /dev/null
+++ b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/5-Direct_Current_Machines.ipynb
@@ -0,0 +1,278 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 5: Direct Current Machines"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.1: EX5_1.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"B=0.78 //flux density in tesla\n",
+"A=200*(10^(-4))//cross sectional area in centimetre square\n",
+"mprintf('Flux per pole Φ=B.A=%fWb\n',B*A)\n",
+"C=95 //no of coils\n",
+"Nc=2 //no of turns in each coil\n",
+"Z=2*C*Nc\n",
+"mprintf('Z=2*C*Nc=%fconductors\n',Z)\n",
+"n=1200 //rotating speed in rev/min\n",
+"w=(n/60)*(2*%pi)\n",
+"mprintf('w=%frad/s\n',w)//ans may vary due to rounof error\n",
+"a=2 //no of paths\n",
+"p=4 //no of poles\n",
+"Ka=(Z*p)/(2*%pi*a)\n",
+"mprintf('Ka=%fV-s/Wb\n',Ka)//ans may vary due to rounof error\n",
+"Eg=Ka*B*A*w\n",
+"mprintf('Eg=Ka*Φ*w=%fV\n',Eg)//ans may vary due to rounof error\n",
+"VT=250 //terminal voltage in volts\n",
+"ra=0.2 //armture resistance in ohms\n",
+"Ia=(VT-Eg)/ra\n",
+"mprintf('Ia=%fA\n',Ia)//ans may vary due to rounof error\n",
+"Pin=VT*Ia\n",
+"mprintf('Pin=%fW\n',Pin)//ans in textbook is wrong\n",
+"mprintf('Armature copper loss=%fW\n',((Ia*Ia)*ra))//ans in textbook is wrong\n",
+"Pd=Pin-((Ia*Ia)*ra)//ans in textbook is wrong\n",
+"mprintf('Pd=Pin-coper loss=%fW\n',Pd)\n",
+"mprintf('τd=Pd/w=%fN-m ',Pd/w)\n",
+"cf=0.7376 //conversion factor for conversion from N-m to lb-ft\n",
+"mprintf('or %flb-ft',(Pd/w)*cf)//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.2: EX5_2.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"I=100 //current drawn in amperes\n",
+"ra=0.07 //armature resistance in ohms\n",
+"Vt=230 //terminal voltage of motor in volts\n",
+"mprintf('Eg*=VT*-Iara*=%fV\n',Vt-(I*ra))\n",
+"n=1200 //speed of rotation in rev/min\n",
+"mprintf('w*=%dπrad/sec\n',(n/60)*2)\n",
+"mprintf('KaΦ=Eg*/w*=%fV-s/rad\n',(Vt-(I*ra))/((n/60)*2*%pi))//ans may vary due to roundoff error\n",
+"Ia=100 //armature current in ampere\n",
+"mprintf('τd=KaΦIa=%fN-m\n',(Ia*(Vt-(I*ra))/((n/60)*2*%pi)))//ans may vary due to roundoff error\n",
+"Td=300 //torque in N-m\n",
+"Ia=Td/((Vt-(I*ra))/((n/60)*2*%pi))//ans may vary due to roundoff error\n",
+"mprintf('Ia=τd/KaΦ=%fA\n',Ia)\n",
+"ra=0.07 //resistance in ohms\n",
+"VT=230 //voltage in volts\n",
+"w=(VT-Ia*ra)/((Vt-(I*ra))/((n/60)*2*%pi))\n",
+"mprintf('w=(VT-Iara)/KaΦ=%frad/sec\n',w)//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.3: Find_speed_of_the_motor_when_it_develops_a_torque_of_300_Newton_metre.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//Ex5_3 uses a magnetization curve given in textbook\n",
+"mprintf('At 1200 rev/min and shunt field current of 0.7A Eg*=90V \n') //from magnetization curve\n",
+"n=1200 //speed of rotation in rev/min\n",
+"Eg1=90 //voltage in volts\n",
+"wB=(n/60)*2\n",
+"mprintf('wB=%dπrad/sec\n',wB)\n",
+"mprintf('KaΦ*=Eg*/wB=%fV-s/rad\n',Eg1/(wB*%pi))//ans may vary due to roundoff error\n",
+"Td=30 //torque in N-m\n",
+"Ia=Td/(Eg1/(wB*%pi))\n",
+"mprintf('Ia=τd/KaΦ*=%fA\n',Ia)//ans may vary due to roundoff error\n",
+"VT=125 //voltage in volts\n",
+"ra=0.2 //resistance in ohms\n",
+"Eg=VT-(Ia*ra)\n",
+"mprintf('Eg=%fV\n',Eg)//ans may vary due to roundoff error\n",
+"w=Eg/((Eg1/(wB*%pi)))\n",
+"mprintf('w=Eg/KaΦ*=%frad/s\n',w)//ans may vary due to roundoff error\n",
+"n=(w*60)/(2*%pi)\n",
+"mprintf('n=%frev/min\n',n)//ans may vary due to roundoff error\n",
+"//other two techniques\n",
+"//first technique\n",
+"nB=1200 //speed in rev/min\n",
+"n=nB*(Eg/Eg1)//ans may vary due to roundoff error\n",
+"mprintf('n=%frev/min\n',n)\n",
+"//second technique\n",
+"mprintf('τd=%flb-ft\n',Td*0.738)//ans may vary due to roundoff error\n",
+"mprintf('Ka`Φ=Eg*/nB=%fV-min/rev\n',Eg/nB)\n",
+"Ia=(Td*0.738)/(7.04*(Eg1/nB))//ans may vary due to roundoff error\n",
+"mprintf('Ia=τd/(7.04*Ka`*Φ)=%fA\n',Ia)\n",
+"n=Eg/(Eg1/nB)\n",
+"mprintf('n=Eg/K`aΦ=%frev/min\n',n)//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.4: Find_the_terminal_voltage_at_full_load_and_no_load_and_voltage_regulation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//Ex5_4 uses a figure given in textbook\n",
+"Ia=50 //current in amperes\n",
+"IB=50 //current in amperes\n",
+"nB=1200 //speed in rev/min\n",
+"ratio=0.01 //ratio of Nsc/Nf ,unit less\n",
+"Isc=0.6*Ia //equation given in textbook\n",
+"mprintf('Isc=%dA\n',Isc)\n",
+"If=1.3 //field current in amperes\n",
+"mprintf('If*=If+(Nsc/Nf)*Isc=%fA\n',If+(ratio*Isc))\n",
+"Eg1=132.5 //voltage in volts\n",
+"mprintf('Ka`Φ=Eg*/nB=%fV-min/rev\n',Eg1/nB)//ans may vary due to roundoff error\n",
+"n=1140 //speed in rev/min\n",
+"Eg=n*(Eg1/nB)\n",
+"mprintf('Eg=Ka`n=%fV\n',Eg)//ans may vary due to roundoff error\n",
+"ra=0.2 //resistance in ohms\n",
+"Ra=0.03+ra //by kirchodff's law and parallel combination or resistances\n",
+"mprintf('Ra=%fΩ\n',Ra)\n",
+"VTfl=Eg-(Ia*Ra)\n",
+"mprintf('VTfl=%fV\n',VTfl)//ans may vary due to roundoff error\n",
+"mprintf('If*=If+0=%fA\n',If)\n",
+"Eg2=125 //voltage in volts\n",
+"VTnl=Eg*(n/nB)\n",
+"mprintf('Eg=Eg*(n/nB)=%fV\n',VTnl)//ans may vary due to roundoff error\n",
+"mprintf('Voltage Regulation=(VTnl-VTfl)/VTfl=%f%c',((VTnl-VTfl)/VTfl)*100,'%') //ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.5: Find_the_efficiency_and_input_horsepower_requirements_under_given_conditions.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"V=250 //voltage rating in volts\n",
+"Pout=125000 //output power in watts\n",
+"ra=0.025 //armature resistance in ohms\n",
+"rsc=0.01 //resistance in ohms \n",
+"rf=30 //field resistance in ohms\n",
+"If=5 //field current in amperes\n",
+"mprintf('Shunt field copper loss=%dW\n',If*If*rf)\n",
+"Iload=Pout/V\n",
+"Ia=Iload+If\n",
+"Isc=Iload+If\n",
+"mprintf('Ia=Isc=Iload+If=%dA\n',Ia)\n",
+"mprintf('Seires filed copper losses=%dW\n',Isc*Isc*rsc)\n",
+"mprintf('ACL=%fW\n',Ia*Ia*ra)//ans in textbook is wrong\n",
+"mprintf('Brush copper loss=2Ia=%dW\n',2*Ia)\n",
+"mprintf('Stray load loss=1%c of 125Kw=%fW\n','%',0.01*Pout)\n",
+"Prot=5000 //rotational loss in watts\n",
+"losses=(If*If*rf)+(Isc*Isc*rsc)+(Ia*Ia*ra)+(2*Ia)+(0.01*Pout)+Prot //aadding all losses\n",
+"\n",
+"mprintf('Efficiency=%f%c\n',(Pout/(Pout+losses))*100,'%')//ans may vary due to roundoff eror\n",
+"rlosses=500 //rheostat losses in watts\n",
+"Pin=Pout+losses+rlosses\n",
+"mprintf('Pin required=%fW\n',Pin) //ans in the textbook is wrong\n",
+"Ia1=sqrt((Prot+(If*If*rf))/(ra+rsc))\n",
+"mprintf('Ia1=%fA\n',Ia1)\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/6-Single_Phase_Machines.ipynb b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/6-Single_Phase_Machines.ipynb
new file mode 100644
index 0000000..84f0122
--- /dev/null
+++ b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/6-Single_Phase_Machines.ipynb
@@ -0,0 +1,184 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 6: Single Phase Machines"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.1: Find_the_performance_of_a_single_phase_motor_under_provided_conditions.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//code uses a userdefined function complexstring\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"r1m=1.9//resistance in ohms\n",
+"x1m=2.6 //reactance in ohms\n",
+"r2=3.6 //resistance in ohms\n",
+"x2=2.6 //reactance in ohms\n",
+"Xm=56 //magnetizing reactance in ohms\n",
+"Prot=25 //rotational losses in watts\n",
+"f=60 //supply frequency in Hz\n",
+"z1m=r1m+(%i*x1m)\n",
+"s=0.05 //slip\n",
+"disp('Z1m='+complexstring(z1m)+'Ω')\n",
+"Zf=((%i*Xm)*((r2/s)+(%i*x2)))/((%i*Xm)+(r2/s)+(%i*x2))//ans may vary due to roundoff error\n",
+"disp('Zf/2='+complexstring(Zf/2)+'Ω')\n",
+"Zb=((%i*Xm)*((r2/(2-s))+(%i*x2)))/((%i*Xm)+(r2/(2-s))+(%i*x2))//ans may vary due to roundoff error\n",
+"disp('Zb/2='+complexstring(Zb/2)+'Ω')\n",
+"Vm=115 //voltage in volts\n",
+"Im=Vm/((Zf/2)+(Zb/2)+z1m) //ans may vary due to roundoff error\n",
+"Imf=Im\n",
+"Imb=Im\n",
+"disp('Im='+complexstring(Im)+'A')\n",
+"Pin=Vm*abs(Im)*(real(Im)/abs(Im))//ans may vary due to roundoff error\n",
+"mprintf('Pin=%fW\n',Pin)\n",
+"Pg=((abs(Im))^2)*(real(Zf/2)-real(Zb/2))//ans may vary due to roundoff error\n",
+"mprintf('Pg=Pgf-Pgb=%fW\n',Pg)\n",
+"mprintf('τd=%fN-m\n',Pg/(2*%pi*(f/2)))\n",
+"DMP=Pg*(1-s)\n",
+"mprintf('DMP=%fW\n',DMP)//ans may vary due to roundoff error\n",
+"Pout=DMP-Prot\n",
+"mprintf('Pout=%fW\n',Pout)//ans may vary due to roundoff error\n",
+"mprintf('Efficiency=%f\n',Pout/Pin)//ans may vary due to roundoff error\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.2: Calculate_the_starting_torque_for_the_motor_under_provided_parametres.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//Ex6_2 is an extension of Ex6_1\n",
+"//code uses userdefined function complexstring\n",
+"function s=complexstring(a)\n",
+" \n",
+" \n",
+" if imag(a)>=0 then\n",
+" s=sprintf('%g+%gi',real(a),imag(a))\n",
+" else\n",
+" s=sprintf('%g%gi',real(a),imag(a))\n",
+" \n",
+" end\n",
+" funcprot(0)\n",
+"endfunction\n",
+"r1a=12//resistance in ohms\n",
+"x1a=6.5//reactance in ohms\n",
+"Xc=-20 //reactance in ohms\n",
+"r1m=1.9 //from E6_1\n",
+"x2=2.6 //from Ex6_1\n",
+"s=1\n",
+"a=1.6 //no unit\n",
+"r2=3.6 //resistance in ohms\n",
+"x2=2.6 //reactance in ohms\n",
+"Xm=56 //magnetizing reactance in ohms\n",
+"Vm=115 //applied voltage in volts\n",
+"Zf=((%i*Xm)*((r2/s)+(%i*x2)))/((%i*Xm)+(r2/s)+(%i*x2))//from Ex6_1\n",
+"Zst=Zf\n",
+"Zb=Zf\n",
+"z1a=r1a+(%i*x1a)+(%i*Xc)\n",
+"disp('z1a='+complexstring(z1a)+'Ω')//ans may vary due to roundoff error\n",
+"mprintf('z1a=%fohm havinga phase angle of %f degrees\n',abs(z1a),(acos(real(z1a)/abs(z1a)))*180/%pi)\n",
+"Z12=((1/2)*(z1a/(a*a)))-(r1m+(%i*x2))//ans in textbook is wrong\n",
+"disp('Z12='+complexstring(Z12)+'Ω')//ans may vary due to roundoff error\n",
+"mprintf('Z12=%fohm havinga phase angle of %f degrees\n',abs(Z12),(acos(real(Z12)/abs(Z12)))*180/%pi)\n",
+"Vmf=(Vm/2)*(1-(%i/a))\n",
+"disp('Vmf='+complexstring(Vmf)+'V')//ans may vary due to roundoff error\n",
+"mprintf('Vmf=%fV havinga phase angle of %f degrees\n',abs(Vmf),(-1)*(acos(real(Vmf)/abs(Vmf)))*180/%pi)\n",
+"Vmb=(Vm/2)*(1+(%i/a))\n",
+"disp('Vmb='+complexstring(Vmb)+'V')//ans may vary due to roundoff error\n",
+"mprintf('Vmb=%fV having a phase angle of %f degrees\n',abs(Vmb),(acos(real(Vmb)/abs(Vmb)))*180/%pi)\n",
+"Imf=11.77*exp(%i*(-1)*54.93*%pi/180)//textbook doesnt provide any formula or hint for this calculation\n",
+"Imb=4.37*exp(%i*(-1)*19.7*%pi/180)//textbook doesnt provide any formula or hint for this calculation\n",
+"disp('Imf='+complexstring(Imf)+'A')//ans may vary due to roundoff error\n",
+"disp('Imb='+complexstring(Imb)+'A')//ans may vary due to roundoff error\n",
+"mprintf('Imf=%fA having a phase angle of %f degrees\n',11.77,-54.93)\n",
+"mprintf('Imb=%fA having a phase angle of %f degrees\n',4.37,-19.37)\n",
+"mprintf('τst=%fN-m\n',(2*real(Zst)*((abs(Imf)^2)-(abs(Imb)^2)))/(60*%pi))//ans may vary due to roundoff error\n",
+"Im=Imf+Imb\n",
+"disp('Im='+complexstring(Im)+'A')//ans may vary due to roundoff error\n",
+"mprintf('Im=%fA having a phase angle of%f degrees\n',abs(Im),(-1)*(acos(real(Im)/abs(Im)))*180/%pi)\n",
+"Ia=(%i*(Imf-Imb))/a\n",
+"disp('Ia='+complexstring(Ia)+'A')//ans may vary due to roundoff error\n",
+"mprintf('Ia=%fA having a phase angle of %f degrees\n',abs(Ia),(acos(real(Ia)/abs(Ia)))*180/%pi)\n",
+"I=Im+Ia\n",
+"disp('Line current='+complexstring(I)+'A')//ans may vary due to roundoff error\n",
+"mprintf('I=%fA having a phase angle of %f degrees\n',abs(I),(-1)*(acos(real(I)/abs(I)))*180/%pi)\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+"\n",
+""
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/8-Forces_And_Torques_In_Electromagnetic_Systems.ipynb b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/8-Forces_And_Torques_In_Electromagnetic_Systems.ipynb
new file mode 100644
index 0000000..27477c1
--- /dev/null
+++ b/An_Introduction_to_Electrical_Machines_and_Transformers_by_G_Mcphersion/8-Forces_And_Torques_In_Electromagnetic_Systems.ipynb
@@ -0,0 +1,64 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 8: Forces And Torques In Electromagnetic Systems"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.2: EX8_2.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"x=0.01 //length in metres\n",
+"L=0.03+(270*x*x) //equation provided in the textbook\n",
+"mprintf('L(0.01)=%fH\n',L)\n",
+"w=377 //angular frequency in rad/sec\n",
+"XL=w*L\n",
+"mprintf('XL=wL=%fΩ\n',XL)//ans may vary due to toundoff error\n",
+"I=1 //current in ampere\n",
+"V=I*XL\n",
+"mprintf('V=IXL=%fV\n',V)//ans may vary due to toundoff error\n",
+"a=540 //comes from an equation in textbook,unit is henry/metre\n",
+"f=(1/2)*(a*x)\n",
+"mprintf('f=%fN\n',f)\n",
+"\n",
+""
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}