拉格朗日乘数法示例3

拉格朗日乘数法示例3
几何画板及绘图内容加载中,请稍等……
2020-07-14 09:43
该示例演示了拉格朗日乘数法在优化问题中的应用。核心数学概念包括:拉格朗日乘数法、函数极值、约束条件。使用了Point、LeftSide、Simplify、UnitVector等GeoGebra命令进行构造。适合大学数学课程中的优化问题教学。

GeoGebra 命令及参数

  1. Point(Cu_g) → B
  2. LeftSide(Cu_g) → g
  3. Simplify(Derivative[g, x, 1]) → gx'
  4. Simplify(Derivative[g, y, 1]) → gy'
  5. UnitVector(Vector[B, Dg]) → u_g
  6. Simplify(Derivative[f, x, 1]) → fx'
  7. Simplify(Derivative[f, y, 1]) → fy'
  8. UnitVector(Vector[B, Df]) → u_f
  9. Angle(u_f, u_g) → α
  10. LaTeX(f, true) → text8a
  11. LaTeX(Cu_g, true) → text8b
  12. Textfield(f) → InputBox3
  13. Textfield(Cu_g) → InputBox4
  14. Zip((x(a), y(a), f(a)), a, Sequence[Point[Cu_g, t / n], t, 0, n]) → lg_1
  15. Textfield(n) → InputBox5
  16. Surface(cos(t) / sqrt(0.1), sin(t), u, t, (-π), π, u, -5, 60) → g1
  17. CurveCartesian(cos(t) / sqrt(0.1), sin(t), f(cos(t) / sqrt(0.1), sin(t)), t, (-π), π) → q1
  18. RotateText(text5, 90°) → text14
  19. Zip(Vector[c, c + UnitVector[a]], a, l1xy'_f, c, l1) → lvec1_f
  20. Zip(Vector[c, c + UnitVector[a]], a, l1xy'_g, c, l1) → lvec1_g
  21. Zip(Vector[c, c + UnitVector[a]], a, l2xy'_f, c, l2) → lvec2_f
  22. Zip(Vector[c, c + UnitVector[a]], a, l2xy'_g, c, l2) → lvec2_g
  23. Text("∇g", Point[u_g, 1]) → text25g
  24. Text("∇f", Point[u_f, 1]) → text25f
  25. Zip(Text["(" + (SurdText[x(a)]) + "," + (SurdText[y(a)]) + ")", (0, 0), true, true], a, l1) → l1surd
  26. Zip(Text["(" + (SurdText[x(a)]) + "," + (SurdText[y(a)]) + ")", (0, 0), true, true], a, l2) → l2surd
  27. Segment(B, C) → f_1
  28. TableText(Append["N", 1…Length[l1]], Append["\fgcolor{red}{Cp}", l1], Append["\fgcolor{blue}{f}(\fgcolor{red}{C_p })", l1fa], Append["(\dot{f_x},\dot{f_y})", l1xy'_fa], Append["(\dot{g_x},\dot{g_y})", l1xy'_ga], Append["λ_x", lλ1ax], Append["λ_y", lλ1ay], Append["\widehat{\dot{g}\dot{f}} ", lα1], "c|_") → tTab1
  29. TableText(Append["N", 1…Length[l2]], Append["\fgcolor{red}{Cp}", l2], Append["\fgcolor{blue}{f}(\fgcolor{red}{C_p })", l2fa], Append["(\dot{f_x},\dot{f_y})", l2xy'_fa], Append["(\dot{g_x},\dot{g_y})", l2xy'_ga], Append["λ_x", lλ2ax], Append["λ_y", lλ2ay], Append["\widehat{\dot{g}\dot{f}} ", lα2], "c|_") → tTab2
  30. Textfield(txtCu01_y) → InputBox2
  31. Textfield(txtCu01_x) → InputBox1
  32. Element(l1, Indexmax1) → Amax1
  33. Element(l1, Indexmax2) → Amax2
  34. Element(l1, Indexmin1) → Amin1_1
  35. Element(l1, Indexmin2) → Amin2_1
  36. Element(l1, 5) → Amin1_2
  37. Element(l2, 5) → Amin2_2
  38. Element(l1f, Indexmin1) → Amin13d_1
  39. Element(l1f, 5) → Amin13d_2
  40. Element(l1f, Indexmax1) → Amax13d
  41. Element(l2f, Indexmax1) → Amax23d
  42. Simplify(fx'(x, y) - (gx'(x, y) * fy'(x, y) / gy'(x, y))) → Cu_xf
  43. Simplify(fy'(x, y) - (gy'(x, y) * fx'(x, y) / gx'(x, y))) → Cu_yf
  44. Zip(Segment[a, b], a, l1, b, l1f) → l1seg
  45. Sequence(Text[i, l1(i) - (0.45, 0.1)], i, 1, lä1) → l1txt
  46. Sequence(Text[i, l2(i) - (0.45, 0.1)], i, 1, lä2) → l2txt
  47. Zip(Segment[a, b], a, l2, b, l2f) → l2seg