summaryrefslogtreecommitdiff
path: root/165/CH4/EX4.22/ex4_22.sce
diff options
context:
space:
mode:
Diffstat (limited to '165/CH4/EX4.22/ex4_22.sce')
-rw-r--r--165/CH4/EX4.22/ex4_22.sce50
1 files changed, 50 insertions, 0 deletions
diff --git a/165/CH4/EX4.22/ex4_22.sce b/165/CH4/EX4.22/ex4_22.sce
new file mode 100644
index 000000000..4d3fe0805
--- /dev/null
+++ b/165/CH4/EX4.22/ex4_22.sce
@@ -0,0 +1,50 @@
+//Example 4.22
+close;
+clc;
+
+E=3; //in volts
+Rm=100; //In ohms
+Im=1*10^-3; //in amperes
+//Rs value that will give FSD current
+Rs=E/Im-Rm;
+printf('\nValue of Rs that will limit Current to FSD = %.2f k ohm\n',Rs/1000)
+
+function [Rx]=deflection(x,Rs,Rm)
+ Rx=(Rs+Rm)/x-(Rs+Rm);
+endfunction
+
+//For 20% deflection
+funcprot(0);
+x=20/100; //x=I/Im
+[Rx]=deflection(x,Rs,Rm);
+printf('\nValue of Rx that will 20 percent deflection = %.2f k ohm\n',Rx/1000)
+
+//For 40% deflection
+funcprot(0);
+x=40/100; //x=I/Im
+[Rx]=deflection(x,Rs,Rm);
+printf('\nValue of Rx that will 40 percent deflection = %.2f k ohm\n',Rx/1000)
+
+//For 50% deflection
+funcprot(0);
+x=50/100; //x=I/Im
+[Rx]=deflection(x,Rs,Rm);
+printf('\nValue of Rx that will 50 percent deflection = %.2f k ohm\n',Rx/1000)
+
+//For 75% deflection
+funcprot(0);
+x=75/100; //x=I/Im
+[Rx]=deflection(x,Rs,Rm);
+printf('\nValue of Rx that will 75 percent deflection = %.2f k ohm\n',Rx/1000)
+
+//For 90% deflection
+funcprot(0);
+x=90/100; //x=I/Im
+[Rx]=deflection(x,Rs,Rm);
+printf('\nValue of Rx that will 90 percent deflection = %.2f k ohm\n',Rx/1000)
+
+//For 100% deflection
+funcprot(0);
+x=100/100; //x=I/Im
+[Rx]=deflection(x,Rs,Rm);
+printf('\nValue of Rx that will 100 percent deflection = %.2f k ohm\n',Rx/1000) \ No newline at end of file