PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

Direct Current and Transient Analysis 179


ANALYTICAL Solution

Part a

The loop differential equation, as well as its current solution i(t), is given as follows:

L
di t
dt
Ri t V
()
() 0

then

it
V
R

V
R
()^00 et Rt for 0 for 1, 2, and 5

where τ = L/R.

MATLAB Solution
% Script file: RL
% parts ( b and c )
itR _ 1 = dsolve(‘Dy+y =10’,’y(0) = 0’,’t’);
itR _ 2 = dsolve(‘Dy+2*y=10’,’y(0)=0’,’t’);
itR _ 5 = dsolve(‘Dy+5*y=10’,’y(0)=0’,’t’);
disp(‘***************************’);
disp(‘The solutions i(t) for R=1,2 and 5 (in Ohms) are:’);
disp(‘***************************’);
disp(‘***************************’);
itR _ 1
disp(‘***************************’);
itR _ 2
disp(‘***************************’);
itR _ 5
disp(‘***************************’);
disp(‘***************************’);
ezplot(itR _ 5,[0 3]);
hold on;
grid on; ezplot(itR _ 2,[0 3]);
hold on;
ezplot(itR _ 1,[0 3]);
hold on;
title(‘i(t) vs t for L=1 & R=1,2 and 5’)
axis([0 3 0 11]);
xlabel(‘time t’);ylabel(‘i(t)’)

FIGURE 2.81
Network of Example 2.23.

V 0 = 10 V R

Switch closes at t = 0 L = 1 H

i(t)
Free download pdf