Lyasya

5 Reputation

2 Badges

14 years, 16 days

MaplePrimes Activity


These are replies submitted by Lyasya

full listing

 

> with(Optimization);

t := Minimize(f0, {x[1]+2*x[2] <= 4, x[1]^2+x[2]^2 <= 5})[1];

for i to n do xi[i] := rhs(op(i, NLPSolve(f0, {x[1]+2*x[2] <= 4, x[1]^2+x[2]^2 <= 5})[2])) end do;
                            -38.0000000000292176
                            -0.400000000005842682
                             2.20000000000292138
> qwe := evalf(norm(x0-st, n));
                                 1.414213562
> count := 1;
> if evalf(qwe > .1) then

while evalf(qwe > .1) do count := count+1;

k := NLPSolve(f(x0+alpha*(xi-x0)), {alpha >= 0, alpha <= 1})[1];

alpha := rhs(op(1, NLPSolve(f(x0), {alpha >= 0, alpha <= 1})[2]));

print(k, alpha);

for i to n do st[i] := x0[i] end do;

print(st);

for i to n do x0[i] := x0[i]+alpha*(xi[i]-x0[i]) end do;

print(x0);

f0 := dotprod(x-x0, fin);

print(f0);

t := NLPSolve(f0, {x[1]+2*x[2] <= 4, x[1]^2+x[2]^2 <= 5})[1]; for i to n do

xi[i] := rhs(op(i, NLPSolve(f0, {x[1]+2*x[2] <= 4, x[1]^2+x[2]^2 <= 5})[2])) end do;

print(t, xi);

qwe := norm(x0-st, n);

print(qwe);

end do;

end if;
Error, (in Optimization:-NLPSolve) non-numeric result encountered
> print(t);
                            -38.0000000000292176

conditional gradient method

does not consider the iteration,I think...

t must be 6.85714285714285676

Thanks)

Thank you!But I use Maple 12, without this package does not consider(linalg)

Thank you!But I use Maple 12, without this package does not consider(linalg)

Page 1 of 1