summaryrefslogtreecommitdiff
path: root/Linear_Control_Systems_by_B_S_Manke/4-SIGNAL_FLOW_GRAPHS.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Linear_Control_Systems_by_B_S_Manke/4-SIGNAL_FLOW_GRAPHS.ipynb')
-rw-r--r--Linear_Control_Systems_by_B_S_Manke/4-SIGNAL_FLOW_GRAPHS.ipynb474
1 files changed, 474 insertions, 0 deletions
diff --git a/Linear_Control_Systems_by_B_S_Manke/4-SIGNAL_FLOW_GRAPHS.ipynb b/Linear_Control_Systems_by_B_S_Manke/4-SIGNAL_FLOW_GRAPHS.ipynb
new file mode 100644
index 0000000..046824b
--- /dev/null
+++ b/Linear_Control_Systems_by_B_S_Manke/4-SIGNAL_FLOW_GRAPHS.ipynb
@@ -0,0 +1,474 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4: SIGNAL FLOW GRAPHS"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.3_1: Overall_Transmittance.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption:overall_transmittance\n",
+"// example 4.3.1\n",
+"//page 63\n",
+"syms G1 G2 H1;\n",
+"// forward path denoted by P1,P2 and so on and loop by L1,L2 and so on \n",
+"//path factor by D1,D2 and so on and graph determinant by D\n",
+"L1=-G1*H1;\n",
+"L2=-G2*H1;\n",
+"P1=G1;\n",
+"P2=G2;\n",
+"D1=1;\n",
+"D2=1;\n",
+"D=1-(L1+L2);\n",
+"Y=(P1*D1+P2*D2)/D;\n",
+"Y=simple(Y)\n",
+"disp(Y,'C(s)/R(s)=')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.3_2: Overall_Transmittance.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption:overall_transmittance\n",
+"// example 4.3.2\n",
+"//page 64\n",
+"syms G1 G2 H1;\n",
+"// forward path denoted by P1,P2 and so on and loop by L1,L2 and so on \n",
+"//path factor by D1,D2 and so on and graph determinant by D\n",
+"P1=G1;\n",
+"P2=G2;\n",
+"L1=-G1*H1;\n",
+"D1=1;\n",
+"D2=1;\n",
+"D=1-(L1);\n",
+"Y=(P1*D1+P2*D2)/D;\n",
+"Y=simple(Y);\n",
+"disp(Y,'C(s)/R(s)=')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4_10: Transfer_function_using_mason_gain_formula.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption:transfer_function_using_mason's_gain_formula\n",
+"// example 4.4.10\n",
+"//page 72\n",
+"syms G1 G2 G3 G4 G5 H1 H2;\n",
+"// forward path denoted by P1,P2 and so on and loop by L1,L2 and so on \n",
+"//path factor by D1,D2 and so on and graph determinant by D\n",
+"P1=G1*G2*G3*G4;\n",
+"P2=G1*G5*G4;\n",
+"L1=-G2*H1;\n",
+"L2=-G3*H2;\n",
+"D1=1;\n",
+"D2=1;\n",
+"D=1-(L1+L2);\n",
+"D=simple(D)\n",
+"Y=(P1*D1+P2*D2)/D;\n",
+"Y=simple(Y);\n",
+"disp(Y,'C(s)/R(s)=')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4_1: Closed_Loop_Transfer_Function.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption:closed_loop_transfer_function\n",
+"// example 4.4.1\n",
+"//page 64\n",
+"syms G1 G2 G3 H1;\n",
+"// forward path denoted by P1,P2 and so on and loop by L1,L2 and so on \n",
+"//path factor by D1,D2 and so on and graph determinant by D\n",
+"P1=G1*G3;\n",
+"P2=G2*G3;\n",
+"L1=-G3*H1;\n",
+"D1=1;\n",
+"D2=1;\n",
+"D=1-(L1);\n",
+"Y=(P1*D1+P2*D2)/D;\n",
+"Y=simple(Y)\n",
+"disp(Y,'C(s)/R(s)=')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4_2: Overall_Gai.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption:overall_gain\n",
+"// example 4.4.2\n",
+"//page 65\n",
+"syms a b c d e f g h\n",
+"// forward path denoted by P1,P2 and so on and loop by L1,L2 and so on \n",
+"\n",
+"//path factor by D1,D2 and so on and graph determinant by D\n",
+"P1=a*b*c*d;\n",
+"P2=a*g;\n",
+"L1=f;\n",
+"L2=c*e;\n",
+"L3=d*h;\n",
+"//nontouching loops are L1L2, L1L3\n",
+"L1L2=L1*L2;\n",
+"L1L3=L1*L3;\n",
+"D1=1;\n",
+"D2=1-L2;\n",
+"D=1-(L1+L2+L3)+(L1L2+L1L3);\n",
+"D=simple(D);\n",
+"Y=(P1*D1+P2*D2)/D;\n",
+"Y=simple(Y);\n",
+"disp(Y,'x5/x1');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4_3: to_find_various_signal_flow_graph_parameter.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption:to_find_various_signal_flow_graph_parameter\n",
+"// example 4.4.3\n",
+"//page 66\n",
+"syms a b c d e f g h ij\n",
+"// forward path denoted by P1,P2 and so on and loop by L1,L2 and so on \n",
+"//path factor by D1,D2 and so on and graph determinant by D\n",
+"//six independent path\n",
+"P1=a*b*d\n",
+"P2=e*f*h\n",
+"P3=a*j*h\n",
+"P4=e*i*d\n",
+"P5=-e*i*c*j*h\n",
+"P6=-a*j*g*i*d\n",
+"//3 INDIVIDUAL LOOPS\n",
+"L1=-b*c\n",
+"L2=-f*g\n",
+"L3=-i*c*j*g\n",
+"//NON TOUCHING LOOPS\n",
+"L1L2=L1*L2\n",
+"//PATH FACTORS\n",
+"D3=1;D4=1;D5=1;D6=1\n",
+"D1=1-L2\n",
+"D2=1-L1\n",
+"//GRAPH DETERMINANT\n",
+"D=1-(L1+L2+L3)+(L1L2);\n",
+"D=simple(D)\n",
+"disp(D,'graph_determinant=')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4_4: Transfer_function_using_mason_gain_formula.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption:transfer_function_using_mason's_gain_formula\n",
+"// example 4.4.4\n",
+"//page 67\n",
+"syms G1 G2 G3 H1;\n",
+"// forward path denoted by P1,P2 and so on and loop by L1,L2 and so on \n",
+"//path factor by D1,D2 and so on and graph determinant by D\n",
+"P1=G1*G2*1;\n",
+"P2=G1*G3;\n",
+"L1=G2*(-1);\n",
+"L2=G3*(-1);\n",
+"L3=-G1*G2*H1\n",
+"D1=1;\n",
+"D2=1;\n",
+"D=1-(L1+L2+L3);\n",
+"Y=(P1*D1+P2*D2)/D;\n",
+"Y=simple(Y);\n",
+"disp(Y,'C(s)/R(s)=')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4_5: Transfer_function_using_mason_gain_formula.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption:transfer_function_using_mason's_gain_formula\n",
+"// example 4.4.5\n",
+"//page 68\n",
+"syms G1 G2 G3 H1 H2;\n",
+"// forward path denoted by P1,P2 and so on and loop by L1,L2 and so on \n",
+"//path factor by D1,D2 and so on and graph determinant by D\n",
+"P1=G1*G2;\n",
+"P2=G1*G3;\n",
+"L1=-G2*H2;\n",
+"L2=-G1*G2*H1;\n",
+"L3=G1*G3*(-H2)*G2*(-H1);\n",
+"L3=simple(L3)\n",
+"D1=1;\n",
+"D2=1;\n",
+"D=1-(L1+L2+L3);\n",
+"D=simple(D)\n",
+"Y=(P1*D1+P2*D2)/D;\n",
+"Y=simple(Y);\n",
+"disp(Y,'C(s)/R(s)=')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4_6: Transfer_function_using_mason_gain_formula.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption:transfer_function_using_mason's_gain_formula\n",
+"// example 4.4.6\n",
+"//page 69\n",
+"syms G1 G2 G3 G4 H1 H2;\n",
+"// forward path denoted by P1,P2 and so on and loop by L1,L2 and so on \n",
+"//path factor by D1,D2 and so on and graph determinant by D\n",
+"// to find C/R consider D=0\n",
+"P1=G1*G3*G4;\n",
+"P2=G2*G3*G4;\n",
+"L1=-G3*H1;\n",
+"L2=-G1*G3*G4*H2;\n",
+"L3=-G2*G3*G4*H2;\n",
+"D1=1;\n",
+"D2=1;\n",
+"D=1-(L1+L2+L3);\n",
+"D=simple(D)\n",
+"Y=(P1*D1+P2*D2)/D;\n",
+"Y=simple(Y);\n",
+"disp(Y,'C(s)/R(s)=')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4_7: Transfer_function_using_mason_gain_formula.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption:transfer_function_using_mason's_gain_formula\n",
+"// example 4.4.7\n",
+"//page 70\n",
+"syms G1 G2 G3 H1;\n",
+"// forward path denoted by P1,P2 and so on and loop by L1,L2 and so on \n",
+"//path factor by D1,D2 and so on and graph determinant by D\n",
+"P1=G1*G3*G4;\n",
+"P2=G1*(-G2);\n",
+"L1=G3*G4*(-1);\n",
+"L2=G1*G3*H1*(-1);\n",
+"L3=G1*G3*H1*(-1);\n",
+"L4=G1*(-G2)*(-1)*G3*H1*(-1);\n",
+"L5=G1*(-G2)*(-1)*G3*H1*(-1);\n",
+"L4=simple(L4);\n",
+"L5=simple(L5);\n",
+"D1=1;\n",
+"D2=1;\n",
+"D=1-(L1+L2+L3+L4+L5);\n",
+"D=simple(D)\n",
+"Y=(P1*D1+P2*D2)/D;\n",
+"Y=simple(Y);\n",
+"disp(Y,'C(s)/R(s)=')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4_8: Transfer_function_using_mason_gain_formula.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption:transfer_function_using_mason's_gain_formula\n",
+"// example 4.4.8\n",
+"//page 70\n",
+"syms G1 G2 G3 G4 G5 H1 H2;\n",
+"// forward path denoted by P1,P2 and so on and loop by L1,L2 and so on \n",
+"//path factor by D1,D2 and so on and graph determinant by D\n",
+"P1=G1*G2*G4;\n",
+"P2=G2*G3*G5;\n",
+"P3=G3;\n",
+"L1=-G4*H1;\n",
+"L2=-G2*G4*H2;\n",
+"L3=-G2*G5*H2;\n",
+"D1=1;\n",
+"D2=1;\n",
+"D3=1-L1;\n",
+"D=1-(L1+L2+L3);\n",
+"D=simple(D)\n",
+"Y=(P1*D1+P2*D2+P3*D3)/D;\n",
+"Y=simple(Y);\n",
+"disp(Y,'C(s)/R(s)=')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4_9: Overall_Transfer_Function.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption:overall_transfer_function\n",
+"// example 4.4.9\n",
+"//page 71\n",
+"// we have defined parallel and series function which we are going to use here\n",
+"exec parallel.sce;\n",
+"exec series.sce;\n",
+"syms G1 G2 G3 G4 H5 H1 H2;\n",
+"//shift the SUMMING point locsted after G3 towards left of block G3\n",
+"a=G2/.H1;\n",
+"b=G5/G3;\n",
+"c=parallel(a,b);\n",
+"c=simple(c);\n",
+"d=G3/.H2;\n",
+"e=series(G1,c);\n",
+"f=series(e,d);\n",
+"y=series(G4,f);\n",
+"y=simple (y);\n",
+"disp(y,'C(s)/R(s)=')"
+ ]
+ }
+],
+"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
+}