source: inundation/pypar_dist/mandelbrot_example/mandel_sequential.py @ 2131

Last change on this file since 2131 was 1852, checked in by ole, 19 years ago

Added prerequisites for mandelbrot_example

File size: 640 bytes
Line 
1#!/usr/bin/env python
2
3"""Sequential program computing the Mandelbrot set.
4
5Ole Nielsen, SUT 2003
6"""
7
8from mandelbrot import calculate_region
9from mandelplot import plot
10import time
11
12# User definable parameters
13kmax = 2**15  # Maximal number of iterations (=number of colors)
14M = N = 700   # width = height = N (200, 400, 600, 700 are good)
15
16# Region in complex plane
17real_min = -2.0
18real_max =  1.0
19imag_min = -1.5
20imag_max =  1.5
21
22# Compute Mandelbrot set
23t0 = time.time()
24A = calculate_region(real_min, real_max, imag_min, imag_max, kmax, M, N)
25print 'Computed region in %.2f seconds' %(time.time()-t0)
26
27# Plot result
28plot(A, kmax)
29
30
31
32
Note: See TracBrowser for help on using the repository browser.