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

Understanding bayesopt: 1: Why is the same point tested more than once? 2: Understanding acquisition function

If your objective function is smooth, then you should use fmincon as your optimizer, starting from a variety of initial points t...

Understanding bayesopt: 1: Why is the same point tested more than once? 2: Understanding acquisition function

If your objective function is smooth, then you should use fmincon as your optimizer, starting from a variety of initial points t...

2 hours ago | 0

Answered

Why does the rowsize of A matter in fmincon

You should not use all-zero rows in A or Aeq. Each such row specifies a linear constraint that does not, in fact, exist. fmincon...

Why does the rowsize of A matter in fmincon

You should not use all-zero rows in A or Aeq. Each such row specifies a linear constraint that does not, in fact, exist. fmincon...

2 hours ago | 1

| accepted

Answered

How to tune fmincon approximate gradient estimation in sqp algorithm

See, for example, the descriptions of FiniteDifferenceStepSize and FiniteDifferenceType in fmincon options. Alan Weiss MATLAB ...

How to tune fmincon approximate gradient estimation in sqp algorithm

See, for example, the descriptions of FiniteDifferenceStepSize and FiniteDifferenceType in fmincon options. Alan Weiss MATLAB ...

18 hours ago | 0

Answered

linprog() with many constraints

Did you try constr = (Pcap_w+Kw)*Ppu_w + Pcap_s*Ppu_s + Pcap_t*Ppu_t >= demand; prob.Constraints.constr = constr; Alan Weiss ...

linprog() with many constraints

Did you try constr = (Pcap_w+Kw)*Ppu_w + Pcap_s*Ppu_s + Pcap_t*Ppu_t >= demand; prob.Constraints.constr = constr; Alan Weiss ...

20 hours ago | 0

| accepted

Answered

How can I improve accuracy using PDE Toolbox

If your toolbox version were R2017a or earlier, the default mesh for 2-D geometry has linear elements. You can get improved accu...

How can I improve accuracy using PDE Toolbox

If your toolbox version were R2017a or earlier, the default mesh for 2-D geometry has linear elements. You can get improved accu...

13 days ago | 0

Answered

Using intlinprog to Minimize Combinations

Your problem formulation is incorrect in several respects. For example, your Aeq and beq arguments ensure that the solution must...

Using intlinprog to Minimize Combinations

Your problem formulation is incorrect in several respects. For example, your Aeq and beq arguments ensure that the solution must...

15 days ago | 1

| accepted

Answered

fmincon optimization option settings

To address this kind of issue, see Converged to an Infeasible Point. Alan Weiss MATLAB mathematical toolbox documentation

fmincon optimization option settings

To address this kind of issue, see Converged to an Infeasible Point. Alan Weiss MATLAB mathematical toolbox documentation

15 days ago | 0

Answered

Optimization Of Function, Curve Fitting

Please don't ask a new question as an answer. Instead, start a new question. But to answer your question, you have two typos: ...

Optimization Of Function, Curve Fitting

Please don't ask a new question as an answer. Instead, start a new question. But to answer your question, you have two typos: ...

15 days ago | 0

Answered

How to use multistart with 'fit' function

As documented, the only local solvers available for MultiStart are fmincon, fminunc, lsqcurvefit, and lsqnonlin. Sorry, no other...

How to use multistart with 'fit' function

As documented, the only local solvers available for MultiStart are fmincon, fminunc, lsqcurvefit, and lsqnonlin. Sorry, no other...

18 days ago | 0

| accepted

Answered

Optimize fminsearch behaviour for "very good" initial guess

You can read about the fminsearch algorithm here. The algorithm has no way to know that you started at a good point, and makes a...

Optimize fminsearch behaviour for "very good" initial guess

You can read about the fminsearch algorithm here. The algorithm has no way to know that you started at a good point, and makes a...

18 days ago | 1

| accepted

Answered

Multi objective optimisation with Genetic algorithms

If you have a Global Optimization Toolbox license, use gamultiobj. Alan Weiss MATLAB mathematical toolbox documentation

Multi objective optimisation with Genetic algorithms

If you have a Global Optimization Toolbox license, use gamultiobj. Alan Weiss MATLAB mathematical toolbox documentation

18 days ago | 0

| accepted

Answered

Particle Swarm Optimization info

The syntaxes for output functions differ between ga and particleswarm. For an example of a particleswarm output function, see th...

Particle Swarm Optimization info

The syntaxes for output functions differ between ga and particleswarm. For an example of a particleswarm output function, see th...

25 days ago | 1

| accepted

Answered

Will calling objective and constraints in the same function affects gamultiobj speed?

Sorry, yes, gamultiobj uses ga as a solver internally, so the procedure will not benefit your solution process. Alan Weiss MAT...

Will calling objective and constraints in the same function affects gamultiobj speed?

Sorry, yes, gamultiobj uses ga as a solver internally, so the procedure will not benefit your solution process. Alan Weiss MAT...

27 days ago | 0

Answered

Linprog Error - Matrix Coefficients are too Large

The default linprog algorithm is the same as a portion of the intlinprog algorithm, a dual-simplex method. For this algorithm, l...

Linprog Error - Matrix Coefficients are too Large

The default linprog algorithm is the same as a portion of the intlinprog algorithm, a dual-simplex method. For this algorithm, l...

27 days ago | 2

Answered

how to choose weight for one of functions in multi-objective genetic algorithm Tool-box?

Perhaps this example will help, especially the section Find Good Parameters from Plot. But if I misunderstood what you were ask...

how to choose weight for one of functions in multi-objective genetic algorithm Tool-box?

