panduan plot grafik dengan mapple.pdf
TRANSCRIPT
7/23/2019 Panduan plot grafik dengan Mapple.pdf
http://slidepdf.com/reader/full/panduan-plot-grafik-dengan-mapplepdf 1/6
BAB III MENGGAMBAR GRAFIK 15
_____________________________________________________________________
_____________________________________________________________________ Program Studi Matematika Jurusan Matematika FMIPA Universitas Brawijaya
BAB IIIMENGGAMBAR GRAFIK
3.1. Grafik Dua Dimensi
Menggambar fungsi dengan satu variabel pada Maple dilakukan dengan
perintah plot. Perintah ini hanya dapat digunakan untuk fungsi eksplisit, baik fungsi
sederhana maupun fungsi parameter, untuk data kontinu maupun berupa array.
Perhatikan worksheet berikut:
> restart;
> plot(cos(x) + sin(x), x=0..Pi);
> plot(tan(x), x=-Pi/3..Pi/3);
> plot([sin(t), cos(t), t=-Pi..Pi]);
> plot(sin(t),t);[Pada contoh terakhir di atas, domain tidak diberikan; Maple menggunakan t=-10..10.
[ Empat plot di atas juga dapat dilakukan dengan cara sebagai berikut:
> plot(cos + sin, 0..Pi):
> plot(tan, -Pi..Pi):
> plot([sin, cos, -Pi..Pi]):
> plot(sin):
[Untuk ekspresi yang mempunyai diskontinuitas pada interval yang diberikan:
> plot(tan(x), x = -2*Pi..2*Pi, y = -4..4, discont = true);
> plot( -1 + 2*Heaviside(x-1) , x = -1..2, discont = true);
7/23/2019 Panduan plot grafik dengan Mapple.pdf
http://slidepdf.com/reader/full/panduan-plot-grafik-dengan-mapplepdf 2/6
BAB III MENGGAMBAR GRAFIK 16
_____________________________________________________________________
_____________________________________________________________________ Program Studi Matematika Jurusan Matematika FMIPA Universitas Brawijaya
[ Plot beberapa fungsi dalam satu frame
> plot([sin(x), x-x^3/6], x=0..2, color=[red,blue],style=[point,line]);
[Plot tak hingga
> plot(sin(x), x=0..infinity);
[plot titik
> l := [[ n, sin(n)] $n=1..10];
> plot(l, x=0..15, style=point,symbol=circle);l [ ],1 ( )sin 1 [ ],2 ( )sin 2 [ ],3 ( )sin 3 [ ],4 ( )sin 4 [ ],5 ( )sin 5 [ ],6 ( )sin 6 [ ],7 ( )sin 7, , , , , , ,[:=
[ ],8 ( )sin 8 [ ],9 ( )sin 9 [ ],10 ( )sin 10, , ]
[beberapa plot lain
> s := t->100/(100+(t-Pi/2)^8): r := t -> s(t)*(2-sin(7*t)-cos(30*t)/2):
> plot([r(t),t,t=-Pi/2..3/2*Pi],numpoints=2000,coords=polar,axes=none);
> plot([x, tan(x), x=-Pi..Pi], -4..4, -5..5,tickmarks=[8,10]);
7/23/2019 Panduan plot grafik dengan Mapple.pdf
http://slidepdf.com/reader/full/panduan-plot-grafik-dengan-mapplepdf 3/6
BAB III MENGGAMBAR GRAFIK 17
_____________________________________________________________________
_____________________________________________________________________ Program Studi Matematika Jurusan Matematika FMIPA Universitas Brawijaya
[plot dalam koordinat polar (dengan kurva dipertebal)
> plot([sin(4*x),x,x=0..2*Pi],coords=polar,thickness=3);
Untuk meggambarkan fungsi implisit dua dimensi, perintah yang digunakan adalah
implicitplot. Perhatikan contoh berikut:
> with(plots):implicitplot(x^2 + y^2 = 1,x=-1..1,y=-
1..1,numpoints=500);implicitplot(r = 1 - cos(theta),r=0..2,theta=0..2*Pi,coords=polar,numpoints=500);
[Plot beberapa fungsi implisit sekaligus
> implicitplot({x^2 - y^2 = 1,y = exp(x)},x=-Pi..Pi,y=-Pi..Pi);
Catatan:
Jika gambar diklik, maka contex bar akan menampirkan tombol menu untuk
gambar.
Pelajari efek perubahan nilai numpoints!
3.2. Grafik Tiga Dimensi
Perintah untuk menggambar grafik tiga dimensi dari fungsi eksplisit baik fungsi biasa
maupun fungsi parameter adalah plot3d.
7/23/2019 Panduan plot grafik dengan Mapple.pdf
http://slidepdf.com/reader/full/panduan-plot-grafik-dengan-mapplepdf 4/6
BAB III MENGGAMBAR GRAFIK 18
_____________________________________________________________________
_____________________________________________________________________ Program Studi Matematika Jurusan Matematika FMIPA Universitas Brawijaya
> restart; with(plots):Warning, the name changecoords has been redefined
> plot3d(sin(x+y),x=-1..1,y=-1..1);
> plot3d(sin(x*y),x=-Pi..Pi,y=-Pi..Pi);
> plot3d(sin(x*y),x=-Pi..Pi,y=-x..x);
> plot3d([x*sin(x)*cos(y),x*cos(x)*cos(y),x*sin(y)],x=0..2*Pi,y=0..Pi);
> plot3d(x*exp(-x^2-y^2),x=-2..2,y=-2..2,grid=[49,49]);
[Warna plot juga dapat dimodifikasi
> plot3d(x*exp(-x^2-y^2),x=-2..2,y=-2..2,color=x);
[Plot 3d berapa fungsi dalam satu frame
> plot3d({sin(x*y), x + 2*y},x=-Pi..Pi,y=-Pi..Pi);c1:= [cos(x)-2*cos(0.4*y),sin(x)-2*sin(0.4*y),y]:c2:= [cos(x)+2*cos(0.4*y),sin(x)+2*sin(0.4*y),y]:c3:= [cos(x)+2*sin(0.4*y),sin(x)-2*cos(0.4*y),y]:
7/23/2019 Panduan plot grafik dengan Mapple.pdf
http://slidepdf.com/reader/full/panduan-plot-grafik-dengan-mapplepdf 5/6
BAB III MENGGAMBAR GRAFIK 19
_____________________________________________________________________
_____________________________________________________________________ Program Studi Matematika Jurusan Matematika FMIPA Universitas Brawijaya
c4:= [cos(x)-2*sin(0.4*y),sin(x)+2*cos(0.4*y),y]: plot3d({c1,c2,c3,c4},x=0..2*Pi,y=0..10,grid=[25,15],style=patch); plot3d({c1,c2,c3,c4},x=0..2*Pi,y=0..10,grid=[25,15],style=patch,color=sin(x));
Plot fungsi implist tiga dimensi:
> restart; with(plots):Warning, the name changecoords has been redefined
> implicitplot3d( x^3 + y^3 + z^3 + 1 = (x + y + z +1)^3,x=-2..2,y=-2..2,z=-2..2,grid=[13,13,13]);
> implicitplot3d({x^2 - y^2 + z^2 = 1,y = exp(-x*z)},x=-Pi..Pi,y=-Pi..Pi,z=-1..1);
> implicitplot3d( (x-1)^2 + (y+1)^2 + z^2 = 4,x=-1..3,y=-3..1,z=-2..2,color=blue);
7/23/2019 Panduan plot grafik dengan Mapple.pdf
http://slidepdf.com/reader/full/panduan-plot-grafik-dengan-mapplepdf 6/6
BAB III MENGGAMBAR GRAFIK 20
_____________________________________________________________________
_____________________________________________________________________ Program Studi Matematika Jurusan Matematika FMIPA Universitas Brawijaya
3.3. Animasi
Selain membuat grafik statis, Maple juga mampu membuat grafik animasi dari
fungsi dengan dua variabel (plot fungsi dua dimensi yang bergerak). Perhatikan
contoh worksheet berikut:
> with(plots):
> animate( sin(x*t),x=-10..10,t=1..2,frames=50);
> animate([sin(x*t),x,x=-4..4],t=1..4,numpoints=100,frames=100);
> animate([sin(x*t),x,x=-4..4],t=1..4,coords=polar,numpoints=100, frames=100);
> animate(sin(5*x*t),x=-3..3,t=0..1,view=0..1);
> animate( [u*sin(t),u*cos(t),t=-Pi..Pi],u=1..8,view=[-
8..8,-8..8]);
> animate( [u*t,t,t=1..8*Pi],u=1..4,coords=polar,frames=60,numpoints=100);
> animate( {x-x^3/u,sin(u*x)}, x=0..Pi/2,u=1..16 );
> animate( {x-x^3/u,sin(u*x)}, x=0..Pi/2,u=1..16 ,color=red);
> s := t->100/(100+(t-Pi/2)^8): r := t -> s(t)*(2-sin(7*t)-cos(30*t)/2):
animate([u*r(t)/2,t,t=-Pi/2..3/2*Pi],u=1..2,numpoints=200,coords=polar,axes=none,color=green);
Catatan:
Seperti hal pada grafik, ketika gambar animasi diklik, contex bar menunjukkan
tombol-tombol operasi untuk animasi