Answered

Determinant of the Jacobian as a constraint couldn't avoid atan2(x,y) get into negative.

While I do not know what you are really doing, you should know that nonlinear constraints are not satisfied at intermediate iter...

Determinant of the Jacobian as a constraint couldn't avoid atan2(x,y) get into negative.

While I do not know what you are really doing, you should know that nonlinear constraints are not satisfied at intermediate iter...

10 months ago | 1

| accepted

Answered

Genetic algorithm takes too much time to solve _ only linear objective and constraints

You say that you have a linear objective function and linear and integer constraints. In that case, you should not use the gene...

Genetic algorithm takes too much time to solve _ only linear objective and constraints

You say that you have a linear objective function and linear and integer constraints. In that case, you should not use the gene...

10 months ago | 1

Answered

Arrays have incompatible sizes for this operation error

You are mixing up the two approaches, problem-based and solver-based. You cannot do that. You have x and y defined as optimizati...

Arrays have incompatible sizes for this operation error

You are mixing up the two approaches, problem-based and solver-based. You cannot do that. You have x and y defined as optimizati...

10 months ago | 0

Answered

how to Plot convergence of Simulated annealing optimization problem?

Perhaps you want to collect the cost as a vector that you can then plot. Something like this: % Put this line immediately after...

how to Plot convergence of Simulated annealing optimization problem?

Perhaps you want to collect the cost as a vector that you can then plot. Something like this: % Put this line immediately after...

10 months ago | 0

Answered

Very small feasibility value but very large first-order optimality value

This is a very interesting issue; I have never seen anything quite like it before. Apparently, you are providing gradients for b...

Very small feasibility value but very large first-order optimality value

This is a very interesting issue; I have never seen anything quite like it before. Apparently, you are providing gradients for b...

10 months ago | 0

| accepted

Answered

Arrays have incompatible sizes for this operation error

