I write documentation for MATLAB mathematical toolboxes, primarily optimization. I have also written documentation for PDE, statistics, symbolic math, and econometrics.

My pre-MathWorks job was with Bell Labs, primarily in mathematical models of data traffic, with a strong interest in parallel computation and in rare events (large deviations).

I do not provide private consulting. If you have a question, please ask on a public forum such as MATLAB Answers.

Answered

what is the maximum population size handled by GA ? What are your advices for large MINLP problems?

General MINLP with over 100 variables are not solvable globally. How can I make this blanket statement? For a general MINLP with...

what is the maximum population size handled by GA ? What are your advices for large MINLP problems?

General MINLP with over 100 variables are not solvable globally. How can I make this blanket statement? For a general MINLP with...

22 hours ago | 0

| accepted

Answered

fitcsvm cross-validation

As shown in this doc example, the cross-validation loss is reported at the command line and plotted by default (I see that you t...

fitcsvm cross-validation

As shown in this doc example, the cross-validation loss is reported at the command line and plotted by default (I see that you t...

1 day ago | 0

| accepted

Answered

Start genetic algorithm more than once until solution is found

Of course, just write a loop. runon = true while runon % Call ga with option set to stop early if necessary % If you didn't ...

Start genetic algorithm more than once until solution is found

Of course, just write a loop. runon = true while runon % Call ga with option set to stop early if necessary % If you didn't ...

1 day ago | 0

Answered

This is for two variable optimization problem using conjugate gradient method but I need to modify the provided code below so that I can check any function having more than two variable lets say 5 variables. Please help me I am new in matlab.

See my answer here: https://www.mathworks.com/matlabcentral/answers/801106-someone-please-help-me-i-have-made-a-2-variable-code...

This is for two variable optimization problem using conjugate gradient method but I need to modify the provided code below so that I can check any function having more than two variable lets say 5 variables. Please help me I am new in matlab.

See my answer here: https://www.mathworks.com/matlabcentral/answers/801106-someone-please-help-me-i-have-made-a-2-variable-code...

1 day ago | 0

Answered

someone please help me. I have made a 2 variable code for optimization, I want code for "n" no. of variables.

It is probably a bit easier to write code for NUMERIC minimizaton of an arbitrary-sized expression than a hybrid SYMBOLIC minimi...

someone please help me. I have made a 2 variable code for optimization, I want code for "n" no. of variables.

It is probably a bit easier to write code for NUMERIC minimizaton of an arbitrary-sized expression than a hybrid SYMBOLIC minimi...

4 days ago | 0

Answered

Writing complicated equations for problem-based optimization

I think that you need to keep clear in your mind (and code) what is an optimization variable and what is an optimization express...

Writing complicated equations for problem-based optimization

I think that you need to keep clear in your mind (and code) what is an optimization variable and what is an optimization express...

4 days ago | 0

| accepted

Answered

3D Scatterplot and Pareto Front visualization

Did you try the scatteredinterpolant code from the answer? Modify it for your data: F = scatteredInterpolant(numbers(:,1),numbe...

3D Scatterplot and Pareto Front visualization

Did you try the scatteredinterpolant code from the answer? Modify it for your data: F = scatteredInterpolant(numbers(:,1),numbe...

5 days ago | 0

Answered

Nonlinear Constraints in Multijob optimization

Your constraints can be formulated as nonlinear constraints. Make sure that you read and follow the note on that page. Alan Wei...

Nonlinear Constraints in Multijob optimization

Your constraints can be formulated as nonlinear constraints. Make sure that you read and follow the note on that page. Alan Wei...

9 days ago | 0

Answered

Error with lsqnonlin : Error in lsqncommon (line 14) if any(~isfinite(initVals.F))

Apparently, some initial values are not finite. You gave a value of x0 so that your objective function evaluated at x0 gives som...

Error with lsqnonlin : Error in lsqncommon (line 14) if any(~isfinite(initVals.F))

Apparently, some initial values are not finite. You gave a value of x0 so that your objective function evaluated at x0 gives som...

11 days ago | 0

| accepted

Answered

Initial population in genetic algorithm

To get reproducible results, set the random number generator before you call ga. For example, rng default % or rng(1) or whate...

Initial population in genetic algorithm

To get reproducible results, set the random number generator before you call ga. For example, rng default % or rng(1) or whate...

12 days ago | 0

| accepted

Answered

how to solve this error: objective function is returning undefined values at initial point. fsolve cannot continue.

I suggest that you learn to use the debugger. I put a break point in the solve_nch function, and found that at the first functio...

how to solve this error: objective function is returning undefined values at initial point. fsolve cannot continue.

I suggest that you learn to use the debugger. I put a break point in the solve_nch function, and found that at the first functio...

12 days ago | 1

Answered

Matrix array in ga

I think that you are making a mistake by choosing the bitstring data type. Doing so loses the possibility of having constraints ...

Matrix array in ga

I think that you are making a mistake by choosing the bitstring data type. Doing so loses the possibility of having constraints ...

17 days ago | 0

| accepted

Answered

Optimisation Tool GA Custom Plot

Perhaps if you put the names of the functions in curly braces {} you would have success: {@gaplotbestf,@gaplotchange} But come...

Optimisation Tool GA Custom Plot

Perhaps if you put the names of the functions in curly braces {} you would have success: {@gaplotbestf,@gaplotchange} But come...

17 days ago | 0

| accepted

Answered

How can we insert upper and lower bounds in particle swarm optimization for more than one variable parameters that need to be optimized.

I am not sure that I understand you. You might be asking about bounding some control variables. Generally, all of your control v...

How can we insert upper and lower bounds in particle swarm optimization for more than one variable parameters that need to be optimized.

I am not sure that I understand you. You might be asking about bounding some control variables. Generally, all of your control v...

18 days ago | 1

Answered

How can we get the surrogate function after the optimisation?

The surrogate model is not available, sorry. Indeed, its quality as a surrogate is unknown, and may be poor. Can you please say...

How can we get the surrogate function after the optimisation?

The surrogate model is not available, sorry. Indeed, its quality as a surrogate is unknown, and may be poor. Can you please say...

23 days ago | 0

Answered

Nonlinear fitting: how do I split the linear and the nonlinear problems?

You should follow the example more closely. In the example the lambda variables only are declared to be optimization variables; ...

Nonlinear fitting: how do I split the linear and the nonlinear problems?

You should follow the example more closely. In the example the lambda variables only are declared to be optimization variables; ...

23 days ago | 1

| accepted

Answered

why does this code give an error ( Undefined function or variable 'ObjectiveFunction'. Error in psi_kozhin (line 44) Swarm.Particles(k).O = fobj(currentX); )?

I do not see where you defined ObjectiveFunction. Is it on your MATLAB path? Alan Weiss MATLAB mathematical toolbox documentat...

why does this code give an error ( Undefined function or variable 'ObjectiveFunction'. Error in psi_kozhin (line 44) Swarm.Particles(k).O = fobj(currentX); )?

I do not see where you defined ObjectiveFunction. Is it on your MATLAB path? Alan Weiss MATLAB mathematical toolbox documentat...

1 month ago | 0

Answered

Find minimum of multi-variable function on fixed interval with additional parameter inputs

You need to pass the parameters correctly. See Passing Extra Parameters. In your case, you need to either nest the function in a...

Find minimum of multi-variable function on fixed interval with additional parameter inputs

You need to pass the parameters correctly. See Passing Extra Parameters. In your case, you need to either nest the function in a...

1 month ago | 0

| accepted

Answered

Genetic Algorithm: Plot ONLY best fitness value, not mean.

You could try using this slightly modified plot function, gaplotbestf2: (I modified it slightly from gaplotbestf) function stat...

Genetic Algorithm: Plot ONLY best fitness value, not mean.

You could try using this slightly modified plot function, gaplotbestf2: (I modified it slightly from gaplotbestf) function stat...

1 month ago | 0

Answered

Fitting nonlinear noisy data

Most likely the issue is that there are multiple local minima, as in this example: Nonlinear Data-Fitting Using Several Problem-...

Fitting nonlinear noisy data

Most likely the issue is that there are multiple local minima, as in this example: Nonlinear Data-Fitting Using Several Problem-...

1 month ago | 1

Answered

Explanation of hyperparameter tuning procedure for regression tree ensembles

You can find all the information later on in that same reference page: Hyperparameter Optimization Options Alan Weiss MATLAB ...

Explanation of hyperparameter tuning procedure for regression tree ensembles

You can find all the information later on in that same reference page: Hyperparameter Optimization Options Alan Weiss MATLAB ...

1 month ago | 0

Answered

Fitting procedure using MultiStart - doesn't recognize objective function

I think that you need to have just one input variable, typically called x, and have each of your other named variables be a comp...

Fitting procedure using MultiStart - doesn't recognize objective function

I think that you need to have just one input variable, typically called x, and have each of your other named variables be a comp...

1 month ago | 0

Answered

Optimization toolbox with ode45

I guess that I would make a minimization problem for Y(end,2)^2. I don't know what your parameters are, but you can use fminbnd ...

Optimization toolbox with ode45

I guess that I would make a minimization problem for Y(end,2)^2. I don't know what your parameters are, but you can use fminbnd ...

1 month ago | 0

Answered

Surrogate Optimization Error: 'Dimensions of arrays being concatenated are not consistent'

You say "Do not mind the AdiabaticReactor function" but I cannot tell what sizes the inputs and outputs are for the objconstrAdi...

Surrogate Optimization Error: 'Dimensions of arrays being concatenated are not consistent'

You say "Do not mind the AdiabaticReactor function" but I cannot tell what sizes the inputs and outputs are for the objconstrAdi...

1 month ago | 0

Answered

Error: Complex values are not supported

I don't know where your objective function creates complex values, though I suspect that one or more of your logarithm calls has...

Error: Complex values are not supported

I don't know where your objective function creates complex values, though I suspect that one or more of your logarithm calls has...

1 month ago | 0

| accepted

Answered

How to find optimum complex weighting coefficients for antenna beam pattern optimisation? A purely optimisation problem

fmincon requires real values only. Convert your complex-valued problem to twice as many real variables. For an example, see Fit ...

How to find optimum complex weighting coefficients for antenna beam pattern optimisation? A purely optimisation problem

fmincon requires real values only. Convert your complex-valued problem to twice as many real variables. For an example, see Fit ...

1 month ago | 0

Answered

system of nonlinear equations

Do you have Optimization Toolbox™ installed? Check by running the ver command. You might need to install or reinstall. Alan Wei...

system of nonlinear equations

Do you have Optimization Toolbox™ installed? Check by running the ver command. You might need to install or reinstall. Alan Wei...

1 month ago | 0

| accepted

Answered

Nonlinear fitting depends too heavily on starting points

You might find some relevant information here or here. The point is that fitting problems typically have multiple local optima, ...

Nonlinear fitting depends too heavily on starting points

You might find some relevant information here or here. The point is that fitting problems typically have multiple local optima, ...

1 month ago | 0

| accepted

Answered

Genetic Algorithm to Find desired parameters.

You might want to spend a little time reading up on the genetic algorithm: Genetic Algorithm Terminology How the Genetic Algor...

Genetic Algorithm to Find desired parameters.

You might want to spend a little time reading up on the genetic algorithm: Genetic Algorithm Terminology How the Genetic Algor...

1 month ago | 0

Answered

I am working on an optimization problem which has 60 optimization variables to get minimum objective function. which solver would be best for this problem? right now I am using multistart with fmincon.

If your problem is smooth and you are looking for a global minimum, then those sound like the right choices, See Table for Choos...

I am working on an optimization problem which has 60 optimization variables to get minimum objective function. which solver would be best for this problem? right now I am using multistart with fmincon.

If your problem is smooth and you are looking for a global minimum, then those sound like the right choices, See Table for Choos...

1 month ago | 2