Rank: 1613 based on 42 downloads (last 30 days) and 13 files submitted
photo

Feng Cheng Chang

E-mail
Company/University
Allwave Corporation
Lat/Long
33.853737, -118.36573

Personal Profile:

Professor,
Senior Scientist,
Ph. D. in E.E., University of Alabama,
IEEE Life member,
Retired

Professional Interests:
mathematics, EM waves, Antennas

 

Watch this Author's files

 

Files Posted by Feng Cheng View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
22 Apr 2013 Making square matrix singular. Making any given non-singular square matrix singular by perturbing with prescribed distribution. Author: Feng Cheng Chang square matrix, inverse matrix, determinant, vector product, pertubation, data distribution 3 0
14 Dec 2012 Polynomial division - derived form covolution Polynomial division is derived directly from convolution. Author: Feng Cheng Chang long polynomial divis..., synthetic polynomial ..., convolution polynomia... 4 1
30 Nov 2012 Inverse and determinant of square matrix Inverse and determinant of a square matrix are determined using only simple matrix multiplication Author: Feng Cheng Chang determinant, inverse matrix, square matrix 6 11
  • 3.0
3.0 | 4 ratings
22 May 2012 Polynomials with multiple roots solved Solving multiple roots polynomial, using simple elementary arithematic operations mostly. Author: Feng Cheng Chang polynomial roots poly... 8 3
  • 5.0
5.0 | 2 ratings
07 Jul 2011 Polynomial division by convolution -- up to finite terms Division of two polynomials by convolution to get up to K terms. Author: Feng Cheng Chang convolution matrix, longhand division, polynomial division, linear algebra 3 0
Comments and Ratings by Feng Cheng View all
Updated File Comments Rating
14 Nov 2012 Inverse and determinant of square matrix Inverse and determinant of a square matrix are determined using only simple matrix multiplication Author: Feng Cheng Chang

Thank you for all of your comments, John and Jan. Afterall I have decided to continue instead of giving up. Here, I want to say thank again to the encouragement from Jan.

The presentation in File Exchange is now updated to include two files: inv0.m and inv0det_pvt.m.

(1) AI = inv0(AO) -- Find AI(inverse) directly from AO(given matrix) without any pivoting. The code is only 4 statement lines total.

(2) [AI,det] = inv0det_pvt(AO,pvt) -- Find both AI and det(determinant) from AO, with or without pivoting. The "write-in" is used for the pivoting (pvt = 2). It is only good for AO of small order and not practical at all. However it may resolve the problem when the divisor 'd' in the k-loop is zero or close to zero. Such as d=AO(1,1)=0.

The option of automatic pivoting with the preset critique is the way to proceed. I think the critique for pivoting is to select the pivoting element such that the divisor d is the absolute maximum among all computed d's. If the value of d, resulted from the selected pivoting element, is zero or close to zero, then the given matrix AO must be singular.

Anyway the derived algorithm for matrix inversion is very pratical compare to some other classical approaches, such as Gauss-Jordan Elimination. I hope our FEX users will like to use it.

I am not majored in mathematics. I am retired now and soon approach to 80. I need some help regarding the option for automatic pivoting.

03 Nov 2012 Inverse and determinant of square matrix Inverse and determinant of a square matrix are determined using only simple matrix multiplication Author: Feng Cheng Chang

Thank you again for your comments. Afterward I do not expect people would want to use my code at all, since the MATLAB functions 'inv' and 'det' have already been here to be used conveniently. However, it does not show how these built-in functions are developed, such as by co-factors, eigenvalues, Guanssian elimination, etc. Perpaps, this is why people like to develop their own codes.

Sometimes, people want to derive his own routine that may be better than the built-in one in some extent. For example, the routine 'polyroots' presented in Mathworks Files Exchange is
more suitable than the built-in function 'roots' for any given polynomials with many high multiple roots.

If anyone like to develop his own codes about the inverse and determinant of a given square matrix, he may do it by applying the approach used in my code. It is very siple and straightforward, and only six statement lines.

Finally, the errors have been found during repeatly running the code
with pvt = 1 option. It will yield the determinant of correct
absolute value but with different sign, either + and - . It needs to be corrected.

I may withdraw this contribution if I feel no good.

02 Nov 2012 Inverse and determinant of square matrix Inverse and determinant of a square matrix are determined using only simple matrix multiplication Author: Feng Cheng Chang

