Page 122 - MATLAB an introduction with applications
P. 122

Electrical Circuits ——— 107


                   fprintf (‘The curent in the circuit is %f amp’,i)
                   fprintf(‘\nThe total power dissipated in the circuit is %f watts\n’,ptotal)
                   MATLAB Output:
                   Enter the source voltage
                   Enter values of resistors as elements in a row vector
                   [10  7  6  9  4  7.5  5]
                           Resistance   Voltage    Power
                             (ohm)       (volt)    (watt)
                            10.0000     2.4742    14.8454
                             7.0000     1.7320    10.3918
                             6.0000     1.4845     8.9072
                             9.0000     2.2268    13.3608
                             4.0000     0.9897     5.9381
                             7.5000     1.8557    11.1340
                             5.0000     1.2371     7.4227

                   The current in the circuit is 0.247423 amp.
                   The total power dissipated in the circuit is 2.969072 watt.

                   Example E2.3: Figure E2.3 shows a semiconductor diode and the current flowing through the diode is
                   given by:

                                           qv d 
                                i D  = i 0 [exp    kT     − 1 ]

                   where v d = the voltage across the diode (volt)
                          i 0 = the leakeage current of the diode (amp)
                          k = Boltzmann’s constant (1.38 ×10 –23  joule/K)
                          q = the charge of an electorn (1.6 × 10 –19  coulombs)
                          T = temperature (in K)
                         i D = the current flow through the diode (amp)
                              (a)  Write a MATLAB program to calculate the current flowing through this diode for all
                                  voltages from –0.2 V to + 0.25 V in 0.01 V steps.
                                                                   o
                                                                            o
                                                              o
                              (b)  Repeat the procedure in (a) for 70 F, 200 F and 400 F.
                              (c)  Plot the current as a function of applied voltage.













                   F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09
   117   118   119   120   121   122   123   124   125   126   127