# Alan Weiss

### MathWorks

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.

**Statistics**

RANK**36**

of 277,780

REPUTATION**5,254**

CONTRIBUTIONS

**0** Questions

**2,377** Answers

ANSWER ACCEPTANCE **
0.00%
**

VOTES RECEIVED**655**

RANK**4,968** of 18,795

REPUTATION**246**

AVERAGE RATING**0.00**

CONTRIBUTIONS**3** Files

DOWNLOADS **5**

ALL TIME DOWNLOADS**2466**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

Can I adjust patternsearch meshsize using output function (during optimisation)?

Sorry to say, but a patternsearch output function does not allow you to change the mesh size. However, as I think you know, the ...

13 days ago | 0

how does check gradient compare supplied gradients with finite difference gradients?

The CheckGradients option causes solvers to compare a finite-difference gradient estimate to the supplied gradient value, and if...

25 days ago | 0

Running genetic algorithm and Simulink in parallel

I am not at all sure that it is possible to run ga in parallel when the objective function is given by a Simulink model. For a ...

28 days ago | 1

optimising hybrid energy design using genetic algorithm

For an error of that type I think that you should learn to use the debugger. See Debug MATLAB Code Files and Set Breakpoints. A...

1 month ago | 0

| accepted

Fitness Scaling Options for Genetic Algorithm

The documentation says this: 'fitscalingrank' — The default fitness scaling function, 'fitscalingrank', scales the raw scores b...

1 month ago | 0

| accepted

Problems with lsqnonlin - initial parameters not changing

We don't see your ObjFunE code, so cannot be sure of what is going on. It seems that you are solving an ODE to create some outpu...

1 month ago | 0

Issue with large memory required for non-linear optimizer

You have 150^2 optimization variables. I do not see your parameterfun function, but if it is not a supported function for automa...

2 months ago | 1

| accepted

How to create a Triple Objective Genetic Algorithm establish constraints and plot 3D

I am sorry to say that I think that you need more help than we can give on this forum. If you want to have a productive interact...

2 months ago | 0

How to create a Triple Objective Genetic Algorithm establish constraints and plot 3D

OK, it seems that you have decided to use the solver-based approach, which is just fine. You set some nondefault options. I am ...

2 months ago | 0

How to prevent ga-Solver from accepting the first best solution?

It is possible that you unknowingly set some constraints that keep the solution you want from being considered. It is very hard ...

2 months ago | 0

Correct implementation of multi start option with pre-specified starters

If you read the description of MultiStart run, you see that calling run(ms,problem,k)) uses k - 1 random points in addition to t...

2 months ago | 0

| accepted

Matlab Code Assistance for Multistart or GA

Perhaps more relevant documentation is here: MultiStart with lsqnonlin, Problem-Based MultiStart Using lsqcurvefit or lsqnonli...

2 months ago | 0

Multistart apparently does not respect the supplied initial points

The only error here is your expectation that fmincon always converges to the closest local minimum. It does not. fun = @(x) x.^...

2 months ago | 0

| accepted

How to create a Triple Objective Genetic Algorithm establish constraints and plot 3D

You are confusing many things here. The first thing you have to do is decide if you are using optimization variables, meaning t...

2 months ago | 1

Unrecognized function or variable 'options'. for simulannealbnd, but works for fminunc

optimoptions requires that the first argument be the name of the solver. Something like options = optimoptions('simulannealbnd'...

2 months ago | 0

| accepted

When the genetic algorithm has integer constraint issues, how to customize the variogram to eliminate the ignored warning

I am not sure what you mean by "variogram." But I think that I know the reason for your difficulty. As the Release Notes state, ...

2 months ago | 0

| accepted

Optimization terminated: maximum number of generations exceeded.

ga exceeded 200 generations. If you want more, increase the MaxGenerations option. options = optimoptions('ga','ConstraintToler...

2 months ago | 1

| accepted

How to output additional variables from objective function using ga optimization?

I am not sure what you are trying to do. You might be trying to pass intermediate values calculated within ga to reuse, for exam...

2 months ago | 0

Multiple initial points in fmincon optimization

fmincon takes the size of the x0 input as determining the number of input variables. Your x0 has 6 elements, so fmincon thinks t...

2 months ago | 0

| accepted

hi, urgent help

There is an example of using MultiStart for problem-based lsqnonlin here: https://www.mathworks.com/help/gads/fit-function-usin...

2 months ago | 0

Integer optimization returns decimal numbers

The intlinprog solver (which solve calls internally for MILP problems) does not necessarily return or use internally exact integ...

2 months ago | 0

Genetic Algorithm output is different than manual calculation

The issue is that your objective function varies extremely quickly, with about 10000 squiggles per unit near x = 1. The exponent...

2 months ago | 1

Differential equation fit to my data: incorrect minimization

I think that you probably did not set up your problem correctly. There are relevant documentation examples: https://www.mathwor...

2 months ago | 0

Swarmsize to give to particleswarm optimization

For most optimization problems, as opposed to algorithm development, the question is how to obtain a good solution in as few fun...

2 months ago | 0

Output function for Simulated Anealing

You have mistaken the output of optimoptions for the optimvalues structure in simulate annealing. opts = optimoptions("simulann...

2 months ago | 0

Optimisation of batch time using genetic algorithm and ODE solver

I do not know what the batch time and crystal size mean in your model, so I cannot tell you directly what to do. I can tell you...

3 months ago | 0

surrogateopt multi-objective function output

I do not understand why you want to use surrogateopt to help solve a multiobjective problem. I think that gamultiobj or paretose...

3 months ago | 0

GA initial solution not used in problem base solver

When using the problem-based approach you must pass initial points to ga using optimvalues. See https://www.mathworks.com/help/r...

3 months ago | 0

How to solve TSP using GA?

I think that it is useless to try to solve a TSP using ga, mainly because ga is so slow and unreliable compared to Optimization ...

3 months ago | 0

What is the difference between surrogateopt and bayeopt?

The algorithms have fairly complete descriptions: https://www.mathworks.com/help/stats/bayesian-optimization-algorithm.html ht...

3 months ago | 0