Parametric plot in mathematica

In summary, the conversation discusses how to plot two functions, x[t] and y[t], obtained by solving two coupled equations numerically. The Mathematica notebook provided has an extra layer of {} around the functions, causing ParametricPlot to not work. The suggested solution is to use the ParametricPlot function with the functions directly from the solution, without the extra {} layer. It is also suggested to use the Trace[] function to track down the issue.
  • #1
yashar
31
0
hi
i solve numerically two coupled equation and obtain two function x[t] and y[t].

how i plot x[t] versus y[t] so that horizontal axis to be x[t] and vertical axis to be y[t].

here is the notebook of mathematica
http://www.mediafire.com/?g4sa3zi630vi8nl

thanks
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
Compare
{x[t] /. sol, y[t] /. sol}
with
{x[t], y[t]} /. sol
and see that what you are doing has an extra layer of {} around your functions that ParametricPlot objects to.

So
ParametricPlot[{x[t], y[t]} /. sol, {t, 0, 10}]
should work for you.

It might be educational to track down exactly what happened and why it didn't work.
Trace[] could help you do that.
 

1. What is a parametric plot in Mathematica?

A parametric plot in Mathematica is a type of graph that shows the relationship between two variables, usually called "x" and "y", where both variables are functions of a third variable, typically called "t". This allows for more complex and dynamic visualizations than traditional x-y plots.

2. How do I create a parametric plot in Mathematica?

To create a parametric plot in Mathematica, you can use the ParametricPlot function, which takes in two functions and a range of values for the third variable. For example, ParametricPlot[{Sin[t], Cos[t]}, {t, 0, 2 Pi}] would create a parametric plot of the sine and cosine functions from 0 to 2π.

3. Can I customize the appearance of a parametric plot in Mathematica?

Yes, there are many options for customizing the appearance of a parametric plot in Mathematica. Some common options include changing the color, style, and thickness of the plot lines, adding axes and labels, and adjusting the range of the x and y axes. These options can be specified within the ParametricPlot function.

4. What are the benefits of using a parametric plot in Mathematica?

Parametric plots in Mathematica allow for a deeper understanding and visualization of complex relationships between variables. They can also be used to create dynamic animations and interactive graphs. Additionally, parametric plots are often used in fields such as physics and engineering to model and analyze systems with multiple variables.

5. Can I export a parametric plot in Mathematica to other file formats?

Yes, you can export a parametric plot in Mathematica to various file formats such as PDF, PNG, and SVG. This can be done by right-clicking on the plot and selecting "Save Graphic As" or by using the Export function. You can also adjust the resolution and size of the exported plot.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
257
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
763
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
896
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
129
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
Back
Top