Lagrange Multipliers Example 2

Lagrange Multipliers Example 2
Loading the math board and drawing, please wait…
2020-07-13 00:18
This example demonstrates solving constrained optimization problems using the method of Lagrange multipliers, visually illustrating the relationship between the objective function and the constraint. Key mathematical concepts include Lagrange multipliers, partial derivatives, gradients, and the geometric interpretation of the objective and constraint functions. The construction utilizes GeoGebra commands and objects such as LeftSide, Simplify, Point, UnitVector, Angle, LaTeX, Textfield, Zip, CurveCartesian, Surface, RotateText, Sequence, RemoveUndefined, Text, TableText, and Segment. It is suitable for university-level mathematics and engineering courses focusing on applying calculus to solve practical optimization problems.

GeoGebra Commands & Parameters

  1. LeftSide(Cu_g) → g
  2. Simplify(Derivative[g, x, 1]) → gx'
  3. Simplify(Derivative[g, y, 1]) → gy'
  4. Simplify(Derivative[f, x, 1]) → fx'
  5. Simplify(Derivative[f, y, 1]) → fy'
  6. Point(Cu_g) → B
  7. UnitVector(Vector[B, Dg]) → u_g
  8. UnitVector(Vector[B, Df]) → u_f
  9. Angle(u_g, u_f) → α
  10. LaTeX(f, true) → text8a
  11. LaTeX(Cu_g, true) → text8b
  12. Textfield(Cu0_x) → InputBox1
  13. Textfield(Cu0_y) → InputBox2
  14. Textfield(f) → InputBox3
  15. Textfield(Cu_g) → InputBox4
  16. Zip((x(a), y(a), f(a)), a, Sequence[Point[Cu_g, t / n], t, 0, n]) → lg_1
  17. Textfield(n) → InputBox5
  18. Zip("(" + (LaTeX[ScientificText[x(a), 2]]) + "," + (LaTeX[ScientificText[y(a), 2]]) + ")", a, l1xy'_f) → l1xy'_fa
  19. CurveCartesian((sqrt(3) * cos(t)), (sqrt(3) * sin(t)), f((sqrt(3) * cos(t)), (sqrt(3) * sin(t))), t, (-π), π) → q1
  20. Surface((sqrt(3) * cos(t)), (sqrt(3) * sin(t)), u, t, (-π), π, u, -2.1, 2.1) → g1
  21. RotateText(text15, 90°) → text20
  22. Zip(Text["(" + (SurdText[x(a)]) + "," + (SurdText[y(a)]) + ")", (0, 0), true, true], a, l1) → l1surd
  23. Zip(Text["(" + (SurdText[x(a)]) + "," + (SurdText[y(a)]) + ")", (0, 0), true, true], a, l2) → l2surd
  24. Sequence(If[lα1(i) ≟ 180°, 1, lα1(i) ≟ 0°, 2, 3], i, 1, Length[l1]) → l1_α
  25. Sequence(If[lα2(i) ≟ 180°, 1, lα2(i) ≟ 0°, 2, 3], i, 1, Length[l2]) → l2_α
  26. RemoveUndefined(Sequence[If[l1_α(i) ≟ 1, l1(i), NaN], i, 1, Length[l1]]) → l1min
  27. RemoveUndefined(Sequence[If[l1_α(i) ≟ 2, l1(i), NaN], i, 1, Length[l1]]) → l1max
  28. RemoveUndefined(Sequence[If[l1_α(i) ≟ 3, l1(i), NaN], i, 1, Length[l1]]) → l1loc1
  29. RemoveUndefined(Sequence[If[l1_α(i) ≟ 1, l1f(i), NaN], i, 1, Length[l1f]]) → l1min_{3D}
  30. RemoveUndefined(Sequence[If[l1_α(i) ≟ 2, l1f(i), NaN], i, 1, Length[l1f]]) → l1max_{3D}
  31. RemoveUndefined(Sequence[If[l2_α(i) ≟ 2, l2(i), NaN], i, 1, Length[l2]]) → l2max
  32. RemoveUndefined(Sequence[If[l2_α(i) ≟ 2, l2f(i), NaN], i, 1, Length[l2f]]) → l2max_{3D}
  33. RemoveUndefined(Sequence[If[l2_α(i) ≟ 1, l2(i), NaN], i, 1, Length[l2]]) → l2min
  34. RemoveUndefined(Sequence[If[l2_α(i) ≟ 1, l2f(i), NaN], i, 1, Length[l2f]]) → l2min_{3D}
  35. Text("∇f", Point[u_f, 1]) → text25
  36. Text("∇g", Point[u_g, 1]) → text25g
  37. TableText(Append["N", 1…Length[l1]], Append["\fgcolor{red}{Cp}", l1surd], 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
  38. TableText(Append["N", 1…Length[l2]], Append["\fgcolor{red}{Cp}", l2surd], 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
  39. Segment(B, C) → f_1
  40. RemoveUndefined(Zip[Vector[c, c + UnitVector[a]], a, l1xy'_f, c, l1]) → lvec1_f
  41. RemoveUndefined(Zip[Vector[c, c + UnitVector[a]], a, l1xy'_g, c, l1]) → lvec1_g
  42. RemoveUndefined(Zip[Vector[c, c + UnitVector[a]], a, l2xy'_f, c, l2]) → lvec2_f
  43. RemoveUndefined(Zip[Vector[c, c + UnitVector[a]], a, l2xy'_g, c, l2]) → lvec2_g
  44. Zip(Segment[a, b], a, l1, b, l1f) → l1seg
  45. Sequence(Text[i, l1(i) + (0.2, 0.1)], i, 1, lä1) → l1txt
  46. Sequence(Text[i, l2(i) + (0.2, 0.1)], i, 1, lä2) → l2txt
  47. Zip(Segment[a, b], a, l2, b, l2f) → l2seg

AI Drawing Prompt Reference

Create a 3D illustration of a constrained optimization problem: a cylindrical surface as the constraint, with a space curve on it representing the objective function values. Place multiple sample points on the surface, and at each point draw gradient vectors for both the objective and constraint functions, marking the angle between them. Show the projection of the objective curve onto the constraint, along with vertical segments connecting surface points to their planar counterparts. Include a table listing coordinates, function values, gradient components, and angles, using colors to distinguish maxima, minima, and saddle points.
The prompt above was compiled from the original drawing commands and is for reference only.