Lower and upper bounds in optimization technique

Dear all
I have 28 variables, I want to put 14 variables with (lower bound (lb) and upper bound(ub)) and the 14 other without (lower bound (lb) and upper bound(ub))... How can I do that?
thank you in advance.

8 Commenti

How can I write two different number like
...
[0.05* (1,14) zero (1,14)
Is that coorect
Almost. It is necessary to supply the function names (and spell the function names correctly), and concatenate them using square brackets []
lb = [0.05*ones(1,14) zeros(1,14)]
lb = 1×28
0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0 0 0 0 0 0 0 0 0 0 0 0 0 0
I assume that the first term is supposed to call the ones function, and I completed this by supplying the right square bracket.
.
Thanks
If I want to use three not zeroes in right square bracket ? How?
I am not certain that I understand what you want, since ‘not zeroes’ can be anything.
Perhaps substituting Inf in the upper bound or -Inf in the lower bound could do what you want. So for example if you wanted the last three elements of ‘lb’ (in this example) to be -Inf do this —
lb = [0.05*ones(1,14) zeros(1,11) -Inf(1,3)]
lb = 1×28
0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0 0 0 0 0 0 0 0 0 0 0 -Inf -Inf -Inf
.
I mean
lb = [0.05* ones (1,14) three (1,14)]
how can I write the number of three
I was a bit mystified.
The same general idea —
lb = [0.05*ones(1,14) 3*ones(1,14)]
lb = 1×28
0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000 3.0000
.
As always, my pleasure!
.

Accedi per commentare.

 Risposta accettata

Create appropriate vectors for each bound. Specify the bounds for the parameters that have bounds, and +Inf and -Inf for those allowed to vary without bound.
.

4 Commenti

Can you write example ? please
A representative example (not for all 14 parameters) would be something like this —
lb = [2 3 2 1 -Inf -Inf]
ub = [10 4 5 7 +Inf +Inf]
So long as the upper bounds are greater than the lower bounds, this should work. The elements of each vector must correspond to the order of the parameters in the model, so here ‘p(1)’ would be allowed to vary between 2 and 10, while ‘p(6)’ would be essentially unbounded.
.
If I want to write the bounded variable as below
lb = 0.05 * (1,14)
ub = 1 * (1,14)
so how can I write the 14 other bound
First, it is not possible to use parentheses to create the vector. It is necessary to use square brackets to concatenate the elements of the vector into a single expression.
The correct way to write those would be something like this —
lb = 0.05 * ones(1,14)
lb = 1×14
0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500
ub = ones(1,14)
ub = 1×14
1 1 1 1 1 1 1 1 1 1 1 1 1 1
If the other 14 are not bounded:
lb = [0.05 * ones(1,14) -Inf(1,14)]
lb = 1×28
0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf
ub = [ones(1,14) Inf(1,14)]
ub = 1×28
1 1 1 1 1 1 1 1 1 1 1 1 1 1 Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
However if they have specific bounds that could not be defined by multiples of ones, additions to zeros, or something else, they would have to be entered individually, as I demonstrated earlier.
Also, optimising 28 parameters could be difficult.
.

Accedi per commentare.

Più risposte (0)

Prodotti

Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by