MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ParametricPlot Remark


> ParametricPlot  - works fine giving nice smooth courbes ,
> ParametricPlot3D - samples largely giving a pretty zigzag form !

ParametricPlot is adaptive -- it adds extra sample points where the  
curve is bending more.
ParametricPlot3D is not adaptive -- it just uses the initial sample  
points.

You can, as you observe, increase the number of sample points  
(PlotPoints -> ...), but with your example  - plotting the solution  
to the Lorentz equations - you have interpolating functions, which  
*have* been constructed adaptively, and we can extract the points  
found.

1) Solve your equations:

 s = 10;
 b = 8/3;
 r = 167;

 tmax = 10;

 eq = {
	x'[t] == s ( y[t] - x[t] ),
        y'[t] == r x[t] - y[t] - x[t] z[t],
	z'[t] == - b z[t] + x[t] y[t],
	x[0] == 0,
	y[0] == 1,
	z[0] == 0
 	};

 sol = NDSolve[ eq, {x,y,z} , {t, 0, tmax},
	MaxSteps -> 5000, StartingStepSize -> 0.001];

2) get the coordinates of the points found

coordinates =
  Thread[Cases[sol,InterpolatingFunction[__,l_]:>First/@l, Infinity]];

3) Plot the line through the points

Show[Graphics3D[Line[coordinates]]]


 Allan Hayes
hay at haystack.demon.co.uk
http://www.haystack.demon.co.uk/


  • Prev by Date: Nonlinear Fit Problem
  • Next by Date: Functions and evaluation, returning themselves
  • Previous by thread: ParametricPlot Remark
  • Next by thread: Re: ParametricPlot Remark