Writing Minimization Function to Find Multiple Vectors

I am currently try to write an objective function to solve the following problem:
E= True - R1' *S1 - R2' *S2 - R3' *S3
where the goal is to minimize E, and R1, R2, and R3 are all vectors, and S1 is a matrix that has as many rows as R1 has rows (and so on for S2 and S3). I am trying to solve for R1, R2, and R3, but am unsure what the correct function to use is. Additionally, I need to place restraints on R1. I have both the Optimization and Global Optimization toolbox available.
I'm new to the optimization coding, so any help is greatly appreciated. Thank you in advance

4 件のコメント

Matt J
Matt J 2021 年 4 月 12 日
編集済み: Matt J 2021 年 4 月 12 日
If the S_i are matrices (not vectors) that means that E is vector-valued, not scalar-valued? If so, what does it mean to "minimize" it?
Adam Rish
Adam Rish 2021 年 4 月 12 日
Apologies, I should've specified more. I am minimizing (E*E'), which gives a scalar value.
Matt J
Matt J 2021 年 4 月 12 日
And what is the form of the constraints on the R_i?
Adam Rish
Adam Rish 2021 年 4 月 12 日
The constraints are as follows: 0< R_i <1 And sum of R1=1

サインインしてコメントする。

 採用された回答

Matt J
Matt J 2021 年 4 月 12 日

0 投票

lsqlin is appropriate for this problem,

2 件のコメント

Matt J
Matt J 2021 年 4 月 12 日
編集済み: Matt J 2021 年 4 月 12 日
You may find prob2matrices(Download) helpful for setting some of this up,
R1=optimvar('R1',size(S1,2),'LowerBound',0,'UpperBound',1);
R2=optimvar('R2',size(S2,2),'LowerBound',0,'UpperBound',1);
R3=optimvar('R3',size(S3,2),'LowerBound',0,'UpperBound',1);
p=prob2matrices({R1,R2,R3},'Constraints', sum(R1)<=1);
Roptimal=lsqlin([S1,S2,S3],True(:), p.Aineq,p.bineq,[],[],p.lb,p.ub);
Adam Rish
Adam Rish 2021 年 4 月 13 日
Thank you for your advice, this was immensly helpful!

サインインしてコメントする。

その他の回答 (0 件)

質問済み:

2021 年 4 月 12 日

コメント済み:

2021 年 4 月 13 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by