In [1]:

```
# To find Shunt resistance required
# Modern Electronic Instrumentation And Measurement Techniques
# By Albert D. Helfrick, William D. Cooper
# First Edition Second Impression, 2009
# Dorling Kindersly Pvt. Ltd. India
# Example 4-1 in Page 56
# Given data
I_m = 1*(10.0**-3) #Full scale deflection of the movement in ampere
R_m = 100.0 #Internal resistance of the movement(the coil) in ohm
I = 100.0*(10**-3) #Full scale of the ammeter including the shunt in Ampere
#Calculations
I_s = I - I_m # calculating current through shunt
R_s = I_m * R_m/ I_s #calculating shunt to be added
print "The value of the shunt resistance required, R_s =",round(R_s,2),"ohm"
#Result
# The value of the shunt resistance required, R_s = 1.01 ohm
```

In [9]:

```
# To design Ayrton shunt
# Modern Electronic Instrumentation And Measurement Techniques
# By Albert D. Helfrick, William D. Cooper
# First Edition Second Impression, 2009
# Dorling Kindersly Pvt. Ltd. India
# Example 4-2 in Page 57
# Given data
I_1 = 1 #Full scale currents of the ammeter in amp
I_2 = 5
I_3 = 10
R_m = 50 #Internal resistance of the movement(the coil) in ohm
I_m = 1*(10**-3) #Full scale deflection of the movement in ampere
#Calculations
# On the 1-A range:
I_s1 = I_1 - I_m # calculating current through shunt
#Using the eq. R_s = I_m * R_m/ I_s
#1 R_a +R_b +R_c = I_m * R_m/ I_s # As (R_a +R_b +R_c) are parallel with R_m
# On the 5-A range
I_s2 = I_2 - I_m
#2 R_a +R_b = I_m * (R_c +R_m)/ I_s # As (R_a+R_b) in parallel with (R_c+R_m)
# On the 10-A range
I_s3 = I_3 - I_m
#3 R_a = I_m * (R_b +R_c +R_m)/ I_s # As R_a is parallel with (R_b +R_c +R_m)
import numpy as np
a = np.array([[1,4999,-9999],[1,4999,1],[1,-1,1]])
b = np.array([0.05005,50,-50])
answer = np.linalg.solve(a.T, b)
R_a = answer[0]
R_b = answer[1]
R_c = answer[2]
disp('The different resistors used for the ayrton shunt for different ranges are:')
print "R_a = ",round(R_a,7)," ohm\n"
print "R_b = ",round(R_b,7)," ohm\n"
print "R_c = ",round(R_c,6)," ohm"
#Result
# The different resistors used for the ayrton shunt for different ranges are:
# R_a = 0.005005 ohm
# R_b = 0.005005 ohm
# R_c = 0.040040 ohm
```

In [13]:

```
# To design multirange dc voltmeter
# Modern Electronic Instrumentation And Measurement Techniques
# By Albert D. Helfrick, William D. Cooper
# First Edition Second Impression, 2009
# Dorling Kindersly Pvt. Ltd. India
# Example 4-3 in Page 60
# Given data
R_m = 100 # internal resistance of movement
I_fsd = 1*(10**-3) #full-scale current in Amp
V_1 = 10 #different ranges in volt
V_2 = 50
V_3 = 250
V_4 = 500
#Calculations
#For the 10-V range
R_T = V_1 / I_fsd
R_4 = R_T - R_m
print "The value of the resistance R_4 = ",R_4," ohm\n"
#For the 50-V range
R_T = V_2 / I_fsd
R_3 = R_T - (R_4 +R_m)
print "The value of the resistance R_3 = ",R_3/1000,"K ohm\n"
#For the 250-V range
R_T = V_3 / I_fsd
R_2 = R_T -(R_3 +R_4 +R_m)
print "The value of the resistance R_2 =",R_2/1000,"k ohm\n"
#For the 500-V range
R_T = V_4 / I_fsd
R_1 = R_T - (R_2 +R_3 +R_4 +R_m)
print "The value of the resistance R_1 =",R_1/1000,"K ohm"
#Result
# The value of the resistance R_4 = 9900 ohm
# The value of the resistance R_3 = 40k ohm
# The value of the resistance R_2 = 200k ohm
# The value of the resistance R_1 = 250k ohm
```