Perhaps this example will help, especially the section Find Good Parameters from Plot. But if I misunderstood what you were ask...

27 days ago | 0

Answered

Working with function handles to solve optimization problems for multiple equations: Basic questions

Perhaps consulting the example Symbolic Math Toolbox Calculates Gradients and Hessians or Using Symbolic Math with Optimization ...

Working with function handles to solve optimization problems for multiple equations: Basic questions

Perhaps consulting the example Symbolic Math Toolbox Calculates Gradients and Hessians or Using Symbolic Math with Optimization ...

1 month ago | 0

| accepted

Answered

Can anyone solve this? Find the shortest distance between the plane 3*x1+4*x2+x3=1 and the point (-1,1,1). (optimization problem?)

If you want to use an optimization technique, see Shortest Distance to a Plane. Alan Weiss MATLAB mathematical toolbox documen...

Can anyone solve this? Find the shortest distance between the plane 3*x1+4*x2+x3=1 and the point (-1,1,1). (optimization problem?)

If you want to use an optimization technique, see Shortest Distance to a Plane. Alan Weiss MATLAB mathematical toolbox documen...

1 month ago | 0

Answered

Linear Programming Code Not Working

I believe that this problem would be much easier to formulate using the problem-based approach rather than the solver-based appr...

Linear Programming Code Not Working

I believe that this problem would be much easier to formulate using the problem-based approach rather than the solver-based appr...

1 month ago | 2

Answered

Save all the optimization results from MultiStart and Global Search

Sorry, no, GlobalSearch and MultiStart do not consider the points corresponding to negative local exit flags as being solutions,...

Save all the optimization results from MultiStart and Global Search

Sorry, no, GlobalSearch and MultiStart do not consider the points corresponding to negative local exit flags as being solutions,...

1 month ago | 0

| accepted

Answered

fmincon requires only double

To transform symbolic variables into MATLAB functions, use matlabFunction, as shown in the examples Symbolic Math Toolbox Calcul...

fmincon requires only double

To transform symbolic variables into MATLAB functions, use matlabFunction, as shown in the examples Symbolic Math Toolbox Calcul...

1 month ago | 0

Answered

How to set up fmincon

Take a look at Optimize an ODE in Parallel. You probably need to specify a time at which the projectile hits the closest to the ...

How to set up fmincon

Take a look at Optimize an ODE in Parallel. You probably need to specify a time at which the projectile hits the closest to the ...

1 month ago | 0

Answered

Error meshing 2D geometry in Matlab R2018a

I do not know what the commands you were using do. Seriously, I simply do not understand them. But I went through the doc topic ...

Error meshing 2D geometry in Matlab R2018a

I do not know what the commands you were using do. Seriously, I simply do not understand them. But I went through the doc topic ...

1 month ago | 0

| accepted

Answered

Solving non linear equation for x

eqn = @(x) x.^2 .* log(0.4956./x) - (1-x).^2 .* log(0.47198./(1-x)); t = linspace(0.01,0.99); plot(t,eqn(t)) % Shows a single ...

Solving non linear equation for x

eqn = @(x) x.^2 .* log(0.4956./x) - (1-x).^2 .* log(0.47198./(1-x)); t = linspace(0.01,0.99); plot(t,eqn(t)) % Shows a single ...

1 month ago | 0

Answered

how-do-i-estimate-or-optimize-the-parameters-of-my-ode-45 system of equations?

Sorry, I don't understand what you said. What do you mean you "don't know how to give constraints in the optimisation toolbox fo...

how-do-i-estimate-or-optimize-the-parameters-of-my-ode-45 system of equations?

Sorry, I don't understand what you said. What do you mean you "don't know how to give constraints in the optimisation toolbox fo...

1 month ago | 0

Answered

Not Enough Input Arguments

Running your code with the input value 0.01 (for fixed) gives me a complex output. This might be the issue: your code can return...

Not Enough Input Arguments

Running your code with the input value 0.01 (for fixed) gives me a complex output. This might be the issue: your code can return...

2 months ago | 0

Answered

Estimation of parameters for curvefit using lsqcurvefit

Apparently, you are solving an ODE by forward Euler steps. Don't do that. It is both inaccurate and wasteful of computer time. I...

Estimation of parameters for curvefit using lsqcurvefit

Apparently, you are solving an ODE by forward Euler steps. Don't do that. It is both inaccurate and wasteful of computer time. I...

2 months ago | 0

Answered

Question about multiobjective optimization with several variable

Take a look at this example. Alan Weiss MATLAB mathematical toolbox documentation

Question about multiobjective optimization with several variable

Take a look at this example. Alan Weiss MATLAB mathematical toolbox documentation

2 months ago | 0

Answered

How can I define a constraint to my optimization problem?

Perhaps you would find it easier to follow the problem-based version of the example. It is indeed difficult to get the constrain...

How can I define a constraint to my optimization problem?

Perhaps you would find it easier to follow the problem-based version of the example. It is indeed difficult to get the constrain...

2 months ago | 0

Answered

I am getting the following error when I use fsolve "Equation solved, fsolve stalled....."

Well, fsolve arrived at a solution. If you plug the value that it returns, you see that it is a solution of the equation. If yo...

I am getting the following error when I use fsolve "Equation solved, fsolve stalled....."

Well, fsolve arrived at a solution. If you plug the value that it returns, you see that it is a solution of the equation. If yo...

2 months ago | 0

Answered

set fmincon function tolerance

If you check the fmincon options description you see the following for the OptimalityTolerance entry: Termination tolerance on ...

set fmincon function tolerance

If you check the fmincon options description you see the following for the OptimalityTolerance entry: Termination tolerance on ...

2 months ago | 0

| accepted