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

Problem with non-linear least squares fit to a non-linear model function using Gauss-Newtons method

I suggest that you try to follow the example Curve Fitting via Optimization. If you have an Optimization Toolbox license, you wo...

Problem with non-linear least squares fit to a non-linear model function using Gauss-Newtons method

I suggest that you try to follow the example Curve Fitting via Optimization. If you have an Optimization Toolbox license, you wo...

2 days ago | 0

Answered

Is fmincon correct for this problem?

I see that you define a quantity Y in your nonlinear constraint expression, but you don't seem to use it. Was this an oversight?...

Is fmincon correct for this problem?

I see that you define a quantity Y in your nonlinear constraint expression, but you don't seem to use it. Was this an oversight?...

2 days ago | 0

Answered

Error when using fminsearch to find least squares fit of data using a given equation

I suggest that you use the debugger. Alan Weiss MATLAB mathematical toolbox documentation

Error when using fminsearch to find least squares fit of data using a given equation

I suggest that you use the debugger. Alan Weiss MATLAB mathematical toolbox documentation

4 days ago | 0

Answered

is there a gradient based and mixed integer optimization algorithm in Matlab?

No, the only two solvers for nonlinear integer-constrained problems are ga and surrogateopt, neither of which is gradient-based....

is there a gradient based and mixed integer optimization algorithm in Matlab?

No, the only two solvers for nonlinear integer-constrained problems are ga and surrogateopt, neither of which is gradient-based....

4 days ago | 0

Answered

penalty fitness value not changing

There may be only one feasible point that ga found. Alan Weiss MATLAB mathematical toolbox documentation

penalty fitness value not changing

There may be only one feasible point that ga found. Alan Weiss MATLAB mathematical toolbox documentation

4 days ago | 0

Answered

fsolve function give poor results for multiple equations

I wasn't able to find a very good answer either. I'm not sure that one exists. I think that lsqnonlin is a more appropriate solv...

fsolve function give poor results for multiple equations

I wasn't able to find a very good answer either. I'm not sure that one exists. I think that lsqnonlin is a more appropriate solv...

9 days ago | 0

Answered

How to use "fmincon" function to find the minimum of a function with nonlinear constraints

I think that you are on the right track using fmincon. See the function reference page for details. Also, there is a topic on ho...

How to use "fmincon" function to find the minimum of a function with nonlinear constraints

I think that you are on the right track using fmincon. See the function reference page for details. Also, there is a topic on ho...

9 days ago | 0

| accepted

Answered

Three inequality constraints for multi-objective genetic algorithm

