Multivariate Nonlinear Problem With vector & matrix unknown inputs

3 次查看(过去 30 天)
Hello,
Problem description:
I have oil flow rate observed (qo_obs) and I have a model to calculate oil flow rate (qo_cal).
The model to find qo_cal is somewhat complex, and it invloved three unknowns: f, tau, and V.
f is a 9x16 matrix, tau is a 9x1 vector, V is a 9x1 vector.
each of the unkowns above has its own constraints, such as:
Sum of every column of f = 1, (How do I even write this constraint?)
any tau >0
0< V<C, where C is some constant I know.
Now I want to find the values of these unkowns that will yield minimum of (qo_obs-qo_cal)^2
What solver to use? and how?
Thanks,

采纳的回答

Matt J
Matt J 2019-9-21
编辑:Matt J 2019-9-21
It's very easy to set up all the variables and constraints with the problem-based approach.
f=optimvar('f',[9,16]);
tau=optimvar('tau',[9,1],'LowerBound',zeros(9,1));
V=optimvar('V',[9,1],'LowerBound',0,'UpperBound',C);
prob=optimproblem('ObjectiveSense','minimize');
prob.Constraints.fconstraint=sum(f)==1;
prob.Objective=_____________
Once you've defined your objective, just do
sol=solve(prob)
  14 个评论
Ahmed Ghamdi
Ahmed Ghamdi 2019-9-27
Thanks Matt,
my code is working fine, but fmincon takes 7 hours to run. Is this normal? Also, are there more advanced algorathims better than fmincon?
Matt J
Matt J 2019-9-27
There is no normal. It depends in part on how much time it takes to execute your Objective function code. I see in your code that you have done no vectorization at all - everything is done with for-loops. It is plausible to me that that would make execution time very long.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by