Mirza Nur Hidayat

Home
Scilab
About
Visualisasi Sains - Planewave


Plot visualisasi di atas dengan menggunakan aplikasi gnuplot (http://gnuplot.info) dengan kode program sebagai berikut.
Gambar kiri:

    set terminal qt size 300,300
    set xlabel "x"
    set ylabel "y"
    set pm3d map
    set palette model RGB
    set palette defined (0 "white", 0.2 "red")
    splot "planewave11.dat" notitle
Gambar kanan:
    set terminal qt size 300,300
    set xlabel "x"
    set ylabel "y"
    set pm3d map
    set palette model RGB
    set palette defined (-0.2 "white", 0.2 "red")
    splot "planewave21.dat" notitle
Data "planewave11.dat" diperoleh dari hasil eksekusi kode program:
    program planewave
	implicit none
	
	integer :: i, j, lx, ly, nx, ny
	real :: psi, x, y
	real, parameter :: pi = 3.1415

	lx = 10
	ly = 10
	nx = 1
	ny = 1

	open(1, file = "/Mirza/UHAMKA/SNIPS ITB/Code/planewave11.dat")

	x = -0.1

	do i = 0, 100
		x = x + 0.1

		y = -0.1

		do j = 0, 100
			y = y + 0.1
			psi = sqrt(2.0/lx) * sqrt(2.0/ly) * sin(pi * nx * x / lx) * sin(pi * ny * y / ly)

			write(1, *) x, y, psi
		end do

		write(1, *) "", "", ""
	end do
end program planewave
Data "planewave21.dat" diperoleh dari hasil eksekusi kode program:
    program planewave
	implicit none
	
	integer :: i, j, lx, ly, nx, ny
	real :: psi, x, y
	real, parameter :: pi = 3.1415

	lx = 10
	ly = 10
	nx = 2
	ny = 1

	open(1, file = "/Mirza/UHAMKA/SNIPS ITB/Code/planewave21.dat")

	x = -0.1

	do i = 0, 100
		x = x + 0.1

		y = -0.1

		do j = 0, 100
			y = y + 0.1
			psi = sqrt(2.0/lx) * sqrt(2.0/ly) * sin(pi * nx * x / lx) * sin(pi * ny * y / ly)

			write(1, *) x, y, psi
		end do

		write(1, *) "", "", ""
	end do
end program planewave
Selamat mencoba!