Code covered by the BSD License

# Inverse Optimal Functions for Motoman HP-3 Tip Precision

### Alan Jennings (view profile)

A population based optimization increases pointing precision for a planar robotic arm.

```function [NewPoint,New_J,Delta_X,Adjusted]=ArmijoStep_1(TestPointA,NewPoint1,...
New_J=Options.J(NewPoint1);
if ((New_J-TestPointJ)-ArmijoRequirement)>0
% (New_J-TestPointJ) is how much the cost actually dropped
% (TestPointGradJ(:).')*(NewPoint1-TestPointA) is how much it would
% It's discounted by a factor, Options.ArmijoK to allow for concave up
% functions
% If the function doesn't decrease by at least the discounted
% prediction, then the quanity will be positive (-small-(-large))>0
% decrease the step size and then exit
for cece=1:Options.MaxDecay
Delta_X0_now=NewPoint1-TestPointA;
NewPoint1=(1-Options.StepDiscount)*Delta_X0_now+TestPointA;
%norm(Delta_X0_now)
ArmijoRequirement=(1-Options.StepDiscount)*ArmijoRequirement;
New_J=Options.J(NewPoint1);
%(New_J-TestPointJ);
if ((New_J-TestPointJ)-ArmijoRequirement)<=0
Delta_X=NewPoint1-TestPointA;
NewPoint=NewPoint1;
return;
end
end
Delta_X=0*Delta_X0_now;
NewPoint=TestPointA;
% point meets optimality conditions, but should return true values
% the next run should identify the point as stationary
return;
end