Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Parametric List Plot??

1,354 views
Skip to first unread message

nlko

unread,
May 13, 2012, 3:06:07 AM5/13/12
to
Hi,
For some phase portraits I want to plot two lists of data in one plot
(x and y axis).
I found ParametricPlot for functions but need that parametric part
combined with ListPlot..?
Thanks in advance!

Kevin J. McCann

unread,
May 14, 2012, 1:37:36 AM5/14/12
to
You could use Interpolation to get a function and then use
ParametricPlot with that.

Kevin

Bob Hanlon

unread,
May 14, 2012, 1:38:06 AM5/14/12
to
Assuming that the lists are the same length:

ListPlot[Thread[{xdata, ydata}]]


Bob Hanlon

nanobio9

unread,
May 15, 2012, 4:57:15 AM5/15/12
to
If you know very well the points (values of parameters) at which to
plot, why don't you just use ListPlot[Table[f[p],{p,{set of parameter
values}}]]?


Alexei Boulbitch

unread,
May 15, 2012, 4:54:11 AM5/15/12
to
Hi,
For some phase portraits I want to plot two lists of data in one plot
(x and y axis).
I found ParametricPlot for functions but need that parametric part
combined with ListPlot..?
Thanks in advance!

Hi,
To the best of my knowledge, there is no such a function. There is, however, a simple work around.
Say, for example, you need to solve this:

sol = NDSolve[{y''[t] == Sin[y[t]], y[0] == 1, y'[0] == 0},
y[t], {t, 0, 3 \[Pi]}][[1]]

{y[t] -> \!\(\*
TagBox[
RowBox[{"InterpolatingFunction", "[",
RowBox[{
RowBox[{"{",
RowBox[{"{",
RowBox[{"0.`", ",", "9.42477796076938`"}], "}"}], "}"}],
",", "\<\"<>\"\>"}], "]"}],
False,
Editable->False]\)[t]}

The result is the interpolation function. Now you need a numeric calculus package:

Needs["NumericalCalculus`"]

With this you easily find the numeric derivative, ND[ ], of the solution. Let us package it into a list
With the following structure {...{y[t],y'[t]}...}:

lst = Table[{y[t] /. sol /. t -> t1, ND[(y[t] /. sol), t, t1]}, {t1,
0, 2. \[Pi], 0.05}];

Here is your phase portrait:

ListPlot[lst]

Evaluate it.

Have fun, Alexei


Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44

e-mail: alexei.b...@iee.lu




k.mis...@gmail.com

unread,
Oct 23, 2012, 1:04:22 AM10/23/12
to
Works for me. Thanks!

emil.bry...@weknowit.nu

unread,
Apr 21, 2013, 5:17:50 AM4/21/13
to
Thread helped me, thanks!

0 new messages