I do appreciate John's comments, so that I am to force myself to do some further homework. Hope it will give him some answers but not expect all.

The code is now updated to include the pivoting scheme. There are three options to choose:
(1) pvt=0 ---> no pivoting,
(2) pvt=1 ---> pivoting elements randomly selected,
(3) pvt=2 ---> pivoting elements by writing-in.

If the very first element of the given square matrix is zero, it does surely fail for option(1), but it will be OK by sucessively running either option(2)or(3) for any non-singular matrix.

The code derived is very short (10 lines for the original and less than 30 for the updated). Yet it will give both inverse and determinant of a given square matrix.

After all, nothing is completely perfect.

31 Oct 2012 Inverse and determinant of square matrix Inverse and determinant of a square matrix are determined using only simple matrix multiplication Author: Feng Cheng Chang

If the run fails due to det = 0 at any stage, please try the following added routine:

function [AI,det,er] = inv_det_pij(AO,pij)
if nargin < 2, AO = AO(pij(:,1),pij(:,2)); end;
[AO,det,er] = inv_det(AO);
if nargin < 2, AO(pij(:,2),pij(:,1)) = AO; end;

where the input 'pij' is nx2 array to modify the given matrix such that the diagonal elements are all replaced.

For example,

>> A=[0 1 2; 3 4 5; 6 7 8], pij=[2 1; 3 2; 1 3], Ap=A(pij(:,1),pij(:,2)),

A =
0 1 2
3 4 5
6 7 8
pij =
2 1
3 2
1 3
Ap =
3 4 5
6 7 8
0 1 2

11 Sep 2012 Polynomial division - derived form covolution Polynomial division is derived directly from convolution. Author: Feng Cheng Chang

Self comment:
For example,
>
> b = [2 7 -5 9 -3], a = [3 -5 9 -2],
b =
2 7 -5 9 -3
a =
3 -5 9 -2

> [q,r] = poly_div(b,a),
q =
0.66667 3.4444
r =
6.2222 -20.667 3.8889

> [q,r] = deconv(b,a),
q =
0.66667 3.4444
r =
0 -8.8818e-016 6.2222 -20.667 3.8889
>
It shows that running the MATLAB built-in routine yields the unwanted data, even it is very very small.

Comments and Ratings on Feng Cheng's Files View all
Updated File Comment by Comments Rating
19 Nov 2012 Inverse and determinant of square matrix Inverse and determinant of a square matrix are determined using only simple matrix multiplication Author: Feng Cheng Chang çilsalar, hüseyin

14 Nov 2012 Inverse and determinant of square matrix Inverse and determinant of a square matrix are determined using only simple matrix multiplication Author: Feng Cheng Chang Chang, Feng Cheng

Thank you for all of your comments, John and Jan. Afterall I have decided to continue instead of giving up. Here, I want to say thank again to the encouragement from Jan.

The presentation in File Exchange is now updated to include two files: inv0.m and inv0det_pvt.m.

(1) AI = inv0(AO) -- Find AI(inverse) directly from AO(given matrix) without any pivoting. The code is only 4 statement lines total.

(2) [AI,det] = inv0det_pvt(AO,pvt) -- Find both AI and det(determinant) from AO, with or without pivoting. The "write-in" is used for the pivoting (pvt = 2). It is only good for AO of small order and not practical at all. However it may resolve the problem when the divisor 'd' in the k-loop is zero or close to zero. Such as d=AO(1,1)=0.

The option of automatic pivoting with the preset critique is the way to proceed. I think the critique for pivoting is to select the pivoting element such that the divisor d is the absolute maximum among all computed d's. If the value of d, resulted from the selected pivoting element, is zero or close to zero, then the given matrix AO must be singular.

Anyway the derived algorithm for matrix inversion is very pratical compare to some other classical approaches, such as Gauss-Jordan Elimination. I hope our FEX users will like to use it.

I am not majored in mathematics. I am retired now and soon approach to 80. I need some help regarding the option for automatic pivoting.

05 Nov 2012 Inverse and determinant of square matrix Inverse and determinant of a square matrix are determined using only simple matrix multiplication Author: Feng Cheng Chang Simon, Jan

