MATLAB Answers


Steady State Probability Calculation - (Solve simultaneous eq. with 33 unknowns)

Asked by sp
on 17 Jan 2013

Hi, i know 33x33 nnormalized matrix.... i shd multiply with 33 unknowns...matrix multiplication....with same 33 unknowns even on left will be there...... how to calculate these 33 unknowns,..

[x1 x2 x3 ....... x33][Normalized matrix 33x33] = [x1 x2 x3 ..... x33]

help me ,,,

thank you


Log in to comment.


No products are associated with this question.

4 Answers

Answer by Cedric Wannaz
on 17 Jan 2013
Edited by Cedric Wannaz
on 17 Jan 2013
 Accepted answer

... try this ...

 >> doc \


Log in to comment.

Answer by Roger Stafford
on 17 Jan 2013

There will be no non-zero solution unless one or more of the eigenvalues of the 33 by 33 matrix is equal to 1. Furthermore there will be no solution with a sum of 1 unless there is a corresponding eigenvector with a non-zero sum. Therefore, use matlab's 'eig' function to find its eigenvalues and eigenvectors and if one of the eigenvalues is 1 with a corresponding eigenvector whose sum is non-zero, normalize that eigenvector (divide its elements by their sum) to have sum 1 and that will be a solution.


i dint get you properly... i have to find x1 x2 .. x33 in

[x1 x2 x3 .... x33] [i have 33x33 matrix where sum of row is 1]=[x1 x2 x3 ... x33]

Your initial question is not very well written, sp. It seems that we all tried to answer based on some assumption of what you want to do effectively.

If your problem, after transposition, is really

 A x = x   ->   (A-I)x = 0

with A completely defined and you need to find x, then see Walter's answer. But this kind of equations is usually found in a context where you need to find eigen values/vectors, and you are looking for lambda that verifies the following equation for all x

 A x = lambda x  ->  (A-lambda I) x = 0

So here x can be anything, which sets constraints on lambda (leading to a set of eigen values).

When I read you question (and it might be the same for the others who answered), I was sure that you had either forgotten some lambda, or some constant right-hand side vector.

Also, this information about all x components summing up to 1 that came later as a comment (which is not the same as "sum of matrix rows is 1" that came even later), is indeed a 34th equation in your system with 33 unknowns (if this is really what you are trying to solve).. something to meditate.

yes cedric you are right... i realized bit later... i got the solution now...same procedure

Log in to comment.

Answer by Walter Roberson
on 17 Jan 2013

Solution: let all the unknowns be 0.

  1 Comment

i shd get values of these unknowns.... and sum of x1 + x2 + .... + x33 = 1

Log in to comment.

Answer by Roger Stafford
on 19 Jan 2013

I didn't realize that by "33x33 nnormalized matrix" you meant that its rows each have a sum of 1. In that case I believe there will be at least one eigenvalue of 1 and my warning no longer applies. You can solve for your vector as follows. Let A be your 33 x 33 matrix in which each row has a sum of 1.

 [V,D] = eig(A'); % Find eigenvalues and left eigenvectors of A
 [~,ix] = min(abs(diag(D)-1)); % Locate an eigenvalue which equals 1
 v = V(:,ix)'; % The corresponding row of V' will be a solution
 v = v/sum(v); % Adjust it to have a sum of 1

The vector v will be the vector you seek.


hey hi.. the logic is different in ur code.....actually i wanted solution following equation as Ax = x... anyways i got solution now... thank you....

I didn't justify my remark that if your matrix rows each have a sum of one, then it must have an eigenvalue of one. The line of reasoning is this. If I is the 33 x 33 identity matrix, then the rows of the matrix A-I would each have a sum of zero. It is a property of determinants that any one of its columns (or rows) can be added to any other column (or row) without altering the value of the determinant. Hence if each of the other columns in A-I is added in turn to the first column, the value of det(A-I) remains the same. However from the above assumption this would make the first column equal to all zeros, which means that det(A-I) itself must be zero. Thus one will be one of the roots of the characteristic equation for A and is therefore one of its eigenvalues.

Of course the same reasoning would hold for any size matrix if all its rows or columns have a fixed sum of some value lambda. Then det(A-lembda*I) = 0 and lambda would therefore have to be an eigenvalue of A.

Log in to comment.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!