{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 12: Direct Current Circuits" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12.1: Current.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Input data\n", "R=[6,6,12]//Resistances from circuit diagram 12.34 on page no.192 in ohms\n", "V=[5,2]//Voltage in V from circuit diagram 12.20 on page no.192\n", "\n", "//Calculations\n", "Re=((R(2)*R(3))/(R(2)+R(3)))+R(1)//Equivalent resistance in ohms for 5V supply\n", "I=V(1)/Re//Equivalent current in A for 5V supply\n", "Ve=((R(2)*R(3))/(R(2)+R(3)))*I//Voltage across 5V supply in V\n", "I1=(Ve/R(3))//Current in A\n", "Re2=(1/((1/(R(1)))+(1/(R(2)))))+R(3)//Equivalent resistance in ohms for 2V supply\n", "I2=V(2)/Re2//Equivalent current in A for 2V supply\n", "Ix=I1-I2//Current through 12 ohm resistance in A\n", "Iy=1/Ix//For displaying output in fraction\n", "\n", "//Output\n", "printf('The current through %i ohm resistor is 1/%i A',R(3),Iy)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12.2: Equivalent_circuit.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Input data\n", "R=[3,5,6,7]//Resistances from circuit diagram 12.36(a) on page no. 193 in ohms\n", "V=12//Voltage in V from circuit diagram 12.36(a) on page no. 193\n", "\n", "//Calculations\n", "Vth=(V*R(3))/(R(3)+R(4)+R(2))//Equivalent voltage in V\n", "Rth=R(1)+(((R(2)+R(4))*R(3))/(R(2)+R(4)+R(3)))//Equivalent resistance in ohms\n", "\n", "//Output\n", "printf('Thevenin equivalent resistance is %i ohms \n Thevenin equivalent voltage is %i V',Rth,Vth)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12.3: Norton_equivalent.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Inut data\n", "R=[2,3,4]//Resistances from circuit diagram 12.37(a) on page no.194 in ohms\n", "V=5//Voltage in V from circuit diagram 12.37(a) on page no.194\n", "\n", "//Calculations\n", "RN=((R(1)+R(2))*R(3))/(R(1)+R(2)+R(3))//Equivalent resistance in ohms\n", "IN=V/(R(1)+R(2))//Equivalent current in A\n", "\n", "//Output\n", "printf('Nortons equivalent resistance is %3.2f ohms \n Nortons equivalent current is %i A',RN,IN)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12.4: Parameters.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Input data\n", "C=10*10^-6//Capicitance in F\n", "R=10*10^3//Resistance in ohms\n", "e=6//Emf of the battery in V\n", "\n", "//Calculations\n", "t=C*R//Time constant in s\n", "Qm=(C*e)/10^-6//Maximum charge in micro C\n", "Im=(e/R)*1000//Maximum current in mA\n", "\n", "//Output\n", "printf('Time constant of the circuit is %3.1f s \n Maximum charge on the capacitor is %i micro C \n Maximum current in the circuit is %3.1f mA \n Charge at time t is Q(t) = %i(1-exp(-t/%3.1f)) micro C \n Currrent at time t is I(t) = %3.1f exp(-t/%3.1f) mA',t,Qm,Im,Qm,t,Im,t)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12.5: Time_constant.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Input data\n", "L=50//Inductance in mH\n", "R=5//Resistance in ohms\n", "V=6//Volatage of the battery in V\n", "t=5//Time in ms\n", "\n", "//Calculations\n", "t1=(L/R)//Time constant in ms\n", "I=(V/R)*(1-exp(-t/t1))//Current in A\n", "\n", "//Output\n", "printf('The time constant of the circuit is %i ms \n The current in the circuit is %3.2f A',t1,I)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12.6: Parameters.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Input data\n", "L=6//Inductance in mH\n", "C=12//Capacitance in pF\n", "V=6//Voltage of the battery in V\n", "\n", "//Calculations\n", "f=(1/(2*3.14*sqrt(L*10^-3*C*10^-12)))/10^5//Frequency of oscillation in Hz*10^5\n", "Qm=(C*10^-12*V)/10^-12//Maximum charge in C *10^-12\n", "Im=(2*3.14*f*10^5*Qm*10^-12)/10^-6//Maximum current in micro A\n", "\n", "//Output\n", "printf('Frequency of oscillation is %3.2f *10^5 Hz \n The maximum value of charge on capacitor is %i *10^-12 C \n The current in the circuit is %i micro A',f,Qm,Im)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12.e_1: Current.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Input data\n", "V=10//voltage in V from fig.12.7 on page no.175\n", "R=10//Resistance in ohms from fig.12.7 on page no.175\n", "\n", "//Calculations\n", "I=(V/R)//Current in A\n", "\n", "//Output\n", "printf('Current in the circuit shown in fig.12.7 is %i A',I)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12.e_2: Current.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Input data\n", "R=[6,6,3]//Resistances in the circuit from circuit diagram 12.9 on page no. 175 in ohms\n", "V=[24,16]//Voltages in the circuit from circuit diagram 12.9 on page no. 175 in V\n", "\n", "//Calculations\n", "Re1=1/((1/R(2))+(1/R(3)))//Equivalent resistance for parallel combination in ohms\n", "Re=R(1)+Re1//Equivalent resistance of the ciriuit in ohms\n", "I1=(V(1)/Re)//Current across the resistors in A\n", "pd=(I1*Re1)//Potential difference across A and B from circuit diagram 12.9 on page no. 175 in V\n", "I2=(pd/R(3))//Current across 3 ohms resistance in A\n", "I3=(V(2)/(R(1)+R(2)))//Current in A\n", "I=I2+I3//Total current\n", "\n", "//Output\n", "printf('The current shown in the circiut is %3.1f A',I)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12.e_3: Thevenins_equivalent_circuit.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Input data\n", "R=[4,12,2,12]//Resistances from circuit diagram 12.12 on page no. 177 in ohms\n", "V=12//Voltage in V from circuit diagram 12.12 on page no. 177\n", "\n", "//Calculations\n", "Rth=((R(1)+R(3))*R(2))/(R(1)+R(3)+R(2))//Equivalent resistance in ohms\n", "Vth=(V*R(2))/(R(1)+R(3)+R(2))//Equivalent voltage in V\n", "I=(Vth/(Rth+R(4)))//Current in A\n", "\n", "//Output\n", "printf('The current through the resistor is %3.1f A',I)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12.e_4: Thevenins_equivalent_circuit.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Input data\n", "R=[2,3,6]//Resistances from circuit diagram 12.15 on page no. 178 in ohms\n", "I=2//Current in A from circuit diagram 12.15 on page no. 178\n", "\n", "//Calculations\n", "Rth=(R(2)+R(3))//Equivalent resistance in ohms\n", "Vth=(R(3)*I)//Equivalent voltage in V\n", "\n", "//Output\n", "printf('Thevenin equivalent resistance is %i ohms \n Thevenin equivalent voltage is %i V',Rth,Vth)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12.e_5: Thevenins_equivalent_circuit.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Input data\n", "R=[12,8,3,6]//Resistances from circuit diagram 12.17 on page no.179 in ohms\n", "V=12//Voltage in V from circuit diagram 12.17 on page no.179\n", "\n", "//Calculations\n", "Rth=((R(3)*R(1))/(R(3)+R(1)))+((R(2)*R(4))/(R(2)+R(4)))//Equivalent resistance in ohms\n", "Vth=2.74//Thevenin voltage taken from the circuit diagram 12.19(a) on page no.179 in V\n", "\n", "//Output\n", "printf('Thevenin equivalent resistance is %3.2f ohms \n Thevenin equivalent voltage is %3.2f V',Rth,Vth)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12.e_6: Nortons_equivalent_circuit.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Input data\n", "R=[4,12,2,12]//Resistances from circuit diagram 12.20 on page no.180 in ohms\n", "V=12//Voltage in V from circuit diagram 12.20 on page no.180\n", "\n", "//Calculations\n", "RN=((R(1)+R(3))*R(2))/(R(1)+R(3)+R(2))//Equivalent resistance in ohms\n", "IN=(V/(RN+R(3)))//Equivalent current in A\n", "\n", "//Output\n", "printf('Nortons equivalent resistance is %i ohms \n Nortons equivalent current is %i A',RN,IN)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12.e_7: Nortons_equivalent_circuit.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Inut data\n", "R=[4,5,6]//Resistances from circuit diagram 12.22 on page no.181 in ohms\n", "I=2//Current in A from circuit diagram 12.22 on page no.181\n", "\n", "//Calculations\n", "RN=(R(1)+R(2)+R(3))//Equivalent resistance in ohms\n", "IN=(R(1)*I)/RN//Equivalent curren in A\n", "\n", "//Output\n", "printf('Nortons equivalent resistance is %i ohms \n Nortons equivalent current is %3.3f A',RN,IN)" ] } ], "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 }