Optimization in maple

31 Views Asked by At

I optimized a function and I want to use the value.

The answer I got is [4.77011197468878567, [alpha = 1.43792823465135400]] and I want to use the alpha for plotting but I don't know how to extract it.

1

There are 1 best solutions below

0
On BEST ANSWER
ans := Optimization:-Minimize(...);

  ans := [4.77011197468878567, [alpha = 1.43792823465135400]];

ans[2];

   [alpha = 1.43792823465135400]

You can utilize that with the eval command, to evaluate-at-a-point (ie, substitute, mathematically).

eval(alpha, ans[2]);

        1.43792823465135400

expr := cos(alpha^2*x);

                     2
    expr := cos(alpha  x)

eval(expr, ans[2]);

     cos(2.067637609 x)