to_r - Convert a polar form complex matrix to standard form.
to_r(R) : A = to_r(R) returns in matrix A the complex values corresponding to the complex polar form matrix R. R has complex number magnitudes and angles (in degrees) in alternate columns. A will have 1/2 the number of columns as R. R may be obtained from a call to to_p()
to_r(R,Theta) : A = to_r(R,Theta) R and Theta are real matrices of the same dimension. R contains the magnitudes and Theta contains angles. A will be a matrix of corresponding complex numbers and will have the same dimensions as R and Theta.
The routines to_r() and to_p() make it easy to work with complex numbers in the polar form that is commonly used by electrical engineers (phasor form). Note that there are two "polar forms" that are accepted by the routines. In the first form the complex number magnitudes and angles are in adjacent columns of a single matrix. In the second form the magnitudes and angles are in separate matrices.
When solving systems of equations, all complex matrices should be in rectangular (standard) form. There are no Scilab routines that work with matrices in "polar form". to_r() is normally used when one wishes to enter a matrix in polar form and then convert the matrix to standard from for computation.
Assume we have a four impedances equal to 100/_ 45, 50+50*%i, 200, 80 /_ 90. We can easily create a corresponding impedance matrix in standard form as: Z = [to_r(100, 45) 50+50*%i; 200 to_r(80, 90)] Or, if we have two voltages equal to (polar form) 200 /_45, and 100. We can create the corresponding complex vector as: V = to_r([200 45; 100 0]) The corresponding currents can be displayed in polar form using: I = Z\V; to_p(I)
to_p ,