PDF

sec2.7.1.html
sec2.7.1.mws
Essential Maple 7
Robert M. Corless
Department of Applied Mathematics
University of Western Ontario
London, Canada
Copyright
Copyright 2001 by Robert M. Corless
All rights reserved
Chapter 2: Useful one-word commands
Section 2.7: Plotting in Maple
Session 2.7.1: Two-dimensional plots
> restart;
> plot( Zeta(t), t=-3..3, y=-3..3, discont=true, colour=black );
http://www.mapleapps.com/powertools/EssentialMaple7/html/sec2.7.1.html (1 of 12)9/13/2004 1:17:11 PM
sec2.7.1.html
> alias( W=LambertW );
> plot( {W(x),W(-1,x)}, x=-0.5..1.5, y=-4..1, colour=black );
http://www.mapleapps.com/powertools/EssentialMaple7/html/sec2.7.1.html (2 of 12)9/13/2004 1:17:11 PM
sec2.7.1.html
> plot( [t*exp(t), t, t=-4..1], view=[-0.5..1.5,-4..1], colour=black );
> plot( {seq(orthopoly[T](k,x),k=0..20)}, x=-1..1, y=-1..1, axes=BOXED, colour=black, scaling=CONSTRAINED, numpoints=101 );
> with( orthopoly ):
> plot( {seq( [T(2,t),T(k,t),t=-1..1], k=1..5) ,
http://www.mapleapps.com/powertools/EssentialMaple7/html/sec2.7.1.html (3 of 12)9/13/2004 1:17:11 PM
sec2.7.1.html
seq( [T(2,t),-T(k,t),t=-1..1],k=1..5)}, view=[-1..1,-1..1], colour=black,
scaling=CONSTRAINED, axes=BOXED );
> plot( {seq( [T(2,t),T(k,t),t=-1..1], k=1..20) ,
seq( [T(2,t),-T(k,t),t=-1..1],k=1..20)}, view=[-1..1,-1..1], colour=black,
scaling=CONSTRAINED, axes=BOXED );
http://www.mapleapps.com/powertools/EssentialMaple7/html/sec2.7.1.html (4 of 12)9/13/2004 1:17:11 PM
sec2.7.1.html
> restart;
> with(student):
> leftbox(1/(1+t), t=0..1, 6, colour=black );
>
> restart;
> f := 1/(2+sin(theta));
> a := n -> Int( f*cos(n*theta), theta=0..2*Pi )/Pi;
http://www.mapleapps.com/powertools/EssentialMaple7/html/sec2.7.1.html (5 of 12)9/13/2004 1:17:11 PM
sec2.7.1.html
> b := n -> Int( f*sin(n*theta), theta=0..2*Pi )/Pi;
> Approx := N -> add( b(k)*sin(k*theta), k=1..N )
+add( a(k)*cos(k*theta), k=1..N ) + a(0)/2;
> err := evalf( f - Approx(5) ):
> plot( err, theta=0..2*Pi );
> restart;
> G := t -> frac(1/t);
http://www.mapleapps.com/powertools/EssentialMaple7/html/sec2.7.1.html (6 of 12)9/13/2004 1:17:11 PM
sec2.7.1.html
> plot( G, 0..1, 0..1, numpoints=101, colour=black );
> y := [ seq( k/10., k=0..10 ) ];
> y[11] := y[11] - Float(1,3-Digits);
> t := Vector[row]( 1..1100 ):
> for i to 100 do
for j to 11 do
t[(i-1)*11+j] := 1./(i+y[j]);
end do;
end do;
http://www.mapleapps.com/powertools/EssentialMaple7/html/sec2.7.1.html (7 of 12)9/13/2004 1:17:11 PM
sec2.7.1.html
> gt := map( G, t ):
> gt_0 := map( G, t[1100-7..1100] );
> pts := zip( (x,y)->[x,y], t, gt ):
> whattype(pts);
> plot( convert(pts,list), view=[0..1,0..1], colour=black );
> pieces := array(1..100):
> for i to 100 do
pieces[i] := NULL;
for j to 11 do
pieces[i] := pieces[i], 1./(1+y[j]), y[j];
end do;
pieces[i] := [pieces[i]];
end do:
http://www.mapleapps.com/powertools/EssentialMaple7/html/sec2.7.1.html (8 of 12)9/13/2004 1:17:11 PM
sec2.7.1.html
> pieces := array(1..100):
> ys := [seq(y[j],j=1..11)]:
> for i to 100 do
pieces[i] := zip((i,j)->[i,j],[seq(1./(i+y[j]),j=1..11)],ys);
end do:
> plot( {seq(pieces[k],k=1..100)}, view=[0..1,0..1], colour=black);
> restart;
> with( plots, polarplot );
> polarplot( {seq(cos(5*theta)+n*cos(theta),n=-5..5)},
theta=0..2*Pi, colour=black, axes=BOXED, scaling=CONSTRAINED);
http://www.mapleapps.com/powertools/EssentialMaple7/html/sec2.7.1.html (9 of 12)9/13/2004 1:17:11 PM
sec2.7.1.html
> r := (n,theta) -> cos(5*theta) + n*cos(theta);
> plots[display]( [seq(plot( [r(n,t)*cos(t),r(n,t)*sin(t),t=0..2*Pi]) ,n=-5..5)],insequence=true);
http://www.mapleapps.com/powertools/EssentialMaple7/html/sec2.7.1.html (10 of 12)9/13/2004 1:17:11 PM
sec2.7.1.html
> polarplot( (4*cos(3*theta)+cos(13*theta))/cos(theta), theta=0..2*Pi, colour=black, axes=BOXED );
> polarplot( (4*cos(theta)+cos(9*theta))/cos(theta), theta=0..2*Pi, colour=black, axes=BOXED );
> polarplot( exp(cos(theta))-2*cos(4*theta)+sin(theta/12)^5, theta=0..24*Pi, colour=black, axes=BOXED );
http://www.mapleapps.com/powertools/EssentialMaple7/html/sec2.7.1.html (11 of 12)9/13/2004 1:17:11 PM
sec2.7.1.html
>
>
http://www.mapleapps.com/powertools/EssentialMaple7/html/sec2.7.1.html (12 of 12)9/13/2004 1:17:11 PM