拉格朗日乘数法示例5:三维约束优化可视化
几何画板及绘图内容加载中,请稍等……
① 本范例通过三维图形直观演示拉格朗日乘数法求解约束优化问题的过程,展示目标函数曲面与约束曲面的交点及最优点。② 核心数学概念包括多元函数极值、约束优化、梯度向量、拉格朗日乘数、曲面与曲线的交集。③ 作图要点:从构造摘要可见,使用了Surface和CurveCartesian绘制三维曲面与曲线,Point和Vector标记关键点及梯度方向,Angle和Text显示角度与标注,Sequence和Zip生成数据序列,Simplify和LeftSide用于方程化简,同时包含多个按钮(button4、button6等)实现交互控制,以及LaTeX文本和TableText展示数学公式。④ 适合大学微积分或高等数学课程中讲解拉格朗日乘数法时使用,也可供高年级高中生拓展学习,帮助理解约束条件下极值的几何意义。
GeoGebra 命令及参数
Simplify(Derivative[f, y, 1]) → fy'Simplify(Derivative[f, x, 1]) → fx'LeftSide(Cu_g) → gSimplify(Derivative[g, y, 1]) → gy'Simplify(Derivative[g, x, 1]) → gx'Point(Cu_g) → BVector(B, B + UnitVector[Vector[B, Dg]] / 2) → u_gVector(B, B + UnitVector[Vector[B, Df]] / 2) → u_fAngle(u_g, u_f) → αLaTeX(f, true) → text8aLaTeX(Cu_g, true) → text8bTextfield(f) → InputBox3Textfield(Cu_g) → InputBox4Zip((x(a), y(a), f(a)), a, Sequence[Point[Cu_g, t / n], t, 0, n]) → lg_1Textfield(n) → InputBox5Element(l1, Indexmax1) → Amax1Element(l1, Indexmin1) → Amin1Element(l1f, Indexmax1) → Amax1_{3D}Element(l1f, Indexmin1) → Amin1_{3D}Element(l2f, Indexmin2) → Amin2_{3D}LaTeX(Amin2_{3D}, true, true) → text17Surface((-4.4 * cos(t)), sqrt(1 - cos(t)^(2)), u, t, (-π), π, u, -5, 60) → g1aSurface((-4.4 * cos(t)), (-sqrt(1 - cos(t)^(2))), u, t, (-π), π, u, -5, 60) → g2aCurveCartesian((-sqrt(t)), sqrt((1 - t^(3)) / 3), f((-sqrt(t)), sqrt((1 - t^(3)) / 3)), t, 0, 1) → q2Surface((-(1 - (3 * t^(2)))^(1 / 6)), t, u, t, -1 / sqrt(3), 1 / sqrt(3), u, -1.2, 1.2) → g2CurveCartesian((-sqrt(t)), (-sqrt((1 - t^(3)) / 3)), f((-sqrt(t)), (-sqrt((1 - t^(3)) / 3))), t, 0, 1) → q1aCurveCartesian(sqrt(t), (-sqrt((1 - t^(3)) / 3)), f(sqrt(t), (-sqrt((1 - t^(3)) / 3))), t, 0, 1) → q2aCurveCartesian((rr(t) * cos(t / 2)), (rr(t) * sin(t / 2)), f((rr(t) * cos(t / 2)), (rr(t) * sin(t / 2))), t, 0, 12) → q1Surface((rr(t) * cos(t / 2)), (rr(t) * sin(t / 2)), v, t, 0, (4 * π), v, 0, 4) → g1RotateText(text1, 90°) → text3TableText(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|_") → tTab1TableText(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|_") → tTab2Segment(B, C) → f_1Text("∇g", Point[u_g, 1]) → text25gText("∇f", Point[u_f, 1]) → text25fElement(l2, Indexmax2) → Amax2Element(l2f, Indexmax2) → Amax2_{3D}Element(l2, Indexmin2) → Amin2Simplify(fx'(x, y) - (gx'(x, y) * fy'(x, y) / gy'(x, y))) → Cu_xfSimplify(fy'(x, y) - (gy'(x, y) * fx'(x, y) / gx'(x, y))) → Cu_yfRemoveUndefined(Zip[Vector[c, c + UnitVector[a] / 2], a, l1xy'_f, c, l1]) → lvec1_fRemoveUndefined(Zip[Vector[c, c + UnitVector[a] / 2], a, l1xy'_g, c, l1]) → lvec1_gRemoveUndefined(Zip[Vector[c, c + UnitVector[a] / 2], a, l2xy'_f, c, l2]) → lvec2_fRemoveUndefined(Zip[Vector[c, c + UnitVector[a] / 2], a, l2xy'_g, c, l2]) → lvec2_gTextfield(txtCu01_x) → InputBox1Textfield(txtCu01_y) → InputBox2Zip(Segment[a, b], a, l1, b, l1f) → l1segSequence(Text[i, l1(i) - (0.3, 0.1)], i, 1, lä1) → l1txtSequence(Text[i, l2(i) - (0.3, 0.1)], i, 1, lä2) → l2txtZip(Segment[a, b], a, l2, b, l2f) → l2seg
AI 绘图提示语参考
绘制一个三维约束优化问题的示意图,包括目标函数曲面和约束曲面的交线,以及它们在最优点的梯度向量。首先绘制目标函数曲面,然后绘制约束曲面,接着找到它们的交线并标出最优点。最后,绘制目标函数和约束函数在最优点的梯度向量,并计算它们之间的夹角。
以上提示语为根据原始绘图命令整理而来,仅供参考。