Plotting vector fields in MATLAB or Maple

In summary, to plot a vector field in MATLAB, you can use the "quiver" function with specified coordinates and components. You can also use the "ezplot" function to plot a vector field from an equation. In Maple, the "plotvectorfield" command is used for plotting vector fields and the "plotoptions" command can be used to customize the appearance of the vectors.
  • #1
JefeNorte
9
0

Homework Statement



The original problem was x'=(-2 1; 1 -2)*x and I needed to find two linearly independent solutions.

Homework Equations


The Attempt at a Solution



I found that x1=(1;1)e^(-t) and x2=(1;-1)e^(-3t). Now I am trying to plot a vector field of this. Is there an easy way to do this using MATLAB or Maple or do i need to do each point by hand? I would like to avoid unnecessary headaches if possible.

Thanks
 
Physics news on Phys.org
  • #2
There are many good tutorials on Matlab plotting on YouTube. Here is one related to vector field plotting.

 

1. How do I plot a vector field in MATLAB?

To plot a vector field in MATLAB, you can use the "quiver" function. This function takes in the x and y coordinates of the vectors, as well as the x and y components of the vectors. For example: quiver(x, y, u, v) where x and y are the coordinates and u and v are the components. You can also customize the appearance of the vectors by specifying additional parameters such as color or line style.

2. Can I plot a vector field from an equation in MATLAB?

Yes, you can plot a vector field from an equation in MATLAB by using the "ezplot" function. This function takes in a symbolic expression or equation and plots the corresponding vector field. For example: ezplot('x^2+y^2=1') would plot the vector field for the equation x^2+y^2=1.

3. How do I plot a vector field in Maple?

To plot a vector field in Maple, you can use the "plotvectorfield" command. This command takes in the x and y coordinates of the vectors, as well as the x and y components of the vectors. For example: plotvectorfield([x, y], [u, v]) where x and y are the coordinates and u and v are the components.

4. Can I plot a vector field in Maple from an equation?

Yes, you can plot a vector field from an equation in Maple by using the "plotvectorfield" command with a symbolic expression or equation. For example: plotvectorfield([x, y], [x^2+y^2=1]) would plot the vector field for the equation x^2+y^2=1.

5. How can I customize the appearance of the vectors in Maple?

In Maple, you can use the "plotoptions" command to customize the appearance of the vectors in a vector field. This command allows you to specify parameters such as color, line style, and size. For example: plotoptions(vectorfield, color=red, arrowsize=5) would change the color of the vectors to red and increase their size to 5.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
992
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
817
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
560
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
16
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
Back
Top