Problems for testing optimizers. Documentation is in the code.

Demonstration 1

The following code

 p_t = optim_problems ().curve.p_1;
 global verbose;
 verbose = false;
 [cy, cp, cvg, iter] = leasqr (p_t.data.x, p_t.data.y, p_t.init_p, p_t.f)
 disp (p_t.result.p)
 sumsq (cy - p_t.data.y)

Produces the following output

cy =

   0.1341
   0.1797
   0.2203
   0.2565
   0.2892
   0.3187
   0.3455
   0.3700
   0.4522
   0.5618
   0.7152
   0.9453
   1.3288
   2.0958
   4.3968

cp =

   0.082410
   1.133031
   2.343700

cvg = 1
iter = 5
   0.082410
   1.133033
   2.343697
ans = 8.2149e-03

Package: optim