From 8ac15bc5efafa2afc053c293152605b0e6ae60ff Mon Sep 17 00:00:00 2001 From: Siddharth Agarwal Date: Tue, 3 Sep 2019 18:27:40 +0530 Subject: Xcos examples from textbooks and for blocks --- Working_Examples/215/CH17/EX17.1/ex17_1.sce | 20 ++++++++++++ Working_Examples/215/CH17/EX17.10/ex17_10.sce | 26 +++++++++++++++ Working_Examples/215/CH17/EX17.2/ex17_2.sce | 20 ++++++++++++ Working_Examples/215/CH17/EX17.3/ex17_3.sce | 22 +++++++++++++ Working_Examples/215/CH17/EX17.4/Figure17_4.jpg | Bin 0 -> 33514 bytes .../215/CH17/EX17.4/Figure17_4_xcos.jpg | Bin 0 -> 49572 bytes Working_Examples/215/CH17/EX17.4/ex17_4.xcos | 1 + Working_Examples/215/CH17/EX17.7/ex17_7.sce | 14 ++++++++ Working_Examples/215/CH17/EX17.8/ex17_8.sce | 36 +++++++++++++++++++++ Working_Examples/215/CH17/EX17.9/ex17_9.sce | 13 ++++++++ 10 files changed, 152 insertions(+) create mode 100755 Working_Examples/215/CH17/EX17.1/ex17_1.sce create mode 100755 Working_Examples/215/CH17/EX17.10/ex17_10.sce create mode 100755 Working_Examples/215/CH17/EX17.2/ex17_2.sce create mode 100755 Working_Examples/215/CH17/EX17.3/ex17_3.sce create mode 100755 Working_Examples/215/CH17/EX17.4/Figure17_4.jpg create mode 100755 Working_Examples/215/CH17/EX17.4/Figure17_4_xcos.jpg create mode 100755 Working_Examples/215/CH17/EX17.4/ex17_4.xcos create mode 100755 Working_Examples/215/CH17/EX17.7/ex17_7.sce create mode 100755 Working_Examples/215/CH17/EX17.8/ex17_8.sce create mode 100755 Working_Examples/215/CH17/EX17.9/ex17_9.sce (limited to 'Working_Examples/215/CH17') diff --git a/Working_Examples/215/CH17/EX17.1/ex17_1.sce b/Working_Examples/215/CH17/EX17.1/ex17_1.sce new file mode 100755 index 0000000..d2697fc --- /dev/null +++ b/Working_Examples/215/CH17/EX17.1/ex17_1.sce @@ -0,0 +1,20 @@ +//Example 17.1 +clc +//From figure 17.3 +disp('The mesh equations are') +disp('V1=10*I1-10*I2') +disp('0=-10*I1+17*I2-2*I3-5*I4') +disp('0=-2*I2+7*I3-I4') +disp('0=-5*I2-I3+26*I4') +//We need to find input impedance +disp('Zin=delz/del11') +//In matrix form +A=[10 -10 0 0 ;-10 17 -2 -5; 0 -2 7 -1;0 -5 -1 26] +delz=det(A) +printf("\n delz=%f ohm^4",delz); +//Eliminating first row and first column to find del11 +B=[17 -2 -5;-2 7 -1;-5 -1 26] +del11=det(B) +printf("\n del11=%f ohm^3",del11); +Zin=delz/del11 +printf("\n Zin=%f ohm",Zin); diff --git a/Working_Examples/215/CH17/EX17.10/ex17_10.sce b/Working_Examples/215/CH17/EX17.10/ex17_10.sce new file mode 100755 index 0000000..9f1c174 --- /dev/null +++ b/Working_Examples/215/CH17/EX17.10/ex17_10.sce @@ -0,0 +1,26 @@ +clc +//Example 17.10 +//From figure 17.32 +disp('Consider Network A') +//Writing the mesh equations +disp('V1=12*I1+10*I2') +disp('V2=10*I1+14*I2') +//Arranging in the standard form +//V1=t11*V2-t12*I2 +//I1=t21*V2-t22*I2 +//Therefore t parameters of Network A is +t11A=1.2;t12A=6.8;t21A=0.1;t22A=1.4; +disp('Consider Network B') +//Writing the mesh equations +disp('V1=24*I1+20*I2') +disp('V2=20*I1+28*I2') +//Arranging in the standard form +//V1=t11*V2-t12*I2 +//I1=t21*V2-t22*I2 +//Therefore t parameters of Network B is +t11B=1.2;t12B=13.6;t21B=0.05;t22B=1.4; +tA=[1.2 6.8;0.1 1.4] +tB=[1.2 13.6;0.05 1.4] +disp('t parameters of cascaded network is t=tA*tB') +t=tA*tB +disp(t) \ No newline at end of file diff --git a/Working_Examples/215/CH17/EX17.2/ex17_2.sce b/Working_Examples/215/CH17/EX17.2/ex17_2.sce new file mode 100755 index 0000000..9f7c012 --- /dev/null +++ b/Working_Examples/215/CH17/EX17.2/ex17_2.sce @@ -0,0 +1,20 @@ +//Example 17.2 +clc +//From figure 17.5 +disp('The mesh equations are') +disp('V1=10*I1-10*I2') +disp('0=-10*I1+17*I2-2*I3-5*I4') +disp('0=-2*I2+7*I3-I4') +disp('0=-0.5*I3+1.5*I4') +//We need to find input impedance +disp('Zin=delz/del11') +//In matrix form +A=[10 -10 0 0 ;-10 17 -2 -5; 0 -2 7 -1;0 0 -0.5 1.5] +delz=det(A) +printf("\n delz=%f ohm^3",delz); +//Eliminating first row and first column to find del11 +B=[17 -2 -5;-2 7 -1;0 -0.5 1.5] +del11=det(B) +printf("\n del11=%f ohm^2",del11); +Zin=delz/del11 +printf("\n Zin=%f ohm",Zin); diff --git a/Working_Examples/215/CH17/EX17.3/ex17_3.sce b/Working_Examples/215/CH17/EX17.3/ex17_3.sce new file mode 100755 index 0000000..dd17bd1 --- /dev/null +++ b/Working_Examples/215/CH17/EX17.3/ex17_3.sce @@ -0,0 +1,22 @@ +//Example 17.3 +clc +//From figure 17.7 +disp('The nodal equations are') +disp('I1=0.35*V1-0.2*V2-0.05*V3') +disp('I2=-0.2*V1+1.7*V2-1*V3') +disp('I3=-0.05*V1-1*V2+1.3*I3') +//We need to find input impedance +disp('Yin=dely/del11') +disp('Zin=1/Yin') +//In matrix form +A=[0.35 -0.2 -0.05;-0.2 1.7 -1;-0.05 -1 1.3] +dely=det(A) +printf("\n dely=%f S^3",dely); +//Eliminating first row and first column to find del11 +B=[1.7 -1;-1 1.3] +del11=det(B) +printf("\n del11=%f S^2",del11); +Yin=dely/del11 +printf("\n Yin=%f S",Yin); +Zin=1/Yin +printf("\n Zin=%f ohm",Zin); diff --git a/Working_Examples/215/CH17/EX17.4/Figure17_4.jpg b/Working_Examples/215/CH17/EX17.4/Figure17_4.jpg new file mode 100755 index 0000000..aa5fa64 Binary files /dev/null and b/Working_Examples/215/CH17/EX17.4/Figure17_4.jpg differ diff --git a/Working_Examples/215/CH17/EX17.4/Figure17_4_xcos.jpg b/Working_Examples/215/CH17/EX17.4/Figure17_4_xcos.jpg new file mode 100755 index 0000000..b568ea3 Binary files /dev/null and b/Working_Examples/215/CH17/EX17.4/Figure17_4_xcos.jpg differ diff --git a/Working_Examples/215/CH17/EX17.4/ex17_4.xcos b/Working_Examples/215/CH17/EX17.4/ex17_4.xcos new file mode 100755 index 0000000..5533d44 --- /dev/null +++ b/Working_Examples/215/CH17/EX17.4/ex17_4.xcos @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Working_Examples/215/CH17/EX17.7/ex17_7.sce b/Working_Examples/215/CH17/EX17.7/ex17_7.sce new file mode 100755 index 0000000..91e9fad --- /dev/null +++ b/Working_Examples/215/CH17/EX17.7/ex17_7.sce @@ -0,0 +1,14 @@ +clc +//Example 17.7 +//From figure 17.16 +disp('Given a linear model of a transistor we need not explicitly find the aadmittance parameters ') +disp('-y12 corresponds to admittance of 2k ohm resistor') +disp('y11+y12 corresponds to admittance of 500 ohm resistor') +disp('y21-y12 correponds to gain of dependent voltage source') +disp('y22+y12 corresponds to admittance of 10k ohm resistor') +//Writing down in equation form +y12=-1/2000 +y11=1/500-y12 +y21=0.0395+y12 +y22=1/10000-y12 +printf("\n y11= %3.2f mS \n y12= %3.2f mS \n y21= %3.2f mS \n y22= %3.2f mS",y11*10^3,y12*10^3,y21*10^3,y22*10^3); \ No newline at end of file diff --git a/Working_Examples/215/CH17/EX17.8/ex17_8.sce b/Working_Examples/215/CH17/EX17.8/ex17_8.sce new file mode 100755 index 0000000..245234f --- /dev/null +++ b/Working_Examples/215/CH17/EX17.8/ex17_8.sce @@ -0,0 +1,36 @@ +clc +//Example 17.8 +Vs = poly(0,'Vs') +disp('Given') +disp('Z=[10^3 10;-10^6 10^4 ]') +z11=10^3 ; z12=10;z21=-10^6;z22=10^4 +//Using the given matrix we can write the mesh equations as +disp('V1=10^3*I1+10*I2') +disp('V2=-10^6*I1+10^4*I2') +//The input to an two port network is an ideal sinusoidal voltage source in series with 500 ohm +//Mathematically +disp('The characterizing equations are') +disp('Vs=500*I1+V1') +//The output to an two port network is a 10k ohm resistor +//Mathematically +disp('V2=-10^4*I2') +Zg=500; +//Expressing V1,V2,I1,I2 in terms of Vs +V1=0.75*Vs +I1=Vs/2000 +V2=-250*Vs +I2=Vs/40 +disp('Voltage gain Gv=V2/V1') +Gv=V2/V1 +disp(Gv,'Gv=') +disp('Current gain Gi=I2/I1') +Gi=I2/I1 +disp(Gi,'Gi=') +disp('Power gain Gp=Real[-0.5*V2*I2*]/Real[0..5*V1*I1*]') +Gp=(-0.5*V2*I2)/(0.5*V1*I1) +disp(Gp,'Gp=') +disp('Input impedance is Zin=V1/I1') +Zin=V1/I1 +disp('Output impedance is Zout=z22-((z12*z21)/(z11+Zg))') +Zout=z22-((z12*z21)/(z11+Zg)) +printf("\n Zout= %3.2f kohm",Zout*10^-3) \ No newline at end of file diff --git a/Working_Examples/215/CH17/EX17.9/ex17_9.sce b/Working_Examples/215/CH17/EX17.9/ex17_9.sce new file mode 100755 index 0000000..a8bbcac --- /dev/null +++ b/Working_Examples/215/CH17/EX17.9/ex17_9.sce @@ -0,0 +1,13 @@ +clc +//Example 17.9 +//From figure 17.27 +//Writing the mesh equations +disp('V1=5*I1+4*I2') +disp('V2=4*I1+10*I2') +//Arranging in the standard form +//V1=h11*I1+h12*V2 +//I2=h21*I1+h22*V2 +//Therefore h parameters are +h11=3.4;h12=0.4;h21=-0.4;h22=0.1; +h=[h11 h12;h21 h22] +disp(h) \ No newline at end of file -- cgit