Electrical Software Lab Assignments
Electrical Software Lab Assignments
The document uses MATLAB's 'roots()' function to find the roots of a polynomial, which is a straightforward approach to determining solutions to polynomial equations. This reflects MATLAB's capability to efficiently solve polynomials, leveraging numerical algorithms to provide solutions .
Euler's number is applied in the document within an expression involving the exponential function and the sine function. By using 'exp(-a)*sin(x)+10*sqrt(y)', it demonstrates the use of exponential decay in calculations, which is significant in modeling processes such as radioactive decay or depreciation that require an exponential decrease .
Linspace is used for generating linearly spaced vectors and is preferred when the number of points in an interval is specified, which guarantees the start and end points are included. In contrast, the colon operator is useful for specifying the increment between elements rather than the number of points. In the document, linspace is used to generate 100 points in the interval [0, 2π] for smoother plots, while the colon operator is used for simpler increments like in plotting 'y=sin(x)' over [0, 10].
The document calculates current as a range vector, voltage as the product of resistance and current, and power as the product of voltage and current. This representation allows analysis over a range of currents. The results are plotted with current on the x-axis and both voltage and power on the y-axis, using different colors to differentiate between the plotted variables .
The document computes eigenvalues and eigenvectors of a matrix using '[V, E] = eig(A)' in MATLAB. This operation identifies the directional scales of transformations represented by the matrix. Eigenvalues and eigenvectors have applications in stability analysis, vibration analysis, and principal component analysis, where they enable dimensionality reduction and system behavior prediction .
The document computes the real and imaginary parts of a complex division by multiplying two complex numbers and dividing by another. It uses the 'real()' and 'imag()' functions in MATLAB to separate these parts after the division is performed using standard complex multiplication and division formulas .
The document demonstrates matrix manipulation by creating a 3x3 matrix and performing operations like sorting elements in descending order for rows and columns. It uses the 'sort()' function in MATLAB for these purposes, reflecting an understanding of how to organize data within matrices for better analysis .
The RMS value of a vector in MATLAB is calculated by taking the square root of the mean of the squares of its elements. This is implemented using the expression 'y = sqrt(mean(X.^2))' where X is the vector .
The document uses matrix operations to solve the system of linear equations, specifically using the backslash operator '\' and the matrix inversion method 'inv()'. The backslash operator is generally preferred as it is computationally more efficient and numerically stable compared to explicitly computing the inverse of the matrix, which can introduce more round-off errors .
The document verifies a trigonometric identity by evaluating both the left-hand side and right-hand side of the equation at a specific value, x = π/5. While this confirms the identity holds for this value, it does not confirm the identity universally. The limitation is that multiple values should be tested or algebraic proof should be provided for general validity .