Message Boards Message Boards

GROUPS:

Minimize doesn't work for simple trigonometric function

Posted 3 months ago
573 Views
|
2 Replies
|
1 Total Likes
|

I'm trying to symbolic minimize a function composed of sine and cosine. As the target function has local minima at the outside of the input domain, setting derivative of the target function as zero can not be used. So I want to use the Minimize, but it seems that it doesn't work for trigonometric function. Simplist version of target function is expressed as follows:

f[x_]:=M*Cos[x]^2;
Minimize[{f[x],0<=x<=pi/2, M>0}, x]

And I can get the output as follows:

Out[]=Minimize[{M Cos[x]^2, 0 <= x <= \[Pi]/2 && M > 0}, x]

I think Minimize doesn't work properly for trigonometric functions. Is there any way to symbolic minimize the trigonometric function?

2 Replies
Posted 3 months ago

Hi Dongmin,

Since there are two variables x and M this is a multivariate minimization and they must both be included in the list of variables.

Minimize[{M Cos[x]^2, 0 <= x <= \[Pi]/2, M > 0}, {x, M}]
(* {0, {x -> \[Pi]/2, M -> 1}} *)

When x = Pi/2 then any value of M is a minimum. Not sure why Minimize picked 1.

Posted 3 months ago

Hi Rohit, I wanted to consider M to be a constant, so I didn't put M in the domain. For example, Solve[ax^2+bx+c==0,x] is single variable function and the result is expressed in a, b and c.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract