Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Ar we succeeding?



Nate and all

Following on my last email, I attach the paving for Nate's example, produced by my Matlab B&B algorithm based on the Neumaier-Pryce decoration scheme. You can see it is pretty well identical to Nate's. So we CAN do it, and in what seems to me a natural way.

Also given is the code of the driver function. It calls T_bb ("test bb") with arguments
1:    function.
2-5:  bounds of rectangle to be paved.
6-7:  constraint. Reject function values outside this interval 
      (irrelevant here so set to [-oo,oo]).
8:    B&B threshold for size of box. 

For this plot I took epsilon=0.05. On exit the code reported "no. of boxes processed is 5979".

The full code is available. Since I only have Octave, not Matlab, and haven't been able to get "setround" to work under Octave, I don't do proper outward rounding, but it doesn't seem to make much difference here.

John

Attachment: bbintersectplot.pdf
Description: Adobe PDF document


function T_bbNateIntersect(epsilon)
% Test the bb algorithm on functions in Nate's "intersect.pdf" example.
%  f(x0,x1) = -sqrt((x0 + 0.5)^2 + (x1 - 2)^2 - 0.5),
%  g(x0,x1) = (5 - x0)*(ln(cos(x0) + sin(x1/exp(x0)) + (x0/x1)^2) - 1/x1).
% We seek the set where both functions are DEFINED.

T_bb(@(x0,x1)f(x0,x1)+g(x0,x1), -2.5,1.5, 0.5,4.5, -Inf,Inf, epsilon);

%==========================================
function y = f(x0,x1)
y = -sqrt(sqr(x0 + 0.5) + sqr(x1 - 2) - 0.5);

function y = g(x0,x1)
y = (5 - x0).*(log(cos(x0) + sin(x1./exp(x0)) + sqr(x0./x1)) - 1.0./x1);