求助 ,为啥我这里VectorPlot画出来没有东西
mathematica吧
全部回复
仅看楼主
level 2
Clear["Global`*"]
V[x_, y_] := {Integrate[\[Lambda]/Sqrt[(x - l)^2 + y^2],
l] /. {l -> L}} - {Integrate[\[Lambda]/Sqrt[(x - l)^2 + y^2],
l] /. {l -> -L}}
Ex[x_, y_] = -Div[V[x, y], x] // Simplify
Ey[x_, y_] = -Div[V[x, y], y] // Simplify
L := 1; \[Lambda] := 1;
P=ContourPlot[V[x, y], {x, -5, 5}, {y, -5, 5}, Contours -> 10,AxesLabel->Automatic]
G=VectorPlot[{Ex[x, y],Ey[x, y]},{x, -5, 5}, {y, -5, 5}]
Show[P,G]
2024年03月15日 02点03分 1
level 9
你的V看上去是标量场,是无法求散度的
Clear["Global`*"]
{L, \[Lambda]} = {1., 1.};
V[x_, y_] :=
Evaluate[(Integrate[\[Lambda]/Sqrt[(x - l)^2 + y^2],
l] /. {l -> L}) - (Integrate[\[Lambda]/Sqrt[(x - l)^2 + y^2],
l] /. {l -> -L})];
P = ContourPlot[V[x, y], {x, -5, 5}, {y, -5, 5}, Contours -> 10,
AxesLabel -> Automatic];
G = VectorPlot[Evaluate@Grad[V[x, y], {x, y}], {x, -5, 5}, {y, -5, 5}];
Show[P, G]
2024年03月15日 07点03分 2
……从LZ的书写来看,ta大概是把Div和D搞混了。
2024年04月06日 07点04分
@xzcyr 确实,后面自行解决了()
2024年04月08日 08点04分
1