diff options
Diffstat (limited to 'Electrical_Power_Systems_by_C_L_Wadhwa/18-LOAD_FLOWS.ipynb')
-rw-r--r-- | Electrical_Power_Systems_by_C_L_Wadhwa/18-LOAD_FLOWS.ipynb | 264 |
1 files changed, 264 insertions, 0 deletions
diff --git a/Electrical_Power_Systems_by_C_L_Wadhwa/18-LOAD_FLOWS.ipynb b/Electrical_Power_Systems_by_C_L_Wadhwa/18-LOAD_FLOWS.ipynb new file mode 100644 index 0000000..2f1011f --- /dev/null +++ b/Electrical_Power_Systems_by_C_L_Wadhwa/18-LOAD_FLOWS.ipynb @@ -0,0 +1,264 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 18: LOAD FLOWS" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.1: Determine_the_voltages_at_the_end_of_first_iteration_using_gauss_seidal_method.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Determine the voltages at the end of first iteration using gauss seidal method\n", +"clear \n", +"clc;\n", +"Y=[3-%i*12 -2+%i*8 -1+%i*4 0;-2+%i*8 3.666-%i*14.664 -.666+%i*2.6664 -1+%i*4;-1+%i*4 -.666+%i*2.6664 3.666-%i*14.664 -2+%i*8;0 -1+%i*4 -2+%i*8 3-%i*12];\n", +"P2=-.5;\n", +"P3=-.4;\n", +"P4=-.3;\n", +"Q4=-.1;\n", +"Q3=-.3;\n", +"Q2=-.2;\n", +"V2=1;\n", +"V3=1;\n", +"V4=1;\n", +"V10=1.06;\n", +"V30=1;\n", +"V40=1;\n", +"V21=(((P2-%i*Q2)/V2)-Y(2,1)*V10-Y(2,3)*V30-Y(2,4)*V40)/(Y(2,2));\n", +"V21acc=1+1.6*(V21-1);\n", +"disp(V21acc,'V21acc=');\n", +"V31=(((P3-%i*Q3)/V3)-Y(3,1)*V10-Y(3,2)*V21acc-Y(3,4)*V40)/(Y(3,3));\n", +"V31acc=1+1.6*(V31-1);\n", +"disp(V31acc,'V31acc=');\n", +"V41=(((P4-%i*Q4)/V4)-Y(4,2)*V21acc-Y(4,3)*V31acc)/(Y(4,4));\n", +"V41acc=1+1.6*(V41-1);\n", +"disp(V41acc,'V41acc=');\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.2: Determine_the_voltages_starting_with_a_flat_voltage_profile.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Determine the voltages starting with a flat voltage profile.\n", +"clear \n", +"clc;\n", +"\n", +"Y=[3-%i*12 -2+%i*8 -1+%i*4 0;-2+%i*8 3.666-%i*14.664 -.666+%i*2.6664 -1+%i*4;-1+%i*4 -.666+%i*2.6664 3.666-%i*14.664 -2+%i*8;0 -1+%i*4 -2+%i*8 3-%i*12];\n", +"P2=.5;\n", +"P3=-.4;\n", +"P4=-.3;\n", +"Q4=-.1;\n", +"Q3=-.3;\n", +"V3=1;\n", +"V4=1;\n", +"V1=1.06;\n", +"V2=1.04;\n", +"V30=1;\n", +"V40=1;\n", +"Q2=-imag([V2*[Y(2,1)*V1+Y(2,2)*V2+Y(2,3)*V3+Y(2,4)*V4]]);\n", +"V21=(((P2-%i*Q2)/V2)-Y(2,1)*V1-Y(2,3)*V30-Y(2,4)*V40)/(Y(2,2));\n", +"d=atand(0.0291473/1.0472868);\n", +"V21=1.04*(cosd(d)+%i*sind(d));\n", +"disp(V21,'V21=');\n", +"V31=(((P3-%i*Q3)/V3)-Y(3,1)*V1-Y(3,2)*V21-Y(3,4)*V40)/(Y(3,3));\n", +"disp(V31,'V31=');\n", +"V41=(((P4-%i*Q4)/V4)-Y(4,2)*V21-Y(4,3)*V31)/(Y(4,4));\n", +"disp(V41,'V41=');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.3: Solve_the_prevous_problem_for_for_voltages_at_the_end_of_first_iteration.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Solve the prevous problem for for voltages at the end of first iteration. for .2<=Q2<=1\n", +"clear \n", +"clc;\n", +"\n", +"Y=[3-%i*12 -2+%i*8 -1+%i*4 0;-2+%i*8 3.666-%i*14.664 -.666+%i*2.664 -1+%i*4;-1+%i*4 -.666+%i*2.664 3.666-%i*14.664 -2+%i*8;0 -1+%i*4 -2+%i*8 3-%i*12];\n", +"P2=.5;\n", +"P3=-.4;\n", +"P4=-.3;\n", +"Q4=-.1;\n", +"Q3=-.3;\n", +"V3=1;\n", +"V4=1;\n", +"V1=1.06;\n", +"V2=1;\n", +"V30=1;\n", +"V40=1;\n", +"Q2=.2;\n", +"V3=1;\n", +"V21=(((P2-%i*Q2)/V2)-Y(2,1)*V1-Y(2,3)*V30-Y(2,4)*V40)/(Y(2,2));\n", +"V31=(((P3-%i*Q3)/V3)-Y(3,1)*V1-Y(3,2)*V21-Y(3,4)*V40)/(Y(3,3));\n", +"V41=(((P4-%i*Q4)/V4)-Y(4,2)*V21-Y(4,3)*V31)/(Y(4,4));\n", +"disp(V21,'V21=');\n", +"disp(V31,'V31=');\n", +"disp(V41,'V41=');\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.4: EX18_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Determine the set of load flow equations at the end of first iteration by using Newton Raphson method.\n", +"clear \n", +"clc;\n", +"Y=[6.25-%i*18.75 -1.25+%i*3.75 -5+%i*15;-1.25+%i*3.75 2.916-%i*8.75 -1.666+%i*5;-5+%i*15 -1.666+%i*5 6.666-%i*20];\n", +"V1=1.06;\n", +"G11=6.25;\n", +"G12=-1.25;\n", +"G21=G12;\n", +"G13=-5;\n", +"G31=G13;\n", +"G22=2.916;\n", +"G23=-1.666;\n", +"G32=G23;\n", +"G33=6.666;\n", +"B11=18.75;\n", +"B12=-3.75;\n", +"B21=B12;\n", +"B13=-15;\n", +"B31=B13;\n", +"B22=8.75;\n", +"B23=-5;\n", +"B32=B23;\n", +"B33=20;\n", +"e1=1.06;\n", +"e2=1;\n", +"e3=1;\n", +"f1=0;\n", +"f2=0;\n", +"f3=0;\n", +"P2=e2*(e1*G21+f1*B21) +f2*(f1*G21-e1*B21) +e2*(e2*G22+f2*B22)+f2*(f2*G22-e2*B22)+e2*(e3*G23+f3*B23)+f2*(f3*G23-e3*B23);\n", +"P3=-.3\n", +"Q2=-.225;\n", +"Q3=-.9;\n", +"dP2=.2-(-.225);\n", +"dP3=-.6-(-.3);\n", +"dQ2=0-(-.225);\n", +"dQ3=-.25-(-.9);\n", +"a1=2*e2*G22+e1*G21+f1*B21+e3*G23+f3*B23;//a1=dP2/de2\n", +"a2=2*e3*G33+e1*G31+f1*B31+e3*G32+f2*B32;//a2=dP3/de3\n", +"b1=2*f2*G22 +f1*G21-e1*B21+f3*G23-e3*B23;//b1=dP2/df2\n", +"b2=20.9;//dP3/df3\n", +"a3=e2*G23-f2*B23;//dP2/de3\n", +"a4=-1.666;//dP3/de2\n", +"b3=-5;//dP2/df3\n", +"b4=-5;//dP3/df2\n", +"c1=2*e2*B22-f1*G21+e1*B21-f3*G23+e3*B23;//dQ2/de2\n", +"c2=19.1;//dQ3/de3\n", +"c3=-2.991;//dQ2/df2\n", +"c4=-6.966;//dQ3/df3\n", +"mprintf('set of linear equations at the end of first iteration are\n');\n", +"mprintf('%.3fde2 %.3fde3+ %.3fdf2 %.3fdf3 = %.3f\n',2.846,-1.666,8.975,-5,2.75);\n", +"mprintf('%.3fde2 +%.3fde3 %.3fdf2 +%.3fdf3 = %.3f\n',-1.666,6.366,-5,20.90,-.3);\n", +"mprintf('%.3fde2 %.3fde3 %.3fdf2 +%.3fdf3 = %.3f\n',8.525,-5,-2.991,1.666,.225);\n", +"mprintf('%.3fde2 +%.3fde3+ %.3fdf2 %.3fdf3 = %.3f\n',-5,19.1,1.666,-6.966,.65);" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 18.5: EX18_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Determine the equations at the end of first iteration after applying given constraints.\n", +"clear \n", +"clc;\n", +"Q2=-.225;\n", +"dP2=.2-(-.075);\n", +"dP3=-.6-(-.3);\n", +"dQ3=-.25-(-.9);\n", +"dV2=1.04^2 - 1^2;//dV2=|dV2|^2\n", +"mprintf('set of linear equations at the end of first iteration are\n');\n", +"mprintf('%.3fde2 %.3fde3+ %.3fdf2 %.3fdf3 = %.3f\n',2.846,-1.666,8.975,-5,2.75);\n", +"mprintf('%.3fde2 +%.3fde3 %.3fdf2 +%.3fdf3 = %.3f\n',-1.666,6.366,-5,20.90,-.3);\n", +"mprintf('%.3fde2 %.3fde3 %.3fdf2 +%.3fdf3 = %.3f\n',8.525,-5,-2.991,1.666,.225);\n", +"mprintf('%.3fde2 +%.3fde3+ %.3fdf2 +%.3fdf3 = %.5f\n',2,0,0,0,dV2);" + ] + } +], +"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 +} |