Professional Documents
Culture Documents
Shyam Shankar H R
EE15B127
Electrical Dept.
February 8, 2017
1 Introduction
This report contains the solutions of the week-4 assignment of EE2307. The answers to the questions,
the python code, and the plot obtained are entered below.
1.1 Abstract
Here, we study the process of fitting experimentally obtained data to theoretical models. In any
experiment, there will be a certain degree of error in data, and we also study how to account for the
error (or noise) while fitting the data to the model.
1
A = c[0]
B = c[1]
mag = sqrt(A**2+B**2)
phi = numpy.arccos((float)(A)/mag)
v[j] = (phi-pi/4.0)/(pi/2.0)+noise[j]
j+=1
return v
x = linspace(0,20,41)
x0 = arange(0.5,18.5,0.5)
fig1 = figure()
plot(x0,calcnu(x,x0,bo,0,b),bo,label=e=0,model(b)) #noise = 0, model: b
plot(x0,calcnu(x,x0,go,0,c),go,label=e=0,model(c)) #noise = 0, model:c
plot(x0,calcnu(x,x0,ro,0.01,c),ro,label=e=1.0e-02,model(c))
#noise = 0.01, model:c
xlabel(r"$x_{o}$",fontsize=16)
ylabel(r"$v$",fontsize=16)
legend(loc=lower left)
savefig("fig.pdf")
show()
2 Theory:
Bessel function, which is an useful tool in cylindrical geometry, comes in the form:
Figure 1:
Bessel function of first type
0.6
0.4
0.2
Jxa
0.0
0.2
0.4
0 5 10 15 20
x
2.1 Model 1:
We construct a matrix corresponding to
We get a matrix equation of the form: A c = b, where A is the matrix of functions cos(xi ) and sin(xi ),
b is the matrix to be evaluated (a vector: (A,B)), and c is the vector of Bessel fuctions corresponding
to xi .
2.2 Model 2:
We construct a matrix corresponding to
cos(xi ) sin(xi )
A +B J1 (xi )
xi xi
We get a matrix equation of the form: A c = b, where A is the matrix of functions cos(x ) sin(x )
i and i ,
xi xi
b is the matrix to be evaluated (a vector: (A,B)), and c is the vector of Bessel fuctions corresponding
to xi .
3 Plots of
1.05
1.00
0.95
v
0.90
0.85 e=0,model(b)
e=0,model(c)
e=1.0e-02,model(c)
0.80
0 2 4 6 8 10 12 14 16 18
R
xo
3
Figure 3: After increasing the number of observations
Plots obtained by increasing the sampling rate x 5 times
1.02
1.00
0.98
0.96
0.94
v
0.92
0.90
e=0,model(b)
0.88 e=0,model(c)
e=1.0e-02,model(c)
0.86
0 5 10 15 20
xo