Solving a system of Linear Equations with constraints. Using Symbolic math.
4 views (last 30 days)
I have the following system of equations with a constraint:
n equations with n unknowns
Here are all known. (Its a known n*n matrix of values).
The following is my try at a solution. How can I correct it to get the 's
p_ij = [0.5, 0.5; 0.2, 0.8];
length_pi_i = size(p_ij);
length_pi_i = length_pi_i(1);
syms pi [1 length(p_ij)]
assume(sum(pi) == 1);
zero_vector = zeros(length(pi), 1);
eqn = (pi' - (pi * p_ij)' == zero_vector);
M = solve(eqn, pi);
Tanmay Das on 30 Dec 2021
I tried reproducing your steps in MATLAB R2021b release and received the following output in the command window:
I tried verifying the answer manually and the answer seems correct to me.