diff options
author | Prashant S | 2020-04-14 10:25:32 +0530 |
---|---|---|
committer | GitHub | 2020-04-14 10:25:32 +0530 |
commit | 06b09e7d29d252fb2f5a056eeb8bd1264ff6a333 (patch) | |
tree | 2b1df110e24ff0174830d7f825f43ff1c134d1af /Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck | |
parent | abb52650288b08a680335531742a7126ad0fb846 (diff) | |
parent | 476705d693c7122d34f9b049fa79b935405c9b49 (diff) | |
download | all-scilab-tbc-books-ipynb-master.tar.gz all-scilab-tbc-books-ipynb-master.tar.bz2 all-scilab-tbc-books-ipynb-master.zip |
Initial commit
Diffstat (limited to 'Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck')
13 files changed, 3652 insertions, 0 deletions
diff --git a/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/1-Vector_Analysis.ipynb b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/1-Vector_Analysis.ipynb new file mode 100644 index 0000000..5166ce3 --- /dev/null +++ b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/1-Vector_Analysis.ipynb @@ -0,0 +1,206 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 1: Vector Analysis" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.1: Program_to_find_the_unit_vector.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the unit vector\n", +"//Example1.1\n", +"//page 8\n", +"G = [2,-2,-1]; //position of point G in cartesian coordinate system\n", +"aG = UnitVector(G);\n", +"disp(aG,'Unit Vector aG =')\n", +"//Result\n", +"//Unit Vector aG = \n", +"// 0.6666667 - 0.6666667 - 0.3333333 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.2: find_the_phase_angle_between_two_vectors.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find the phase angle between two vectors\n", +"//Example1.2\n", +"//page 11\n", +"clc;\n", +"Q = [4,5,2]; //point Q\n", +"x = Q(1);\n", +"y = Q(2);\n", +"z = Q(3);\n", +"G = [y,-2.5*x,3]; //vector field\n", +"disp(G,'G(rQ) =')\n", +"aN = [2/3,1/3,-2/3]; //unit vector- direction of Q\n", +"G_dot_aN = dot(G,aN); //dot product of G and aN\n", +"disp(G_dot_aN,'G.aN =')\n", +"G_dot_aN_aN = G_dot_aN*aN;\n", +"disp(G_dot_aN_aN,'(G.aN)aN=')\n", +"teta_Ga = Phase_Angle(G,aN) //phase angle between G and unit vector aN\n", +"disp(teta_Ga,'phase angle between G and unit vector aN in degrees =')\n", +"//Result\n", +"// G(rQ) = 5. - 10. 3. \n", +"// G.aN = - 2. \n", +"// (G.aN)aN = - 1.3333333 - 0.6666667 1.3333333 \n", +"// phase angle between G and unit vector aN in degrees = 99.956489 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.3: Rectangular_coordinates_into_cylindrical.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Transform the vector of Rectangular coordinates into cylindrical coordinates\n", +"//Example1.3\n", +"//page 18\n", +"clc;\n", +"y = sym('y');\n", +"x = sym('x');\n", +"z = sym('z');\n", +"ax = sym('ax');\n", +"ay = sym('ay');\n", +"az = sym('az');\n", +"ar = sym('ar');\n", +"aphi = sym('aphi');\n", +"phi = sym('phi');\n", +"B = y*ax-x*ay+z*az;\n", +"disp(B,'Given vector in cartesian co-ordiante system B=')\n", +"Br = B*ar;\n", +"Bphi = B*aphi;\n", +"Bz = B*az;\n", +"disp('Components of cylindrical vector B')\n", +"disp(Br,'Br=')\n", +"disp(Bphi,'Bphi=')\n", +"disp(Bz,'Bz=')\n", +"//Result\n", +"//Given vector in cartesian co-ordiante system B= \n", +"// az*z+ax*y-ay*x \n", +"// Components of cylindrical vector B \n", +"// Br= \n", +"// ar*(az*z+ax*y-ay*x) \n", +"// Bphi= \n", +"// aphi*(az*z+ax*y-ay*x) \n", +"// Bz= \n", +"// az*(az*z+ax*y-ay*x) \n", +"//" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.4: Rectangular_coordinates_into_spherical.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Transform the vector of Rectangular coordinates into spherical coordinates\n", +"//Example1.4\n", +"//page 22\n", +"clc;\n", +"y = sym('y');\n", +"x = sym('x');\n", +"z = sym('z');\n", +"ax = sym('ax');\n", +"ay = sym('ay');\n", +"az = sym('az');\n", +"ar = sym('ar');\n", +"aTh = sym('aTh');\n", +"aphi = sym('aphi');\n", +"G = (x*z/y)*ax;\n", +"disp(G,'Given vector in cartesian co-ordiante system B=')\n", +"r = sym('r');\n", +"teta = sym('teta')\n", +"phi = sym('phi')\n", +"x1 = r*sin(teta)*cos(phi);\n", +"y1 = r*sin(teta)*sin(phi);\n", +"z1 = r*cos(teta);\n", +"G1 = (x1*z1/y1)*ax;\n", +"Gr = G1*ar;\n", +"GTh = G1*aTh;\n", +"Gphi = G1*aphi;\n", +"Gsph = [Gr,GTh,Gphi];\n", +"disp(Gr,'Gr=')\n", +"disp(GTh,'GTh=')\n", +"disp(Gphi,'Gphi=')\n", +"//Result\n", +"//Given vector in cartesian co-ordiante system B = ax*x*z/y \n", +"//Gr = ar*ax*cos(phi)*r*cos(teta)/sin(phi) \n", +"//GTh = ax*cos(phi)*r*cos(teta)*aTh/sin(phi) \n", +"//Gphi = aphi*ax*cos(phi)*r*cos(teta)/sin(phi) \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/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/11-Transmission_Lines.ipynb b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/11-Transmission_Lines.ipynb new file mode 100644 index 0000000..382636c --- /dev/null +++ b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/11-Transmission_Lines.ipynb @@ -0,0 +1,514 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 11: Transmission Lines" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.10: find_the_input_impedance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the input impedance for a line terminated with impedance(with inductive reactance)\n", +"//Example11.10\n", +"//page369\n", +"clc;\n", +"close;\n", +"ZL = 25+%i*50; //load impdance in ohms\n", +"Zo = 50; //characteristic impedance in ohms\n", +"T = reflection_coeff(ZL,Zo);//reflection coefficient in rectandular form\n", +"[R,teta] = polar(T);//reflection coefficient in polar form\n", +"L = 60e-02;//length 60 cm\n", +"Lambda = 2; //wavelength = 2m\n", +"EL = electrical_length(L,Lambda);\n", +"EL = EL/57.3; //electrical length in radians\n", +"Zin =(1+T*exp(-%i*2*EL))/(1-T*exp(-%i*2*EL));\n", +"disp(Zin,'Input impedance in ohms Zin =')\n", +"//Result\n", +"//Input impedance in ohms Zin = \n", +"// 0.2756473 - 0.4055013i " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.11: Steady_state_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:\n", +"//Example11.11\n", +"//page381\n", +"clc;\n", +"close;\n", +"Rg = 50; //series resistance with battery in ohms\n", +"Zo = Rg; //characteristic impedance\n", +"RL = 25; //load resistance\n", +"Vo = 10; //battery voltage in volts\n", +"V1_S = (Rg/(Zo+Rg))*Vo;\n", +"T = reflection_coeff(RL,Zo);\n", +"V1_R = T*V1_S;\n", +"I1_S = V1_S/Zo;\n", +"I1_R = -V1_R/Zo;\n", +"IB = Vo/(Zo+RL);\n", +"VL = Vo*(RL/(Rg+RL));\n", +"disp(V1_S,'Voltage at source in volts V1plus =')\n", +"disp(V1_R,'Voltage returns to battery in volts V1minus=')\n", +"disp(I1_S,'Current at battery in amps I1plus=')\n", +"disp(I1_R,'Current at battery in amps I1minus=')\n", +"disp(IB,'Steady state current through battery in amps IB=')\n", +"disp(VL,'Steady state load voltage in volts VL=')\n", +"//Result\n", +"//Voltage at source in volts V1plus = \n", +"// 5. \n", +"//Voltage returns to battery in volts V1minus= \n", +"// - 1.6666667 \n", +"//Current at battery in amps I1plus= \n", +"// 0.1 \n", +"//Current at battery in amps I1minus= \n", +"// 0.0333333 \n", +"//Steady state current through battery in amps IB= \n", +"// 0.1333333 \n", +"//Steady state load voltage in volts VL= \n", +"// 3.3333333 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.12: voltage_and_current_through_a_resistor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to plot the voltage and current through a resistor\n", +"//Example11.12\n", +"//page 386\n", +"clear;\n", +"close;\n", +"clc;\n", +"t1 = 0:0.1:2;\n", +"t2 = 2:0.1:4;\n", +"t3 = 4:0.1:6;\n", +"t4 = 6:0.1:8;\n", +"VR=[40*ones(1,length(t1)),-20*ones(1,length(t2)),10*ones(1,length(t3)),-5*ones(1,length(t4))];\n", +"IR =[-1.2*ones(1,length(t1)),0.6*ones(1,length(t2)),-0.3*ones(1,length(t3)),0.15*ones(1,length(t4))];\n", +"subplot(2,1,1)\n", +"a=gca();\n", +"a.x_location = 'origin';\n", +"a.y_location = 'origin';\n", +"a.data_bounds = [0,-100;10,100];\n", +"plot2d([t1,t2,t3,t4],VR,5)\n", +"xlabel(' t')\n", +"ylabel(' VR')\n", +"title('Resistor Voltage as a function of time')\n", +"subplot(2,1,2)\n", +"a=gca();\n", +"a.x_location = 'origin';\n", +"a.y_location = 'origin';\n", +"a.data_bounds = [0,-1.4;10,1.4];\n", +"plot2d([t1,t2,t3,t4],IR,5)\n", +"xlabel(' t')\n", +"ylabel(' IR')\n", +"title('Current through Resistor as a function of time')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.1: determine_the_total_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to determine the total voltage as a function\n", +"//of time and position in a loss less transmisson line\n", +"//Example11.1\n", +"//page342\n", +"//syms z,t,B,w,Vo;\n", +"VST = sym('2*Vo*cos(B*z)');\n", +"V_zt = VST*sym('cos(w*t)');\n", +"disp(V_zt,'V(z,t)=')\n", +"//Result\n", +"//V(z,t)= 2*Vo*cos(t*w)*cos(z*B) " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.2: characteristic_impedance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the characteristic impedance, the phase constant an the phase velocity\n", +"//Example11.2\n", +"//page344\n", +"clear;\n", +"clc;\n", +"close;\n", +"L = 0.25e-6; //0.25uH/m\n", +"C = 100e-12; //100pF/m\n", +"f = 600e06; //frequency f = 100MHz\n", +"W = 2*%pi*f; //angular frequency\n", +"Zo = sqrt(L/C); \n", +"B = W*sqrt(L*C);\n", +"Vp = W/B;\n", +"disp(Zo,'Characteristic Impedance in ohms Zo =')\n", +"disp(B,'Phase constant in rad/m B=')\n", +"disp(Vp,'Phase velocity in m/s Vp=')\n", +"//Result\n", +"//Characteristic Impedance in ohms Zo = \n", +"// 50. \n", +"//Phase constant in rad/m B= \n", +"// 18.849556 \n", +"//Phase velocity in m/s Vp= \n", +"// 2.000D+08 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.3: magnitude_and_phase_of_characteristic.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program tofind the magnitude and phase of characteristic\n", +"//impedance Zo\n", +"//Example11.3\n", +"//page347\n", +"Zo = sym('sqrt(L/C)*(1-sqrt(-1)*R/(2*W*L))');\n", +"teta = sym('atan(-R/(2*W*L))');\n", +"disp(Zo,'Characteristic impedance Zo =')\n", +"disp(teta,'The phase angle teta=')\n", +"//Result\n", +"//Characteristic impedance Zo = \n", +"// sqrt(L/C)*(1-%i*R/(2*L*W)) \n", +"//The phase angle teta= \n", +"// -atan(R/(2*L*W)) " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.4: output_power_and_attenuation_coefficient.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the output power and attenuation coefficient\n", +"//Example11.4\n", +"//page349\n", +"clear;\n", +"clc;\n", +"close;\n", +"z = 20; //distance in meters\n", +"Pz_P0_dB = -2; //fraction of power drop in dB\n", +"Pz_P0 = 10^(Pz_P0_dB/10);\n", +"disp(Pz_P0,'Fraction of input power reaches output P(z)/P(0)=')\n", +"P0_mid_dB = -1; //fraction of power drop at midpoint in dB\n", +"P0_mid = 10^(P0_mid_dB/10);\n", +"disp(P0_mid,'Fraction of the input power reaches the midpoint P(10)/P(0)=')\n", +"alpha = -Pz_P0_dB/(8.69*z);\n", +"disp(alpha,'attenuation in Np/m alpha=')\n", +"//Result\n", +"//Fraction of input power reaches output P(z)/P(0)= \n", +"// 0.6309573 \n", +"//Fraction of the input power reaches the midpoint P(10)/P(0)= \n", +"// 0.7943282 \n", +"//attenuation in Np/m alpha= \n", +"// 0.0115075" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.5: power_dissipated_in_the_lossless.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the power dissipated in the lossless\n", +"//transmission line\n", +"//Example11.5\n", +"//page352\n", +"clc;\n", +"close;\n", +"ZL = 50-%i*75; //load impedance in ohms\n", +"Zo = 50; //characteristic impedance in ohms\n", +"R = reflection_coeff(ZL,Zo);\n", +"Pi = 100e-03; //input power in milliwatts\n", +"Pt = (1-abs(R)^2)*Pi;//power dissipated by the load\n", +"disp(R,'Reflection coefficient R =')\n", +"disp(Pt*1000,'power dissipated by the load in milli watss Pt=')\n", +"//Result\n", +"//Reflection coefficient R = 0.36 - 0.48i \n", +"//power dissipated by the load in milli watss Pt = 64. " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.6: find_the_total_loss.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the total loss in lossy lines\n", +"//Example11.6\n", +"//page352-353\n", +"clc;\n", +"close;\n", +"L1 = 0.2*10;//loss(dB) in first line of length =10 m\n", +"L2 = 0.1*15;//loss(dB) in second line of length =15m\n", +"R = 0.3; //reflection coefficient \n", +"Pi = 100e-03;//input power in milli watts\n", +"Lj = 10*log10(1/(1-abs(R)^2));\n", +"Lt = L1+L2+Lj; \n", +"Pout = Pi*(10^(-Lt/10));\n", +"disp(Lt,'The total loss of the link in dB is Lt=')\n", +"disp(Pout*1000,'The output power will be in milli watss Pout =')\n", +"//Result\n", +"//The total loss of the link in dB is Lt= \n", +"// 3.9095861 \n", +"//The output power will be in milli watss Pout = \n", +"// 40.648207 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.7: find_the_load_impedance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the load impedance of a slotted line\n", +"//Example11.7\n", +"//page357\n", +"clear;\n", +"clc;\n", +"close;\n", +"S = 5; //standing wave ratio\n", +"T = (1-S)/(1+S); //reflection coefficient\n", +"Zo = 50; //characteristic impedance\n", +"ZL = Zo*(1+T)/(1-T);\n", +"disp(ZL,'Load impedance of a slotted line in ohms ZL=')\n", +"//Result\n", +"//Load impedance of a slotted line in ohms ZL = 10. " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.8: find_the_input_impedance_and_power_delivered.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the input impedance and power delivered to\n", +"//the load\n", +"//Example11.8\n", +"//page363\n", +"clc;\n", +"close;\n", +"ZR1 = 300; //input impedance of first receiver\n", +"ZR2 = 300; //input impedance of second receiver\n", +"Zo = ZR1; //characteristic impedance = 300 ohm\n", +"Zc = -%i*300;//capacitive impedance\n", +"L = 80e-02;//length = 80 cm\n", +"Lambda = 1; //wavelength = 1m\n", +"Vth = 60; // voltage 300 volts\n", +"Zth = Zo;\n", +"ZL1 = parallel(ZR1,ZR2);\n", +"ZL = parallel(ZL1,Zc); //net load impedane\n", +"T = reflection_coeff(ZL,ZR2);//reflection coefficient\n", +"[R,teta1] = polar(T); //reflection coefficient in polar form\n", +"teta1 = real(teta1)*57.3;//teta value in degrees\n", +"S = VSWR(R); //voltage standing wave ratio\n", +"EL = electrical_length(L,Lambda);\n", +"EL = EL/57.3; //electrical length in degrees\n", +"Zin = Zo*(ZL*cos(EL)+%i*Zo*sin(EL))/(Zo*cos(EL)+%i*ZL*sin(EL));\n", +"disp(Zin,'Input Impedance in ohms Zin =')\n", +"Is = Vth/(Zth+Zin);//source current in amps\n", +"[Is,teta2] = polar(Is);//source current in polar form\n", +"Pin = (1/2)*(Is^2)*real(Zin);\n", +"PL = Pin; //for lossless line\n", +"disp(Pin,'Power delivered to a loss less line in watss PL =')\n", +"//Result\n", +"//Input Impedance in ohms Zin = 755.49551 - 138.46477i \n", +"// Power delivered to a loss less line in watss PL = 1.2 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.9: find_the_input_impedance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the input impedance for a line terminated with pure capacitive impedance\n", +"//Example11.9\n", +"//page363\n", +"clc;\n", +"close;\n", +"ZL = -%i*300; //load impdance is purely capacitive impedance\n", +"ZR = 300;\n", +"T = reflection_coeff(ZL,ZR);//reflection coefficient in rectandular form\n", +"[R,teta] = polar(T);//reflection coefficient in polar form\n", +"S = VSWR(R)\n", +"if(S ==%inf)\n", +" Zo = ZR;\n", +"end\n", +"Zin =Zo*(ZL*cos(EL)+%i*Zo*sin(EL))/(Zo*cos(EL)+%i*ZL*sin(EL));\n", +"disp(T,'Reflection coefficient in rectangular form')\n", +"disp(S,'Voltage Standing Wave Ratio S=')\n", +"disp(Zin,'Input impedance in ohms Zin =')\n", +"//Result\n", +"//Reflection coefficient in rectangular form \n", +"// - i \n", +"//Voltage Standing Wave Ratio S= \n", +"// Inf \n", +"//Input impedance in ohms Zin = \n", +"// 588.78315i " + ] + } +], +"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/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/12-The_Uniform_Plane_Wave.ipynb b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/12-The_Uniform_Plane_Wave.ipynb new file mode 100644 index 0000000..c97fa6a --- /dev/null +++ b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/12-The_Uniform_Plane_Wave.ipynb @@ -0,0 +1,309 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12: The Uniform Plane Wave" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.1: phasor_of_forward_propagating_field.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to determine the phasor of forward propagating field\n", +"//Example12.1\n", +"//page400\n", +"clc;\n", +"close;\n", +"Eyzt = sym('100*exp(%i*10^8*t-%i*0.5*z+30)');\n", +"Eysz = sym('100*exp(%i*10^8*t-%i*0.5*z+30)*exp(-%i*10^8*t)');\n", +"disp(Eyzt)\n", +"disp(Eysz,'Forward Propagating Field in phasor form =')\n", +"//Result\n", +"//100*exp(-0.5*%i*z+100000000*%i*t+30) \n", +"// Forward Propagating Field in phasor form =100*exp(30-0.5*%i*z) " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.2: determine_the_instanteous_field.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to determine the instanteous field of a wave\n", +"//Example12.2\n", +"//page400-401\n", +"clc;\n", +"t = sym('t');\n", +"z = sym('z');\n", +"Ezt1 =sym('100*cos(-0.21*z+2*%pi*1e07*t)');\n", +"Ezt2 = sym('20*cos(-0.21*z+30+2*%pi*1e07*t)');\n", +"ax = sym('ax');\n", +"ay = sym('ay');\n", +"Ezt = Ezt1*ax+Ezt2*ay;\n", +"disp(Ezt,'The real instantaneous field Ezt =')\n", +"//Result\n", +"//The real instantaneous field Ezt = \n", +"// 100*ax*cos(0.21*z-2.0E+7*%pi*t)+20*ay*cos(0.21*z-2.0E+7*%pi*t-30) \n", +"//" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.3: find_the_Phase_constant.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the Phase constant, Phase velocity, Electric Field Intensity and Intrinsci ratio.\n", +"//Example12.3\n", +"//page408\n", +"clc;\n", +"syms t;\n", +"z = %z;\n", +"[uo,eo] = muo_epsilon();\n", +"ur = 1;\n", +"f = 10^6;\n", +"er1 = 81;\n", +"er2 =0;\n", +"etta0 = 377;\n", +"Ex0 = 0.1;\n", +"beta1 = phase_constant_dielectric(uo,eo,f,er1,er2,ur);\n", +"disp(beta1,'phase constant in rad/m beta=')\n", +"Lambda = 2*%pi/beta1;\n", +"Vp = phase_velocity(f,beta1);\n", +"disp(Vp,'Phase velocity in m/sec')\n", +"etta = intrinsic_dielectric(etta0,er1,er2)\n", +"disp(etta,'Intrinsic impedancein ohms =')\n", +"Ex = 0.1*cos(2*%pi*f*t-beta1*z)\n", +"disp(Ex,'Electric field in V/m Ex=')\n", +"Hy = Ex/etta;\n", +"disp(Hy,'Magnetic Field in A/m Hy=')\n", +"//Result\n", +"// phase constant in rad/m beta= 0.1886241 \n", +"// Phase velocity in m/sec = 33310626. \n", +"// Intrinsic impedancein ohms = 41.888889 \n", +"// Electric field in V/m Ex= cos(58342*z/309303-81681409*t/13)/10 \n", +"//equivalent to Ex = 0.1*cos(0.19*z-6283185.3*t) \n", +"// Magnetic Field in A/m Hy = 9*cos(58342*z/309303-81681409*t/13)/3770 \n", +"//equivalent to Hy = 0.0023873*cos(0.19*z-6283185.3*t) " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4: find_the_penetration_depth_and_intrinsic_impedance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the penetration depth and intrinsic impedance\n", +"//Example12.4\n", +"//page409\n", +"clc;\n", +"f = 2.5e09;//high microwave frequency = 2.5GHz\n", +"er1 = 78;//relative permittivity\n", +"er2 = 7;\n", +"C = 3e08; //free space velocity in m/sec\n", +"[uo,eo] = muo_epsilon(); //free space permittivity and permeability\n", +"ur = 1; //relative permeability\n", +"etta0 = 377; //free space intrinsic imedance in ohms\n", +"alpha = attenuation_constant_dielectric(uo,eo,f,er1,er2,ur);\n", +"etta = intrinsic_dielectric(etta0,er1,er2);\n", +"disp(alpha,'attenuation constant in Np/m alpha=')\n", +"disp(etta,'Intrinsic constant in ohms etta=')\n", +"//Result\n", +"//attenuation constant in Np/m alpha= 20.727602 \n", +"// Intrinsic constant in ohms etta= 42.558673 + 1.9058543i " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.5: find_the_attenuation_constant.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the attenuation constant,propagation constant and intrinsic impedance\n", +"//Example12.5\n", +"//page412\n", +"clc;\n", +"f = 2.5e09;//high microwave frequency = 2.5GHz\n", +"er1 = 78;//relative permittivity\n", +"er2 = 7;\n", +"C = 3e08; //free space velocity in m/sec\n", +"[uo,eo] = muo_epsilon(); //free space permittivity and permeability\n", +"ur = 1; //relative permeability\n", +"etta0 = 377; //free space intrinsic imedance in ohms\n", +"alpha = attenuation_constant_gooddie(uo,eo,f,er1,er2,ur);\n", +"etta = intrinsic_good_dielectric(etta0,er1,er2);\n", +"beta1 = phase_constant_gooddie(uo,eo,f,er1,er2,ur);\n", +"disp(alpha,'attenuation constant per cm alpha=')\n", +"disp(beta1,'phase constant in rad/m beta1 =')\n", +"disp(etta,'Intrinsic constant in ohms etta=')\n", +"//Result\n", +"//attenuation constant per cm alpha= \n", +"// 20.748417 \n", +"//phase constant in rad/m beta1 = \n", +"// 462.3933 \n", +"//Intrinsic constant in ohms etta= \n", +"// 42.558673 + 1.9058543i " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.6: find_skin_depth.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find skin depth, loss tangent and phase velocity\n", +"//Example12.6\n", +"//page419\n", +"clc;\n", +"f1 = 1e06; //frequency in Hz\n", +"//er1 = 81;\n", +"ur = 1;\n", +"[uo,eo] = muo_epsilon();//free space permittivity and permeability\n", +"sigma = 4;//conductivity of a conductor in s/m\n", +"[del] = SkinDepth(f1,uo,ur,sigma);\n", +"pi = 22/7;\n", +"Lambda = 2*pi*del;\n", +"Vp = 2*pi*f1*del;\n", +"disp(del*100,'skin depth in cm delta =')\n", +"disp(Lambda,'Wavelength in metre Lambda =')\n", +"disp(Vp,'Phase velocity in m/sec Vp =')\n", +"//Result\n", +"//skin depth in cm delta = \n", +"// 25.17737 \n", +"//Wavelength in metre Lambda = \n", +"// 1.5825775 \n", +"//Phase velocity in m/sec Vp = \n", +"// 1582577.5 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.7: Electric_field.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//\n", +"clc;\n", +"s = sym('s');\n", +"B = sym('B');\n", +"Eo = sym('Eo');\n", +"z = sym('z');\n", +"ax = sym('ax');\n", +"EsL = Eo*(ax+%i*ay)*exp(%i*s)*exp(-%i*B*z);\n", +"EsR = Eo*(ax-%i*ay)*exp(-%i*B*z);\n", +"Est = Eo*exp(%i*s/2)*(2*cos(s/2)*ax-%i*2*%i*sin(s/2)*ay)*exp(-%i*B*z);\n", +"disp(EsL,'Left circularly polarized field EsL=')\n", +"disp(EsR,'Right circularly polarized field EsR=')\n", +"disp(Est,'Total Elecetric field of a linearly polarized wave EsT =')\n", +"//Result\n", +"//Left circularly polarized field EsL= \n", +"// (%i*ay+ax)*Eo*exp(%i*s-%i*z*B) \n", +"//Right circularly polarized field EsR= \n", +"// (ax-%i*ay)*Eo*%e^-(%i*z*B) \n", +"//Total Elecetric field of a linearly polarized wave EsT = \n", +"// Eo*(2*ay*sin(s/2)+2*ax*cos(s/2))*exp(%i*s/2-%i*z*B) " + ] + } +], +"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/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/13-Plane_Wave_Reflection_and_Dispersion.ipynb b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/13-Plane_Wave_Reflection_and_Dispersion.ipynb new file mode 100644 index 0000000..41f1a6f --- /dev/null +++ b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/13-Plane_Wave_Reflection_and_Dispersion.ipynb @@ -0,0 +1,490 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 13: Plane Wave Reflection and Dispersion" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.10: group_velocity_and_phase_velocity.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to determine group velocity and phase velocity of a wave\n", +"//Example13.10\n", +"//page470\n", +"clc;\n", +"w = sym('w');\n", +"wo = sym('wo');\n", +"no = sym('no');\n", +"c = sym('c');\n", +"beta_w = (no*w^2)/(wo*c);\n", +"disp(beta_w,'Phase constant=')\n", +"d_beta_w = diff(beta_w,w);\n", +"disp(d_beta_w,'Differentiation of phase constant w.r.to w =')\n", +"Vg = 1/d_beta_w;\n", +"Vg = limit(Vg,w,wo);\n", +"Vp = w/beta_w;\n", +"Vp = limit(Vp,w,wo);\n", +"disp(Vg,'Group velocity =')\n", +"disp(Vp,'Phase velocity=')\n", +"//Result\n", +"//Phase constant= \n", +"// no*w^2/(c*wo) \n", +"//Differentiation of phase constant w.r.to w = \n", +"// 2*no*w/(c*wo) \n", +"//Group velocity = \n", +"// c/(2*no) \n", +"//Phase velocity= \n", +"// c/no " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.11: pulse_width_at_the_optical_fiber.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to determine the pulse width at the optical fiber output\n", +"//Example13.11\n", +"//page474\n", +"clear;\n", +"clc;\n", +"T = 10; //width of light pulse at the optical fiber input in pico secs\n", +"beta2 = 20; //dispersion in pico seconds square pre kilometre\n", +"z = 15; // length of optical fiber in kilometre\n", +"delta_t = beta2*z/T;\n", +"T1 = sqrt(T^2+delta_t^2);\n", +"disp(delta_t,'Pulse spread in pico seconds delta_t =')\n", +"disp(ceil(T1),'Output pulse width in pico seconds T1 =')\n", +"//Result\n", +"//Pulse spread in pico seconds delta_t = \n", +"// 30. \n", +"//Output pulse width in pico seconds T1 = \n", +"// 32. " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.1: electric_field_of_incident.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to finid the electric field of incident, reflected and transmitted waves\n", +"//Example13.1\n", +"//page439\n", +"etta1 = 100;\n", +"etta2 = 300; //intrinsic impedance in ohms\n", +"T = reflection_coefficient(etta1,etta2);\n", +"Ex10_i = 100;//incident electric field in v/m\n", +"Ex10_r = T*Ex10_i;//reflected electric field in v/m\n", +"Hy10_i = Ex10_i/etta1;//incident magnetic field A/m\n", +"Hy10_r = -Ex10_r/etta1; //reflected magnetic field A/m\n", +"Si = (1/2)*Ex10_i*Hy10_i;//average incident power density in W/square metre\n", +"Sr = -(1/2)*Ex10_r*Hy10_r;//average reflected power denstiy in W/square metre\n", +"tuo = 1+T; //transmission coefficient\n", +"Ex20_t = tuo*Ex10_i; //transmitted electric field v/m\n", +"Hy20_t = Ex20_t/etta2; //transmitted magnetic field A/m\n", +"St = (1/2)*Ex20_t*Hy20_t; //average power density transmitted \n", +"disp(T,'reflection coefficient t =');\n", +"disp(Ex10_i,'incident electric field in v/m Ex10_i =')\n", +"disp(Ex10_r,'reflected electric field in v/m Ex10_r =')\n", +"disp(Hy10_i,'incident magnetic field A/m Hy10_i =')\n", +"disp(Hy10_r,'reflected magnetic field A/m Hy10_r=')\n", +"disp(Si,'average incident power density in W/square metre Si=')\n", +"disp(Sr,'average reflected power denstiy in W/square metre Sr=')\n", +"disp(St,'average power density transmitted in W/square metre St=')\n", +"//Result\n", +"//reflection coefficient t = 0.5 \n", +"//incident electric field in v/m Ex10_i = 100. \n", +"//reflected electric field in v/m Ex10_r = 50. \n", +"//incident magnetic field A/m Hy10_i = 1. \n", +"//reflected magnetic field A/m Hy10_r= - 0.5 \n", +"//average incident power density in W/square metre Si= 50. \n", +"//average reflected power denstiy in W/square metre Sr= 12.5 \n", +"//average power density transmitted in W/square metre St= 37.5 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.2: maxima_and_minma_electric_field.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the maxima and minma electric field\n", +"//Example13.2\n", +"//page443\n", +"clc;\n", +"er1 = 4; \n", +"ur1 = 1;\n", +"er2 = 9;\n", +"ur2 = 1;\n", +"[uo,eo] = muo_epsilon();//free space permittivity and permeability\n", +"u1 = uo*ur1; //permeability of medium 1\n", +"u2 = uo*ur2; //permeability of medium 2\n", +"e1 = eo*er1; //permittivity of medium 1\n", +"e2 = eo*er2; //permittivity of medium 2\n", +"etta1 = sqrt(u1/e1);\n", +"etta2 = sqrt(u2/e2);\n", +"T = reflection_coefficient(etta1,etta2)\n", +"Exs1_i = 100; //incident electric field in v/m\n", +"Exs1_r = -20; //reflected electric field in v/m\n", +"Ex1T_max = (1+abs(T))*Exs1_i;//maximum transmitted electric field in v/m\n", +"Ex1T_min = (1-abs(T))*Exs1_i;//minimum transmitted electric field in v/m\n", +"S = VSWR(T); //voltage standing wave ratio\n", +"disp(Ex1T_max,'maximum transmitted electric field in v/m =')\n", +"disp(Ex1T_min,'minimum transmitted electric field in v/m =')\n", +"disp(S,'voltage standing wave ratio S=')\n", +"//Result\n", +"//maximum transmitted electric field in v/m = \n", +"// 120. \n", +"//minimum transmitted electric field in v/m = \n", +"// 80. \n", +"//voltage standing wave ratio S= \n", +"// 1.5 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.3: determine_the_intrinsic_impedance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to determine the intrinsic impedance of the unkonwn material\n", +"//Eample13.3\n", +"//page441\n", +"clc;\n", +"maxima_spacing = 1.5;//Lambda/2 in metres\n", +"Lambda = 2*maxima_spacing; //wavelength in metres\n", +"C = 3e08;//free space velocity in m/sec\n", +"f = C/Lambda; //frequency in Hz\n", +"S = 5; //voltage standing wave ratio\n", +"T = (1-S)/(1+S); //reflection coefficient\n", +"etta0 = 377;//intrinsic impedance in ohms\n", +"ettau = etta0/S;//intrinsic impedance of unkonwn material in ohms\n", +"disp(T,'reflection coefficient T=')\n", +"disp(ettau,'intrinsic impedance in ohms =')\n", +"//Result\n", +"//reflection coefficient T = - 0.6666667 \n", +"// intrinsic impedance in ohms = 75.4 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.4: determine_the_required_range_of_glass_thickness.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to determine the required range of glass thickness for Fabry-perot interferometer\n", +"//Example13.4\n", +"//page450\n", +"clear;\n", +"clc;\n", +"Lambda0 = 600e-09; //wavelength of red part of visible spectrum 600nm\n", +"n = 1.45;//refractive index of glass plate\n", +"delta_Lambda = 50e-09; //optical spectrum of full width = 50nm\n", +"l = Lambda0^2/(2*n*delta_Lambda);\n", +"disp(l*1e06,'required range of glass thickness in micro meter l=')\n", +"//Result\n", +"//required range of glass thickness in micro meter l = 2.4827586" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.5: Index_for_coating.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the required index for the coating and its thickness\n", +"//Example13.5\n", +"//page451\n", +"clear;\n", +"clc;\n", +"etta1 = 377;//intrinsic impedance of free space in ohms\n", +"n3 = 1.45; //refractive index of glass\n", +"etta3 = etta1/n3;//intrinsic impedance in glass\n", +"etta2 = sqrt(etta1*etta3);//intrinsic impedance in ohms for coating\n", +"n2 = etta1/etta2; //refractive index of region2\n", +"Lambda0 = 570e-09;//free space wavelength\n", +"Lambda2 = Lambda0/n2; //wavelength in region2\n", +"l = Lambda2/4; //minimum thickness of the dielectric layer\n", +"disp(l*1e06,'minimum thickness of the dielectric layer in um =')\n", +"//Result\n", +"//minimum thickness of the dielectric layer in um = \n", +"// 0.1183398 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.6: phasor_expressio.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the phasor expression for the electric field\n", +"//Example13.6\n", +"//page456\n", +"clc;\n", +"ax = sym('ax');\n", +"ay = sym('ay');\n", +"az = sym('az');\n", +"x = sym('x');\n", +"y = sym('y');\n", +"z = sym('z');\n", +"teta = 30; //phase angle in degrees\n", +"teta = 30/57.3; //phase angle in radians\n", +"Eo = 10; //Electric field in v/m\n", +"f = 50e06; //frequency in Hz\n", +"er = 9.0; //relative permittivity\n", +"ur = 1; //relative permeability\n", +"[uo,eo] = muo_epsilon();\n", +"k = propagation_constant(f,uo,ur,eo,er);\n", +"K = k*(cos(teta)*ax+sin(teta)*ay);\n", +"r = x*ax+y*ay;\n", +"Es = Eo*exp(-sqrt(-1)*K*r)*az;\n", +"disp(K,'propagation constant per metre K=')\n", +"disp(r,'distance in metre r=')\n", +"disp(Es,'Phasor expression for the electric field of the uniform plane wave Es=')\n", +"//Result\n", +"//K=5607*(14969*ay/29940+25156*ax/29047)/1784 \n", +"// r= ay*y+ax*x \n", +"//Es=10*az*%e^-(5607*%i*(14969*ay/29940+25156*ax/29047)*(ay*y+ax*x)/1784) " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.7: find_the_fraction_of_incident_power.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the fraction of incident power that is reflected and transmitted\n", +"//Example13.7\n", +"//page460\n", +"clc;\n", +"teta1 = 30; //incident angle in degrees\n", +"n2 = 1.45;//refractive index of glass\n", +"teta2 = snells_law(teta1,n2);\n", +"etta1 = 377*cos(teta1/57.3); // intrinsic impedance in medium 1 in ohms\n", +"etta2 = (377/n2)*cos(teta2); //intrinsic impedance in medium2 in ohms\n", +"Tp = reflection_coefficient(etta1,etta2);//reflection coefficient for p-polarization\n", +"Reflected_Fraction_p = (abs(Tp))^2;\n", +"Transmitted_Fraction_p = 1-(abs(Tp))^2;\n", +"etta1s = 377*sec(teta1/57.3); //intrinsic impedance for s-polarization\n", +"etta2s = (377/n2)*sec(teta2); \n", +"Ts = reflection_coefficient(etta1s,etta2s);//reflection coefficient for s-polarization\n", +"Reflected_Fraction_s = (abs(Ts))^2;\n", +"Transmitted_Fraction_s = 1-(abs(Ts))^2;\n", +"disp(teta2*57.3,'Transmission angle using snells law in degrees teta2 =')\n", +"disp(Tp,'Reflection coefficient for p-polarization Tp=')\n", +"disp(Reflected_Fraction_P,'Fraction of incident power that is reflected for p-polarization =')\n", +"disp(Transmitted_Fraction_p,'Fraction of power transmitted for p-polarization =')\n", +"disp(Ts,'Reflection coefficient for s-polarization Tp=')\n", +"disp(Reflected_Fraction_s,'Fraction of incident power that is reflected for s-polarization =')\n", +"disp(Transmitted_Fraction_s,'Fraction of power transmitted for s-polarization =')\n", +"//Result\n", +"//Transmission angle using snells law in degrees teta2 = \n", +"// 20.171351 \n", +"//Reflection coefficient for p-polarization Tp= \n", +"// - 0.1444972 \n", +"//Fraction of incident power that is reflected for p-polarization = \n", +"// 0.0337359 \n", +"//Fraction of power transmitted for p-polarization = \n", +"// 0.9791206 \n", +"//Reflection coefficient for s-polarization Tp= \n", +"// - 0.2222748 \n", +"//Fraction of incident power that is reflected for s-polarization = // 0.0494061 \n", +"//Fraction of power transmitted for s-polarization = \n", +"// 0.9505939 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.8: find_the_refractive_index.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the refractive index of the prism material\n", +"//Example13.8\n", +"//page463\n", +"clear;\n", +"clc;\n", +"n2 =1.00; //refractive index of air\n", +"teta1 = 45; //incident angle in degrees\n", +"teta1 = 45/57.3;//incident angle in radians\n", +"n1 = n2/sin(teta1);\n", +"disp(n1,'refractive index of prism material n1=')\n", +"//Result\n", +"//refractive index of prism material n1= \n", +"// 1.4142954 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.9: determine_incident_and_transmitted_anlges.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to determine incident and transmitted anlges\n", +"//Example13.9\n", +"//page464\n", +"clear;\n", +"clc;\n", +"n1 =1.00; //refractive index of air\n", +"n2 =1.45; //refractive index of glass\n", +"teta1 = asin(n2/sqrt(n1^2+n2^2));\n", +"teta2 = asin(n1/sqrt(n1^2+n2^2));\n", +"Brewster_Condition = teta1+teta2;\n", +"disp(teta1*57.3,'Incident angle in degrees teta1 =')\n", +"disp(teta2*57.3,'transmitted angle in degrees teta2=')\n", +"disp(Brewster_Condition*57.3,'sum of the incident angle and transmitted angle, Brewster_Condition=')\n", +"//Result\n", +"//Incident angle in degrees teta1 = 55.411793 \n", +"//transmitted angle in degrees teta2 = 34.594837 \n", +"//sum of the incident angle and transmitted angle, Brewster_Condition= 90.00663 " + ] + } +], +"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/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/14-Guided_Wave_and_Radiation.ipynb b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/14-Guided_Wave_and_Radiation.ipynb new file mode 100644 index 0000000..bc9568a --- /dev/null +++ b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/14-Guided_Wave_and_Radiation.ipynb @@ -0,0 +1,234 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 14: Guided Wave and Radiation" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.1: determine_the_cutoff_frequency.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to determine the cutoff frequency for the first waveguide mode(m=1)\n", +"//Example14.1\n", +"//page 499\n", +"clear;\n", +"clc;\n", +"er1 = 2.1; //dielectric constant of teflon material\n", +"er0 = 1; //dielectric constant of air\n", +"d = 1e-02; //parallel plate waveguide separation in metre\n", +"C = 3e08; //free space velocity in m/sec\n", +"n = sqrt(er1/er0); //refractive index\n", +"fc1 = C/(2*n*d);\n", +"disp(fc1,'cutoff frequency for the first waveguide mode in Hz fc1 =')\n", +"//Result\n", +"//cutoff frequency for the first waveguide mode in Hz fc1 = \n", +"// 1.035D+10 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.2: number_of_modes_propagate_in_waveguide.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to determine the number of modes propagate in waveguide\n", +"//Example14.2\n", +"//page 499\n", +"clear;\n", +"clc;\n", +"er1 = 2.1; //dielectric constant of teflon material\n", +"er0 = 1; //dielectric constant of air\n", +"n = sqrt(er1/er0); //refractive index\n", +"Lambda_cm = 2e-03; //operating cutoff wavelength in metre\n", +"d = 1e-02; //parallel-plate waveguide separation\n", +"m = (2*n*d)/Lambda_cm;\n", +"disp(floor(m),'Number of waveguides modes propagate m =')\n", +"//Result\n", +"//Number of waveguides modes propagate m = \n", +"// 14. " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.3: determine_the_group_delay_and_difference.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to determine the group delay and difference in propagation times\n", +"//Example14.3\n", +"//page 502\n", +"clc;\n", +"C = 3e08; //free space velocity in m/sec\n", +"er = 2.1; //dielectric constant of teflon material\n", +"fc1 = 10.3e09;//cutoff frequency for mode m =1\n", +"fc2 = 2*fc1; //cutoff frequency for mode m =2\n", +"f = 25e09; //operating frequency in Hz\n", +"Vg1 = group_delay(C,er,fc1,f);//group delay for mode m = 1\n", +"Vg2 = group_delay(C,er,fc2,f);//group delay for mode m = 2\n", +"del_t = group_delay_difference(Vg1,Vg2);\n", +"disp(ceil(del_t*1e10),'group delay difference in ps/cm del_t=')\n", +"//Result\n", +"//group delay difference in ps/cm del_t= \n", +"// 33. " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.4: determine_the_operating_range.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to determine the operating range of frequency for TE10 mode of air filled rectangular waveguide\n", +"//Example14.4\n", +"//page 509\n", +"clear;\n", +"clc;\n", +" //dimensions of air filled rectangular waveguide\n", +"a = 2e-02;\n", +"b = 1e-02;\n", +"//Free space velocity in m/sec\n", +"C = 3e08;\n", +"//the value of m for TE10 mode\n", +"m = 1;\n", +"n = 1;//refractive index for air filled waveguide\n", +"fc = (m*C)/(2*n*a);\n", +"disp(fc*1e-09,'Operating range of frequency for TE10 mode in GHz fc=')\n", +"//Result\n", +"//Operating range of frequency for TE10 mode in GHz fc= \n", +"// 7.5 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.5: maximum_allowable_refractive_index.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to determine the maximum allowable refractive index of the slab material\n", +"//Example14.5\n", +"//page 517\n", +"clear;\n", +"clc;\n", +"Lambda = 1.30e-06;//wavelength range over which single-mode operation\n", +"d = 5e-06;//slab thickness in metre\n", +"n2 = 1.45; //refractive index of the slab material\n", +"n1 = sqrt((Lambda/(2*d))^2+n2^2);\n", +"disp(n1,'The maximum allowable refractive index of the slab material n1=')\n", +"//Result\n", +"//The maximum allowable refractive index of the slab material n1= \n", +"// 1.4558159 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.6: find_the_V_number_of_a_step_index_fiber.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to find the V number of a step index fiber\n", +"//Example14.6\n", +"//page 524\n", +"clear;\n", +"clc;\n", +"Lambda = 1.55e-06; //operating wavelength in metre\n", +"LambdaC = 1.2e-06; //cutoff wavelength in metre\n", +"V = (LambdaC/Lambda)*2.405;\n", +"disp(V,'the V number of a step index fiber V=')\n", +"//Result\n", +"//the V number of a step index fiber V= \n", +"// 1.8619355 " + ] + } +], +"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/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/2-Columbs_Law_and_Electric_Field_Intensity.ipynb b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/2-Columbs_Law_and_Electric_Field_Intensity.ipynb new file mode 100644 index 0000000..ddf50a6 --- /dev/null +++ b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/2-Columbs_Law_and_Electric_Field_Intensity.ipynb @@ -0,0 +1,183 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2: Columbs Law and Electric Field Intensity" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1: Caculate_force_exerted_on_Q2_by_Q1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to Caculate force exerted on Q2 by Q1\n", +"//Example2.1\n", +"//page 29\n", +"clc;\n", +"r2 = [2,0,5];\n", +"r1 = [1,2,3];\n", +"R12 = norm(r2-r1);\n", +"aR12 = UnitVector(r2-r1);\n", +"disp(R12,'R12=')\n", +"disp(aR12,'aR12=')\n", +"Q1 = 3e-04; //charge 1 in Coulombs\n", +"Q2 = -1e-04; //charge 2 in Coulombs\n", +"Eps = 8.854e-12; //free space permittivity\n", +"F2 = ((Q1*Q2)/(4*%pi*Eps*R12^2))*aR12;\n", +"F1 = -F2;\n", +"disp(F2,'Force exerted on Q2 by Q1 in N/m F2 =')\n", +"disp(F1,'Force exerted on Q1 by Q2 in N/m F1 =')\n", +"//Result\n", +"//R12= \n", +"// 3. \n", +"//aR12= \n", +"// 0.3333333 - 0.6666667 0.6666667 \n", +"//Force exerted on Q2 by Q1 in N/m F2 = \n", +"// - 9.9863805 19.972761 - 19.972761 \n", +"//Force exerted on Q1 by Q2 in N/m F1 = \n", +"// 9.9863805 - 19.972761 19.972761 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2: Caculate_Electric_Field.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption:Program to Caculate Electric Field E at P due to 4 identical charges\n", +"//Example2.2\n", +"//page 33\n", +"clc;\n", +"P = [1,1,1];\n", +"P1 = [1,1,0];\n", +"P2 = [-1,1,0];\n", +"P3 = [-1,-1,0];\n", +"P4 = [1,-1,0];\n", +"R1 = norm(P-P1);\n", +"aR1 = UnitVector(P-P1);\n", +"R2 = norm(P-P2);\n", +"aR2 = UnitVector(P-P2);\n", +"R3 = norm(P-P3);\n", +"aR3 = UnitVector(P-P3);\n", +"R4 = norm(P-P4);\n", +"aR4 = UnitVector(P-P4);\n", +"disp(R1,'R1=')\n", +"disp(aR1,'aR1=')\n", +"disp(R2,'R2=')\n", +"disp(aR2,'aR2=')\n", +"disp(R3,'R3=')\n", +"disp(aR3,'aR3=')\n", +"disp(R4,'R4=')\n", +"disp(aR4,'aR4=')\n", +"Q = 3e-09; //charge in Coulombs\n", +"Eps = 8.854e-12; //free space permittivity\n", +"E1 = (Q/(4*%pi*Eps*R1^2))*aR1;\n", +"E2 = (Q/(4*%pi*Eps*R2^2))*aR2;\n", +"E3 = (Q/(4*%pi*Eps*R3^2))*aR3;\n", +"E4 = (Q/(4*%pi*Eps*R4^2))*aR4;\n", +"E = E1+E2+E3+E4;\n", +"disp(E,'Electric Field Intesnity at any point P due to four identical Charges in V/m=')\n", +"//Result\n", +"//R1= 1. \n", +"//aR1= 0. 0. 1. \n", +"//R2= 2.236068 \n", +"//aR2= 0.8944272 0. 0.4472136 \n", +"//R3= 3. \n", +"//aR3= 0.6666667 0.6666667 0.3333333 \n", +"//R4= 2.236068 \n", +"//aR4= 0. 0.8944272 0.4472136 \n", +"//Electric Field Intesnity at any point P due to four identical Charges in V/m= \n", +"// 6.8206048 6.8206048 32.785194 \n", +"// " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3: Total_Charge_Enclosed.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Example2.3\n", +"//page 35\n", +"clc;\n", +"r = sym('r');\n", +"z = sym('z');\n", +"phi = sym('phi');\n", +"rv = -5e-06*exp(-1e05*r*z);\n", +"disp(rv,'Volume Charge density in C/cubic.metre rv=')\n", +"Q1 = integ(rv*r,phi);\n", +"Q1 = limit(Q1,phi,2*%pi);\n", +"Q2 = integ(Q1,z);\n", +"Q2 = limit(Q2,z,0.04)-limit(Q2,z,0.02);\n", +"Q3 = integ(Q2,r);\n", +"Q3 = limit(Q3,r,0.01)-limit(Q3,r,0);\n", +"disp(Q1,'Q1=')\n", +"disp(Q2,'Q2=')\n", +"disp(Q3,'Total Charge Enclosed in a 2cm length of electron beam in coulombs Q=')\n", +"//Result\n", +"//Volume Charge density in C/cubic.metre rv = -%e^-(100000*r*z)/200000 \n", +"//Q1= -103993*r*%e^-(100000*r*z)/3310200000 \n", +"//Q2= -103993*%e^-(2000*r)/331020000000000 \n", +"//Total Charge Enclosed in a 2cm length of electron beam in coulombs Q= \n", +"// 103993/1324080000000000000-103993*%e^-40/1324080000000000000 \n", +"//Q approximately equal to 103993/1324080000000000000 = 7.854D-14 coulombs " + ] + } +], +"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/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/3-Electric_Flux_Density_Gausss_Law_and_Divergence.ipynb b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/3-Electric_Flux_Density_Gausss_Law_and_Divergence.ipynb new file mode 100644 index 0000000..b2d26da --- /dev/null +++ b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/3-Electric_Flux_Density_Gausss_Law_and_Divergence.ipynb @@ -0,0 +1,262 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3: Electric Flux Density Gausss Law and Divergence" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1: find_Electric_Flux_density_D.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find Electric Flux density 'D' of a uniform line charge\n", +"//Example3.1\n", +"//page 54\n", +"clc;\n", +"e0 = 8.854e-12; //free space permittivity in F/m\n", +"rL = 8e-09; //line charge density c/m\n", +"r = 3; // distance in metre\n", +"E = Electric_Field_Line_Charge(rL,e0,r); //electric field intensity of line charge\n", +"D = e0*E;\n", +"disp(D,'Electric Flux Density in Coulombs per square metre D =')\n", +"//Result\n", +"// Electric Flux Density in Coulombs per square metre D = \n", +"// 4.244D-10 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2: calculate_surface_charge_density.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to calculate surface charge density,Flux density, Field Intensity of coaxial cable\n", +"//Example3.2\n", +"//page 64\n", +"clc;\n", +"Q_innercyl = 30e-09; //total charge on the inner conductor in coulombs\n", +"a = 1e-03; // inner radius of coaxial cable in metre\n", +"b = 4e-03; // outer radius of coaxial cable in metre\n", +"L = 50e-02; //length of coaxial cable\n", +"rs_innercyl = Q_innercyl/(2*%pi*a*L);\n", +"rs_outercyl = Q_innercyl/(2*%pi*b*L);\n", +"e0 = 8.854e-12; //free space relative permittivity F/m\n", +"r = sym('r');\n", +"Dr = a*rs_innercyl/r;\n", +"Er = Dr/e0;\n", +"disp(rs_innercyl,'Surface charge density of inner cylinder of coaxial cable in C/square.metre, rs_innercyl=')\n", +"disp(rs_outercyl,'Surface charge density of outer cylinder of coaxial cable in C/square.metre, rs_outercyl=')\n", +"disp(Dr,'Electric Flux Density in C/square.metre Dr=')\n", +"disp(Er,'Electric Field Intensity in V/m Er=')\n", +"//Result\n", +"//Surface charge density of inner cylinder of coaxial cable in C/square.metre, rs_innercyl= \n", +"// 0.0000095 \n", +"//Surface charge density of outer cylinder of coaxial cable in C/square.metre, rs_outercyl= \n", +"// 0.0000024 \n", +"//Electric Flux Density in C/square.metre Dr= \n", +"// 9.5488183337312011E-9/r \n", +"//Electric Field Intensity in V/m Er= \n", +"// 1078.47507722286/r " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.3: total_charge_enclosed_in_a_volume.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to calculate the total charge enclosed in a volume at the origin\n", +"//Example3.3\n", +"//page 67\n", +"clc;\n", +"V = 1e-09; //volume in cubic metre\n", +"x = sym('x');\n", +"y = sym('y');\n", +"z = sym('z');\n", +"//Components of Electric Flux Density in cartesian coordinate system\n", +"Dx = exp(-x)*sin(y);\n", +"Dy = -exp(-x)*cos(y);\n", +"Dz = 2*z;\n", +"//Divergence of electric flux density 'D'\n", +"dDx = diff(Dx,x);\n", +"dDy = diff(Dy,y);\n", +"dDz = diff(Dz,z);\n", +"//Total charge enclosed in a given volume\n", +"del_Q = (dDx+dDy+dDz)*V;\n", +"disp(del_Q,'Total charge enclosed in an incremental volume in coulombs, del_Q =')\n", +"//Total Charge enclosed in a given volume at origin (0,0,0)\n", +"del_Q = limit(del_Q,x,0);\n", +"del_Q = limit(del_Q,y,0);\n", +"del_Q = limit(del_Q,z,0);\n", +"disp(del_Q*1e09,'Total charge enclosed in an incremental volume in nano coulombs at origin, del_Q =')\n", +"//Result\n", +"//Total charge enclosed in an incremental volume in coulombs, del_Q = 2.0000000000000001E-9 \n", +"//Total charge enclosed in an incremental volume in nano coulombs at origin, del_Q = \n", +"// 2.0 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4: Find_the_Divergence.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to Find the Divergence of 'D' at the origin\n", +"//Example3.4\n", +"//page 70\n", +"clc;\n", +"x = sym('x');\n", +"y = sym('y');\n", +"z = sym('z');\n", +"//Components of Electric Flux Density in cartesian coordinate system\n", +"Dx = exp(-x)*sin(y);\n", +"Dy = -exp(-x)*cos(y);\n", +"Dz = 2*z;\n", +"//Divergence of electric flux density 'D'\n", +"dDx = diff(Dx,x);\n", +"dDy = diff(Dy,y);\n", +"dDz = diff(Dz,z);\n", +"divD = dDx+dDy+dDz\n", +"disp(divD,'Divergence of Electric Flux Density D in C/cubic.metre, divD =')\n", +"divD = limit(divD,x,0);\n", +"divD = limit(divD,y,0);\n", +"divD = limit(divD,z,0);\n", +"disp(divD,'Divergence of Electric Flux Density D in C/cubic.metre at origin, divD =')\n", +"//Result\n", +"//Divergence of Electric Flux Density D in C/cubic.metre, divD = \n", +"// 2 \n", +"//Divergence of Electric Flux Density D in C/cubic.metre at origin, divD = \n", +"// 2 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5: verify_the_Divergence_theorem.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to verify the Divergence theorem for the field 'D' \n", +"//Example3.5\n", +"//page 74\n", +"clc;\n", +"x = sym('x');\n", +"y = sym('y');\n", +"z = sym('z');\n", +"//Components of Electric Flux Density in cartesian coordinate system\n", +"Dx = 2*x*y;\n", +"Dy = x^2;\n", +"Dz = 0;\n", +"//Divergence of electric flux density 'D'\n", +"dDx = diff(Dx,x);\n", +"dDy = diff(Dy,y);\n", +"dDz =0;\n", +"divD = dDx+dDy+dDz\n", +"disp(divD,'Divergence of Electric Flux Density D in C/cubic.metre, divD =')\n", +"//Evaluate volume integral on divergence of 'D'\n", +"Vol_int_divD = integ(divD,x);\n", +"Vol_int_divD = limit(Vol_int_divD,x,1)-limit(Vol_int_divD,x,0);\n", +"Vol_int_divD = integ(Vol_int_divD,y);\n", +"Vol_int_divD = limit(Vol_int_divD,y,2)-limit(Vol_int_divD,y,0);\n", +"Vol_int_divD = integ(Vol_int_divD,z);\n", +"Vol_int_divD = limit(Vol_int_divD,z,3)-limit(Vol_int_divD,z,0);\n", +"disp(Vol_int_divD,'Volume Integral of divergence of D, in coulombs vol_int(divD)=')\n", +"//Evaluate surface integral on field D\n", +"Dx = limit(Dx,x,1);\n", +"sur_D = integ(Dx,y);\n", +"sur_D = limit(sur_D,y,2) - limit(sur_D,y,0);\n", +"sur_D = integ(sur_D,z);\n", +"sur_D = limit(sur_D,z,3) - limit(sur_D,z,0);\n", +"disp(sur_D,'Surface Integral of field D, in coulombs sur_int(D.ds)=')\n", +"if(sur_D==Vol_int_divD)\n", +" disp('Divergence Theorem verified')\n", +"end\n", +"//Result\n", +"// Divergence of Electric Flux Density D in C/cubic.metre, divD = \n", +"// 2*y \n", +"//Volume Integral of divergence of D, in coulombs vol_int(divD)= \n", +"// 12 \n", +"// Surface Integral of field D, in coulombs sur_int(D.ds)= \n", +"// 12 " + ] + } +], +"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/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/4-Energy_and_Potential.ipynb b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/4-Energy_and_Potential.ipynb new file mode 100644 index 0000000..9cf42b1 --- /dev/null +++ b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/4-Energy_and_Potential.ipynb @@ -0,0 +1,214 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4: Energy and Potential" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.1: find_the_work_involved.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find the work involved 'W' in moving a charge 'Q' along shorter arc of a circle\n", +"//Example4.1\n", +"//page 84\n", +"clc;\n", +"x = sym('x');\n", +"y = sym('y');\n", +"z = sym('z');\n", +"y1 = sym('y1');\n", +"y = sqrt(1-x^2);\n", +"Q = 2; //charge in coulombs\n", +"Edot_dL1 = integ(y,x);\n", +"disp(Edot_dL1,'E.dx*ax =')\n", +"Edot_dL1 = limit(Edot_dL1,x,0.8)-limit(Edot_dL1,x,1);\n", +"disp(Edot_dL1,'Value of E.dx*ax =')\n", +"Edot_dL2 = 0;\n", +"disp(Edot_dL2,'Value of E.dz*az=')\n", +"x = sqrt(1-y1^2);\n", +"Edot_dL3 = integ(x,y1)\n", +"disp(Edot_dL3,'E.dy*ay=')\n", +"Edot_dL3 = limit(Edot_dL3,y1,0.6)-limit(Edot_dL3,y1,0);\n", +"disp(Edot_dL3,'Value of E.dy*ay =')\n", +"W = -Q*(Edot_dL1+Edot_dL2+Edot_dL3);\n", +"disp(W,'Work done in moving a point charge along shorter arc of circle in Joules, W=')\n", +"//Result\n", +"// E.dx*ax = asin(x)/2+x*sqrt(1-x^2)/2 \n", +"// Value of E.dx*ax = (25*asin(4/5)+12)/50-%pi/4 \n", +"// Value of E.dz*az = 0. \n", +"// E.dy*ay = asin(y1)/2+y1*sqrt(1-y1^2)/2 \n", +"// Value of E.dy*ay = (25*asin(3/5)+12)/50 \n", +"//Work done in moving a point charge along shorter arc of circle in Joules, W = \n", +"// -2*((25*asin(4/5)+12)/50+(25*asin(3/5)+12)/50-%pi/4) \n", +"//Which is equivalent to\n", +"// -2*((25*0.9272952+12)/50+(25*0.6435011+12)/50-%pi/4) = -0.96 Joules" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.2: find_the_work_involved_W_.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find the work involved 'W' in moving a charge 'Q' along straight line\n", +"//Example4.2\n", +"//page 84\n", +"clc;\n", +"x = sym('x');\n", +"y = sym('y');\n", +"z = sym('z');\n", +"y1 = sym('y1');\n", +"y = -3*(x-1);\n", +"Q = 2; //charge in coulombs\n", +"Edot_dL1 = integ(y,x);\n", +"disp(Edot_dL1,'E.dx*ax =')\n", +"Edot_dL1 = limit(Edot_dL1,x,0.8)-limit(Edot_dL1,x,1);\n", +"disp(Edot_dL1,'Value of E.dx*ax =')\n", +"Edot_dL2 = 0;\n", +"disp(Edot_dL2,'Value of E.dz*az=')\n", +"x = (1-y1/3);\n", +"Edot_dL3 = integ(x,y1)\n", +"disp(Edot_dL3,'E.dy*ay=')\n", +"Edot_dL3 = limit(Edot_dL3,y1,0.6)-limit(Edot_dL3,y1,0);\n", +"disp(Edot_dL3,'Value of E.dy*ay =')\n", +"W = -Q*(Edot_dL1+Edot_dL2+Edot_dL3);\n", +"disp(W,'Work done in moving a point charge along shorter arc of circle in Joules, W=')\n", +"//Result\n", +"//E.dx*ax = -3*(x^2/2-x) \n", +"//Value of E.dx*ax = -3/50 \n", +"//Value of E.dz*az = 0. \n", +"//E.dy*ay = y1-y1^2/6 \n", +"//Value of E.dy*ay = 27/50 \n", +"//Work done in moving a point charge along shorter arc of circle in Joules, W = -24/25 = -0.96 Joules" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.3: Program_to_calculate_E.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to calculate E, D and volume charge density using divergence of D\n", +"//Example4.3\n", +"//page 100\n", +"clc;\n", +"x = -4;\n", +"y = 3;\n", +"z = 6;\n", +"V = 2*(x^2)*y-5*z;\n", +"disp(float(V),'Potential V at point P(-4,3,6)in volts is Vp =')\n", +"x1 = sym('x1');\n", +"y1 = sym('y1');\n", +"z1 = sym('z1');\n", +"ax = sym('ax');\n", +"ay = sym('ay');\n", +"az = sym('az');\n", +"V1 = 2*(x1^2)*y1-5*z1;\n", +"//Electric Field Intensity from gradient of V\n", +"Ex = -diff(V1,x1);\n", +"Ey = - diff(V1,y1);\n", +"Ez = - diff(V1,z1);\n", +"Ex1 = limit(Ex,x1,-4);\n", +"Ex1 = limit(Ex1,y1,3);\n", +"Ex1 = limit(Ex1,z1,6);\n", +"Ey1 = limit(Ey,x1,-4);\n", +"Ey1 = limit(Ey1,y1,3);\n", +"Ey1 = limit(Ey1,z1,6);\n", +"Ez1 = limit(Ez,x1,-4);\n", +"Ez1 = limit(Ez1,y1,3);\n", +"Ez1 = limit(Ez1,z1,6);\n", +"E = Ex1*ax+Ey1*ay+Ez1*az;\n", +"Ep = sqrt(float(Ex1^2+Ey1^2+Ez1^2));\n", +"disp(Ep,'Electric Field Intensity E at point P(-4,3,6) in volts E =')\n", +"aEp = float(E/Ep);\n", +"disp(aEp,'Direction of Electric Field E at point P(-4,3,6) aEp=')\n", +"Dx = float(8.854*Ex);\n", +"Dy = float(8.854*Ey);\n", +"Dz = float(8.854*Ez);\n", +"D = Dx*ax+Dy*ay+Dz*az;\n", +"disp(D,'Electric Flux Density in pico.C/square.metre D =')\n", +"dDx = diff(Dx,x1);\n", +"dDx = limit(dDx,x1,-4);\n", +"dDx = limit(dDx,y1,3);\n", +"dDx = limit(dDx,z1,6);\n", +"dDy = diff(Dy,y1);\n", +"dDy = limit(dDy,x1,-4);\n", +"dDy = limit(dDy,y1,3);\n", +"dDy = limit(dDy,z1,6);\n", +"dDz = diff(Dz,z1);\n", +"dDz = limit(dDz,x1,-4);\n", +"dDz = limit(dDz,y1,3);\n", +"dDz = limit(dDz,z1,6);\n", +"rV = dDx+dDy+dDz;\n", +"disp(rV,'Volume Charge density from divergence of D in pC/cubic.metre is rV=')\n", +"//Result\n", +"//Potential V at point P(-4,3,6)in volts is Vp = 66. \n", +"//Electric Field Intensity E at point P(-4,3,6) in volts E = 57.9050947672137 \n", +"//Direction of Electric Field E at point P(-4,3,6) aEp= \n", +"//0.01726963756851*(5*az-32*ay+48*ax)\n", +"//equivalent to aEp= 0.0863482*az-0.5526284*ay+0.8289426*ax\n", +"//Electric Flux Density in pico.C/square.metre D = \n", +"// -35.416*ax*x1*y1-17.708*ay*x1^2+44.27*az \n", +"//Volume Charge density from divergence of D in pC/cubic.metre is rV= \n", +"// -106.248 " + ] + } +], +"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/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/5-Current_and_Conductors.ipynb b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/5-Current_and_Conductors.ipynb new file mode 100644 index 0000000..0ecab0c --- /dev/null +++ b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/5-Current_and_Conductors.ipynb @@ -0,0 +1,159 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: Current and Conductors" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1: find_the_resistance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find the resistance, current and current density\n", +"//Example5.1\n", +"//page 123\n", +"clc;\n", +"clear;\n", +"D = 0.0508; //diameter of conductor in inches\n", +"D = 0.0508*0.0254; //diameter in metres\n", +"r = D/2; //radius in metres\n", +"A = %pi*r^2; //area of the conductor in square metre\n", +"L = 1609; //length of the copper wire in metre\n", +"sigma = 5.80e07; //conductivity in siemens/metre\n", +"R = L/(sigma*A); //resistance in ohms\n", +"I = 10; //current in amperes \n", +"J = I/A; //current density in amps/square.metre\n", +"disp(R,'Rresistance in ohms of given copper wire R =')\n", +"disp(J,'Current density in A/square.metre J = ')\n", +"//Result\n", +"//Rresistance in ohms of given copper wire R = \n", +"// 21.215013 \n", +"//Current density in A/square.metre J = \n", +"// 7647425.6" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2: find_potential_at_point_P.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find potential at point P, Electricf Field Intensity E, Flux density D\n", +"//Example5.2\n", +"//page 126\n", +"clc;\n", +"x = sym('x');\n", +"y = sym('y');\n", +"z = sym('z');\n", +"ax = sym('ax');\n", +"ay = sym('ay');\n", +"az = sym('az');\n", +"V = 100*(x^2-y^2);\n", +"disp(V,'Potential in Volts V =')\n", +"Ex = diff(V,x);\n", +"Ey = diff(V,y);\n", +"Ez = diff(V,z);\n", +"E = -(Ex*ax+Ey*ay+Ez*az);\n", +"disp(E,'Electric Field Intensity in V/m E =')\n", +"E = limit(E,x,2);\n", +"E = limit(E,y,-1);\n", +"V = limit(V,x,2);\n", +"V = limit(V,y,-1);\n", +"disp(V,'Potential at point P in Volts Vp =')\n", +"disp(E,'Electric Field Intensity at point P in V/m Ep =')\n", +"D = 8.854e-12*E; \n", +"disp(D*1e09,'Electric FLux Density at point P in nC/square.metre Dp =')\n", +"//Result\n", +"//Potential in Volts V = 100*(x^2-y^2) \n", +"//Electric Field Intensity in V/m E = 200*ay*y-200*ax*x \n", +"//Potential at point P in Volts Vp = 300 \n", +"//Electric Field Intensity at point P in V/m Ep = -200*ay-400*ax \n", +"//Electric FLux Density at point P in nC/square.metre Dp = 0.008854*(-200*ay-400*ax) \n", +"//which is equivalent to Dp = -3.5416*ax -1.7708*ay " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3: equation_of_the_streamline.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to determine the equation of the streamline passing through any point P\n", +"//Example5.3\n", +"//page 128\n", +"clc;\n", +"x = sym('x');\n", +"y = sym('y');\n", +"z = sym('z');\n", +"C1 = integ(1/y,y)+integ(1/x,x);\n", +"disp(C1,'C1 = ')\n", +"C2 = exp(C1);\n", +"disp(C2,'The Stream line Equation C2 = ')\n", +"C2 = limit(C2,x,2);\n", +"C2 = limit(C2,y,-1);\n", +"disp(C2,'The value of constant in the streamline equation passing through the point P is C2=')\n", +"//Result\n", +"//C1 = log(y)+log(x) \n", +"//The Stream line Equation C2 = x*y \n", +"//The value of constant in the streamline equation passing through the point P is C2 = -2 " + ] + } +], +"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/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/6-Dielectrics_and_Capacitance.ipynb b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/6-Dielectrics_and_Capacitance.ipynb new file mode 100644 index 0000000..2f3da8c --- /dev/null +++ b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/6-Dielectrics_and_Capacitance.ipynb @@ -0,0 +1,142 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: Dielectrics and Capacitance" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1: calculate_D.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to calculate D,E and Polarization P for Teflon slab\n", +"//Example6.1\n", +"//page 142\n", +"clc;\n", +"ax = sym('ax');\n", +"e0 = sym('e0');\n", +"E0 = sym('E0');\n", +"Ein = sym('Ein');\n", +"er = 2.1; //relative permittivity of teflon\n", +"chi = er-1; //electric susceptibility \n", +"Eout = E0*ax;\n", +"Dout = float(e0*Eout);\n", +"Din = float(er*e0*Ein);\n", +"Pin = float(chi*e0*Ein);\n", +"disp(Dout,'Dout in c/square.metre = ')\n", +"disp(Din,'Din in c/square.metre = ')\n", +"disp(Pin,'Polarization in coulombs per square metre Pin =')\n", +"//Result\n", +"//Dout in c/square.metre = ax*e0*E0 \n", +"//Din in c/square.metre = 2.1*e0*Ein \n", +"//Polarization in coulombs per square metre Pin = 1.1*e0*Ein " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2: Program_to_calculate_E_and_Polarization_P.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to calculate E and Polarization P for Teflon slab\n", +"//Example6.2\n", +"//page 146\n", +"clc;\n", +"ax = sym('ax');\n", +"e0 = sym('e0');\n", +"E0 = sym('E0');\n", +"er = 2.1; //relative permittivity of teflon\n", +"chi = er-1; //electric susceptibility \n", +"Eout = E0*ax;\n", +"Ein = float(Eout/er);\n", +"Din = float(e0*Eout);\n", +"Pin = float(Din - e0*Ein);\n", +"disp(Ein,'Ein in V/m = ')\n", +"disp(Pin,'Polarization in coulombs per square metre Pin =')\n", +"//Result\n", +"//Ein in V/m = 0.47619047619048*ax*E0 \n", +"//Polarization in coulombs per square metre Pin = 0.52380952380952*ax*e0*E0 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3: Program_to_calculate_the_capacitance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to calculate the capacitance of a parallel plate capacitor\n", +"//Example6.3\n", +"//page 151\n", +"clc;\n", +"S = 10;//area in square inch\n", +"S = 10*(0.0254)^2; //area in square metre\n", +"d = 0.01; //distance between the plates in inch\n", +"d = 0.01*0.0254; //distance between the plates in metre\n", +"e0 = 8.854e-12; //free space permittivity in F/m\n", +"er = 6; //relative permittivity of mica\n", +"e = e0*er;\n", +"C = parallel_capacitor(e,S,d);\n", +"disp(C*1e09,'Capacitance of a parallel plate capacitor in pico farads C =')\n", +"//Result\n", +"//Capacitance of a parallel plate capacitor in pico farads C = 1.3493496 " + ] + } +], +"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/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/7-Poissons_and_Laplaces_Equation.ipynb b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/7-Poissons_and_Laplaces_Equation.ipynb new file mode 100644 index 0000000..afac7af --- /dev/null +++ b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/7-Poissons_and_Laplaces_Equation.ipynb @@ -0,0 +1,257 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7: Poissons and Laplaces Equation" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.1: Derivation_of_capacitance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Derivation of capacitance of a parallel plate capacitor\n", +"//Example7.1\n", +"//page 177\n", +"clc;\n", +"x = sym('x');\n", +"d = sym('d');\n", +"Vo = sym('Vo');\n", +"e = sym('e');\n", +"ax = sym('ax');\n", +"A = sym('A');\n", +"B = sym('B');\n", +"S = sym('S');\n", +"V = integ(A,x)+B;\n", +"V = limit(V,A,Vo/d);\n", +"V = limit(V,B,0);\n", +"disp(V,'Potential in Volts V =')\n", +"E = -diff(V,x)*ax;\n", +"disp(E,'Electric Field in V/m E =')\n", +"D = e*E;\n", +"DN = D/ax;\n", +"disp(D,'Electric Flux Density in C/square metre D =')\n", +"Q = -DN*S;\n", +"disp(Q,'Charge in Coulombs Q =')\n", +"C = Q/Vo;\n", +"disp(C,'Capacitance of parallel plate capacitor C =')\n", +"//Result\n", +"//Potential in Volts V = Vo*x/d \n", +"//Electric Field in V/m E = -ax*Vo/d \n", +"//Electric Flux Density in C/square metre D = -ax*e*Vo/d \n", +"//Charge in Coulombs Q = e*Vo*S/d \n", +"//Capacitance of parallel plate capacitor C = e*S/d " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.2: Capacitance_of_a_Cylindrical_Capacitor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Capacitance of a Cylindrical Capacitor\n", +"//Example7.2\n", +"//page 179\n", +"clc;\n", +"A = sym('A');\n", +"B = sym('B');\n", +"r = sym('r');\n", +"ar = sym('ar');\n", +"ruo = sym('ruo');\n", +"a = sym('a');\n", +"b = sym('b');\n", +"L = sym('L');\n", +"Vo = sym('Vo');\n", +"V = integ(A/r,r)+B;\n", +"disp(V,'Potential V = ')\n", +"V = limit(V,A,Vo/log(a/b));\n", +"V = limit(V,B,-Vo*log(b)/log(a/b));\n", +"disp(V,'Potential V by substitute the values of constant A & B = ')\n", +"V = Vo*log(b/r)/log(b/a);\n", +"E = -diff(V,r)*ar;\n", +"disp(E,'E = ');\n", +"E = limit(E,r,a);\n", +"disp(E,'E at r =a is =')\n", +"D = e*E;\n", +"DN = D/ar;\n", +"disp(DN,'DN =')\n", +"S = float(2*%pi*a*L); //area of cylinder\n", +"Q = DN*S\n", +"disp(Q,'Q =')\n", +"C = Q/Vo;\n", +"disp(C,'Capacitance of a cylindrical Capacitor C =')\n", +"//Result\n", +"// Potential V = B+log(r)*A \n", +"// Potential V by substitute the values of constant A & B =(log(r)-log(b))*Vo/log(a/b) \n", +"// E = ar*Vo/(log(b/a)*r) \n", +"// E at r =a is = ar*Vo/(a*log(b/a)) \n", +"// DN = e*Vo/(a*log(b/a)) \n", +"// Q = 6.283185306023805*e*Vo*L/log(b/a) \n", +"// Capacitance of a cylindrical Capacitor C = 6.283185306023805*e*L/log(b/a) " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.3: Determine_the_electric_field.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to Determine the electric field of a two infinite radial planes with an interior angle alpha\n", +"//Example 7.3\n", +"//page 180\n", +"clc;\n", +"phi = sym('phi');\n", +"A = sym('A');\n", +"B = sym('B');\n", +"Vo = sym('Vo');\n", +"alpha = sym('alpha');\n", +"aphi = sym('aphi');\n", +"r = sym('r');\n", +"V = integ(A,phi)+B;\n", +"disp(V,'V =');\n", +"V = limit(V,B,0);\n", +"V = limit(V,A,Vo/alpha);\n", +"disp(V,'Potential V after applying boundary conditions =')\n", +"E = -(1/r)*diff(V,phi)*aphi;\n", +"disp(E,'E =')\n", +"//Result\n", +"// V = B+phi*A \n", +"// Potential V after applying boundary conditions = phi*Vo/alpha \n", +"// E = -aphi*Vo/(alpha*r) " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.4: capacitance_of_a_spherical_capacito.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Derivation of capacitance of a spherical capacitor\n", +"//Example7.4\n", +"//page 181\n", +"clc;\n", +"a = sym('a');\n", +"b = sym('b');\n", +"Vo = sym('Vo');\n", +"r = sym('r');\n", +"e = sym('e');\n", +"V = Vo*((1/r)-(1/b))/((1/a)-(1/b));\n", +"disp(V,'V =')\n", +"E = -diff(V,r)*ar;\n", +"disp(E,'E =')\n", +"D = e*E;\n", +"DN = D/ar;\n", +"disp(DN,'DN =')\n", +"S = float(4*%pi*r^2); //area of sphere\n", +"Q = DN*S;\n", +"disp(Q,'Q =')\n", +"C = Q/Vo;\n", +"disp(C,'Capacitance of a spherical capacitor =')\n", +"//Result\n", +"//V = (1/r-1/b)*Vo/(1/a-1/b) \n", +"//E = ar*Vo/((1/a-1/b)*r^2) \n", +"//DN = e*Vo/((1/a-1/b)*r^2) \n", +"//Q = 12.56637060469643*e*Vo/(1/a-1/b) \n", +"//Capacitance of a spherical capacitor = 12.56637060469643*e/(1/a-1/b)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.5: Potential_in_spherical_coordinates.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Potential in spherical coordinates as a function of teta V(teta)\n", +"//Example7.5\n", +"//page 182\n", +"clc;\n", +"teta = sym('teta');\n", +"A = sym('A');\n", +"B = sym('B');\n", +"V = integ(A/float(sin(teta)),teta)+B;\n", +"disp(V,'V = ')\n", +"//Result\n", +"//V = B+(log(cos(teta)-1)/2-log(cos(teta)+1)/2)*A \n", +"//Equivalent to V = B+log(tan(teta/2))*A" + ] + } +], +"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/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/8-The_Steady_Magnetic_Field.ipynb b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/8-The_Steady_Magnetic_Field.ipynb new file mode 100644 index 0000000..6d88cdf --- /dev/null +++ b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/8-The_Steady_Magnetic_Field.ipynb @@ -0,0 +1,163 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: The Steady Magnetic Field" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.1: find_the_magnetic_field_intensity.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find the magnetic field intensity of a current carrying filament\n", +"//Example8.1\n", +"//page 217\n", +"clc;\n", +"I = 8; //current in amps\n", +"alpha1x = -90/57.3; // phase angle along with x-axis\n", +"x = 0.4;\n", +"y = 0.3;\n", +"z =0;\n", +"alpha2x = atan(x/y);\n", +"aphi = sym('aphi');\n", +"az = sym('az');\n", +"rx = y; // distance in metres in cynlindrical coordiante system\n", +"H2x = float((I/(4*%pi*rx))*(sin(alpha2x)-sin(alpha1x)))*-az;\n", +"disp(H2x,'H2x = ')\n", +"alpha1y = -atan(y/x);\n", +"alpha2y = 90/57.3;\n", +"ry = 0.4;\n", +"H2y = float((I/(4*%pi*ry))*(sin(alpha2y)-sin(alpha1y)))*-az;\n", +"disp(H2y,'H2y =')\n", +"H2 = H2x+H2y;\n", +"disp(H2,'H2 =')\n", +"//Result\n", +"//H2x = -3.819718617079289*az \n", +"//H2y = -2.546479080730701*az \n", +"//H2 = -6.36619769780999*az " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.2: to_find_the_curl_H.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find the curlH of a square path of side 'd'\n", +"//Example8.2\n", +"//page 230\n", +"clc;\n", +"ax = sym('ax');\n", +"az = sym('az');\n", +"ay = sym('ay');\n", +"z = sym('z');\n", +"y = sym('y');\n", +"d = sym('d');\n", +"H = 0.2*z^2*ax;\n", +"Hx = float(H/ax);\n", +"HdL = float(0.4*z*d^2);\n", +"//curlH evaluated from the definition of curl\n", +"curlH = (HdL/(d^2))*ay;\n", +"//curlH evaluated from the determinant\n", +"del_cross_H = -ay*(-diff(Hx,z))+az*(-diff(Hx,y));\n", +"disp(curlH,'curlH = ')\n", +"disp(del_cross_H,'del_cross_H = ')\n", +"//Result\n", +"//curlH = 0.4*ay*z \n", +"//del_cross_H = 0.4*ay*z " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.3: verify_Stokes_theorem.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to verify Stokes theorem\n", +"//Example8.3\n", +"//page 233\n", +"clc;\n", +"teta = sym('teta');\n", +"phi = sym('phi');\n", +"ar = sym('ar');\n", +"aphi = sym('aphi');\n", +"az = sym('az');\n", +"r = sym('r');\n", +"curlH = float(36*cos(teta)*cos(phi)*r^2*sin(teta));\n", +"curlH_S = integ(curlH,teta);\n", +"curlH_S = float(limit(curlH_S,r,4));\n", +"curlH_S = float(limit(curlH_S,teta,0.1*%pi))-float(limit(curlH_S,teta,0));\n", +"curlH_S = integ(curlH_S,phi);\n", +"curlH_S = float(limit(curlH_S,phi,0.3*%pi))-float(limit(curlH_S,phi,0));\n", +"disp(curlH_S,'Surface Integral of curlH in Amps =')\n", +"Hr = 6*r*sin(phi);\n", +"Hphi = 18*r*sin(teta)*cos(phi);\n", +"HdL = float(limit(Hphi*r*sin(teta),r,4));\n", +"HdL = float(limit(HdL,teta,0.1*%pi));\n", +"HdL = float(integ(HdL,phi))\n", +"HdL = float(limit(HdL,phi,0.3*%pi));\n", +"disp(HdL,'Closed Line Integral of H in Amps =')\n", +"//Result\n", +"//Surface Integral of curlH in Amps = 22.24922359441324 \n", +"// Closed Line Integral of H in Amps = 22.24922359441324 " + ] + } +], +"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/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/9-Magnetic_Forces_Materials_and_Inductance.ipynb b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/9-Magnetic_Forces_Materials_and_Inductance.ipynb new file mode 100644 index 0000000..dea7d70 --- /dev/null +++ b/Engineering_Electromagnetics_by_W_H_Hayt_And_J_A_Buck/9-Magnetic_Forces_Materials_and_Inductance.ipynb @@ -0,0 +1,519 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9: Magnetic Forces Materials and Inductance" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.1: find_magnetic_field_and_force_produced.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find magnetic field and force produced in a square loop\n", +"//Example9.1\n", +"//page 263\n", +"clc;\n", +"x = sym('x');\n", +"y = sym('y');\n", +"z = sym('z');\n", +"ax = sym('ax');\n", +"ay = sym('ay');\n", +"az = sym('az');\n", +"I = 15; //filament current in amps\n", +"I1 = 2e-03; //current in square loop\n", +"u0 = 4*%pi*1e-07; //free space permeability in H/m\n", +"H = float(I/(2*%pi*x))*az;\n", +"disp(H,'Magnetic Field Intensity in A/m H =')\n", +"B = float(u0*H);\n", +"disp(B,'Magnetic Flux Density in Tesla B = ')\n", +"Bz = B/az;\n", +"//Bcross_dL = ay*diff(Bz,x);\n", +"F1 = float(-I1*integ(ay*Bz,x));\n", +"F1 = float(limit(F1,x,3)-limit(F1,x,1));\n", +"F2 = float(-I1*integ(ax*-Bz,y));\n", +"F2 = float(limit(F2,x,3));\n", +"F2 = float(limit(F2,y,2)-limit(F2,y,0));\n", +"F3 = float(-I1*integ(ay*Bz,x));\n", +"F3 = float(limit(F3,x,1)-limit(F3,x,3));\n", +"F4 = float(-I1*integ(ax*-Bz,y));\n", +"F4 = float(limit(F4,x,1));\n", +"F4 = float(limit(F4,y,0)-limit(F4,y,2));\n", +"F =float((F1+F2+F3+F4)*1e09);\n", +"disp(F,'Total Force acting on a square loop in nN F = ')\n", +"//Result\n", +"//Magnetic Field Intensity in A/m H = 2.387324146817574*az/x \n", +"//Magnetic Flux Density in Tesla B = 3.0000000003340771E-6*az/x \n", +"//Total Force acting on a square loop in nN F = -8.000000000890873*ax " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.2: determine_the_differential_force.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to determine the differential force between two differential current elements\n", +"//Example9.2\n", +"//page 265\n", +"clc;\n", +"ax = sym('ax');\n", +"ay = sym('ay');\n", +"az = sym('az');\n", +"//position of filament in cartesian coordinate system\n", +"P1 = [5,2,1]; \n", +"P2 = [1,8,5];\n", +"//distance between filament 1 and filament 2\n", +"R12 = norm(P2-P1);\n", +"disp(R12,'R12 =')\n", +"I1dL1 = [0,-3,0]; //current carrying first filament 1\n", +"I2dL2 = [0,0,-4]; //current carrying second filament 2\n", +"u0 = 4*%pi*1e-07; //free space permeability in H/m\n", +"aR12 = UnitVector(P2-P1); //unit vector\n", +"disp(aR12,'aR12 =')\n", +"C1 = cross_product(I1dL1,aR12);\n", +"C2 = cross_product(I2dL2,C1);\n", +"dF2 = (u0/(4*%pi*R12^2))*C2;\n", +"dF2_y = float(dF2(2)*1e09);\n", +"disp(dF2_y*ay,'the differential force between two differential current elements in nN =')\n", +"//Result\n", +"//R12 = 8.2462113 \n", +"//aR12 = - 0.4850713 0.7276069 0.4850713 \n", +"//the differential force between two differential current elements in nN = 8.560080878105142*ay " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.3: calculate_the_total_torque_acting.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to calculate the total torque acting on a planar rectangular current loop\n", +"//Example9.3\n", +"//page 271\n", +"clc;\n", +"ax = sym('ax');\n", +"ay = sym('ay');\n", +"az = sym('az');\n", +"x = 1;//length in metre\n", +"y = 2; //wide in metre\n", +"S = [0,0,x*y]; //area of current loop in square metre\n", +"I = 4e-03; //current in Amps\n", +"B = [0,-0.6,0.8];\n", +"T = I*cross_product(S,B);\n", +"Tx = float(T(1));\n", +"disp(Tx*ax*1e03,'Total Torque acting on the rectangular current loop in milli N/m=')\n", +"//Result\n", +"//Total Torque acting on the rectangular current loop in milli N/m = 4.8*ax " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.4: find_the_torque_and_force_acting.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find the torque and force acting on each side of planar loop\n", +"//Example9.4\n", +"//page 271\n", +"clc;\n", +"ax = sym('ax');\n", +"ay = sym('ay');\n", +"az = sym('az');\n", +"I = 4e-03; //current in Amps\n", +"B = [0,-0.6,0.8]; //Magentic Field acting on current loop in Tesla\n", +"L1 = [1,0,0]; //length along x-axis\n", +"L2 = [0,2,0]; //length along y-axis\n", +"F1 = I*cross_product(L1,B);\n", +"F3 = -F1;\n", +"F2 = I*cross_product(L2,B);\n", +"F4 = -F2;\n", +"R1 = [0,-1,0]; //distance from center of loop for side1\n", +"R2 = [0.5,0,0]; //distance from center of loop for side2\n", +"R3 = [0,1,0]; //distance from center of loop for side3\n", +"R4 = [-0.5,0,0];//distance from center of loop for side4\n", +"T1 = cross_product(R1,F1);\n", +"T2 = cross_product(R2,F2);\n", +"T3 = cross_product(R3,F3);\n", +"T4 = cross_product(R4,F4);\n", +"T = T1+T2+T3+T4;\n", +"Tx = float(T(1)*1e03);\n", +"disp(F1,'F1 =')\n", +"disp(F2,'F2 =')\n", +"disp(F3,'F3 =')\n", +"disp(F4,'F4 =')\n", +"disp(T1,'T1 =')\n", +"disp(T2,'T2 =')\n", +"disp(T3,'T3 =')\n", +"disp(T4,'T4 =')\n", +"disp(Tx*ax,'Total torque acting on the rectangular planar loop in milli N/m T =')\n", +"//Result\n", +"// F1 = \n", +"// 0. \n", +"// - 0.0032 \n", +"// - 0.0024 \n", +"// F2 = \n", +"// 0.0064 \n", +"// 0. \n", +"// 0. \n", +"// F3 = \n", +"// 0. \n", +"// 0.0032 \n", +"// 0.0024 \n", +"// F4 = \n", +"// - 0.0064 \n", +"// 0. \n", +"// 0. \n", +"// T1 = \n", +"// 0.0024 \n", +"// 0. \n", +"// 0. \n", +"// T2 = \n", +"// 0. \n", +"// 0. \n", +"// 0. \n", +"// T3 = \n", +"// 0.0024 \n", +"// 0. \n", +"// 0. \n", +"// T4 = \n", +"// 0. \n", +"// 0. \n", +"// 0. \n", +"// Total torque acting on the rectangular planar loop in milli N/m T = 4.8*ax " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.5: find_Magnetic_Susceptibility.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find Magnetic Susceptibility, H,Magentization M\n", +"//Example9.5\n", +"//page 279\n", +"clc;\n", +"ur = 50; //relative permeability of ferrite material\n", +"u0 = 4*%pi*1e-07; //free space permeability in H/m\n", +"chim = ur-1; //magnetic susceptibility\n", +"B = 0.05; //magnetic flux density in tesla\n", +"u = u0*ur;\n", +"H = B/u; //magnetic field intensity in A/m\n", +"M = chim*ceil(H); //magnetization in A/m\n", +"disp(chim,'chim =')\n", +"disp(H,'H =')\n", +"disp(M,'M = ')\n", +"//Reuslt\n", +"//chim = 49. \n", +"//H = 795.77472 \n", +"//M = 39004. " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.6: find_the_boundary_conditions_on_magnetic_field.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find the boundary conditions on magnetic field\n", +"//Example9.6\n", +"//page 283\n", +"clc;\n", +"ax = sym('ax');\n", +"ay = sym('ay');\n", +"az = sym('az');\n", +"u1 = 4e-06; // relative permeability in medium1\n", +"u2 = 7e-06; //relative permeability in medium2\n", +"k = [80,0,0]; //in A/m\n", +"B1 = [2e-03,-3e-03,1e-03];//field in region1\n", +"aN12 = [0,0,-1];\n", +"//To find Normal Components of Magnetic Field\n", +"Bz = dot(B1,aN12);\n", +"BN1 = [0,0,-Bz];\n", +"BN1 = float(BN1);\n", +"BN2 = float(BN1);\n", +"//To Find the Tangential Components of Magnetic Field\n", +"Bt1 = float(B1 - BN1);\n", +"Ht1 = float(Bt1/u1);\n", +"v = cross_product(aN12,k);\n", +"Ht2 = float(Ht1-v');\n", +"Bt2 = float(u2*Ht2);\n", +"disp(BN1(1)*ax+BN1(2)*ay+BN1(3)*az,'BN1 =')\n", +"disp(BN2(1)*ax+BN2(2)*ay+BN2(3)*az,'BN2 =')\n", +"disp(Bt1(1)*ax+Bt1(2)*ay+Bt1(3)*az,'Bt1 =');\n", +"disp(Ht1(1)*ax+Ht1(2)*ay+Ht1(3)*az,'Ht1 =');\n", +"disp(Ht2(1)*ax+Ht2(2)*ay+Ht2(3)*az,'Ht2 =');\n", +"disp(Bt2(1)*ax+Bt2(2)*ay+Bt2(3)*az,'Bt2 =');\n", +"//Total Magnetic Field Region2\n", +"B2 = (BN2+Bt2)*1e03;\n", +"B2 = B2(1)*ax+B2(2)*ay+B2(3)*az;\n", +"disp(B2,'Total Magnetic Field Region2 in milli Tesla B2 =')\n", +"//Result\n", +"// BN1 = \n", +"// 0.001*az \n", +"//BN2 = \n", +"// 0.001*az \n", +"//Bt1 = \n", +"// 0.002*ax-0.003*ay \n", +"//Ht1 = \n", +"// 500.0*ax-750.0*ay \n", +"//Ht2 = \n", +"// 500.0*ax-670.0*ay \n", +"//Bt2 = \n", +"// 0.0035*ax-0.00469*ay \n", +"//Total Magnetic Field Region2 in milli Tesla B2 = \n", +"// 1.0*az-4.69*ay+3.5*ax " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.7: magnetomotive_force_Vm_.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find find magnetomotive force 'Vm' and reluctance 'R'\n", +"//Example9.7\n", +"//page 288\n", +"clc;\n", +"u0 = 4*%pi*1e-07 ;//free space permeability in H/m\n", +"ur = 1;//relative permeability\n", +"u = u0*ur;\n", +"dair = 2e-03; //air gap in toroid\n", +"dsteel = 0.3*%pi;\n", +"S = 6e-04; //area of cross section in square metre\n", +"B = 1; //flux density 1 tesla\n", +"N = 500; //number of turns\n", +"Rair = dair/(u*S); \n", +"disp(Rair,'Reluctance in A.t/Wb Rair =')\n", +"phi = B*S;\n", +"disp(phi,'Magnetic Flux in weber phi =')\n", +"Vm_air = S*Rair;\n", +"disp(Vm_air,'mmf required for the air gap in A.t Vm_air =')\n", +"Hsteel = 200; //magnetic field intensity of steel in A/m\n", +"Vm_steel = Hsteel*dsteel;\n", +"disp(Vm_steel,'mmf required for the steel in A.t Vm_steel =')\n", +"disp(Vm_steel+Vm_air,'Totla mmf required for toroid in A.t Vm =')\n", +"I = (Vm_steel+Vm_air)/N;\n", +"disp(I,'Total coil current in Amps I =')\n", +"//Result\n", +"//Reluctance in A.t/Wb Rair = 2652582.4 \n", +"//Magnetic Flux in weber phi = 0.0006 \n", +"//mmf required for the air gap in A.t Vm_air = 1591.5494 \n", +"//mmf required for the steel in A.t Vm_steel = 188.49556 \n", +"//Totla mmf required for toroid in A.t Vm = 1780.045 \n", +"//Total coil current in Amps I = 3.56009 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.8: total_Magnetic_Flux_Density.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to find total Magnetic Flux Density in Weber\n", +"//Example9.8\n", +"//page 289\n", +"clc;\n", +"I = 4; //current through toroid in Amps\n", +"r = 1e-03; //air gap radius in metre\n", +"Hphi = I/(2*%pi*r);\n", +"u0 = 4*%pi*1e-07 ;//free space permeability in H/m\n", +"ur = 1;//relative permeability\n", +"u = u0*ur;\n", +"N = 500;//number of turns\n", +"S = 6e-04; //cross section area in square metre\n", +"Rair = 2.65e06; //reluctance in air A.t/Wb\n", +"Rsteel = 0.314e06; //reluctance in steel A.t/Wb\n", +"R = Rair+Rsteel;//total reluctance in A.t/Wb\n", +"Vm = I*500; //total mmf in A.t\n", +"phi = Vm/R;//total flux in webers\n", +"B = phi/S; //flux density in Wb/Square metre\n", +"disp(B,'Magentic Flux Density in tesla B =')\n", +"//Result\n", +"//Magentic Flux Density in tesla B = 1.1246064 " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.9: self_inductances_and_Mutual_Inductances.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//clear//\n", +"//Caption: Program to calculate self inductances and Mutual Inductances between two coaixal solenoids\n", +"//Example9.9\n", +"//page 297\n", +"clc;\n", +"n1 = sym('n1');\n", +"n2 = sym('n2');\n", +"I1 = sym('I1');\n", +"I2 = sym('I2');\n", +"az = sym('az');\n", +"R1 = sym('R1');\n", +"R2 = sym('R2');\n", +"u0 = sym('u0');\n", +"H1 = n1*I1*az;\n", +"disp(H1,'H1 =');\n", +"H2 = n2*I2*az;\n", +"disp(H2,'H2 =');\n", +"S1 = float(%pi*R1^2);\n", +"S2 = float(%pi*R2^2);\n", +"Hz = float(H1/az);\n", +"phi12 = float(u0*Hz*S1);\n", +"disp(phi12,'phi12 = ')\n", +"M12 = n2*phi12/I1;\n", +"disp(M12,'M12 =')\n", +"//R1 = 2e-02; \n", +"//R2 = 3e-02;\n", +"//n1 = 50*100; //number of turns/m\n", +"//n2 = 80*100; //number of turns/m\n", +"//u0 = 4*%pi*1e-07;\n", +"M12 = float(limit(M12,R1,2e-02));\n", +"M12 = float(limit(M12,R2,3e-02));\n", +"M12 = float(limit(M12,n1,5000));\n", +"M12 = float(limit(M12,n2,8000));\n", +"M12 = float(limit(M12,u0,4*%pi*1e-07));\n", +"disp(M12*1e03,'Mutual Inductance in mH/m M12=')\n", +"L1 = u0*n1^2*S1;\n", +"L1 = float(limit(L1,u0,4*%pi*1e-07));\n", +"L1 = float(limit(L1,n1,5000));\n", +"L1 = float(limit(L1,R1,2e-02));\n", +"disp(L1*1e3,'Self Inductance of solenoid 1 in mH/m L1 =')\n", +"L2 = u0*n2^2*S2;\n", +"L2 = float(limit(L2,u0,4*%pi*1e-07));\n", +"L2 = float(limit(L2,n2,8000));\n", +"L2 = float(limit(L2,R2,3e-02));\n", +"disp(L2*1e3,'Self Inductance of solenoid 1 in mH/m L2 =')\n", +"//Result\n", +"// H1 = az*n1*I1 \n", +"// H2 = az*n2*I2 \n", +"// phi12 = 3.141592653011903*n1*u0*I1*R1^2 \n", +"// M12 = 3.141592653011903*n1*n2*u0*R1^2 \n", +"// Mutual Inductance in mH/m M12= 63.16546815077 \n", +"// Self Inductance of solenoid 1 in mH/m L1 = 39.47841759423 \n", +"// Self Inductance of solenoid 1 in mH/m L2 = 227.39568534276 " + ] + } +], +"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 +} |