Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
1© 2001-3s2  RMIT University Computational Science 1 1
Overview
COSC1229/1479
Computational Science 1
© 2001-3s2  RMIT University Computational Science 1 2
Overview
Where are we ?
• COSC1229/1479: Computational Science 1
• Lecturer, Tutor, and Course Leader: Ron van Schyndel
– ronvs@cs.rmit.edu.au
– Office: 14.6.4, Phone: x59677
– Consultation time: Wednesday 3.00 - 6.00pm (or after lecture/tute)
• Tutor: Craig Pearce
– crpearce@cs.rmit.edu.au
• Abbreviation: Computational Science = CLS
• News: Group is rmit.cs.ComputationalScience1 
or news://news.cs.rmit.edu.au/rmit.cs.ComputationalScience1
or https://inside.cs.rmit.edu.au/webnews/   then subscribe to
rmit.cs.ComputationalScience1
2© 2001-3s2  RMIT University Computational Science 1 3
Overview
Who are You ?
• There are a variety of students currently enrolled in this course:
– Undergraduate:
• B. App. Sc. (Computational Science), 32 students
• B. App. Sc. (Computer Science), 15 students
• B. App. Sc. (Information Technology) 10 students
• Even 3 Bundoora students !
– Post-Graduate:
• Grad. Dip. eScience 2 students
• M Tech (IT) 1 student
© 2001-3s2  RMIT University Computational Science 1 4
Overview
Course Overview
• 12 Lectures, 12 tute/labs
• 12 Laboratories (self-scheduled)
• 2 Assignments (30% each),
– Handed out in weeks 3 and 8, submitted by end of week 7 and 12
– Both assignments to be demonstrated in the following week (8 and 13)
– Students to set up their account
http://yallara.cs.rmit.edu.au/~yourid/CLS/index.html
– Assignments to be submitted using turnin
• A 3 hour Exam (40%)
• Hurdles:
– Successful completion in the total assignment mark
– Successful completion in the exam
3© 2001-3s2  RMIT University Computational Science 1 5
Overview
Syllabus
1. 
2. Intro and Overview,  
3. Basic Architecture.  Intro to Numerical Methods
4. Basic Java GUI programming, Image Animation, Overview of Matlab
5. Physically-based Modelling, Particle Collisions
6. Spring-Mass Simulations, Projectiles, Pendula, Multiple Springs
7. Monte-Carlo Methods
8. Computational Complexity
9. Introduction to Chaos
10. Fractal Geometry and Chaos
11. Basic 1D Signal Analysis
12. Basic 2D Image Analysis
13. Revision
© 2001-3s2  RMIT University Computational Science 1 6
Overview
Outcomes
The experience we hope to gain from this course is:
• to understand the foundations of computational science; 
• to recognise key problems in computational science; 
• to understand and apply fundamental numerical methods; 
• to understand the role of visualisation in computational 
science and apply some of its techniques; 
• to implement simulation programs.
4© 2001-3s2  RMIT University Computational Science 1 7
Overview
Assignments
Two assignments will constitute 30% each of your final mark.
• They will consist of Java based application or applet and 
supporting documentation.
• Students should work individually on the assignment, but 
discussion between students, particularly during tutes, is 
encouraged. Take advantage of tutes to bring up problems 
and ideas as though the assignment was a project in a 
commercial environment.
Do NOT share code!!! Two people working on
an idea together, one writing the code, then
sharing that code is not acceptable!
© 2001-3s2  RMIT University Computational Science 1 8
Overview
Plagiarism is an Offence
Plagiarism: Submitting an assignment that contains other 
people’s work.
All submitted work must be your own.
The only exception: Other people’s work can be included if 
the assignment has explicit instructions to do so.  All 
copied work (from the internet, other students, or staff) 
must be clearly identified.
A student who submits copied work without reference 
receives no marks for that assignment. Partial marks will 
not be given. Even if only part of the assignment was 
copied, the student will get no marks. If this means that a 
hurdle is not reached, then the student fails the subject.
A student who plagiarises a second time will be sent to the 
university disciplinary committee. Penalties include 
expulsion from the university.
5© 2001-3s2  RMIT University Computational Science 1 9
Overview
University Plagiarism Statement
Students are reminded that cheating, whether by fabrication, 
falsification of data, or plagiarism, is an offence subject to 
University disciplinary procedures. Plagiarism in oral, written or 
visual presentations is the presentation of the work, idea or 
creation of another person, without appropriate referencing, as 
though it is one's own. Plagiarism is not acceptable. The use of
another person's work or ideas must be acknowledged. Failure to 
do so may result in charges of academic misconduct which carry a
range of penalties including cancellation of results and exclusion 
from your course.
Students are responsible for ensuring that their work is kept in a 
secure place. It is also a disciplinary offence for students to allow 
their work to be plagiarised by another student. Students should 
be aware of their rights and responsibilities regarding the use of 
copyright material.
© 2001-3s2  RMIT University Computational Science 1 10
Overview
Exam
The exam will be three hours and will make up 40% 
of the final mark.
It will not involve writing complete Java programs, 
but may require modification or discussion of 
existing code samples.
6© 2001-3s2  RMIT University Computational Science 1 11
Overview
More Details
• Attendance
– Minimum attendance is not compulsory, but additional material 
will be handed out in each lecture, and may not be available online.
– Attendance is compulsory (assessment will take place)
• In tutorial during week 7 (Assignment demonstration, Assignment 1)
• In tutorial during week 13
• Assignment demonstrations
• Exam
• Laboratory Classes
– No specific exercises will be scheduled for the laboratory periods.  
Students are expected to work on assignments during this time.
– Tute/labs are held in 10.9.32 (the Sutherland lab).
• Usage is restricted to students doing graphics classes.
• Disks have a large local storage, but yallara quotas apply in users home dir.
© 2001-3s2  RMIT University Computational Science 1 12
Overview
Help Desks
• Java Help Desk
– Assistance with Java programming
– Timetable for help desk attendance can be found at
http://www.cs.rmit.edu.au/timetables/city/2002s2
under CS Help Desk - Java
– Currently Java help is on Tue/Thu/Fri 16.30-19.30 
7© 2001-3s2  RMIT University Computational Science 1 13
Overview
Recommended Texts
Class notes will be available in print form prior to 
each lecture and parts may be online before that.
Prescribed References: 
• David Acheson, From Calculus to Chaos, 
An introduction to Dynamics.
Oxford University Press, 1997 
Strongly Recommended:
• R. Landau, M Paez, Computational Physics, 1997, Wiley
Recommended References: 
• David Halliday, Robert Resnick and Jearl Walker, Fundamentals of Physics, 
Sixth Edition (parts 1 and 2), 1999
• William H. Press et. al., Numerical Recipes, (in whichever programming 
language the student is familiar) 
© 2001-3s2  RMIT University Computational Science 1 14
Overview
Finally
Have Fun !
8© 2001-3s2  RMIT University Computational Science 1 15
Overview
Computational Science
Overview
© 2001-3s2  RMIT University Computational Science 1 16
Overview
Introduction and overview. 
Definition of Computational Science
“Computational activities from whatever 
discipline with the following characteristics:
• Precise mathematical statement
• Intractable by traditional methods
• In-depth knowledge of science, engineering or arts
• Significant scope”
http:csep1.phy.ornl.edu/
9© 2001-3s2  RMIT University Computational Science 1 17
Overview
Moore's law. 
• Memory chip capacity doubles every 18-24 months
http://www.intel.com/intel/museum/25anniv/hof/moore.htm
© 2001-3s2  RMIT University Computational Science 1 18
Overview
Interdisciplinary Nature of 
Computational Science
– Natural sciences and Mathematics
• Looking for patterns of behaviour in large data sets
• Chaotic behaviour - how do we model this?
• Graph theory - sequences of events,location,items etc
– Engineering
• Finite-element methods of analysis, Stability analysis, simulations
– Numerate humanities and hi-tech arts
• Economic modelling
– Biology / Genetics
• Genome project, Protein interaction modelling
Science Maths
Computer 
Science
10
© 2001-3s2  RMIT University Computational Science 1 19
Overview
Algorithm Abstraction
• Algorithms developed in one area of science can be readily 
applied in very different areas
• Why are certain problems difficult?
– Too big ...combinatorial explosion
– Too complex ...different kinds of interaction
– Nature of interaction ...non-linear dynamics
– Measurement difficulties ...Quantum-like effects
© 2001-3s2  RMIT University Computational Science 1 20
Overview
Travelling Salesman Problem
– Select optimum path for travelling salesman
• each path has a total cost associated with it
• In the case of the travelling salesman, the nodes
represent cities, the length of arrows the distance
between cities
http:www.math.princeton.edu/tsp/history.html/ Search: Travelling/traveling  Salesman Problem, TSP
Distance
C
o
m
bi
n
a
tio
n
11
© 2001-3s2  RMIT University Computational Science 1 21
Overview
Travelling Salesman Problem
– Example of “Combinatorial Optimisation”
(not practical by brute force for > about 30 cities)
http:www.math.princeton.edu/tsp/history.html/
42 Cities
George Dantzig, Ray
Fulkerson, and 
Selmer Johnson (1954)
532 Telephone switch locations
Padberg and Rinaldi (1987)
13,509 cities
Applegate, Bixby, Chvátal, 
and Cook (1998)
Search: Travelling/traveling  Salesman Problem, TSP
© 2001-3s2  RMIT University Computational Science 1 22
Overview
Multi-Body Problems
• Example of 3 body interaction
(vectors indicate gravity strength and direction)
http:www.cs.rnit.edu/~nigels/nbody/
12
© 2001-3s2  RMIT University Computational Science 1 23
Overview
Multi-Body Problems
• Eg Pucks on an ice rink, solar system, 
molecular system, gravitational systems
• Collisions and collision dynamics
• Long range forces vs short range forces
• Hard vs soft collisions
• Lattices and their interactions
© 2001-3s2  RMIT University Computational Science 1 24
Overview
Multi-Body Problems
• Example of Lattice interaction
A single spring mass system can be 
generalised to include many bodies 
(eg 3 bodies).
13
© 2001-3s2  RMIT University Computational Science 1 25
Overview
Multi-Body Problems
• Example of large scale interaction
(Simulation of a fracture using 38 million particles)
David M. Beazley 
Department of Computer Science 
University of Utah 
Salt Lake City, Utah 84112
beazley@cs.utah.edu 
http://www.cs.utah.edu/~beazley 
© 2001-3s2  RMIT University Computational Science 1 26
Overview
Multi-Body Problems
• Vibrational Modelling in Molecular simulations
(two frames shown)
http://www.kfa-juelich.de/wsqs/animation.html Search: many body simulation movie
14
© 2001-3s2  RMIT University Computational Science 1 27
Overview
Grand Computational Challenges
Term First coined by Physicist Dr Ken Wilson of Cornell, 1991
• “Historically, studies of specific problems and corresponding 
breakthroughs have led to the development of new sciences.”
• Covers “...fundamental problems in science or engineering, 
with potentially broad social, political and/or scientific 
impact, that could be advanced by applying high performance 
computing resources.”
© 2001-3s2  RMIT University Computational Science 1 28
Overview
Typical Challenges
• Electronic structure of materials and 
fundamental properties of matter (QCD)
• Genome sequencing and structural biology
• Drug design
• Vision and cognition / speech and language
• Turbulence and pollution dispersion
• Global climate & global warming
15
© 2001-3s2  RMIT University Computational Science 1 29
Overview
Visualisation. 
• Role of visualisation
– to show the data in a form that allows patterns in the data to be 
observed by humans.
– to allow manipulation of data sets in ways that real world data 
cannot be manipulated (yet).
– “Electronic Visualisation is the art and science of creating images in electronic media and on 
virtual reality display devices. The primary goal of the Electronic Visualization graduate 
program is to further [people’s] visual goals using the tools of advanced computer graphics, 
computer animation, interactive graphics, video, and virtual reality (VR). ”
-- Electronic Visualization Laboratory University of Illinois at Chicago
(http://evlweb.eecs.uic.edu/)
© 2001-3s2  RMIT University Computational Science 1 30
Overview
Visualisation. 
Microtomography of a fossil shell -- Argonne National Labs
http://www.kfa-juelich.de/wsqs/animation.html
16
© 2001-3s2  RMIT University Computational Science 1 31
Overview
Visualisation. 
Stereo
Transparency
Research Activities: Roman Durikovic, PhD, Assistant Professor
http://www.eml.hiroshima-u.ac.jp/member/person/Roman.d/research/mousevis/mvisual.html
Anatomy of 10.5 days old mouse embryo is 
demonstrated in this page afther the successful 
reconstruction from a set of microscopic slices.
Stereo pair showing the major organs
The major blood vessels
© 2001-3s2  RMIT University Computational Science 1 32
Overview
Visualisation
The study of photonic crystals involves 
electromagnetic modeling of periodic structures of 
alternating layers of materials with different 
refractive indices. Depending on the type of 
structure and scale, a photonic band gap of 
forbidden wavelengths is obtained for the device. 
By destroying the periodic structure in a limited 
region of the crystal, a waveguide can be created. 
Such waveguides can be designed having very 
sharp bends without significant loss of radiation. 
This may enable an increase in integration density 
in photonic circuits by several orders of magnitude.
From the website http://www.femlab.com/showroom/interactive/electro/photoniccrystal/index.php
This model consists of silicon (GaAs) pillars placed equidistant 0.375 µm 
from each other. The distance between the pillars prevent light of certain 
wavelengths to be propagated into the crystal structure, thus guiding the 
light along the path where the pillars have been removed. The figure to 
the left depicts the geometry of the 2D model.
Photonic Crystal as 
Light Conductor
17
© 2001-3s2  RMIT University Computational Science 1 33
Overview
Photonic Crystal as Light Conductor
© 2001-3s2  RMIT University Computational Science 1 34
Overview
Photonic Crystal as Light Conductor
18
© 2001-3s2  RMIT University Computational Science 1 35
Overview
Photonic Crystal as Light Conductor
© 2001-3s2  RMIT University Computational Science 1 36
Overview
Photonic Crystal as Light Conductor
19
© 2001-3s2  RMIT University Computational Science 1 37
Overview
Photonic Crystal as Light Conductor
© 2001-3s2  RMIT University Computational Science 1 38
Overview
Photonic Crystal as Light Conductor
20
© 2001-3s2  RMIT University Computational Science 1 39
Overview
Photonic Crystal as Light Conductor
© 2001-3s2  RMIT University Computational Science 1 40
Overview
Photonic Crystal as Light Conductor
21
© 2001-3s2  RMIT University Computational Science 1 41
Overview
Photonic Crystal as Light Conductor
© 2001-3s2  RMIT University Computational Science 1 42
Overview
Photonic Crystal as Light Conductor
22
© 2001-3s2  RMIT University Computational Science 1 43
Overview
Photonic Crystal as Light Conductor
© 2001-3s2  RMIT University Computational Science 1 44
Overview
Photonic Crystal as Light Conductor
From the website http://www.femlab.com/showroom/interactive/electro/photoniccrystal/index.php
23
© 2001-3s2  RMIT University Computational Science 1 45
Overview
Chaos
• Chaotic behaviour - How do we model it?
– L-systems - (used for fractal trees)
…for scientific modelling
Research Activities: Roman Durikovic, PhD, Assistant Professor
http://www.eml.hiroshima-u.ac.jp/member/person/Roman.d/research/mousevis/mvisual.html
“We have showed that the formal languages such as 
parametric differential L-systems can be used in growth 
simulations of organs. The stomach undergoes the rapid 
changes that were approximated with a global geometric 
transformation.”
© 2001-3s2  RMIT University Computational Science 1 46
Overview
Simulated gas-phase 
molecular dynamics
• Balls-in-a-box
• Kinetic Gas Theory, Temperature
• Speed distribution of particles http:www.cs.rnit.edu/~nigels/nbody/
24
© 2001-3s2  RMIT University Computational Science 1 47
Overview
Computer Performance and Optimisation
• Loops and other repeat structures
– role of vectorisation
• Local versus global optimisation
– role of compiler (automatic optimisation)
• Implementation vs algorithmic optimisation
– effect on final code execution times
© 2001-3s2  RMIT University Computational Science 1 48
Overview
Bioinformatics
• Genomic Databases
• High-volume, Data-driven
• Often keyed on single characteristics such as
– nucleotide or amino-acid sequence, organism, gene-annotation or 
protein name.
• Protein Information Resources
• Data analysis service industry
– Looking for measures of statistical significance, clustering, level 
of discrimination or sequence homology
– Other information sources:
° genomic sequences, expressed sequence tags, micro-array 
experimental images, 2D protein gels
• A global database must integrate all these information sources
• Searching Mechanisms
• We have local expertise here at RMIT (potential research 
direction)
25
© 2001-3s2  RMIT University Computational Science 1 49
Overview
Distributed and parallel computing. 
• The Von Neumann model
• Alternatives
– SISD, SIMD, MIMD, Network
• Vector vs cluster
• Role of communication between "grid" 
elements
• Amdahl's Law
© 2001-3s2  RMIT University Computational Science 1 50
Overview
Distributing the load using MPI
• MPI (Message Passing Interface).
The goal of MPI, is to develop a widely used standard for writing 
message-passing programs. As such the interface attempts to establish 
a practical, portable, efficient, and flexible standard for message 
passing.
• MPI can be used to implement “coarse-grained” parallel 
computing architectures.
26
© 2001-3s2  RMIT University Computational Science 1 51
Overview
Spatial Data Structures
• Uniform and 
non-uniform grids
• Spatial decomposition
• Use of MPI in subdividing and distributing 
the workload
http//www.gisdevelopement/aars/acrs/2000/ts9/imgp0017.shtml