Answered
Doubts in genetic algorithm (Using toolbox)
# Use normal default MATLAB variables, not any other type. # The mixed-integer solver, as its name suggests, is MIXED-integer, ...

8 years ago | 0

| accepted

Answered
What is the correction of error: Failure in initial user-supplied objective function evaluation. PARTICLESWARM cannot continue?
Without reading your code, I can tell you that your initial swarm contained at least one point that led to a NaN or Inf or compl...

8 years ago | 1

| accepted

Answered
Get access to all the population members of one generation (Multi-objective optimization - gamultiobj)
I am not sure that I understand how you are passing information between MATLAB and COMSOL, but if you are using a parallel netwo...

8 years ago | 0

Answered
How can I implement constraints of x1 not equal to x2 in intlinprog ?
I'm not sure that this is the best approach, but I think that it is a correct approach. Assume that |x1| and |x2| are each bound...

8 years ago | 1

Answered
Can fgoalattain recover from NaN values in function derivatives?
The |fgoalattain| algorithm is based on the |fmincon 'active-set'| algorithm, which does not recover gracefully from |NaN| value...

8 years ago | 1

| accepted

Answered
hide message for fmincon
Set the |Display| option to |'none'|. Make sure to pass the options to |fmincon|. Alan Weiss MATLAB mathematical toolbox d...

8 years ago | 0

Answered
Plot Slice of pdeplot3D
Did you look at the <https://www.mathworks.com/help/pde/ug/plot-3-d-solutions.html examples in the documentation>? There is one ...

8 years ago | 0

| accepted

Answered
Problem Based approach for Mixed Integer Linear Programming problem fails to produce any feasible solution.
To check whether the bounds and linear constraints are inconsistent, see <https://www.mathworks.com/help/optim/ug/when-the-solve...

8 years ago | 0

Answered
for loop for gradient nested within objective function of fmincon
It looks to me as if your gradient should have 10 elements. Did you declare all those variables global in the workspace? Mayb...

8 years ago | 0

| accepted

Answered
Want Less "Noisy" Solution from fmincon
It seems to me that you are looking for a global optimum, but you are likely getting stuck in local optima. So I would suggest t...

8 years ago | 0

| accepted

Answered
I am using GA tool in Matlab and after running the optimize tool I got the error Optimization running.
The error means that your fitness function returns a vector or matrix instead of a scalar value. In other words, |Y = simple_fit...

8 years ago | 0

Answered
Export geometry out of model container
Your <https://www.mathworks.com/help/pde/ug/pde.pdemodel.html |PDEModel|> object has a |Mesh| property that is a <https://www.ma...

8 years ago | 0

Answered
lsqnonlin stops early issue
The problem seems to be poor scaling. The speed of light is awfully large, so the times are miniscule. I suggest that you set...

8 years ago | 1

Answered
Undefined function '[function name] ' for input arguments of type 'double'.
Sometimes you need to change the finite difference step size, as explained in <https://www.mathworks.com/help/optim/ug/optimizin...

8 years ago | 0

| accepted

Answered
Using factorial in optimiztion toolbox
Do you really need to know the factorial of those large numbers? Or would it be sufficient to know the logarithm of the numbers?...

8 years ago | 0

| accepted

Answered
What dimension is measured by the output of the traveling salesman function?
You need to ask the person who wrote the code what the output means. We cannot possibly know how anyone implemented an algorithm...

8 years ago | 0

Answered
I would like to implement special restrictions to the intcon usage for ga optimization.
Set a linear constraint |x(1) + x(2) + x(3) <= 3/2|. In other words, A = [1,1,1]; b = 3/2; See the <https://www.mathw...

8 years ago | 0

| accepted

Answered
i have generated mesh for elliptical domain(2d) using pde tool box , how to get these node points coordinates of mesh generated?
It depends how you generated the mesh: * |generateMesh| -- examine the |Nodes| property of the |FEMesh| object in the |PDEMod...

8 years ago | 0

| accepted

Answered
how to solve the following expression in matlab optimization tool
This looks like a job for <https://www.mathworks.com/help/optim/ug/fmincon.html |fmincon|> with the objective function as you wr...

8 years ago | 0

| accepted

Answered
How can I optimize a two-reservoir system in Matlab with linear constraints specific to each reservoir but one objective function?
Your linear constraints can apply to whatever variables you want. For example, if you have a vector |x = (x(1),...,x(n))| and yo...

8 years ago | 1

Answered
How to plot the search path in patternsearch to find the minima?
Take a look at <https://www.mathworks.com/help/gads/examples/pattern-search-climbs-mount-washington.html Pattern Search Climbs M...

8 years ago | 0

Answered
Error message using function fminunc
The error is clear. Try to evaluate |fun_1938(param0_1938)| and you will find that it throws an error. Investigate the error usi...

8 years ago | 0

Answered
Is there a way to plot a subset of the surfaces, with Face labels, using pdegplot?
I certainly feel your pain. But, at the moment, I believe that there is no built-in way to do what you want. Alan Weiss MA...

8 years ago | 0

Answered
I need to maximize an objective function using genetic algorithm but the toolbox fails to do so. Can you help ?
Is your problem inherently nonlinear? If you can express your objective and constraints as linear functions, then you would doub...

8 years ago | 0

Answered
Multiobjective GA pareto front
There are no built-in plot functions for that many objective functions. You will have to figure out by yourself how you want to ...

8 years ago | 0

Answered
link ODE45 solver with the optimization toolbox
<https://www.mathworks.com/help/gads/optimize-an-ode-in-parallel.html Here is an example>. Alan Weiss MATLAB mathematical ...

8 years ago | 0

Answered
How to use IF statement to filter out FSOLVE failed solutions in a loop?
Ask for more outputs from |fsolve|. If the returned |<https://www.mathworks.com/help/optim/ug/fsolve.html#buta__s-exitflag exitf...

8 years ago | 0

| accepted

Answered
How can I label faces and edges of my model using dsg in pde toolbox?
The only way that I know to make the labels refer to things reproducibly is to construct your geometry using a <https://www.math...

8 years ago | 0

| accepted

Answered
How to solve a nonlinear optimization problem using fmincon
The only thing that occurs to me is that you have no bounds on your variables. This is usually a mistake, especially for a probl...

8 years ago | 0

Answered
how I transfer a multi-objective optimization ( F1 F2) to a mono-objective optimization f ??
Usually you would optimize fun = @(x)-A*F1(x) + (1-A)*F2(x) where |A| is a number from 0 through 1. When |A| = 0 this is...

8 years ago | 0

Load more