12.07.2015 Views

What Is Optimization Toolbox?

What Is Optimization Toolbox?

What Is Optimization Toolbox?

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

lsqnonlinfor(that is, F should have k components).First, write an M-file to compute the k-component vector F.function F = myfun(x)k = 1:10;F = 2 + 2*k-exp(k*x(1))-exp(k*x(2));Next, invoke an optimization routine.x0 = [0.3 0.4][x,resnorm] = lsqnonlin(@myfun,x0)% Starting guess% Invoke optimizerAfter about 24 function evaluations, this example gives the solutionx =0.2578 0.2578resnorm % Residual or sum of squaresresnorm =124.3622AlgorithmLarge-Scale <strong>Optimization</strong>By default lsqnonlin chooses the large-scale algorithm. This algorithmis a subspace trust region method and is based on the interior-reflectiveNewton method described in [1] and [2]. Each iteration involves theapproximate solution of a large linear system using the method ofpreconditioned conjugate gradients (PCG). See “Trust-Region Methodsfor Nonlinear Minimization” on page 4-3 and “Preconditioned ConjugateGradients” on page 4-7.Medium-Scale <strong>Optimization</strong>If you set the LargeScale option set to 'off' with optimset, lsqnonlinuses the Levenberg-Marquardt method with line search [4], [5],and [6]. Alternatively, you can select a Gauss-Newton method [6]with line search by setting the LevenbergMarquardt option. SettingLevenbergMarquardt to 'off' (and LargeScale to 'off') selects the8-175

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!