You are on page 1of 5

Sheet of chapter (2)

Sheet of chapter (2)


MATLAB Matrices
Section (A)
1) Create MATLAB variables to represent the following matrices, and use them in the exercises that
follow:

a. Assign to the variable x1 the value in the second column of matrix a. This is sometimes
represented in mathematics textbooks as element a1,2 and could be expressed as x1 = a1,2.
b. Assign to the variable x2 the third column of matrix b.
c. Assign to the variable x3 the third row of matrix b.
d. Assign to the variable x4 the values in matrix b along the diagonal (i.e., elements b1,1,
b2,2, and b3,3).
e. Assign to the variable x5 the first three values in matrix a as the first row and all the values
in matrix b as the second through the fourth row.
f. Assign to the variable x6 the values in matrix c as the first column, the values in matrix b
as columns 2, 3, and 4, and the values in matrix a as the last row.
g. Assign to the variable x7 the value of element 8 in matrix b, using the single-index-number
identification scheme.
h. Convert matrix b to a column vector named x8.

2) The area of a rectangle is length times width (area =length × width). Find the areas of rectangles
with lengths of 1, 3, and 5 cm and with widths of 2, 4, 6, and 8 cm. (You should have 12 answers.)

3) The volume of a circular cylinder is, volume = πr2h. Find the volume of cylindrical containers
with radius from 0 to 12 m and heights from 10 to 20 m. Increment the radius dimension by 3 m
and the height by 2 m as you span the two ranges.

1
Computer Applications

4) Do the following
a. Create a 3 × 3 matrix of zeros.
b. Create a 3 × 4 matrix of zeros.
c. Create a 3 × 3 matrix of ones.
d. Create a 5 × 3 matrix of ones.
e. Create a 4 × 6 matrix in which all the elements have a value of pi.
f. Use the diag function to create a matrix whose diagonal has values of 1, 2, 3.

5) A DC circuit of variable DC source its output can be changed between100 and 110 Volt. This
source is connected to supply a variable resistive load. The resistance has a wide range of change
from 10 kΩ to 100 kΩ in a step of 10 kΩ. An ammeter is connected in series to read the supply
current. Draw the circuit, then write a MATLAB m-file to calculate all expected supply current
and dissipated load power. Find the minimum, average and maximum values of the circuit current.
Draw the flowchart.

6) I-V characteristics curves of the solar cell (PV) are basically a graphical representation of the
operation of a solar cell or module summarizing the relationship between the current and voltage
at the existing conditions of irradiance and temperature. The following figure shows the I-V
characteristic of a certain PV at certain solar radiation and temperature. With load variation, the
operating point on the I-V characteristics moves from the short circuit condition to the open circuit
condition passing through maximum extracted power point. The I-V curve provide the
information required to configure a solar system so that it can operate as close to its optimal peak
power point (MPP) as possible to increase the overall system efficiency. The following table gives
a sample of I-V characteristics. Write a MATLAB m-file to read the voltage and current values
and then calculate the power outputs. Draw the I-V and P-V curves in the same figure. Identify
the maximum power point and the maximum power value.
Trial 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Voltage
0.0 0.624 1.248 1.872 2.497 3.121 3.745 4.369 4.7 4.934 5.165 5.336 5.566 5.927 6.07 6.113 6.137 6.210 6.294 6.373 6.389 6.407
(V)
Current
0.124 0.122 0.120 0.118 0.116 0.114 0.112 0.110 0.103 0.10 0.091 0.085 0.078 0.057 0.045 0.037 0.034 0.025 0.02 0.004 0.002 0.0
(A)

2
Sheet of chapter (2)

7) As mentioned in previous question the I-V characteristics curve of a solar cell (PV) is given or
calculated at certain condition of irradiance and temperature. At different irradiation condition the
solar PV has a different I-V characteristic curves as shown in the following figure. For each curve
there is a MPP that the control circuit can track. The following tables give I-V measured values
at different two irradiations. Draw the I-V for each irradiation in the same figure. Then, in a new
figure, draw the P-V curves for each irradiation in the same figure. Analyze the previous two
figures and write your comment. Identify the maximum power point for each irradiation and the
maximum power value, I-V operating point for MPP.

200W/m2
Voltage (V) 0.0 2.5 5 7.5 10 12.5 15 17.5 20 22.5 25 27.5 30 31 32 33 34 35 36 37 38

Current (A) 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.19 1.17 1.12 1.08 1.05 1.03 1 0.95 0.9 0.7 0.4 0.0

600W/m2
Voltage (V) 0.0 5 10 15 20 24 26 28 30 31 32 33 34 35 36 37 38 39 40 41 42

Current (A) 3.7 3.7 3.7 3.7 3.7 3.68 3.64 3.62 3.6 3.58 3.53 3.5 3.4 3.2 3.0 2.6 2.4 2.1 1 0.6 0.0

3
Computer Applications

8) Write a MATLAB code to compute the current in 4-ohm resistance shown in the following figure
using the Branch-Current Analysis method. Hint: use only matrix formation to solve this problem
(Solution 1.4A)

9) In previous problem if the ratted power of the resistances R1 to R3 is 3 Watt identify which of
these resistances will be damaged.

10) In previous problem if the supply voltage E3 is changed from -20V to 20V in a step of 10V (-ve
voltage means reversing source polarity). Using only matrix formation (2-D and 3-D), modify the
previous MATLAB code to compute the current in 4-ohm resistance for each value of the source
E3 using the Branch-Current Analysis method. Hint: use only matrix formation and simplify the
code as possible. Also, the final output should be represented as a matrix of two column one for
voltage E3 and the other for the corresponding IR3.

11) Write a MATLAB code to compute the current in 4-ohm resistance shown in the previous figure
using the Mesh (Loop) Analysis method.

12) Write a MATLAB code to compute the current in 4-ohm resistance shown in the following figure
using the Nodal Analysis method.

4
Sheet of chapter (2)

13) Write a MATLAB code to find the line current IbB and the phase voltage VAN using mesh-current
analysis. f = 100 Hz.

14) Write a MATLAB code to determine the voltage V for the circuit of the following figure using
Nodal Analysis method.

You might also like