P 2.4-10 The voltage source shown in

Figure P 2.4-10 is an adjustable dc voltage source. In other words, the voltage vs is a constant voltage, but the value of that constant can be adjusted. The tabulated data were collected as follows. The voltage, vs, was set to some value, and the voltages across the resistor, va and vb, were measured and recorded. Next, the value of vs was changed, and the voltages across the resistors were measured again and recorded. This procedure was repeated several times. (The values of vs were not recorded.) Determine the value of the resistance, R.

 

Figure P 2.4-10

 

This is a simple circuit so we can find vb from Ohm’s law

 

We get i also from Ohm’s law

Combining these

Solving for R

So we could just choose one set of values, but what was the point of taking several?  Better choice would be to plot vb vs va, find the slope and use the slope in place of  so the equation becomes

 

Using MATLAB we can find the best line and its slope.  From MATLAB we find the slope is 0.6.

 

 

MATLAB Plot and Code follows:

 

 

%Program to find slope of best line for Homework Problem 2.4-10.

%Version 2018-12-28 D.W. Donovan

 

clear all;

 

va = [11.75 7.5 5.625 10 4.375]';

vb = [7.05 4.5 3.375 6 2.625]';

x = va;

y = vb;

a(:,2) = va;

a(:,1) = ones(size(va,2));

c = a\vb;

b = c(1);

m = c(2);

 

inew = [min(va) : (max(va) - min(va))/1000 : max(va)]';

vnew = m*inew +b;

 

 

R = 40*m;

ls = ['Model Slope is ' num2str(m) ' '];

ly = ['Model Y-intercept is ' num2str(b) ' (V)'];

lv = ['R = (40 \Omega)(slope) = ' num2str(R) ' \Omega'];

 

ans = {'Slope ' m; 'Y-intercept ' b;

    'R = ' R };

 

ans

 

figure

hold on

plot(va, vb, 'k *','MarkerSize',20)

plot(inew, vnew, 'k-', 'LineWidth', 3)

plot(max(va), min(vb), '.w')

plot(max(va), min(vb), '.w')

plot(max(va), min(vb), '.w')

 

 

tt1 = 'PH 320 Homework Problem 2.4-10';

tt2 = 'Voltage vs voltage for a Circuit Element';

ttn = 'D.W. Donovan -- ';

tnl = '\newline';

ttf = [tt1 tnl tt2 tnl ttn date];

xl = 'Voltage, v, (V)';

yl = 'Voltage, v, (V)';

 

sp = 1;

axxmin = min(x)-sp;

axxmax = max(x) + sp;

axymin = min(y) - sp;

axymax = max(y) + sp;

 

 

title (ttf,'FontSize', 16)

xlabel(xl, 'FontSize', 16)

ylabel(yl, 'FontSize', 16)

legend ('Raw Data', 'Model Curve', ls, ly, lv, 'Location','SE')

legend ('boxoff')

 

axis([axxmin axxmax axymin axymax])

 

 

%{

ans = 'Slope '        [     0.6000]

    'Y-intercept '    [-1.2545e-15]

    'R = '            [    24.0000]

%}

 

 

 

Please send any comments or questions about this page to ddonovan@nmu.edu

This page last updated on December 28, 2018