@John: Your point has become clear. I'm convinced, that Feng did not want to insult you, me or any other FEX user. The quality of his linear algebra function is low and you rated it three times with 1 star. I'm sure that users, who are interested in linear algebra methods, will remember, that they have heard different strategies for pivoting in their numeric lessons.
According to his profile Feng Cheng Chang is a retired professor and has a PhD in Electrical Engineering. I'm sure, that he has reasons to post this submission in its current form. His calm and friendly reactions let me think, that these reasons are neither the will to provoke nor to seduce beginners to apply poor LA methods.

In my opinion, there are too few ratings and comments in the FEX. You, John, are very active here and your ratings increase the value of the complete platform. Beside others, I personally would benefit, if you use the limited time to analyze and comment other submission instead of this one.

04 Nov 2012 Inverse and determinant of square matrix Inverse and determinant of a square matrix are determined using only simple matrix multiplication Author: Feng Cheng Chang D'Errico, John

There are several reasons why you might post code for others. One is for them to use. Tools that expand MATLAB are always good, as long as they are well done. This tool has incredibly serious problems for anyone who might want to use it, and the description of this code strongly implies that it is for use! That is how I reviewed it.

There is also a teaching use of the FEX. There others can look at your code and learn from it, learning how did you solve the problem. As a learning tool, comments are extremely valuable. Code for this purpose is useless IF it claims to teach yet has no comments that explain why you have done something and what you are doing. Good teaching code should be overflowing with helpful comments. It should use descriptive variable names.

In fact, the first case I mentioned also needs internal comments, as debugging is a forever task. Things break. Changes to MATLAB happen. You cannot simply write code and forget it in any language.

The question of pivots is an important one. When I mentioned the lack of pivots, the only thing the author did was to add the options of random pivots and user supplied pivots. Both of these options are foolish, and are an insult to the user, an insult to the student who would learn from you, and an insult to me. No rational person will ever want to use them for such a code, and teaching a student that random pivoting is a good idea is crazy.

Had the author chosen to add various other pivoting options that ARE designed to improve the stability of the problem while also including the poor schemes along with clear and exhaustive explanations of why they are terribly poor choices, I'd have had no problem of their inclusion in a teaching tool. But no such thing was done.

04 Nov 2012 Inverse and determinant of square matrix Inverse and determinant of a square matrix are determined using only simple matrix multiplication Author: Feng Cheng Chang Simon, Jan

@Feng: I understand John's arguments. I miss comments, which explain the algorithm you are using. Without them, a user has to guess what you are doing and it is nearly impossible to find bugs.
A random pivoting is a surprising technique. Actually the pivoting should increase the stability of the algorithm and avoid errors caused by zeros on the diagonal. But random pivoting will let the output change (slightly or massively depending on the condition of the matrix) in a not reproducible manner.
If you are interested in the source of INV and DET, look in the corresponding BLAS and LAPACK functions, which can be downloaded at www.netlib.org. Even TMW itself did not dare to implement such fundamental functions, but existing and well established code has been chosen. This should let you and other developers of alternative INV versions think twice.

@John: Thanks for your comments and the exhaustive testing. I'm sure that Feng did not want to occupy your time.

Top Tags Applied by Feng Cheng
linear algebra, polynomial division, polynomial gcd, polynomial roots, control design
Files Tagged by Feng Cheng View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
22 Apr 2013 Making square matrix singular. Making any given non-singular square matrix singular by perturbing with prescribed distribution. Author: Feng Cheng Chang square matrix, inverse matrix, determinant, vector product, pertubation, data distribution 3 0
14 Dec 2012 Polynomial division - derived form covolution Polynomial division is derived directly from convolution. Author: Feng Cheng Chang long polynomial divis..., synthetic polynomial ..., convolution polynomia... 4 1
30 Nov 2012 Inverse and determinant of square matrix Inverse and determinant of a square matrix are determined using only simple matrix multiplication Author: Feng Cheng Chang determinant, inverse matrix, square matrix 6 11
  • 3.0
3.0 | 4 ratings
22 May 2012 Polynomials with multiple roots solved Solving multiple roots polynomial, using simple elementary arithematic operations mostly. Author: Feng Cheng Chang polynomial roots poly... 8 3
  • 5.0
5.0 | 2 ratings
07 Jul 2011 Polynomial division by convolution -- up to finite terms Division of two polynomials by convolution to get up to K terms. Author: Feng Cheng Chang convolution matrix, longhand division, polynomial division, linear algebra 3 0

Contact us