Finding Transpose of Matrix in GAMS and solving data reconciliation problem

904 views
Skip to first unread message

suryanarayana kolluri

unread,
May 18, 2012, 12:00:27 PM5/18/12
to gams...@googlegroups.com
Hi All,

I am new to GAMS, I have to solve a DATA RECONCILIATION problem to some chemical engineering example.
My MINLP Optimization Problem is

Min f(x)

Such that,

S_hat = S - SA'PAS
P(ASA') = I

where
A is Matrix came from Material Balance of the System
A' is Transpose of A
S is Co-variance Matrix
P is a Continuous Variable
S_hat is diagonal elements of matrix
I is identity matrix
for example :

A = [1  -1  -1  0;
       0   0   1 -1];

can find transpose of A directly in GAMS?

S = [x1*s1+y1*10, 0,0,0 ;
        0,
x2*s2+y2*10,0,0 ;
        0,0,
x3*s3+y3*10,0 ;
        0,0,0,
x4*s4+y4*10];

 
P = [p11, 0;
       p21,p22];

By matrix multiplication, can i get constraints for expressions S_hat = S - SA'PAS and P(ASA') = I.

I would be great help if anyone can help for giving me an idea.


Thanks and Regards
Suryanarayana
PhD Student
IIT Bombay

Edson Cordeiro do Valle

unread,
May 18, 2012, 5:05:16 PM5/18/12
to gams...@googlegroups.com
   Hello Suryanarayana

I have some experience with data reconciliation and I would like to know where are your integer variables come from, since in typical Dara reconciliation problems, no integer variables are present, by your formulation I can't see them and why are you trying to use it.

To do matrix multiplications, transposes and inverse other package can be used, as matlab and scilab (the last one is free).
Regarding the use of Scilab, I've developed a framework in this tool for data reconcilation and gross error detection ( https://code.google.com/p/dr-ged-benchmarks/ ), where you can find the implementations and behchmark test problems.
I know this is not a Scilab forum, but I'm suggesting this tool since I've tried to use Gams in the past and found Matlab/Scilab more helpfull.

Any doubts you can contact me by this personal e-mail.

Regards


2012/5/18 suryanarayana kolluri <snk....@gmail.com>

--
You received this message because you are subscribed to the Google Groups "gamsworld" group.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



--
       Edson Valle
eds...@gmail.com

yan ren

unread,
May 18, 2012, 11:46:46 PM5/18/12
to gams...@googlegroups.com
> can find transpose of A directly in GAMS?

parameter A(i,j), At(j,i);

...

At(j,i) = A(i.j) should work.

> S = [x1*s1+y1*10, 0,0,0 ;
>         0,x2*s2+y2*10,0,0 ;
>         0,0,x3*s3+y3*10,0 ;
>         0,0,0,x4*s4+y4*10];
>
>
> P = [p11, 0;
>        p21,p22];
>
> By matrix multiplication, can i get constraints for expressions S_hat = S -
> SA'PAS and P(ASA') = I.
>

matrix muliplication for C = A* B
parameter A(i,k) , B(k,j) ,C(i,j) ;

C(i,j ) = sum(k, A(i,k)* B(k,j))


HTH,

Yan

任彦

unread,
May 20, 2012, 12:59:59 PM5/20/12
to gamsworld
> To do matrix multiplications, transposes and inverse other package can be used, as matlab and scilab (the last one is free).
> Regarding the use of Scilab, I've developed a framework in this tool for data reconcilation and gross error detection ( https://code.google.com/p/dr-ged-benchmarks/ ), where > you can find the implementations and behchmark test problems.
> I know this is not a Scilab forum, but I'm suggesting this tool since I've tried to use Gams in the past and found Matlab/Scilab more helpfull.
I had some terriable experience rewrote in GAMS some reonciliation code written in matlab.
matrix multiplications utillities in GMAS does sucks ... sometimes I have to unload GAMS 2D parameter into gdx file and call lapack myself.

Yan

Edson Cordeiro do Valle

unread,
May 21, 2012, 7:26:55 AM5/21/12
to gams...@googlegroups.com
   Hello Suryanarayana

As
Yan.ren said in the GAMS list, the transpose and the matrix multiplication in GAMS is pretty straightforward.
I think you won't have dificulties in do it. If you have, send me your Gams code.

Regards

2012/5/20 任彦 <yan...@enintech.com>
--
You received this message because you are subscribed to the Google Groups "gamsworld" group.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.




--
       Edson Valle
eds...@gmail.com

Azadeh Maroufmashat

unread,
Jun 10, 2014, 6:04:24 PM6/10/14
to gams...@googlegroups.com
Hi Every body!
can we eneter the transpos of one variable in equation set in GAMS?

Renger van Nieuwkoop

unread,
Jun 11, 2014, 3:26:58 AM6/11/14
to gams...@googlegroups.com

Hi Azadeh

 

If you want for example to multiply matrix A with the transpose of it you just use PROD()

 

Prod((i,j), A(i,j)*A(j,i))

 

Cheers

Renger

 

____________________

Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

In...@modelworks.ch

blog.modelworks.ch

--

You received this message because you are subscribed to the Google Groups "gamsworld" group.

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.


To post to this group, send email to gams...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages