Optimisation using fmincon (constraints)
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I have a function I would like to optimize it but this function has multi varabiles (T & c2 )
The objectives is to identify the minimum V
I did the following
q = 30;
c1i = 5;
x0 = 0;
lb = 300;
[T,V] = fmincon(V,x0,A,b,Aeq,beq,lb,ub);
how can I insert the (c1o) constraint & work out the c2
0 件のコメント
回答 (1 件)
Ameer Hamza
2020 年 3 月 7 日
You can solve for multiple variables, but all of them need to be elements of x. See how in the following example. the objective function V is changed
q = 30;
c1i = 5;
c1o = 1; % HERE IS MY PROBLEM
c2 = 4; % HERE IS MY PROBLEM
A = [];
b = [];
Aeq = [];
beq = [];
x0 = [1 500 1];
lb = [-inf -inf -inf];
ub = [1.143 inf inf];
k1 = @(x) 7.0*(10^15)*exp(-15075/x);
k2= @(x) 2.86*(10^4)*exp(-5025/x);
V = @(x) q*(c1i-x(1))./(x(1)*k1(x(2))-x(3)*k2(x(2))); % c1o => x(1), T => x(2), c2 => x(3)
[T,V] = fmincon(V,x0,A,b,Aeq,beq,lb,ub);
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with Optimization Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!