Runtime creation of constraints and optimization variable
Al momento, stai seguendo questa domanda
- Vedrai gli aggiornamenti nel tuofeed del contenuto seguito.
- Potresti ricevere delle e-mail a seconda delle tuepreferenze per le comunicazioni.
Si è verificato un errore
Impossibile completare l'azione a causa delle modifiche apportate alla pagina. Ricarica la pagina per vedere lo stato aggiornato.
0 voti
Condividi un link a questa domanda
Risposta accettata
0 voti
Condividi un link a questa risposta
- Kindly define the optimization variable ‘Q’
- Second step is to set up the constraints, since each row of “Q” is “g*P_i” and “P_i” is an “NxN” diagonal matrix, you can express “P_i” as a vector (since it's diagonal) and then multiply by g to get the row of “Q”. The Frobenius norm constraint on “P_i” is equivalent to constraining the 2-norm of the vector since “P_i” is diagonal.
- Then we need to define the objective function, Since you have not specified the objective function, I am considering a placeholder function(“myObjectiveFunction”).
- So we have our problem set up now, we will need to loop over different values of “T” to solve for each scenario.
- https://in.mathworks.com/help/optim/ug/optimvar.html%22
- https://in.mathworks.com/help/optim/ug/optimproblem.html%22
- https://in.mathworks.com/help/optim/examples.html?category=problem-based-basics&s_tid=CRUX_topnav%22
4 Commenti
Condividi un link a questo commento
- We loop over the array 'T_values' to solve the optimization problem for different values of 'T'.
- We define 'Q' and 'P_i' variables for each 'T' within the loop.
- We create a structure 'x0' to hold the initial conditions for each 'P_i'.
- We set an example initial condition for each 'P_i' as a vector of ones multiplied by sqrt(N/N). This is a simple starting point, and you might want to choose a more appropriate initial condition based on your specific problem.
- We pass the initial guess 'x0' to the 'solve' function to provide a starting point for the optimization.
Condividi un link a questo commento
Più risposte (0)
Categorie
Scopri di più su Surrogate Optimization in Centro assistenza e File Exchange
Tag
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
