summaryrefslogtreecommitdiff
path: root/61
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:38:01 +0530
committerprashantsinalkar2017-10-10 12:38:01 +0530
commitf35ea80659b6a49d1bb2ce1d7d002583f3f40947 (patch)
treeeb72842d800ac1233e9d890e020eac5fd41b0b1b /61
parent7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (diff)
downloadScilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.gz
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.bz2
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.zip
updated the code
Diffstat (limited to '61')
-rwxr-xr-x61/CH10/EX10.1/ex10_1.sce29
-rwxr-xr-x61/CH10/EX10.10/ex10_10.sce47
-rwxr-xr-x61/CH6/EX6.12/ex6_12.sce25
3 files changed, 56 insertions, 45 deletions
diff --git a/61/CH10/EX10.1/ex10_1.sce b/61/CH10/EX10.1/ex10_1.sce
index 34bdf2a4e..58371bc89 100755
--- a/61/CH10/EX10.1/ex10_1.sce
+++ b/61/CH10/EX10.1/ex10_1.sce
@@ -1,12 +1,17 @@
-//ex10.1
-//P out/P in=250;
-A_p_dB=gain_in_decibel_power(250)
-disp(A_p_dB,'Power gain when power gain is 250')
-A_p_dB=gain_in_decibel_power(100)
-disp(A_p_dB,'Power gain when power gain is 100')
-A_v_dB=gain_in_decibel_voltage(10)
-disp(A_v_dB,'Voltage gain when voltage gain is 10')
-A_v_dB=gain_in_decibel_power(0.5)
-disp(A_v_dB,'Power gain when voltage gain is 0.5')
-A_v_dB=gain_in_decibel_voltage(0.707)
-disp(A_v_dB,'Voltage gain when voltage gain is 0.707')
+function A_p_dB=gain_in_decibel_power(A_p)
+ A_p_dB=10*log10(A_p)
+endfunction
+function A_v_dB=gain_in_decibel_voltage(A_v)
+ A_v_dB=20*log10(A_v)
+endfunction//ex10.1
+//P out/P in=250;
+A_p_dB=gain_in_decibel_power(250)
+disp(A_p_dB,'Power gain when power gain is 250')
+A_p_dB=gain_in_decibel_power(100)
+disp(A_p_dB,'Power gain when power gain is 100')
+A_v_dB=gain_in_decibel_voltage(10)
+disp(A_v_dB,'Voltage gain when voltage gain is 10')
+A_v_dB=gain_in_decibel_power(0.5)
+disp(A_v_dB,'Power gain when voltage gain is 0.5')
+A_v_dB=gain_in_decibel_voltage(0.707)
+disp(A_v_dB,'Voltage gain when voltage gain is 0.707') \ No newline at end of file
diff --git a/61/CH10/EX10.10/ex10_10.sce b/61/CH10/EX10.10/ex10_10.sce
index 6b1d997d5..a8f4eda17 100755
--- a/61/CH10/EX10.10/ex10_10.sce
+++ b/61/CH10/EX10.10/ex10_10.sce
@@ -1,24 +1,25 @@
-//ex10.10
-B_ac=125;
-C_be=20*10^-12;
-C_bc=2.4*10^-12;
-R1=22*10^3;
-R2=4.7*10^3;
-R_E=470;
-R_S=600;
-R_L=2.2*10^3;
-V_CC=10;
-V_B=(R2/(R1+R2))*V_CC;
-V_E=V_B-0.7;
-I_E=V_E/R_E;
-r_e=25*10^-3/I_E;
-//total resistance of input circuit is parallel combination of R1,R2,R_s,B_ac*r_e
-R_in_tot=B_ac*r_e*R1*R2*R_S/(B_ac*r_e*R1*R2+B_ac*r_e*R1*R_S+B_ac*r_e*R2*R_S+R1*R2*R_S);
-R_c=R_C*R_L/(R_C+R_L)
-A_v_mid=R_c/r_e;
-C_in_Miller=C_bc*(A_v_mid+1)
-C_in_tot=C_in_Miller+C_be;
-f_c=1/(2*%pi*R_in_tot*C_in_tot);
-disp(R_in_tot, 'total resistance of circuit in ohms')
-disp(C_in_tot,'total capacitance in farads')
+//ex10.10
+B_ac=125;
+C_be=20*10^-12;
+C_bc=2.4*10^-12;
+R1=22*10^3;
+R2=4.7*10^3;
+R_E=470;
+R_S=600;
+R_L=2.2*10^3;
+R_C = 2.2*10^3;
+V_CC=10;
+V_B=(R2/(R1+R2))*V_CC;
+V_E=V_B-0.7;
+I_E=V_E/R_E;
+r_e=25*10^-3/I_E;
+//total resistance of input circuit is parallel combination of R1,R2,R_s,B_ac*r_e
+R_in_tot=B_ac*r_e*R1*R2*R_S/(B_ac*r_e*R1*R2+B_ac*r_e*R1*R_S+B_ac*r_e*R2*R_S+R1*R2*R_S);
+R_c=R_C*R_L/(R_C+R_L)
+A_v_mid=R_c/r_e;
+C_in_Miller=C_bc*(A_v_mid+1)
+C_in_tot=C_in_Miller+C_be;
+f_c=1/(2*%pi*R_in_tot*C_in_tot);
+disp(R_in_tot, 'total resistance of circuit in ohms')
+disp(C_in_tot,'total capacitance in farads')
disp(f_c,'critical frequency in hertz') \ No newline at end of file
diff --git a/61/CH6/EX6.12/ex6_12.sce b/61/CH6/EX6.12/ex6_12.sce
index f374cccca..c4bdb477f 100755
--- a/61/CH6/EX6.12/ex6_12.sce
+++ b/61/CH6/EX6.12/ex6_12.sce
@@ -1,11 +1,16 @@
-//ex6.12
-A_v1=10;
-A_v2=15;
-A_v3=20;
-A_v=A_v1*A_v2*A_v3; //overall voltage gain
-disp(A_v,'overall voltage gain')
-A_v1_dB=gain_in_decibel_voltage(A_v1);
-A_v2_dB=gain_in_decibel_voltage(A_v2);
-A_v3_dB=gain_in_decibel_voltage(A_v3);
-A_v_dB=A_v1_dB+A_v2_dB+A_v3_dB;
+//ex6.12
+clc
+clear
+function A_v_dB=gain_in_decibel_voltage(A_v)
+ A_v_dB=20*log10(A_v)
+endfunction
+A_v1=10;
+A_v2=15;
+A_v3=20;
+A_v=A_v1*A_v2*A_v3; //overall voltage gain
+disp(A_v,'overall voltage gain')
+A_v1_dB=gain_in_decibel_voltage(A_v1);
+A_v2_dB=gain_in_decibel_voltage(A_v2);
+A_v3_dB=gain_in_decibel_voltage(A_v3);
+A_v_dB=A_v1_dB+A_v2_dB+A_v3_dB;
disp(A_v_dB,'total voltage gain in decibels') \ No newline at end of file