回答済み

How can I implement a constraint on any subset of columns in a matrix optimisation variable?

You need to use some of the ideas in Integer and Logical Modeling. Create an auxiliary binary variable tf the same size as resul...

How can I implement a constraint on any subset of columns in a matrix optimisation variable?

You need to use some of the ideas in Integer and Logical Modeling. Create an auxiliary binary variable tf the same size as resul...

約2ヶ月 前 | 0

| 採用済み

回答済み

How am I getting higher values for my objective function from a global search based on fmincon than I did from fmincon alone?

This does seem strange. If you look at the algorithm description in How GlobalSearch and MultiStart Work, you see that GlobalSea...

How am I getting higher values for my objective function from a global search based on fmincon than I did from fmincon alone?

This does seem strange. If you look at the algorithm description in How GlobalSearch and MultiStart Work, you see that GlobalSea...

約2ヶ月 前 | 0

| 採用済み

回答済み

why there is a different value between the latest Fval and the Optimal Solution that Fmincon gives me

The answer is correct to within tolerances. Generally, you cannot expect an answer that is correct down to the last few decimal ...

why there is a different value between the latest Fval and the Optimal Solution that Fmincon gives me

The answer is correct to within tolerances. Generally, you cannot expect an answer that is correct down to the last few decimal ...

約2ヶ月 前 | 0

| 採用済み

回答済み

Solve problem of choice of resistor

To allow this code to work, I copy over your data. % Power source source_V = 5; % voltage of the power source source_I...

Solve problem of choice of resistor

To allow this code to work, I copy over your data. % Power source source_V = 5; % voltage of the power source source_I...

約2ヶ月 前 | 0

| 採用済み

回答済み

Link between Genetic Algorithm ga and Simulink

I am no expert in Simulink®, but perhaps some documented examples might show how to link (Global) Optimization Toolbox solvers t...

Link between Genetic Algorithm ga and Simulink

I am no expert in Simulink®, but perhaps some documented examples might show how to link (Global) Optimization Toolbox solvers t...

2ヶ月 前 | 0

回答済み

Optimization Problem but don't have closed form expression

This seems like a straightforward problem using either the Problem-Based Optimization Workflow or the solver-based approach. As ...

Optimization Problem but don't have closed form expression

This seems like a straightforward problem using either the Problem-Based Optimization Workflow or the solver-based approach. As ...

2ヶ月 前 | 1

| 採用済み

回答済み

How to solve the error "Conversion to logical from optim.problemdef.OptimizationConstraint is not possible!"

You probably need to formulate your constraints according to the procedures in Integer and Logical Modeling. Alan Weiss MATLAB...

How to solve the error "Conversion to logical from optim.problemdef.OptimizationConstraint is not possible!"

You probably need to formulate your constraints according to the procedures in Integer and Logical Modeling. Alan Weiss MATLAB...

2ヶ月 前 | 0

| 採用済み

回答済み

How do I interpret the results from Multistart?

Here is how to interpret the results. I assume that the local solver is fmincon. The local exitflag is the exit flag from fminc...

How do I interpret the results from Multistart?

Here is how to interpret the results. I assume that the local solver is fmincon. The local exitflag is the exit flag from fminc...

2ヶ月 前 | 1

| 採用済み

回答済み

LaGrange Multiplier constrain with discretised functions

I think that you are making a mistake by trying to use symbolic variables here. If I understand what you are trying to do, you ...

LaGrange Multiplier constrain with discretised functions

I think that you are making a mistake by trying to use symbolic variables here. If I understand what you are trying to do, you ...

3ヶ月 前 | 0

回答済み

How to check the FMINCON feasibility correctly

If you look at the documentation for fmincon iterative display, you see: Feasibility: Maximum constraint violation, where satis...

How to check the FMINCON feasibility correctly

If you look at the documentation for fmincon iterative display, you see: Feasibility: Maximum constraint violation, where satis...

3ヶ月 前 | 1

回答済み

