Misra1b

Problem definition

Objective function
f = @(x,b) b(1)*(1-(1+b(2)*x/2).^(-2))
Problem setup
dim = 2 

% dimension of the minimization problem

nb = 14

% number of points

% NIST certified values

target = zeros(dim,1) target(1) = 3.3799746163E+02 target(2) = 3.9039091287E-04

% start 1

ig1 = [500.;0.0001]

% start 2

ig2 = [300.;0.0002]

% points to fit

x = zeros(nb,1) y = zeros(nb,1) x(1)=77.6E0; y(1)=10.07E0; x(2)=114.9E0; y(2)=14.73E0; x(3)=141.1E0; y(3)=17.94E0; x(4)=190.8E0; y(4)=23.93E0; x(5)=239.9E0; y(5)=29.61E0; x(6)=289.0E0; y(6)=35.18E0; x(7)=332.8E0; y(7)=40.02E0; x(8)=378.4E0; y(8)=44.82E0; x(9)=434.8E0; y(9)=50.76E0; x(10)=477.3E0; y(10)=55.05E0; x(11)=536.8E0; y(11)=61.01E0; x(12)=593.1E0; y(12)=66.40E0; x(13)=689.1E0; y(13)=75.47E0; x(14)=760.0E0; y(14)=81.78E0;
Graphic representation
scatter(x,y)

Optimization example with lsqcurvefit

Optimization
rng(0)	

% for tractability

[b,info] = lsqcurvefit(f,ig1,x,y)

% running minimization

Animation
rng(0)
[~,info] = lsqcurvefit(f,ig1,x,y)
info.plot = 'fit'
info.animate = true	

% plot animation

optimview('lsqcurvefit',info)

Related functions

lsqcurvefit | plot | scatter