KKTMinimize[obj_,eqns_,ineqns_,variables_]:= Block[{myrule,lambda,u,\[Lambda],Lagrange,eqnu,ineqnlam, eqnus,ineqnlams,kkteqns,kktvars,kktans}, myrule={z_[i_]:>ToExpression[ToString[z]<>ToString[i]]}; eqnu=u[#]&/@Range[Length@eqns]; ineqnlam=\[Lambda][#]&/@Range[Length@ineqns]; eqnus=If[Length@eqns>=1,eqns.eqnu,0]; ineqnlams=If[Length@ineqns>=1,ineqns.ineqnlam,0]; kktvars=Flatten@{variables,eqnu,ineqnlam}/.myrule; Lagrange=obj-eqnus-ineqnlams; kkteqns=Flatten@{Thread[D[Lagrange,{variables}]==0], Thread[eqns==0],Thread[ineqns<=0], Thread[ineqns*ineqnlam==0],Thread[ineqnlam<=0]}/. myrule; If[MemberQ[PolynomialQ[#,kktvars]&/@kkteqns[[All,1]],False], Print["KKT限制式均需為多項式。"], kktans=Reduce[kkteqns,kktvars, Backsubstitution->True]/.{And->List,Or->List, Equal->Rule}; If[Length@Dimensions@kktans==1,{obj/.kktans, kktans},{obj/.#,#}&/@kktans]]]; Plot[(1-Cos[x]/Cos[x/2])/x^2,{x,0.-10,Pi/2}, PlotRange->{{0,Pi/2},{0.3,0.5}},Frame->True, FrameTicks->{{{0.3,0.5,{3/8,"3/8"},{4/Pi^2,"4/Pi^2"}}, None},{{0,Pi/2},None}}, GridLines->{None,{3/8,4/Pi^2}},GridLinesStyle->Dashed] D[(1-Cos[x]/Cos[x/2])/x^2,x]//Simplify D[(1-(Cos[x/2]^2-Sin[x/2]^2)/Cos[x/2])/x^2,x]//Simplify D[4-4Sec[x/2]+3xTan[x/2]-4Tan[x/2]^2+xTan[x/2]^3,x]//TrigExpand//Simplify (D[(6x-2Sin[x/2]-4Sin[x]-2Sin[(3x)/2]+Sin[2x]),x]//TrigExpand) /.{Sin[z_]:>a,Cos[z_]:>b} KKTMinimize[6+4a^2+2a^4-b+9a^2b-4b^2-12a^2b^2-3b^3+2b^4,{}, {-a,-b,a-1/Sqrt[2],1/Sqrt[2]-b,b-1},{a,b}] Limit[(1-(Cos[x/2]^2-Sin[x/2]^2)/Cos[x/2])/x^2,x->0] Limit[(1-(Cos[x/2]^2-Sin[x/2]^2)/Cos[x/2])/x^2,x->Pi/2]
Let f(x)=(1-cos(x)/cos(x/2))/x^2. Taking the first derivative of f(x) with respect to x yields d/dx f(x)=cos(x/2)*g(x)/(2x^3),
where g(x)=x*tan^3(x/2)-4*tan^2(x/2)+3*x*tan(x/2)-4*sec(x/2)+4. Because g'(x)=1/4*sec(x/2)^2*h(x) and h'(x)=k(x)=2*sin^4(x/2)+4*sin^2(x/2)+2*cos^4(x/2)-3*cos^3(x/2)-4*cos^2(x/2)-cos(x/2)-12*sin^2(x/2) *cos^2(x/2)+9*sin^2(x/2) cos(x/2)+6. Let a=sin(x/2) and b=cos(x/2). By Karush-Kuhn-Tucker conditions, we know that k(x) reaches its minimum at a=0 and b=1. This, together with the facts that h(0)=0, g(0)=0, and f(0)=0, indicates that f(x) is increasing in x, which also implies that 3/8<(1-Cos[x]/Cos[x/2])/x^2<4 br="" completes="" proof.="" the="" this=""> 4>
讀者回應 ( 0 意見 )
訂閱發佈留言 (Atom)
發佈留言
Please leave your name and tell me what you thought about this site. Comments, suggestions and views are welcomed.
如果這篇文章對你有幫助,那請留個訊息給我~