How to define objective for this optimization problem?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
My objective is:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/828465/image.png)
subject to:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/828315/image.png)
where k and h are two given vectors of size N. For this objective I tried:
x = optimvar('x',1,2,3,'LowerBound',0)
k = rand(100,1);
h = rand(100,1);
obj = sum((x(1) + x(2)/x(3) * (k.^(-x(3))-1) - h).^2,'all')
What is the proper way to define the objective? What's the best solver?
2 Commenti
Walter Roberson
il 9 Dic 2021
You appear to be using Problem Based Optimization rather than Solver Based.
We do not know what your z(3) is, but the context of the error message hints it might be one of your optimization variables.
Risposte (1)
Walter Roberson
il 9 Dic 2021
- x and y represent optimization arrays of arbitrary size (usually the same size).
- a is a scalar numeric constant.
Supported operations
- Pointwise power x.^a
Look through that list and notice that a.^x is not one of the supported operations. You cannot use problem-based optimization to take a constant to a power that is an optimization variable.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!