It looks like the issue is that ai is not 36-by-36. You probably want something like ai = repmat(ai,1,36); z= (-1)*sum(x.*rij....

Arrays have incompatible sizes for this operation error

It looks like the issue is that ai is not 36-by-36. You probably want something like ai = repmat(ai,1,36); z= (-1)*sum(x.*rij....

10 months ago | 0

Answered

How to input mixed positive integer variable to "gamultiobj" fitness function?

If your MATLAB version is R2021b or later, you can use integer constraints in gamultiobj. For details, see the function referenc...

How to input mixed positive integer variable to "gamultiobj" fitness function?

If your MATLAB version is R2021b or later, you can use integer constraints in gamultiobj. For details, see the function referenc...

10 months ago | 0

Answered

How to introduce constraints to my objective function (Genetic Algorithm)

You have at least two errors that keep the constraint function from working properly. First, this section needs a loop such as f...

How to introduce constraints to my objective function (Genetic Algorithm)

You have at least two errors that keep the constraint function from working properly. First, this section needs a loop such as f...

11 months ago | 0

| accepted

Answered

Problem training Gaussian process with 'ardsquaredexponential' kernel function using bayesopt

As stated in the documentation for OptimizeHyperparameters: "KernelScale cannot be optimized for any of the ARD kernels." Alan...

Problem training Gaussian process with 'ardsquaredexponential' kernel function using bayesopt

As stated in the documentation for OptimizeHyperparameters: "KernelScale cannot be optimized for any of the ARD kernels." Alan...

11 months ago | 1

| accepted

Answered

Optimization completed because the size of the gradient is less than the value of the optimality tolerance.

I think that you are mistaking the exit message for the solution. The solution resides in the p variable that the solver returns...

Optimization completed because the size of the gradient is less than the value of the optimality tolerance.

I think that you are mistaking the exit message for the solution. The solution resides in the p variable that the solver returns...

11 months ago | 1

Answered

I am doing Genetic algorithm for optimisation , but it is very slowly optimising, 1st itteration is not complete since 5hours but it is showing optimisation running.

ga is a slow algorithm. Most likely you have nonlinear constraints, which makes the algorithm even slower. If you do not have in...

I am doing Genetic algorithm for optimisation , but it is very slowly optimising, 1st itteration is not complete since 5hours but it is showing optimisation running.

ga is a slow algorithm. Most likely you have nonlinear constraints, which makes the algorithm even slower. If you do not have in...

11 months ago | 0

Answered

Get best hyperparameters for ionosphere data using fitcecoc & bayesopt. but i am getting error optimizableVariable.

I do not understand why you are attempting to use fitcecoc with a 2-class model. Try this instead: load ionosphere mdl = fitcs...

Get best hyperparameters for ionosphere data using fitcecoc & bayesopt. but i am getting error optimizableVariable.

I do not understand why you are attempting to use fitcecoc with a 2-class model. Try this instead: load ionosphere mdl = fitcs...

11 months ago | 0

| accepted

Answered

How to solve "Conversion to logical from optim.problemdef.OptimizationInequality is not possible." for logical statement for variable.

You need to take care of logical constraints using a roundabout sort of modeling construct. The documentation is here: Integer a...

How to solve "Conversion to logical from optim.problemdef.OptimizationInequality is not possible." for logical statement for variable.

You need to take care of logical constraints using a roundabout sort of modeling construct. The documentation is here: Integer a...

11 months ago | 0

Answered

fmincon pause after 2 iterations when using gradients

I don't know for sure, but MATLAB has a just-in-time compiler that does indeed make a sort of cache for code that is repeatedly ...

fmincon pause after 2 iterations when using gradients

I don't know for sure, but MATLAB has a just-in-time compiler that does indeed make a sort of cache for code that is repeatedly ...

11 months ago | 0

| accepted

Answered

lsqnonlin projectBox error when using OutputFcn

The error is because optimValues.residual is a vector, not a scalar. Possibly you want to write norm(optimValues.residual). Ala...

lsqnonlin projectBox error when using OutputFcn

The error is because optimValues.residual is a vector, not a scalar. Possibly you want to write norm(optimValues.residual). Ala...

11 months ago | 0

Answered

How can I ensure the nonlinear constraints are met before running the objective function?

You are in luck: all of your "nonlinear" constraints are, in fact, linear constraints. Simply rewrite your constraints as linear...

How can I ensure the nonlinear constraints are met before running the objective function?

You are in luck: all of your "nonlinear" constraints are, in fact, linear constraints. Simply rewrite your constraints as linear...

11 months ago | 1

| accepted

Answered

When I'm using the fmincon function to solve an optimization problem，the optimization result is always near the initial value. How to avoid this situation?

There is a documentation section about this issue: Final Point Equals Initial Point. There is also the possibility that you are ...

When I'm using the fmincon function to solve an optimization problem，the optimization result is always near the initial value. How to avoid this situation?

There is a documentation section about this issue: Final Point Equals Initial Point. There is also the possibility that you are ...

11 months ago | 0

Answered

How can I use Genetic Algorithm toolbox to calibrate a model?

It is entirely possible that I have misunderstood your question in some way. Feel freee to ask again with more explanation if my...

How can I use Genetic Algorithm toolbox to calibrate a model?

It is entirely possible that I have misunderstood your question in some way. Feel freee to ask again with more explanation if my...

11 months ago | 0

Answered

Optimization for differential equations and measuring points

You might find the following examples relevant: Fit ODE, Problem-Based Fit an Ordinary Differential Equation (ODE) Alan Weiss...

Optimization for differential equations and measuring points

You might find the following examples relevant: Fit ODE, Problem-Based Fit an Ordinary Differential Equation (ODE) Alan Weiss...

12 months ago | 0

Answered

pass double symbolic expression to paretosearch

It depends on how you created your symbolic expressions. If you have two expressions, say obj1 and obj2, then two runs of matla...

pass double symbolic expression to paretosearch

It depends on how you created your symbolic expressions. If you have two expressions, say obj1 and obj2, then two runs of matla...

12 months ago | 0

| accepted

Answered

How can I using fmincon on both vector variables and matrix variables

You might enjoy the problem-based approach, which does not require you to put all variables into one. Alan Weiss MATLAB mathem...

How can I using fmincon on both vector variables and matrix variables

You might enjoy the problem-based approach, which does not require you to put all variables into one. Alan Weiss MATLAB mathem...

12 months ago | 0

| accepted

Answered

The StartPoint of Curve Fitting of the Function f(x)=a*exp(-x/b)+c

I think that your data is very small, about order 1e-8 instead of order 1. Here is a little script I knocked together that seems...

The StartPoint of Curve Fitting of the Function f(x)=a*exp(-x/b)+c

I think that your data is very small, about order 1e-8 instead of order 1. Here is a little script I knocked together that seems...

12 months ago | 0

Answered

Optimize the more than one variable in bayesopt

I believe that the error is in this line: [y_pred,~] = predict(model,x.opt_v); The software passes a table of values in x, wit...

Optimize the more than one variable in bayesopt

I believe that the error is in this line: [y_pred,~] = predict(model,x.opt_v); The software passes a table of values in x, wit...

12 months ago | 0

| accepted

Answered

How to generate the objconstr for multivariate surrogate optimization with nonlinear constraints?

Try this: obj = matlabFunction(symbolic_objective_function,'vars',{x}); constr = matlabFunction(symbolic_nonlinear_constraints...

How to generate the objconstr for multivariate surrogate optimization with nonlinear constraints?

Try this: obj = matlabFunction(symbolic_objective_function,'vars',{x}); constr = matlabFunction(symbolic_nonlinear_constraints...

12 months ago | 0

| accepted

Answered

problem with solving system of differential equations

If you are willing to have a numerical solution, rather than a symbolic solution, then using fsolve along with ode45 can work. T...

problem with solving system of differential equations

If you are willing to have a numerical solution, rather than a symbolic solution, then using fsolve along with ode45 can work. T...

12 months ago | 0

Answered

How Can I improve the result of Surrogateopt Optimization?

Is your initial point Xint feasible? In other words, does it satisfy Xint >= lb Xint <= ub Aeq*Xint' = beq A*Xint' <= b f.I...

How Can I improve the result of Surrogateopt Optimization?

Is your initial point Xint feasible? In other words, does it satisfy Xint >= lb Xint <= ub Aeq*Xint' = beq A*Xint' <= b f.I...

12 months ago | 0

Answered

How does the Surrogateopt function consider nonlinear integer constraints?

Your "nonlinear" inequality constraints are, in fact, linear inequality constraints. I suggest that you express them as linear c...

How does the Surrogateopt function consider nonlinear integer constraints?

Your "nonlinear" inequality constraints are, in fact, linear inequality constraints. I suggest that you express them as linear c...

12 months ago | 0

| accepted

Answered

Is it possible to make create custom InitialPopulation for N simulation iterates of genetic algorithm w/o resetting optimoptions N times?

You can use a custom creation function. As you probably know, this function can have the syntax function Population = myfun(Gen...

Is it possible to make create custom InitialPopulation for N simulation iterates of genetic algorithm w/o resetting optimoptions N times?

You can use a custom creation function. As you probably know, this function can have the syntax function Population = myfun(Gen...

12 months ago | 0

| accepted

Answered

Failure in initial objective function evaluation. FSOLVE cannot continue

I think that you are missing parameters: function res = lista1b_fct(x) Tee = x(1); Cee = x(2); res(1) = q*Cf - q*Cee - V*k0*...

Failure in initial objective function evaluation. FSOLVE cannot continue

I think that you are missing parameters: function res = lista1b_fct(x) Tee = x(1); Cee = x(2); res(1) = q*Cf - q*Cee - V*k0*...

12 months ago | 0

Answered

How to define a binary variable as part of constraints in the optimization problem(fmincon)?

fmincon does not accept binary constraints, or any integer constraints. The only solvers that accept a nonlinear objective funct...

How to define a binary variable as part of constraints in the optimization problem(fmincon)?

fmincon does not accept binary constraints, or any integer constraints. The only solvers that accept a nonlinear objective funct...

12 months ago | 0

| accepted