0

我想确定以下两个函数的局部最大值和最小值

  1. xE[t_] := 10 (t - Sin[t]) - Sqrt[40^2 - (10 (1 - Cos[t]))^2]
  2. vE = xE'[t]

所以我试图解决第一个导数xE[t]

extremaXE = Solve[vE[t] == 0, t] (* vE is the 1st derivative of xE *)

但我收到了这个错误:

Solve::ifun: Inverse functions are being used by Solve, so some solutions may not 
be found; use Reduce for complete solution information.

然后我尝试使用reduce,我得到了这个错误:

Reduce::nsmet: This system cannot be solved with the methods available to Reduce

那么我应该怎么做才能通过导数确定局部最小值和最大值呢?

4

2 回答 2

0

I don't get an error with Reduce. For example, to find the local extrema of xE I tried

Reduce[xE'[t] == 0, t]

which returned

C[1] \[Element] Integers && (t == 2 \[Pi] C[1] || 
   t == 2 I ArcTanh[2/Sqrt[3]] + 2 \[Pi] C[1])

Note that this gives you both real and complex solutions. If you only want the real ones you can try

Reduce[xE'[t] == 0, t, Reals]

which gives

C[1] \[Element] Integers && t == 2 \[Pi] C[1]

Edit

To substitute the solutions back into the original expression you could convert it to a list of rules using for example ToRules. Since ToRules can't handle expressions like C[1] \[Element] Integers we simplify the solution first

sol = Reduce[xE'[t] == 0, t];
sol = Simplify[sol, C[_] \[Element] Integers]

(* ==> t == 2 \[Pi] C[1] || t == 2 I ArcTanh[2/Sqrt[3]] + 2 \[Pi] C[1] *)

ToRules will then convert this expression to a list of rules which you can substitute back into your expression using ReplaceAll

xE[t] /. {ToRules[sol]}

(* ==> {-Sqrt[1600 - 100 (1 - Cos[2 \[Pi] C[1]])^2] + 
          10 (2 \[Pi] C[1] - Sin[2 \[Pi] C[1]]), 
        -Sqrt[1600 - 100 (1 - Cosh[2 ArcTanh[2/Sqrt[3]] - 2 I \[Pi] C[1]])^2] + 
          10 (2 I ArcTanh[2/Sqrt[3]] + 2 \[Pi] C[1] - 
          I Sinh[2 ArcTanh[2/Sqrt[3]] - 2 I \[Pi] C[1]])} *)

Note that the resulting expression still contains the constant C[1]. To find the extrema for a particular value of C[1] you can use another replacement rule, e.g.

({t, xE[t]} /. {ToRules[sol]}) /. {C[1] -> -4}
于 2012-04-29T20:50:55.837 回答
0

Use NLOpt.

It has algorithms to find local/global extrema with/without derivatives. It is callable from C, C++, Fortran, Matlab or GNU Octave, Python, GNU Guile, and GNU R.

http://ab-initio.mit.edu/wiki/index.php/NLopt

Does this help?

于 2012-04-29T20:14:49.333 回答