Lab05

html

School

University of British Columbia *

*We aren’t endorsed by this school

Course

119

Subject

Electrical Engineering

Date

Feb 20, 2024

Type

html

Pages

7

Uploaded by MajorTreeLyrebird3

Report
Lab 05 - Ohm's Law Edit this cell and provide the information requested: Your name: Partha Pritom Ghosh Your student number: 12303244 Partner's name: Raymond Wen In [2]: %reset -f import numpy as np import data_entry2 import matplotlib.pyplot as plt Part A - Grading feedback, overview of the day Your notes here (optional, these are not graded) Class Discussion: Residuals Your notes on how residuals are useful, and what properties of a residuals graph inform us about the quality of a fit of a model to data. (Optional, these are not graded.) Part B - Familiarize, Part 1 (Build your circuit) Your notes on Ohm's law, multimeters, and anything else useful for building the circuit. Record the experimental goal. In todays experiment, we will be following with ohm's law which is $V = IR.$. Also, $I = V/R.$ To calculate the slope of the graph, the formula is $m= 1/R$ For building our circuits, we are using a ammeter that uses 200mA and COM terminals and set to a DC current range. We are using a voltmeter with the COM terminals and use of V and uses the red and black terminals of the power supply. We start by turning the power supply off and connecting the ammeter in a series connection and voltmeter in a parallel connection with respect to the resistor we are using of unknown resistance. Also, we are using a DC power supply too. We adjust the range using the voltage and current knob to fix a current range throughout our experiment. The unit for voltage(V) is in Voltage(V) the unit for current(I) is in Ampere(A) The unit for resistance (R) is is ohms Our experimental goal today is Do our resistors obey Ohm’s law? Determine the resistance of a
resistor.Does it match what we think it should be? Voltage and current have a linear relationship between them following ohm's law Part C - Familiarize, Part 2 (Explore the Equipment and Develop a Measurement Strategy) The knobs in the power supply are very essential. the voltage knob is put moved counterclock-wise firstly to the end before the power supply is turned on(for eg to 0) and then turn on the power supply. This ensures that our reading are started without any initial values stored previously and begins from 0. the voltage knob is moved clockwise and is used to to support in determining the range and the current knob has no function in the DC power supply the choosen range for voltage is 20V and the current is 20mA. It is chosen beacuse at this range, the values are more precious and more specific and not that much scattered. For our uncertainty in voltage and current, we are using the rectangular method uncertainty as they are measured from a digital method. Moreover, the formula is $x=a / \sqrt{3}$ we are going to record values for current and voltage from the voltmeter and ammeter and record along with uncertainty. We are going to find the slope of the gradient for the best fit line and the limits of the data to find the maximum and minimum of the gradient (m) and then calculate the uncertainty of the gradient which is $u_m (m_max - m_min) /2$. We are going to record values in spreadsheet for Current(I) in Ampere(mA) , Voltage(V) in V, u_I(uncertaintiy in current(mA)) and u_V (uncertainty in voltage(V)) We are gonna plot a scatter plot and residual plot and then determine the resistance using $m = 1/R$ and calculate uncertainty in resistance (R) which is $u_R = R * (u_m/m)$ We need to find the best estimate slope for our data. The Current should be in the Y-axis and the Voltage should be in the X-axis. For the voltage knob, we are increasing it by 0.15V per interval for better precision We are taking 10 number of trails for our sets of data for plotting Part D - Measure and Analyze (Collect Data and Make a Scatter Plot) In [24]: de2 = data_entry2.sheet("lab05_lab_ohms_law") Sheet name: lab05_lab_ohms_law.csv In [34]: # Using this cell to create your scatter plot with model, and your residuals plot # Scatter step 1: find the limits of the data: xmin = np.min(VVec) xmax = np.max(VVec)
print (xmin, xmax) # Scatter step 2: generate a bunch of x points between xmin and xmax xpoints = np.linspace(xmin, xmax, 200) print(xpoints) # Scatter step 3: calculate the model values: slope = 0.775 print(slope) ypoints = xpoints * slope # this calculates the yvalues at all 200 points. # Scatter step 4: plot the curve. We plot this as a red line "r-" : plt.plot(xpoints, ypoints, "r-", label = "V = IR") # Scatter step 5: plot the data: plt.errorbar(VVec, IVec, u_IVec, fmt="bo", markersize = 3, label="Experimental data for Current Vs Voltage") plt.title("Current vs Voltage Plot") plt.xlabel("Voltage (V)") plt.ylabel("Current (mA)") plt.legend() plt.show() # Residuals step 1: Calculate the model at each x-datapoint ymodel = slope * VVec # y = mx at each x_i # Residuals step 2: Calcualte the residual vector RVec = IVec - ymodel # Resoduals step 3: Plot the residual vector against the x-data vector plt.errorbar(VVec, RVec, u_IVec, fmt="bo", markersize = 3) # Residuals step 4: Add a R = 0 x-axis (horizontal line) to the plot plt.hlines(y=0, xmin=xmin, xmax=xmax, color='k') # draw axis at y = 0. # Residuals step 5: Add axis labels and title, and show the graph plt.title("Residuals for Current vs Voltage Plot") plt.xlabel("Voltage (V)") plt.ylabel("Residual = data - model (A)") plt.show() #Calculating the Resistance(R) and the uncertainty in Resistance(u_R):- m_max = 0.780 m_min = 0.731 m_best = 0.772 u_m = (m_max - m_min) / 2 print("Uncertainty in m is=", u_m, "Ω^-1") print ("slope m is=", m_best, "Ω^-1") R = 1 / (m / 1000) print("The resistance R is=", R, "Ω") u_R = (R * (u_m / m)) / 1000
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
print("The uncertainty in R is=", u_R, "Ω") 0.98 2.47 [0.98 0.98748744 0.99497487 1.00246231 1.00994975 1.01743719 1.02492462 1.03241206 1.0398995 1.04738693 1.05487437 1.06236181 1.06984925 1.07733668 1.08482412 1.09231156 1.09979899 1.10728643 1.11477387 1.12226131 1.12974874 1.13723618 1.14472362 1.15221106 1.15969849 1.16718593 1.17467337 1.1821608 1.18964824 1.19713568 1.20462312 1.21211055 1.21959799 1.22708543 1.23457286 1.2420603 1.24954774 1.25703518 1.26452261 1.27201005 1.27949749 1.28698492 1.29447236 1.3019598 1.30944724 1.31693467 1.32442211 1.33190955 1.33939698 1.34688442 1.35437186 1.3618593 1.36934673 1.37683417 1.38432161 1.39180905 1.39929648 1.40678392 1.41427136 1.42175879 1.42924623 1.43673367 1.44422111 1.45170854 1.45919598 1.46668342 1.47417085 1.48165829 1.48914573 1.49663317 1.5041206 1.51160804 1.51909548 1.52658291 1.53407035 1.54155779 1.54904523 1.55653266 1.5640201 1.57150754 1.57899497 1.58648241 1.59396985 1.60145729 1.60894472 1.61643216 1.6239196 1.63140704 1.63889447 1.64638191 1.65386935 1.66135678 1.66884422 1.67633166 1.6838191 1.69130653 1.69879397 1.70628141 1.71376884 1.72125628 1.72874372 1.73623116 1.74371859 1.75120603 1.75869347 1.7661809 1.77366834 1.78115578 1.78864322 1.79613065 1.80361809 1.81110553 1.81859296 1.8260804 1.83356784 1.84105528 1.84854271 1.85603015 1.86351759 1.87100503 1.87849246 1.8859799 1.89346734 1.90095477 1.90844221 1.91592965 1.92341709 1.93090452 1.93839196 1.9458794 1.95336683 1.96085427 1.96834171 1.97582915 1.98331658 1.99080402 1.99829146 2.00577889 2.01326633 2.02075377 2.02824121 2.03572864 2.04321608 2.05070352 2.05819095 2.06567839 2.07316583 2.08065327 2.0881407 2.09562814 2.10311558 2.11060302 2.11809045 2.12557789 2.13306533 2.14055276 2.1480402 2.15552764 2.16301508 2.17050251 2.17798995 2.18547739 2.19296482 2.20045226 2.2079397 2.21542714 2.22291457 2.23040201 2.23788945 2.24537688 2.25286432 2.26035176 2.2678392 2.27532663 2.28281407 2.29030151 2.29778894 2.30527638 2.31276382 2.32025126 2.32773869 2.33522613 2.34271357 2.35020101 2.35768844 2.36517588 2.37266332 2.38015075 2.38763819 2.39512563 2.40261307 2.4101005 2.41758794 2.42507538 2.43256281 2.44005025 2.44753769 2.45502513 2.46251256 2.47 ] 0.775
Uncertainty in m is= 0.024500000000000022 Ω^-1 slope m is= 0.772 Ω^-1 The resistance R is= 1288.659793814433 Ω
The uncertainty in R is= 0.040685779572749534 Ω Part E - IMPROVE, COMPARE, SUMMARIZE, REFLECT The ohm's law model describes our data very well as it shows a linear relationship between the current vs voltage graph showing that the resistance acts a medium between them and the slope is used to get the correct resistance. The resistance we found matches with our expectations so closely which is (1300 +/- 1%) showing that we could achieve the data very precise meaning lower uncertainty level. Following the other group, they used a range of 20mA for the current and 20V for the votlage too and achieved a resistance of 1305Ω and an uncertainty in resistance of 1.7Ω. They also got a data very close to the expectations showing a follow of the ohm's law and hence precise but exceeded 1300Ω showing a slight higher uncertainty and less precise data measurement methods. Part F - IMPROVE, COMPARE, SUMMARIZE, REFLECT In terms of improvement, we could narrow our range which is 2mA and 2V on both ends so that we use to get the best maximum and minimum values that would assist us to get more evenly distributed sets of data and hence allowing us to achieve our expectations even better and closely precise and lower the uncertainty even more. Increasing the number of trails for more repeated values and more plotting achieving a more steady value and increasing the gap distance between the turning of voltage knob in the DC power supply This will allow us to even get better sets of data and hence allow the residual to improve even better by increasing the y-intercept slightly more above and hence getting a evenly distribution on both ends. Part G - Summary The experimental goal for this experiment was did our data follow ohm's law and was our resistance matching with our expectations and does it match what we think it should be? WE successfuly achieved a very precise and closely matched expexted resistance of : R = 1300 $\pm$ 0.04Ω The improvements mentioned above would make our data achieved more confident, more precise, with even more lower uncertainty level, and allowing out scatter plot to have evenly distributed sets of points through the best fit line on both sides. Besides, for the residual plotting, it would make greater improvements for lesser the scatter data as mentioned above. The conclusion we can make is that methods of ohm's law were accurately matched as the formula and relations matches with our data and plottings that we achieved showing a linear relationship all over. For further investigation, we can provide more time to experiment it more by plotting a graph of voltage vs current and then matching with different ranges to play with sets of data and achieve more accurate and precise data. Submit Steps for submission:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
1. Click: Run => Run_All_Cells 2. Read through the notebook to ensure all the cells executed correctly and without error. 3. File => Save_and_Export_Notebook_As->HTML 4. Upload the HTML document to the lab submission assignment on Canvas. In [ ]: In [4]: display_sheets() Sheet: de2 File: lab05_prelab_ohms_law.csv V u_V I u_I Units V V A A 0 0 0.02 0 0.005 1 0.11 0.02 0.009 0.005 2 0.19 0.02 0.020 0.01 3 0.28 0.02 0.029 0.005 4 0.41 0.02 0.043 0.015 5 0.53 0.02 0.053 0.01 6 0.67 0.02 0.070 0.015 7 0.80 0.02 0.078 0.02