【问题标题】:the point on a multi-dimensional surface closet to the given point多维曲面上最接近给定点的点
【发布时间】:2013-12-28 11:54:26
【问题描述】:

我有一个多维曲面,其方程为 y=a1x1^2 + b1x1 + a2x2^2 + b2x2 + ... + anxn^2 + bnxn + c。

现在,我需要让这个表面壁橱上的点到给定点。

我希望我对我的问题的措辞没有让你们太困惑,并提前感谢你们。

期待回复。

【问题讨论】:

标签: wolfram-mathematica mathematical-optimization


【解决方案1】:

尝试一个 2 维和 3 维示例来展示在 Mathematica 中执行此操作的一种方法。

p = {7, 2};
f = {x1, 2 x1^2 + 3 x1};
sol = NMinimize[Norm[p - f], Most[f], Method->"RandomSearch"][[2]];
q = f /. sol;
Print[q];
Show[Graphics[Line[{q, p}]], Plot[Last[f], {x1, -1, 1}]]

p = {7, 3, 2};
f = {x1, x2, 2 x1^2 + 3 x1 + x2^2 - 4 x2};
sol = NMinimize[Norm[p - f], Most[f], Method->"RandomSearch"][[2]];
q = f /. sol;
Print[q];
Show[Graphics3D[Line[{q, p}]], Plot3D[Last[f], {x1, -2, 2}, {x2, 0, 7}]]

推广到 n 维。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-06
    • 2020-12-28
    相关资源
    最近更新 更多