How can I apply bayesopt to my Simulink model?

As the documentation states, the objective function accepts a 1-by-D table of values, where D is the number of variables. So you...

How can I apply bayesopt to my Simulink model?

As the documentation states, the objective function accepts a 1-by-D table of values, where D is the number of variables. So you...

3ヶ月 前 | 1

| 採用済み

回答済み

Implement parameter constraint for surrogateopt

The answer depends on your MATLAB version. As the Release Notes show, linear constraints were introduced in R2021a, nonlinear co...

Implement parameter constraint for surrogateopt

The answer depends on your MATLAB version. As the Release Notes show, linear constraints were introduced in R2021a, nonlinear co...

3ヶ月 前 | 0

| 採用済み

回答済み

How to constrain fmincon unknowns to itself

Or maybe with linear constraints: A = [1 1 -1 -1]; b = 0; unknowns = fmincon(@(x)fun(x),initial,A,b,[],[],lb,ub) What do the...

How to constrain fmincon unknowns to itself

Or maybe with linear constraints: A = [1 1 -1 -1]; b = 0; unknowns = fmincon(@(x)fun(x),initial,A,b,[],[],lb,ub) What do the...

3ヶ月 前 | 0

| 採用済み

回答済み

Global variables are forbidden in parallel multistart optimization

There are other ways to pass variables other than declariig them as global. See Passing Extra Parameters. Alan Weiss MATLAB ma...

Global variables are forbidden in parallel multistart optimization

There are other ways to pass variables other than declariig them as global. See Passing Extra Parameters. Alan Weiss MATLAB ma...

3ヶ月 前 | 1

| 採用済み

回答済み

Can I use "xxx.m" file for object function in GA tool

Please report the MATLAB version you are using, such as R2019a. It makes a difference, because, for example, the Optimization ap...

Can I use "xxx.m" file for object function in GA tool

Please report the MATLAB version you are using, such as R2019a. It makes a difference, because, for example, the Optimization ap...

3ヶ月 前 | 1

回答済み

Hardstop intlinprog & return the current solutions

You don't have to call prob2struct to solve your problem. Just call [sol,fval] = solve(prob,'Options',opts) Now, what should o...

Hardstop intlinprog & return the current solutions

You don't have to call prob2struct to solve your problem. Just call [sol,fval] = solve(prob,'Options',opts) Now, what should o...

3ヶ月 前 | 0

| 採用済み

回答済み

How can I use lsqcurvefit with a look-up table search as the objective function? Currently, the initial guess always is identified as a local minimum.

To use lsqcurvefit your function needs to be defined and differentiable for continuous values of p. It looks to me as if your fu...

How can I use lsqcurvefit with a look-up table search as the objective function? Currently, the initial guess always is identified as a local minimum.

To use lsqcurvefit your function needs to be defined and differentiable for continuous values of p. It looks to me as if your fu...

3ヶ月 前 | 0

回答済み

optimising variables in for loop

It is not clear to me whether you want to minimize q_backup(k) for one particular value of k or for all k from 1 to 145. Genera...

optimising variables in for loop

It is not clear to me whether you want to minimize q_backup(k) for one particular value of k or for all k from 1 to 145. Genera...

3ヶ月 前 | 0

回答済み

Fsolve Intemidiate equations result

You could use persistent variables along with assignin to write the variaible value to a workspace variable. Something like this...

Fsolve Intemidiate equations result

You could use persistent variables along with assignin to write the variaible value to a workspace variable. Something like this...

3ヶ月 前 | 0

回答済み

Supplied objective function must return a scalar value

You have a misconception about what linear constraints mean and what a scalar objective function is. Linear constraints do NOT t...

Supplied objective function must return a scalar value

You have a misconception about what linear constraints mean and what a scalar objective function is. Linear constraints do NOT t...

3ヶ月 前 | 0

回答済み

How to limit optimization program to choose only natural integers numbers (not float) if my objective function is not linear?

