Forgot password?
 Create new account
View 1059|Reply 4

用 mathematica 求条件极佳

[Copy link]

123

Threads

463

Posts

3299

Credits

Credits
3299

Show all posts

TSC999 Posted at 2017-5-19 18:01:40 |Read mode
Last edited by TSC999 at 2017-5-19 18:08:00在 $ x+y=5 $ 的条件下,求 \( f(x,y)=3\sqrt{2x^2+1}+ 2\sqrt{9y^2+40} \) 的极小值。

用拉格朗日乘数法编程如下:
  1. Clear["Global`*"];
  2. NSolve[D[3 Sqrt[2 x^2 + 1] +
  3.     2 Sqrt[9 y^2 + 40] + \[Lambda] (x + y - 5), {{x,
  4.      y, \[Lambda]}}] == 0, {x, y}, {\[Lambda]}, Reals]   
Copy the Code
运行结果是:
{{x->3.,y->2.}}

将 $ x=3, y=2 代入  f(x,y)  $ 中得到:
$ f(x,y)=7\sqrt{19}  $

123

Threads

463

Posts

3299

Credits

Credits
3299

Show all posts

 Author| TSC999 Posted at 2017-5-19 18:13:55
头一次发现这个数学论坛。这是官办的还是民办的?有几年的历史了?人气旺不?

701

Threads

110K

Posts

910K

Credits

Credits
94172
QQ

Show all posts

kuing Posted at 2017-5-19 18:14:54
直接用 Minimize 就好了啊

701

Threads

110K

Posts

910K

Credits

Credits
94172
QQ

Show all posts

kuing Posted at 2017-5-19 18:18:53
回复 2# TSC999

个人论坛

至于人气,这年头还上论坛玩的人已经不多,何况是圈子这么小的数学论坛,不可能旺的

123

Threads

463

Posts

3299

Credits

Credits
3299

Show all posts

 Author| TSC999 Posted at 2017-5-19 19:10:42
直接用 Minimize 就好了啊
kuing 发表于 2017-5-19 18:14
您说的对,用下面这个语句更好:
  1. In[27]:= Minimize[{3 Sqrt[2 x^2 + 1] + 2 Sqrt[9 y^2 + 40],
  2.   x + y == 5}, {x, y}]
  3. Out[27]= {7 Sqrt[19],{x->3,y->2}}
Copy the Code

手机版Mobile version|Leisure Math Forum

2025-4-20 22:14 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list