vector - Mathematica 如何绘制具有 1 个变量的矢量场?

标签 vector wolfram-mathematica plot

我不知道如何绘制只有 1 个变量的向量场。也许 Mathematica 不支持这个。例如:

 r(t) = cost j + sint i

一样
 <cost, sint>

这行不通:

VectorPlot[{cos t, sin t}, {t, 0, 2 Pi}] 

作为奖励,如何对向量求导?

最佳答案

一个简单的解决方法是使用带有虚拟变量的 2D-VectorPlot,如下所示:

VectorPlot[
  {Cos[t], Sin[t]}, {t, 0, 2 \[Pi]}, {s, -1/2, 1/2},
  AspectRatio -> Automatic,
  VectorPoints -> {15, 3}, 
  FrameLabel -> {"t", None}
]

VectorPlot with dummy variable

或者可能更有意义的是,在增加 t 的同时,离散化您在跟随向量时获得的曲线。这是例如对量子力学中的费曼式作用积分很有用。

Module[
  {t, dt = 0.1, vectors, startpoints, startpoint, vector, spv, spvs},
  vectors = Table[dt {Cos[t], Sin[t]}, {t, 0, 2 \[Pi], dt}];
  startpoints = Accumulate[vectors];
  spvs = Transpose[{startpoints, vectors}];
  Graphics[Table[Arrow[{spv[[1]], spv[[1]] + spv[[2]]}], {spv, spvs}]]
]

Feynman 1D-vectorplot

关于vector - Mathematica 如何绘制具有 1 个变量的矢量场?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8732974/

相关文章:

layout - Mathematica 中的最佳代码布局?

function - 生成局部变量(作为常量)时出错

plot - 如何设置绘图窗口的窗口大小?

c++ - 添加 operator<< 到 std::vector

java - Java 中不带 <> 的类型转换 arrayList/Vector

wolfram-mathematica - 从 0 开始张量指数

colors - gnuplot - 如何获得与 3d 绘图具有相同级别颜色的等高线

python - 创建具有相等轴比例的子图,Python,matplotlib

c++ - 如何在 vector<vector<pair<int,int>> 中插入一个 vpii >

java - 在 Java 中使用 Hashtable、Vector 或 HashMap 或 ArrayList