Producing a matrix with minimal condition number
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
This code below produces a 42 by 21 matrix called ohms_law_matrix given as input a random 6 by 7 matrix called u_matrix (last column is zeros).
How can I find an u_matrix which gives the smallest possible condition number for the ohms_law_matrix produced? Trying a gradient descent type algorithm I found one which gave condition number of 2.77, is there expected to exist a matrix which gives much smaller condition number then this? (1 would be nice).
index_matrix = [ 0, 1, 2, 3, 4, 5, 6; ...
1, 0, 7, 8, 9,10,11; ...
2, 7, 0,12,13,14,15; ...
3, 8,12, 0,16,17,18; ...
4, 9,13,16, 0,19,20; ...
5,10,14,17,19, 0,21; ...
6,11,15,18,20,21, 0];
u_matrix=[(rand(6,6)),[0,0,0,0,0,0]'];
ohms_law_matrix = zeros(42,21);
%Looping over rows in input.
for meas_row=1:6
%Looping over columns in input.
for el_col=1:7
current_index = el_col + (meas_row-1)*7;
for voltage_index=1:7
%Go from matrix form to vector form.
i = index_matrix(el_col, voltage_index);
if i %this m)eans (el_col ~= voltage_index)
ohms_law_matrix(current_index, i) = ...
u_matrix(meas_row, el_col)...
- u_matrix(meas_row, voltage_index);
end
end
end
end
linear-algebra matrices matlab condition-number
add a comment |Â
up vote
0
down vote
favorite
This code below produces a 42 by 21 matrix called ohms_law_matrix given as input a random 6 by 7 matrix called u_matrix (last column is zeros).
How can I find an u_matrix which gives the smallest possible condition number for the ohms_law_matrix produced? Trying a gradient descent type algorithm I found one which gave condition number of 2.77, is there expected to exist a matrix which gives much smaller condition number then this? (1 would be nice).
index_matrix = [ 0, 1, 2, 3, 4, 5, 6; ...
1, 0, 7, 8, 9,10,11; ...
2, 7, 0,12,13,14,15; ...
3, 8,12, 0,16,17,18; ...
4, 9,13,16, 0,19,20; ...
5,10,14,17,19, 0,21; ...
6,11,15,18,20,21, 0];
u_matrix=[(rand(6,6)),[0,0,0,0,0,0]'];
ohms_law_matrix = zeros(42,21);
%Looping over rows in input.
for meas_row=1:6
%Looping over columns in input.
for el_col=1:7
current_index = el_col + (meas_row-1)*7;
for voltage_index=1:7
%Go from matrix form to vector form.
i = index_matrix(el_col, voltage_index);
if i %this m)eans (el_col ~= voltage_index)
ohms_law_matrix(current_index, i) = ...
u_matrix(meas_row, el_col)...
- u_matrix(meas_row, voltage_index);
end
end
end
end
linear-algebra matrices matlab condition-number
2
If you could express this in mathematical notation instead of requiring people to decipher what you are doing in that code, you'll be much more likely to get useful response.
â Paul Sinclair
Jul 31 at 23:23
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This code below produces a 42 by 21 matrix called ohms_law_matrix given as input a random 6 by 7 matrix called u_matrix (last column is zeros).
How can I find an u_matrix which gives the smallest possible condition number for the ohms_law_matrix produced? Trying a gradient descent type algorithm I found one which gave condition number of 2.77, is there expected to exist a matrix which gives much smaller condition number then this? (1 would be nice).
index_matrix = [ 0, 1, 2, 3, 4, 5, 6; ...
1, 0, 7, 8, 9,10,11; ...
2, 7, 0,12,13,14,15; ...
3, 8,12, 0,16,17,18; ...
4, 9,13,16, 0,19,20; ...
5,10,14,17,19, 0,21; ...
6,11,15,18,20,21, 0];
u_matrix=[(rand(6,6)),[0,0,0,0,0,0]'];
ohms_law_matrix = zeros(42,21);
%Looping over rows in input.
for meas_row=1:6
%Looping over columns in input.
for el_col=1:7
current_index = el_col + (meas_row-1)*7;
for voltage_index=1:7
%Go from matrix form to vector form.
i = index_matrix(el_col, voltage_index);
if i %this m)eans (el_col ~= voltage_index)
ohms_law_matrix(current_index, i) = ...
u_matrix(meas_row, el_col)...
- u_matrix(meas_row, voltage_index);
end
end
end
end
linear-algebra matrices matlab condition-number
This code below produces a 42 by 21 matrix called ohms_law_matrix given as input a random 6 by 7 matrix called u_matrix (last column is zeros).
How can I find an u_matrix which gives the smallest possible condition number for the ohms_law_matrix produced? Trying a gradient descent type algorithm I found one which gave condition number of 2.77, is there expected to exist a matrix which gives much smaller condition number then this? (1 would be nice).
index_matrix = [ 0, 1, 2, 3, 4, 5, 6; ...
1, 0, 7, 8, 9,10,11; ...
2, 7, 0,12,13,14,15; ...
3, 8,12, 0,16,17,18; ...
4, 9,13,16, 0,19,20; ...
5,10,14,17,19, 0,21; ...
6,11,15,18,20,21, 0];
u_matrix=[(rand(6,6)),[0,0,0,0,0,0]'];
ohms_law_matrix = zeros(42,21);
%Looping over rows in input.
for meas_row=1:6
%Looping over columns in input.
for el_col=1:7
current_index = el_col + (meas_row-1)*7;
for voltage_index=1:7
%Go from matrix form to vector form.
i = index_matrix(el_col, voltage_index);
if i %this m)eans (el_col ~= voltage_index)
ohms_law_matrix(current_index, i) = ...
u_matrix(meas_row, el_col)...
- u_matrix(meas_row, voltage_index);
end
end
end
end
linear-algebra matrices matlab condition-number
asked Jul 31 at 13:30
KALLE THE BAWSMAN
109113
109113
2
If you could express this in mathematical notation instead of requiring people to decipher what you are doing in that code, you'll be much more likely to get useful response.
â Paul Sinclair
Jul 31 at 23:23
add a comment |Â
2
If you could express this in mathematical notation instead of requiring people to decipher what you are doing in that code, you'll be much more likely to get useful response.
â Paul Sinclair
Jul 31 at 23:23
2
2
If you could express this in mathematical notation instead of requiring people to decipher what you are doing in that code, you'll be much more likely to get useful response.
â Paul Sinclair
Jul 31 at 23:23
If you could express this in mathematical notation instead of requiring people to decipher what you are doing in that code, you'll be much more likely to get useful response.
â Paul Sinclair
Jul 31 at 23:23
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2868043%2fproducing-a-matrix-with-minimal-condition-number%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
If you could express this in mathematical notation instead of requiring people to decipher what you are doing in that code, you'll be much more likely to get useful response.
â Paul Sinclair
Jul 31 at 23:23