180
Practical MATLAB
® Applications for Engineers
The script fi le RL is executed and the results and plots (Figure 2.82) are shown as
follows:
>> RL
******************************************************
The solutions i(t) for R=1, 2 and 5 (in Ohms) are :
******************************************************
******************************************************
itR _ 1 =
10-10*exp(-t)
******************************************************
itR _ 2 =
5-5*exp(-2*t)
*******************************************************
itR _ 5 =
2-2*exp(-5*t)
******************************************************
******************************************************
0
0.5
1
1.5
2
2.5
3
0
1
2
3
4
5
6
7
8
9
10
11
time t
i(t) versus t for L=1 & R=1, 2, and 5
i(t)
time const = 1 sec
time const = 0.5 sec
time const = 0.2 sec
FIGURE 2.82
Transient current plots of Example 2.23.
Example 2.24
Create the script fi le RL_vol_plots that returns
1. The expression of v L (t) and plot v L (t) versus t, for t ≥ 0
2. The expression of v R (t) and plot v R (t) versus t, for t ≥ 0
for the circuit shown in Figure 2.81, for the same three resistors: R = 1, 2, and 5 Ω,
assuming that the initial current is i L (0) = 0 A.
CRC_47760_CH002.indd 180
CRC_47760_CH002.indd 180
7/23/2008 1:38:56 PM
7/23/2008 1:38:56 PM
Practical MATLAB
® Applications for Engineers
The script fi le RL is executed and the results and plots (Figure 2.82) are shown as
follows:
>> RL
******************************************************
The solutions i(t) for R=1, 2 and 5 (in Ohms) are :
******************************************************
******************************************************
itR _ 1 =
10-10*exp(-t)
******************************************************
itR _ 2 =
5-5*exp(-2*t)
*******************************************************
itR _ 5 =
2-2*exp(-5*t)
******************************************************
******************************************************
0
0.5
1
1.5
2
2.5
3
0
1
2
3
4
5
6
7
8
9
10
11
time t
i(t) versus t for L=1 & R=1, 2, and 5
i(t)
time const = 1 sec
time const = 0.5 sec
time const = 0.2 sec
FIGURE 2.82
Transient current plots of Example 2.23.
Example 2.24
Create the script fi le RL_vol_plots that returns
1. The expression of v L (t) and plot v L (t) versus t, for t ≥ 0
2. The expression of v R (t) and plot v R (t) versus t, for t ≥ 0
for the circuit shown in Figure 2.81, for the same three resistors: R = 1, 2, and 5 Ω,
assuming that the initial current is i L (0) = 0 A.
CRC_47760_CH002.indd 180
CRC_47760_CH002.indd 180
7/23/2008 1:38:56 PM
7/23/2008 1:38:56 PM