If you have Global Optimization Toolbox you can use Mixed Integer ga Optimization. Alan Weiss MATLAB mathematical toolbox docu...

How to limit optimization program to choose only natural integers numbers (not float) if my objective function is not linear?

If you have Global Optimization Toolbox you can use Mixed Integer ga Optimization. Alan Weiss MATLAB mathematical toolbox docu...

3ヶ月 前 | 0

| 採用済み

回答済み

Why does the fmincon optimization give a slightly different solution in MATLAB 2019B as compared to 2020B?

Many things change in each version. The usual issue is that the underlying math libraries can have slight differences. Optimizat...

Why does the fmincon optimization give a slightly different solution in MATLAB 2019B as compared to 2020B?

Many things change in each version. The usual issue is that the underlying math libraries can have slight differences. Optimizat...

3ヶ月 前 | 0

回答済み

hi, i have a problem with ga function. the problem is: Caused by: Failure in initial user-supplied nonlinear constraint function evaluation.

I believe that the error is here: function [c, ceq] = nlc(x) for j=1:320 c(1) = -sum(x(1,:)) +(320/43.65); ...

hi, i have a problem with ga function. the problem is: Caused by: Failure in initial user-supplied nonlinear constraint function evaluation.

I believe that the error is here: function [c, ceq] = nlc(x) for j=1:320 c(1) = -sum(x(1,:)) +(320/43.65); ...

3ヶ月 前 | 0

| 採用済み

回答済み

optimization of matrices with random initialization

You would probably do well to use the Problem-Based Optimization Workflow. But you can just as easily change your current soluti...

optimization of matrices with random initialization

You would probably do well to use the Problem-Based Optimization Workflow. But you can just as easily change your current soluti...

3ヶ月 前 | 0

回答済み

How can I implement an "if" in optimization problem?

Yoou might be able to find some techniques in the new documentation topic Integer and Logical Modeling. Alan Weiss MATLAB math...

How can I implement an "if" in optimization problem?

Yoou might be able to find some techniques in the new documentation topic Integer and Logical Modeling. Alan Weiss MATLAB math...

3ヶ月 前 | 0

| 採用済み

回答済み

Linear fitting with 2 variables

I think that the Problem-Based Optimization Workflow would help. Write your optimization variables a, b, and c as you have done,...

Linear fitting with 2 variables

I think that the Problem-Based Optimization Workflow would help. Write your optimization variables a, b, and c as you have done,...

3ヶ月 前 | 1

回答済み

replicating excel solver using optimization linprog

I think that you would probably have an easier time formulating your problem by using the Problem-Based Optimization Workflow. ...

replicating excel solver using optimization linprog

I think that you would probably have an easier time formulating your problem by using the Problem-Based Optimization Workflow. ...

3ヶ月 前 | 0

| 採用済み

回答済み

problem using GA to optimize an image processing index in MATLAB?

I suspect that the problem is your objective function takes too long, possibly it does not even finish. I assume that you have ...

problem using GA to optimize an image processing index in MATLAB?

I suspect that the problem is your objective function takes too long, possibly it does not even finish. I assume that you have ...

3ヶ月 前 | 0

回答済み

Trying to solve Bethe equations - system of non linear equations

You are the unfortunate victim of a naming discrepancy. The fsolve you linked is for Optimization Toolbox, not Symbolic Math sym...

Trying to solve Bethe equations - system of non linear equations

You are the unfortunate victim of a naming discrepancy. The fsolve you linked is for Optimization Toolbox, not Symbolic Math sym...

3ヶ月 前 | 0

回答済み

How to use ObjectiveCutOff and ObjectiveImprovementThreshold from optimoptions in solver-based optimization problems

I think that you have a mistaken view of what these options do. Consult the options to see what they really do. I don't think th...

How to use ObjectiveCutOff and ObjectiveImprovementThreshold from optimoptions in solver-based optimization problems

I think that you have a mistaken view of what these options do. Consult the options to see what they really do. I don't think th...

3ヶ月 前 | 0

| 採用済み