These are linear constraints, so you should not use a nonlinear constraint function (which has errors in signs in any case: you ...

Three inequality constraints for multi-objective genetic algorithm

These are linear constraints, so you should not use a nonlinear constraint function (which has errors in signs in any case: you ...

16 days ago | 0

| accepted

Answered

symbolic matrices optimization with fmincon

I was able to modify your program to run. I don't know if it is correct, but at least it runs. chi= rand(4,4) %% for example s...

symbolic matrices optimization with fmincon

I was able to modify your program to run. I don't know if it is correct, but at least it runs. chi= rand(4,4) %% for example s...

25 days ago | 0

| accepted

Answered

How can I require an optimization function to only consider a step successful if it decreases the cost function by a user-defined amount?

I think that you can accomplish what you want by using a custom search function. The syntax of a search function is function [s...

How can I require an optimization function to only consider a step successful if it decreases the cost function by a user-defined amount?

I think that you can accomplish what you want by using a custom search function. The syntax of a search function is function [s...

25 days ago | 0

Answered

What are the limitations for gamultiobj

There is no built-in limitation to either the number of variables or the number of objectives. Depending on your software versio...

What are the limitations for gamultiobj

There is no built-in limitation to either the number of variables or the number of objectives. Depending on your software versio...

25 days ago | 0

Answered

How to Iteratively optimise an equation [OPTIMTOOLBOX]

Are you asking how to write a loop in MATLAB or how to store the results? This is just a sketch, it is missing some values, but ...

How to Iteratively optimise an equation [OPTIMTOOLBOX]

Are you asking how to write a loop in MATLAB or how to store the results? This is just a sketch, it is missing some values, but ...

25 days ago | 0

Answered

MultiStart Parallel processing doubt

I am not an expert in MATLAB parallel computation, but I believe that generally the answer is no to both of your questions. Whil...

MultiStart Parallel processing doubt

I am not an expert in MATLAB parallel computation, but I believe that generally the answer is no to both of your questions. Whil...

25 days ago | 0

Answered

Set hessian function only once for fmincon

It seems to me that if you are changing the problem Hessian at each iteration then you will have to change the fmincon Hessian a...

Set hessian function only once for fmincon

It seems to me that if you are changing the problem Hessian at each iteration then you will have to change the fmincon Hessian a...

1 month ago | 1

| accepted

Answered

how to define sqrt in Optimization?

I'm not sure what you are talking about. If you are trying to extend the problem-based method, then the short answer is you are ...

how to define sqrt in Optimization?

I'm not sure what you are talking about. If you are trying to extend the problem-based method, then the short answer is you are ...

2 months ago | 0

Answered

Restriction of upper and lower boundary values to single decimal place in GA.

You are free to use Mixed Integer ga Optimization and have your integer problem variables be ten times your real variables. Ala...

Restriction of upper and lower boundary values to single decimal place in GA.

You are free to use Mixed Integer ga Optimization and have your integer problem variables be ten times your real variables. Ala...

2 months ago | 1

| accepted

Answered

Is it possible before to run the optimization with GA or whatever meta-heuristic methods (algorihtm of optimization) you can choose or define the step or the increment of the bound of variables ?

You are free to use Mixed Integer ga Optimization and define your resulting variables as, for example, integer/100 or integer/20...

Is it possible before to run the optimization with GA or whatever meta-heuristic methods (algorihtm of optimization) you can choose or define the step or the increment of the bound of variables ?

You are free to use Mixed Integer ga Optimization and define your resulting variables as, for example, integer/100 or integer/20...

2 months ago | 1

Answered

Constrained Non linear least squares returns equation parameters much different from true set

I don't know exactly where your error is, but I reworked your code, and in my reworked version lsqnonlin returns the correct ans...

Constrained Non linear least squares returns equation parameters much different from true set

I don't know exactly where your error is, but I reworked your code, and in my reworked version lsqnonlin returns the correct ans...

2 months ago | 0

| accepted

Answered

Using derivatives function, diff and GA toolbox

You don't show any code, so my answer might be irrelevant. Are you using diff as a symbolic derivative or as a standard MATLAB ...

Using derivatives function, diff and GA toolbox

You don't show any code, so my answer might be irrelevant. Are you using diff as a symbolic derivative or as a standard MATLAB ...

2 months ago | 0

| accepted

Answered

Why isn't parallel computing taking place when using MADS search methods in patternsearch?

I think that you might have a slight misunderstanding of what some options mean, and also you need to set your options slightly ...

Why isn't parallel computing taking place when using MADS search methods in patternsearch?

I think that you might have a slight misunderstanding of what some options mean, and also you need to set your options slightly ...

2 months ago | 0

| accepted

Answered

fminsearch options...supressing error messages

Are you passing the options to fminsearch? Please show your fminsearch call and options creation call. Alan Weiss MATLAB mathe...

fminsearch options...supressing error messages

Are you passing the options to fminsearch? Please show your fminsearch call and options creation call. Alan Weiss MATLAB mathe...

2 months ago | 0

Answered

How to change the MaxSQPIter in the fmincon solver options?

If you look in the fmincon documentation of options you fiind that MaxSQPIter is a hidden option for the active-set algorithm. ...

How to change the MaxSQPIter in the fmincon solver options?

If you look in the fmincon documentation of options you fiind that MaxSQPIter is a hidden option for the active-set algorithm. ...

2 months ago | 1

| accepted

Answered

Computational Efficiency for Decoupled Optimisation

Because the problems can be solved separately, then it will certainly save memory to solve them separately. Whether it saves tim...

Computational Efficiency for Decoupled Optimisation

Because the problems can be solved separately, then it will certainly save memory to solve them separately. Whether it saves tim...

2 months ago | 0

Answered

Finding a single global solution

The answer is that you are using the wrong solver, and might have a wrong idea about what is possible. For almost all problems,...

Finding a single global solution

The answer is that you are using the wrong solver, and might have a wrong idea about what is possible. For almost all problems,...

2 months ago | 0

| accepted

Answered

Objective function for peak shaving and valley filling of wind turbine electrical load profile

Perhaps your objective should be a new variable m along with the constraint m >= f(i) % for all i where i is the time index an...

Objective function for peak shaving and valley filling of wind turbine electrical load profile

Perhaps your objective should be a new variable m along with the constraint m >= f(i) % for all i where i is the time index an...

3 months ago | 0

Answered

Energy storage optimisation problem - separate charge and discharge constraint

The error message is spot on: when you multiply variables, the problem becomes nonlinear. However, I am sure that you would rath...

Energy storage optimisation problem - separate charge and discharge constraint

The error message is spot on: when you multiply variables, the problem becomes nonlinear. However, I am sure that you would rath...

3 months ago | 0

| accepted

Answered

Look for Only Integer Values or Fixed Point Values in Paretosearch Algorithm

You could try setting the MeshTolerance option to a large value such as 1e-2 or even 1e-1. I'm not sure how it will affect the a...

Look for Only Integer Values or Fixed Point Values in Paretosearch Algorithm

You could try setting the MeshTolerance option to a large value such as 1e-2 or even 1e-1. I'm not sure how it will affect the a...

3 months ago | 0

| accepted

Answered

How to change patternsearch options for paretosearch algorithm?

Did you look in the documentation of options for paretosearch? It states clearly that MeshExpansionFactor is for patternsearch o...

How to change patternsearch options for paretosearch algorithm?

Did you look in the documentation of options for paretosearch? It states clearly that MeshExpansionFactor is for patternsearch o...

3 months ago | 0

| accepted

Answered

How can one write a program to do this? (fminbnd)

You can get the value of out = z simply by asking for it: [xbest,out] = fminbnd(@(x) test(x),0,1) See the fminbnd reference pa...

How can one write a program to do this? (fminbnd)

You can get the value of out = z simply by asking for it: [xbest,out] = fminbnd(@(x) test(x),0,1) See the fminbnd reference pa...

3 months ago | 0

| accepted

Answered

optimal allocation of two assets by minimizing shortfall probability using fmincon

The problem is the you have not defined your objective function as a separate file that the optimization calls. You need to writ...

optimal allocation of two assets by minimizing shortfall probability using fmincon

The problem is the you have not defined your objective function as a separate file that the optimization calls. You need to writ...

3 months ago | 1