Mathematica: Graph for a single vector instead of vector field?

Click For Summary
SUMMARY

The discussion focuses on creating a graphical representation of forces between two point particles using Mathematica. The user encountered issues with the VectorPlot function due to the requirement for variable input, leading to an error when using raw objects. A solution was proposed using the Graphics function to draw arrows representing the vectors, along with a method to convert polar coordinates to Cartesian coordinates for better visualization.

PREREQUISITES
  • Familiarity with Mathematica's Graphics function
  • Understanding of vector representation in physics
  • Knowledge of polar and Cartesian coordinate systems
  • Basic experience with Mathematica's Arrow function
NEXT STEPS
  • Explore Mathematica's VectorPlot function and its limitations
  • Learn how to use the Graphics function for custom vector representations
  • Study the conversion between polar and Cartesian coordinates in Mathematica
  • Investigate advanced vector field visualizations in Mathematica
USEFUL FOR

Students and professionals in physics, mathematicians, and anyone using Mathematica for graphical representations of vector fields or forces.

bentley4
Messages
66
Reaction score
0
Hi guys, I would like to construct 2 vectors on a coordinate grid.(or a vector field for only one t) of the forces between 2 point particles on a certain moment t. Can I do that?
When I try the VectorPlot function and insert all values instead of also inserting a variable it gives the error that it cannot exist out of only raw objects, that it cannot iterate.
Does anyone know how to do this?
 
Last edited:
Physics news on Phys.org
I think I tried to do this once, its very difficult to get it here you want. Basically its better to just use arrows:

Graphics[{Arrow[{{0, 0}, {0, 1}}], Arrow[{{0, 0}, {1, 0}}],
Arrow[{{0, 0}, {0, -1}}], Arrow[{{0, 0}, {-1, 0}}]}]

you could also just convert polar to cartesian to get it in terms of magnitude and angle if you needed.EDIT:
such as

AR[point_, mag_, \[Theta]_] = Arrow[{point, {mag Cos[\[Theta]], mag Sin[\[Theta]]}}]
Graphics[AR[{0, 0}, 1, 3 \[Pi]/2]]
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
24K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K