Docsity

Solving Non-Linear Resistance Problem using MATLAB, Slides of Computational Methods

Partial preview of the text

Download Solving Non-Linear Resistance Problem using MATLAB and more Slides Computational Methods in PDF only on Docsity!

Problem

Solution by Plotting

  • Lines cross at v

≈ 7.7 v

v2 (V)

v1 (V)

P5.

% Bruce Mayer, PE % ENGR25 * 12Mar % P5_25_NonLinear_Resistance_1203.m % clear % given: i1 = B(exp(mv2) - 1); where B = 0.16; % amps m = 0.12; % 1/volts % % The voltage absorbed by the source Resistance, R %=> vR = i1R R1 = 30; % ohms % % by Conservation of Energy (Kirchoff's Voltage Law, KVL) %=> v1 = vR + v2 SO v1 = i1R1 + v2 = R1B(exp(mv2) - 1) + v %==> also v v1 = 15; % volts % % WHEN IN DOUBT PLOT IT! % plot v1(v2) and find where v1 is 15V v2 = linspace(0,10,500); % % calc v1PLot v1p = R1B(exp(mv2) - 1) + v2; % make at straigth line @ v1p = 15 v2L = [0, 10]; v1pL = [15, 15]; plot(v2, v1p, v2L, v1pL, 'LineWidth', 3), grid, xlabel('v2 (V)'),... ylabel('v1 (V)'), title('P5.26') % By plot v2 is about 7.8V % % find v2 precisely by fzero %=> fcn to zero = vNet = vR + v2 - v vNet = @(V2) R1B(exp(mV2) - 1) + V2 - v1; % % Now use fzero to find v2soln using 8V as starting point v2soln = fzero(vNet, 8); % % Use v2soln to find i1 using defining eqn i1soln = B(exp(m*v2soln) - 1); % disp('i1 in Amps:') disp(i1soln) disp(' ') disp('v2 in volts:') disp(v2soln)