Rule for Determinant of a General Size Matrix

57 views
Skip to first unread message

Kennedy Putra

unread,
Jul 13, 2018, 8:52:22 AM7/13/18
to Pyomo Forum
Hi All,

I have a Pyomo model of a simple lab-scale chemical process. I am trying to conduct a model-based design of experiments. It involves solving an optimization problem with an objective function that is equal to the determinant of something called the Fisher Information Matrix; it is by definition is a (square) symmetric matrix. I have completed the model, and also evaluated the elements of the matrix. 

The problem is that I cannot figure out a way to code in a rule for the objective function. This is because the number of kinetic parameters of the chemical process varies between each problem. The different number of kinetic parameters means that the size of the matrix varies. And I want a general rule function that can evaluate the determinant of my matrix for any number of kinetic parameters. I feel that it is possible to define a general rule function to evaluate the determinant of an arbitrary size matrix in Pyomo, it is just that I cannot come up with the formula.

My question is (i) if you guys can help me come up with the general formula, or (ii) point it out to me if I can use numpy's pre-written function to evaluate determinant and optimize my problem, or (iii) any other methods to solve my problem.

Many thanks for all your time, and any replies will be greatly appreciated.

I have attached my .py file containing my model and .dat the data for the model, I feel that it should not be necessary to understand the problem. But, it will be there for reference, in case it is needed.

Kind regards,

Kennedy
Case_Study_1_MBDOE.py
Data_6.dat

Anas Musah

unread,
Jul 13, 2018, 10:24:40 AM7/13/18
to pyomo...@googlegroups.com
I haven't gone through your files currently because I am replying through my phone which cannot support the attached files.

But I think you can try this idea: 
set the size of the dimension of the matrix (say n=size(of your input data), so that anytime an instance of the model is created, it ll automatically generate matrix of n size.

Hope this is helpful 

--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kennedy Putra

unread,
Jul 15, 2018, 5:10:25 PM7/15/18
to Pyomo Forum
Hi Anas,

Thanks for your reply!

I may not have explained the problem very well. I actually have no problem evaluating and storing the elements of the matrix. And I believe that Pyomo has a built-in feature that uses sets and indices that allows me to do what you suggested.

The problem is in generating a rule that evaluates the determinant of a general size matrix.

I hope this clarifies what my original question is. I am still looking for answers.

Many thanks,

Kennedy
Reply all
Reply to author
Forward
0 new messages