Question: Use of a procedure involving several parameters in Minimize

I am trying to find the minimum of a function TF defined by a procedure over an interval. The function depends on variable x and fixed parameters x0, L, k, alpha_0, alpha_L. Here is the function

TF := proc(x, x0, L, k, alpha_0, alpha_L) if x0 <= x then evalc(abs(cos(k*(x - L) - alpha_L)*cos(k*x0 + alpha_0)/(cos(alpha_L)*cos(k*x0 + alpha_0)))); else evalc(abs(cos(k*(x0 - L) - alpha_L)*cos(k*x + alpha_0)/(cos(alpha_L)*cos(k*x0 + alpha_0)))); end if; end proc;

When I use

Minimize('TF'(x, 0, 0.03, 55.11566060, Pi/2, Pi/4), x = 0 .. 0.03);

I get an error "Error, (in Optimization:-NLPSolve) cannot determine if this expression is true or false: 0 <= x". What is my mistake ?

Thanks.

Please Wait...