求助 ,为啥我这里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
1