How to solve minimization problem for matrix system

17 views (last 30 days)
I have a system of matrices and I need to solve minimization problem.
Please see the matrix in the attached Word document.
Also attached is my code
The whole code is to calculate the values for the matrix system. This part I already did.
The matrix system is this C1*A1*x1 + C2*A2*x2 = B
C1 and C2 are scalar constants.
A1 and A2 are matrices of size (3 by 4).
x1 and x2 are matrices of size (4 by 1).
B is a matrix of size (3 by 1).
All the elements are known values calculated in the code, except elements of [x2] and the last element of matrix B. "B(3,1)"
Matrix [x2]: The number of elements of matrix [x2] are four but actually they are only three variables because x2(2,1) and x2(3,1) are the same variable 'delta_a'. These variables in the code are ('delta_a', 'delta_c', 'delta_t') defined in line 178. The values of the elements of matrix x2 can be constrained in a range of integers from (-5) to (+5).
The required minimization is for the variable (Di) in matrix B in line 183.
Please see attached matrix and code.
Musab

Accepted Answer

Torsten
Torsten on 18 Jan 2018
Edited: Torsten on 18 Jan 2018
And you are sure that one of the 11*11*11 combinations of possible values for alpha, beta and gamma give you the prescribed values of B(1,1) and B(2,1) ?
If this is the case, just test the 11*11*11 combinations and see which of the feasible ones give you a minimal B(3,1).
Best wishes
Torsten.
  4 Comments
Yaser
Yaser on 19 Jan 2018
Thank you Torsen
I applied your suggestion on my code.
The code is only producing the same initial setting values:
minimum = 1e6;
delta_a_min = -10.0;
delta_c_min = -10.0;
delta_t_min = -10.0;
Please see attached code. Minimisation started at line 190. The variable names are different in the code that what was presented in my question above.
I appreciate any helpful solution
Torsten
Torsten on 19 Jan 2018
Edited: Torsten on 19 Jan 2018
You use "monimum" instead of "minimum", "delat_a_min" instead of "delta_a_min", "delat_c_min" instead of "delta_c_min" and "delat_t_min" instead of "delta_t_min" as variable names.
If the code still reproduces the initial settings, there does not seem to be a combination of alpha, beta and gamma that makes x(1)=50000 and x(2)=0.
Best wishes
Torsten.

Sign in to comment.

More Answers (1)

John D'Errico
John D'Errico on 18 Jan 2018
A bit confusing to say the least. First, you tell us that x2 is a MATRIX of size 4x1. Then you talk about element x(2,2)? I can only assume you meant to write x2 there, because there is no variable x. You are also a bit sloppy, in that in some places you understand that B will be a column vector, thus of size 3x1, but in other places, you talk about B(1,3).
Anyway, it seems that x2 has 3 unknowns in it. They can take on only integer values -5 to 5. Just generate all possible combinations of those levels (use ndgrid to do so) and test the result. This will require only a matrix multiplication. WTP?
Essentially, you will create an array for x2 that is 4x1331. That will result in 1331 possible results. Pick the one that makes you happy.
Note that you say nothing about the requirement that elements B(1) and B(2) must match? So are these exact equality constraints? What if no solution exists? This is possible since x2 is constrained to live on a restricted set of integers.
  1 Comment
Yaser
Yaser on 18 Jan 2018
yes you are right I corrected the question the value to minimize is B(3,1). and the variables that match are x2(2,1) and x(3,1)

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!