Direct Current and Transient Analysis
205
or
di t
di
i t
i t
1
1
2
7
3
( )
( )
( )
ϭ
ϩ
Ϫ
and
Ϫ3
9
2
0
1
2
2
i t
i t
di t
di
( )
( )
( )
ϩ
ϩ
ϭ
or
2
3
9
2
1
2
di t
dt
i t
i t
( )
( )
( )
ϭ
Ϫ
MATLAB Solution
% Script file : transient _ 2loops
% transient solutions for two loop network
disp(‘****************************************’)
disp(‘*******R E S U L T S*******************’)
disp(‘****************************************’)
disp(‘Solution of the two diff. loop equations for t>0 ’)
[y1 y2] = dsolve(‘Dy1=-7*y1+3*y2,2*Dy2=3*y1- 9*y2’,’y1(0)=3’,’y2(0)=2’,’t’);
figure(1)
ezplot (y1,[0 3])
axis([0 1.5 0 3.5])
xlabel (‘time (sec)’)
ylabel (‘current i1(t) in amps’)
title (‘i1(t) vs t ’)
figure(2)
ezplot(y2,[0 3])
axis([0 1.5 0 2.3])
xlabel(‘time (sec)’)
ylabel(‘current i2(t) in amps’)
title(‘i2(t) vs t ’)
disp(‘***************************************’)
disp(‘The currents i1(t) and i2(t), in amps are :’)
[y1 y2]’
disp(‘***************************************’)
disp(‘The simplify solution for i1(t) is:’)
simplify(y1)
disp(‘***************************************’)
disp(‘The simplify solution for i2(t) is :’)
simplify(y2)
disp(‘***************************************’)
disp(‘The pretty solution for i1(t) is :’)
pretty(y1)
disp(‘***************************************’)
disp(‘The pretty solution for i2(t) is :’)
pretty(y2)
disp(‘***************************************’)
CRC_47760_CH002.indd 205
CRC_47760_CH002.indd 205
7/23/2008 1:39:01 PM
7/23/2008 1:39:01 PM
205
or
di t
di
i t
i t
1
1
2
7
3
( )
( )
( )
ϭ
ϩ
Ϫ
and
Ϫ3
9
2
0
1
2
2
i t
i t
di t
di
( )
( )
( )
ϩ
ϩ
ϭ
or
2
3
9
2
1
2
di t
dt
i t
i t
( )
( )
( )
ϭ
Ϫ
MATLAB Solution
% Script file : transient _ 2loops
% transient solutions for two loop network
disp(‘****************************************’)
disp(‘*******R E S U L T S*******************’)
disp(‘****************************************’)
disp(‘Solution of the two diff. loop equations for t>0 ’)
[y1 y2] = dsolve(‘Dy1=-7*y1+3*y2,2*Dy2=3*y1- 9*y2’,’y1(0)=3’,’y2(0)=2’,’t’);
figure(1)
ezplot (y1,[0 3])
axis([0 1.5 0 3.5])
xlabel (‘time (sec)’)
ylabel (‘current i1(t) in amps’)
title (‘i1(t) vs t ’)
figure(2)
ezplot(y2,[0 3])
axis([0 1.5 0 2.3])
xlabel(‘time (sec)’)
ylabel(‘current i2(t) in amps’)
title(‘i2(t) vs t ’)
disp(‘***************************************’)
disp(‘The currents i1(t) and i2(t), in amps are :’)
[y1 y2]’
disp(‘***************************************’)
disp(‘The simplify solution for i1(t) is:’)
simplify(y1)
disp(‘***************************************’)
disp(‘The simplify solution for i2(t) is :’)
simplify(y2)
disp(‘***************************************’)
disp(‘The pretty solution for i1(t) is :’)
pretty(y1)
disp(‘***************************************’)
disp(‘The pretty solution for i2(t) is :’)
pretty(y2)
disp(‘***************************************’)
CRC_47760_CH002.indd 205
CRC_47760_CH002.indd 205
7/23/2008 1:39:01 PM
7/23/2008 1:39:01 PM
