Nonlinear optimization of a matrix with the costraint to be orthonormal
up vote
1
down vote
favorite
I'm trying to find the matrix x which minimize the following cost function :
$J =||B_b -x*B_n||^2$
with the constraint that x has to be an orthonormal matrix.
I'm trying to use MATLAB fmincon tool, but I'm kind of stucked in how to pose the problem to the solver. What I did up until now is writing an objective function like this :
function f=objfun(x)
B_b = [8.53086963374351e-06,-1.56083520340848e-06,2.62167147268028e-05];
B_n = [-8.53086963374351e-06,1.56083520340848e-06,2.62167147268028e-05];
f = (norm(B_b' - x*B_n'))^2; % Cost function
The costraints can be expressed as :
$det(x) = 1$
$trace(I-x'x) = 0 $
Where I is the identity matrix.
But I don't get how to write them for MATLAB's fmincon.
Can someone help me to realize what I'm doing wrong in posing the problem to MATLAB and how I can express the costraint to solve this costrained problem ?
optimization convex-optimization matlab nonlinear-optimization numerical-optimization
New contributor
add a comment |
up vote
1
down vote
favorite
I'm trying to find the matrix x which minimize the following cost function :
$J =||B_b -x*B_n||^2$
with the constraint that x has to be an orthonormal matrix.
I'm trying to use MATLAB fmincon tool, but I'm kind of stucked in how to pose the problem to the solver. What I did up until now is writing an objective function like this :
function f=objfun(x)
B_b = [8.53086963374351e-06,-1.56083520340848e-06,2.62167147268028e-05];
B_n = [-8.53086963374351e-06,1.56083520340848e-06,2.62167147268028e-05];
f = (norm(B_b' - x*B_n'))^2; % Cost function
The costraints can be expressed as :
$det(x) = 1$
$trace(I-x'x) = 0 $
Where I is the identity matrix.
But I don't get how to write them for MATLAB's fmincon.
Can someone help me to realize what I'm doing wrong in posing the problem to MATLAB and how I can express the costraint to solve this costrained problem ?
optimization convex-optimization matlab nonlinear-optimization numerical-optimization
New contributor
fmincon works on vectors, so have your function transform the vector to a matrix (reshape) as the first step in evaluating the function values
– LinAlg
Dec 1 at 14:06
You can add the constraint into cost function instead of using a solver that can handle constraints. Just add norm(x'*x-I)^2 or something like it.
– mathreadler
Dec 1 at 14:22
@LinAlg if fmincon works on vectors, why I have to reshape the vector into a matrix ?
– Francescodario Cuzzocrea
Dec 1 at 14:41
@mathreadler you mean to add norm(x'*x-eye(3))^2 == 0; det(x) == 1; before defining f ?
– Francescodario Cuzzocrea
Dec 1 at 14:43
No binary comparisons. Just +norm(x'$*$x-eye(3))^2 . It will behave better with any calculus based solver and probably other solvers also. Maybe you need 1e3$*$ in front of also.
– mathreadler
Dec 1 at 17:04
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm trying to find the matrix x which minimize the following cost function :
$J =||B_b -x*B_n||^2$
with the constraint that x has to be an orthonormal matrix.
I'm trying to use MATLAB fmincon tool, but I'm kind of stucked in how to pose the problem to the solver. What I did up until now is writing an objective function like this :
function f=objfun(x)
B_b = [8.53086963374351e-06,-1.56083520340848e-06,2.62167147268028e-05];
B_n = [-8.53086963374351e-06,1.56083520340848e-06,2.62167147268028e-05];
f = (norm(B_b' - x*B_n'))^2; % Cost function
The costraints can be expressed as :
$det(x) = 1$
$trace(I-x'x) = 0 $
Where I is the identity matrix.
But I don't get how to write them for MATLAB's fmincon.
Can someone help me to realize what I'm doing wrong in posing the problem to MATLAB and how I can express the costraint to solve this costrained problem ?
optimization convex-optimization matlab nonlinear-optimization numerical-optimization
New contributor
I'm trying to find the matrix x which minimize the following cost function :
$J =||B_b -x*B_n||^2$
with the constraint that x has to be an orthonormal matrix.
I'm trying to use MATLAB fmincon tool, but I'm kind of stucked in how to pose the problem to the solver. What I did up until now is writing an objective function like this :
function f=objfun(x)
B_b = [8.53086963374351e-06,-1.56083520340848e-06,2.62167147268028e-05];
B_n = [-8.53086963374351e-06,1.56083520340848e-06,2.62167147268028e-05];
f = (norm(B_b' - x*B_n'))^2; % Cost function
The costraints can be expressed as :
$det(x) = 1$
$trace(I-x'x) = 0 $
Where I is the identity matrix.
But I don't get how to write them for MATLAB's fmincon.
Can someone help me to realize what I'm doing wrong in posing the problem to MATLAB and how I can express the costraint to solve this costrained problem ?
optimization convex-optimization matlab nonlinear-optimization numerical-optimization
optimization convex-optimization matlab nonlinear-optimization numerical-optimization
New contributor
New contributor
New contributor
asked Dec 1 at 12:37
Francescodario Cuzzocrea
61
61
New contributor
New contributor
fmincon works on vectors, so have your function transform the vector to a matrix (reshape) as the first step in evaluating the function values
– LinAlg
Dec 1 at 14:06
You can add the constraint into cost function instead of using a solver that can handle constraints. Just add norm(x'*x-I)^2 or something like it.
– mathreadler
Dec 1 at 14:22
@LinAlg if fmincon works on vectors, why I have to reshape the vector into a matrix ?
– Francescodario Cuzzocrea
Dec 1 at 14:41
@mathreadler you mean to add norm(x'*x-eye(3))^2 == 0; det(x) == 1; before defining f ?
– Francescodario Cuzzocrea
Dec 1 at 14:43
No binary comparisons. Just +norm(x'$*$x-eye(3))^2 . It will behave better with any calculus based solver and probably other solvers also. Maybe you need 1e3$*$ in front of also.
– mathreadler
Dec 1 at 17:04
add a comment |
fmincon works on vectors, so have your function transform the vector to a matrix (reshape) as the first step in evaluating the function values
– LinAlg
Dec 1 at 14:06
You can add the constraint into cost function instead of using a solver that can handle constraints. Just add norm(x'*x-I)^2 or something like it.
– mathreadler
Dec 1 at 14:22
@LinAlg if fmincon works on vectors, why I have to reshape the vector into a matrix ?
– Francescodario Cuzzocrea
Dec 1 at 14:41
@mathreadler you mean to add norm(x'*x-eye(3))^2 == 0; det(x) == 1; before defining f ?
– Francescodario Cuzzocrea
Dec 1 at 14:43
No binary comparisons. Just +norm(x'$*$x-eye(3))^2 . It will behave better with any calculus based solver and probably other solvers also. Maybe you need 1e3$*$ in front of also.
– mathreadler
Dec 1 at 17:04
fmincon works on vectors, so have your function transform the vector to a matrix (reshape) as the first step in evaluating the function values
– LinAlg
Dec 1 at 14:06
fmincon works on vectors, so have your function transform the vector to a matrix (reshape) as the first step in evaluating the function values
– LinAlg
Dec 1 at 14:06
You can add the constraint into cost function instead of using a solver that can handle constraints. Just add norm(x'*x-I)^2 or something like it.
– mathreadler
Dec 1 at 14:22
You can add the constraint into cost function instead of using a solver that can handle constraints. Just add norm(x'*x-I)^2 or something like it.
– mathreadler
Dec 1 at 14:22
@LinAlg if fmincon works on vectors, why I have to reshape the vector into a matrix ?
– Francescodario Cuzzocrea
Dec 1 at 14:41
@LinAlg if fmincon works on vectors, why I have to reshape the vector into a matrix ?
– Francescodario Cuzzocrea
Dec 1 at 14:41
@mathreadler you mean to add norm(x'*x-eye(3))^2 == 0; det(x) == 1; before defining f ?
– Francescodario Cuzzocrea
Dec 1 at 14:43
@mathreadler you mean to add norm(x'*x-eye(3))^2 == 0; det(x) == 1; before defining f ?
– Francescodario Cuzzocrea
Dec 1 at 14:43
No binary comparisons. Just +norm(x'$*$x-eye(3))^2 . It will behave better with any calculus based solver and probably other solvers also. Maybe you need 1e3$*$ in front of also.
– mathreadler
Dec 1 at 17:04
No binary comparisons. Just +norm(x'$*$x-eye(3))^2 . It will behave better with any calculus based solver and probably other solvers also. Maybe you need 1e3$*$ in front of also.
– mathreadler
Dec 1 at 17:04
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Francescodario Cuzzocrea is a new contributor. Be nice, and check out our Code of Conduct.
Francescodario Cuzzocrea is a new contributor. Be nice, and check out our Code of Conduct.
Francescodario Cuzzocrea is a new contributor. Be nice, and check out our Code of Conduct.
Francescodario Cuzzocrea is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3021281%2fnonlinear-optimization-of-a-matrix-with-the-costraint-to-be-orthonormal%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
fmincon works on vectors, so have your function transform the vector to a matrix (reshape) as the first step in evaluating the function values
– LinAlg
Dec 1 at 14:06
You can add the constraint into cost function instead of using a solver that can handle constraints. Just add norm(x'*x-I)^2 or something like it.
– mathreadler
Dec 1 at 14:22
@LinAlg if fmincon works on vectors, why I have to reshape the vector into a matrix ?
– Francescodario Cuzzocrea
Dec 1 at 14:41
@mathreadler you mean to add norm(x'*x-eye(3))^2 == 0; det(x) == 1; before defining f ?
– Francescodario Cuzzocrea
Dec 1 at 14:43
No binary comparisons. Just +norm(x'$*$x-eye(3))^2 . It will behave better with any calculus based solver and probably other solvers also. Maybe you need 1e3$*$ in front of also.
– mathreadler
Dec 1 at 17:04