- About your first query. Yes, you are correct. In the given problem, the constraints on the minimizer x* are such that the elements of x* must be negative or equal to zero if they correspond to points inside the closed half-unit square R1. This means that any component of x* that corresponds to a point inside R1 must be less than or equal to zero.
- Secondly, to use the MATLAB function `find` to obtain the indices corresponding to points inside the closed half-unit square R1 = {1/2 ≤ s, t ≤ 1/2}, your ‘find’ function should return the indices of the points where the logical expression is true, indicating that those points are inside R1.
Constraints using the discrete Poisson's problem for Constrained Optimization
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am working on Constrained Optimization, using the Penalty Method, and then using Uzawa's algorithm.
I am looking to minimize the objective function f, given by
f = @(x) ( (1/2)*x'*A*x - x'*b + (1/4)*sum(x.^4) );
with A generated by the MATLAB command relative to the discrete Poisson’s problem -delta(u) = f in a 2-dimensional region R in or equal {1 <= x, y <= 1} u = 0 on the boundary of R.
function [A,b,N] = generate(n, c)
G = numgrid('S',n);
A = delsq(G);
N = length(A);
b = c*ones(N,1);
The constraints are such that x_i <= 0 whenever the index i corresponds to points in the closed half-unit square R1 = {1/2 <= s, t <= 1/2}.
Now, what I understood is that the constraints on the minimizer x* are such that elements of x*, which are x_i, must be negative or equal to zero, if they happen to be inside the half unit square. Right?
Moreover, how can I use the MATLAB function `find` to get these indices and write (or programme) my constraints to be able to write my algorithm (say, Uzawa's algorithm).
My m constraints should be summarized as vector phi: R^m to R, such that phi(x) = C*x - d <= 0.
If anyone could please help me make sense of all this. I am not a math student but I need to understand these for a thesis work in engineering. This is not an assignment.
0 Commenti
Risposte (1)
Rijuta
il 13 Set 2023
Hi Charbel,
I understand that you have questions regarding Constrained Optimization.
To achieve this, you can use an expression as below:
indices_inside_R1 = find(points_inside_R1(:, 1) >= 1/2 & points_inside_R1(:, 2) >= 1/2);
After executing this, the variable indices_inside_R1 will contain the indices of the points inside R1, which can be used to define the constraints in the optimization problem.
I hope this solves your queries.
0 Commenti
Vedere anche
Categorie
Scopri di più su Get Started with Optimization Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!