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
- The expression of vL(t) and plot vL(t) versus t, for t ≥ 0
- The expression of vR(t) and plot vR(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 iL(0) = 0 A.