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 301234567891011time ti(t) versus t for L=1 & R=1, 2, and 5i(t)time const = 1 sectime const = 0.5 sectime const = 0.2 secFIGURE 2.82
Transient current plots of Example 2.23.Example 2.24Create 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.