You are on page 1of 3

Assignment-1 [C-2]

Curve fitting by linear and polynomial regression


(Do not use built-in function for curve fitting)

Problem-1: (Submit Code and Output)


From an experiment on ‘I-V characteristics of diode’, the following data have been found, where, VD is
the voltage across the diode and ID is the current through the diode.

VD (volt) ID (ampere)
0.1 0.6𝑋10−9
0.2 4.2𝑋10−9
0.3 29𝑋10−9
0.4 176𝑋10−9
0.5 10−6
0.6 7.3𝑋10−6
0.7 40𝑋10−6
0.8 252𝑋10−6
0.9 2.3𝑋10−3
0.1 26𝑋10−3

Task1:
Suppose that, the diode follows the following approximate I-V equation,
𝑉𝐷
𝐼𝐷 = 𝐼𝑆 𝑒 𝑛𝑉𝑇

where,
𝐼𝑠 = 𝑠𝑎𝑡𝑢𝑟𝑎𝑡𝑖𝑜𝑛 𝑐𝑢𝑟𝑟𝑒𝑛𝑡
𝑛 = 𝑖𝑑𝑒𝑎𝑙𝑖𝑡𝑦 𝑓𝑎𝑐𝑡𝑜𝑟 = 2
𝑘𝑇
𝑉 𝑇 = 𝑡ℎ𝑒𝑟𝑚𝑎𝑙 𝑣𝑜𝑙𝑡𝑎𝑔𝑒 =
𝑞
𝑘 = 1.38𝑋10−23 m2 kg s-2 K-1
𝑞 = 1.6𝑋10−19 coulombs
𝑇 = 𝑇𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒

Use linearization of non-linear relationship to fit a curve to the data and find values of IS and T in °C .

Task 2:
Plot the original data and the fitted curve on the same figure.
Problem-2: (Submit Code and Output)
The following data have been obtained through on experiment conducted on a resistor. The voltage
across the resistance (VR ) and the current through it (IR ) has been measured in each case.

VR(volt) IR (ampere)
1 0.51
2 0.25
3 0.18
4 0.11
5 0.10
6 0.085
7 0.07
8 0.065
9 0.056
10 0.048
Task1:
Suppose that, the resistor follows the following relation:

𝑃𝑅
𝐼𝑅 =
(𝑉𝑅 )𝑛

Where,
PR= power delivered to the resistance
n= an unknown exponent factor

Use linearization of non-linear relationship to fit a curve to the data and find values of PR and n. Plot the
original data and the fitted curve on the same figure.

Task 2:
Use linear regression to fit the data and find the values of a0 and a1. Plot the original data and the
fitted curve on the same figure.

Comment on the two results obtained from Task-1 and Task-2.

Problem-3: (Submit Code and Output)


An investigator has reported the data tabulated in the following table for an experiment to determine “𝒚”
as a function of “𝒙”.

x y
0.5 0.2
0.8 0.4
1.5 1.38
2.5 5.05
4 18.02
It is known that such data can be modeled by the following equation:
𝒙+𝑪𝒔 ∗ 𝒙𝟑
𝒚=
𝑲𝒔
Task1:

Use polynomial regression method to fit a curve to the obtained data and find values of Ks and Cs .

Task 2:
Plot the original data and the fitted curve on the same figure.

Problem-4: (Submit Theory)


Find the system of linear equations that must be solved to fit a 6th order polynomial to the data using
regression analysis.
Hints: Take the examples of 1st and 2nd order polynomials given in the lecture and observe how the
equations are formed. Then carry on the calculations for a 6th order polynomial fitting.

You might also like