Problem with parametric plot



On Wed, 2007-04-04 at 11:44 +1000, Alasdair McAndrew wrote:
> Try:
> 
> plot2d([parametric,x, y,[s,0,1]],[gnuplot_preamble,"set dummy s"]);
> 
> and see if that works.
 Thank you for the tip. Using the command that you suggest allows the
routine to run without an error but the plot file is empty (no data is
written to the file).

I changed the code to create lists of x and y then graph the output as a
set of discrete points. A suboptimal technique I am sure but I could not
get plot2d to evaluate my functions.

beam(m,n):=
block ( [s],
	b:3,
	lam:m^2*%pi^2,	
	cospsi:ev(collectterms(cospsi,c),eval),
	sinpsi:ev(collectterms(sinpsi,c),eval),
	x:sum(coeff(cospsi,c,2*i)*integrate(cos(lam*s)^(2*i),s),i,0,n),
	y:sum(coeff(sinpsi,c,2*i+1)*integrate(cos(lam*s)^(2*i+1),s),i,0,n),
	xcoor[0]:0,
	ycoor[0]:0,
	for j thru 100 do (
		xcoor[j]:ev(x,s=j/100,numer),
		ycoor[j]:ev(y,s=j/100,numer) ),
	plot2d([discrete,listarray(xcoor),listarray(ycoor)])
) $