|
|||||||||
SciencePostgraduate workUntil I find time to create/finish the content on this page, I will post some of the coursework from my MSc (in HTML and PDF formats), and eventually eBooks containing course notes from my MSc (photon science) and my BSc (maths and physics). Where available, the awarded mark is also shown in square brackets. Essays
I recommend using the PDF versions over the HTML ones, as some elements appear out of place in the HTML versions due to the conversion process. The presentations are available in Powerpoint (PPT) format on request. Short articlesThese articles (all PDF format) are intended to be educational but were put together fairly quickly - they may contain the occasional mistake...
PresentationsThese presentations are complementary to the essays above. They are available in Powerpoint (PPT) format on request.
Calculating PI from the Mandelbrot setUntil I get round to filling out this page, here's a program that calculates PI from Mandelbrot paths by mercilessly stealing a discovery made by David Boll [PDF]. To use the program, simply run it, then enter the error range you'd like it to work to: for example, 0.01 will get you a result with an error of up to +/- 1 in the "hundredths" digit (after rounding); 1E-6 would produce a result with +/-1 error in the "millionths" digit (after rounding). The main part of this program is now written in x86 ASM, as this runs around 900% faster than the same algorithm in pure Pascal (due to Delphi's optimiser being hopeless with FPU code). The ASM version loads data into CPU and FPU registers, then for the duration of the algorithm it does not use system memory at all (code fits into L1 cache) and does not move any data between CPU and FPU (besides [E]FLAGS for conditional jumping). The Pascal version is considerably slower as the compiler-produced ASM for the repeated part of the algorithm constantly moves chunks of data (up to 160 bits at a time) between memory (presumably L1 data cache), CPU and FPU registers during each iteration. The main loop consists of 51 (compiler-generated) ASM instructions in the Pascal version and just 25 (handwritten) ASM instructions in the ASM version. The benchmark version (ASM-BENCH) uses a slight structural change to the loop, which reduces the number of instructions per loop to 24 (one less than the ASM version). The benchmark should not be used on systems with single-core processors. I would recommend setting epsilon such that each "loop" takes several minutes (1E-10 should be fine). As interrupts, operating-system features and background processes will affect the performance of the benchmark (and most other benchmarks), I would recommend taking the MAXIMUM value that PiFractal produces (set it to run 20-50 loops). There is an exact theoretical limit to how fast it can run on a certain processor, so provided it comes very near to that limit at least once out of the many loops that you run, the results will have some meaning and be comparable across systems (when run with the same epsilon value). Slight variations in the computer's FSB frequency are the only source of error that cannot be avoided (theoretically) with the right code, as far as I know. Tools such as CPUZ may give some indication as to how much the FSB frequency varies. The programs are released under the same disclaimer as the software on the software page.
MathematicsIntroductionTODO: NB. Give each of the following its own section! Problem solving - problems solved recently including Chris' maximum. Graphics vs. theoretical treatment of problems. Chambers and his intro to calculus vs. university "intro to calculus". Music - missing fundamental and ringing. Overlap of the two in powerchords / fifths. 12th fret and 19/7th fret harmonics in powerchord, 5th/24th. 5th/7th tuning and Pythagorean vs. Equal - circle/spiral. Geometry: Circle defined by three pointsThe roundest knight at King Arthur's table was Sir Cumference. He acquired his size from 2 much PI. Terms used here:
Circles
Conventionally, a circle is described by its centre C (a, b) and radius (r). The distance of a point P (x, y) from the centre of the circle is given by
Where:
The problemMost graphics programs either allow you to draw circles by marking the centre, then dragging to set the radius, or they draw them to fit an invisible box dragged out by the cursor. Sometimes, I may want a circle in an image to act as a border, and cross through several features that should be at the edge of an image, so neither of the common ways of describing circles to a graphics program were particulally useful. Yes, you can keep re-drawing and dragging circles until one fits, but doesn't that seem a bit tedious? What are lines and circles, mathematically?A line can be described by two points that it passes through. It can also be described with a point on the line, and a direction that the line leaves/enters the point in:
A circle can also be described by three points that it's circumference passes through.
Parallax and the bisector of two pointsWith two points (that aren't overlapping), the path formed by points ("locus") that are equidistant from them lies along a line called the "bisector". This line is at exactly 90 degrees (a "right angle") to a line joining the two points, and halfway along it, ie. halfway between either point. With three points, we can draw three bisectors. For this problem though, we only need two.
* = not quite true, but we can assume so for this problem. Technically, parallel lines meet at infinity (
Three points and some bisectorsWe start with three points that aren't colinear. First, we number them 1, 2 and 3 and draw some lines to connect them:
We now draw the perpendicular* bisectors of the connecting lines and label these. Below, I've labelled the bisector of points 1 and 2 "A" and the bisector of points 2 and 3 "B":
Finding the centre and radiusNow time to apply some logic:
Or put in simpler terms: where these bisectors meet, we have the centre of our circle! The radius of the circle (distance from the centre to the edge) is the distance between any of the points and the centre:
As we have a centre and a radius, we can now draw the circle:
Animated methodThe whole process in stages is shown in the animation below: This requires an SVG-capable browser such as Opera. It will almost certainly NOT work in Internet Explorer, and Chrome doesn't seem too happy with animated SVG either. The algebraTo describe this mathematically, vectors are very useful. They aren't essential, but they do reduce the amount of writing considerably, and simplify it.
PhysicsIntroductionTODO: Give each of the following its own section! High importance of graphical treatment. Feynman's analogy of curved spacetime. Chemists' importance with actual lab for discovery, vs. physicists' thought-lab for discoveries and developments - Churchman conversation. 10yrs Gallilean relativity and time-travel paradoxes (football match), determinism and thought problem. Einstein, special relativity vs. 12 yrs "speed of light" problem. Simple explanations of some physical problems and their importance, labs to assist explanation and vindication. Simple quantum mechanics? Aikido physics? Feynman's quote "We couldn't reduce it to a simple level, which means we don't fully understand it". Recommend some good books! ComputersIntroductionTODO: Give each of the following its own section! British rocket attempts. Code breaking. IBM quote - how many will we need? Ease to build nowadays with CPUs and RAM cheaply available, and cheap units to convert (PSP, GBA, cellphone, etc) Use for any task that can be treated mathematically / logically Some examples - This website - XSL, XPath, XML, XHTML, CSS for easy page (re)generation. Smug comment about validator and examples of (seemingly harmless) problems encountered along the way (eg. xmlns=""). Big leap from bad quirky html to strict xhtml. Title graphic - how it was made - Delphi, circle vs. sine, blur function, gaussian blur, envelope, copy, paint-shop-pro finishing, final half-size. Ease of manipulation in program, adjustment and sandboxing in PSP. Sound engineering - DFT, echo, reverb - digital vs. valves - reverb pipes. Solving physics problems quicly. Importance of testing programs with predictable data and organised logic - IF/IF/ELSE/ELSE indenting in pascal for example. Examples of annoying bugs encountered in the past (including "INTERNAL ERROR") Link to software page, with # markers to find programs of relavent interest. Link to graphics where needed too. Software for clean version of MIDICOM3EG2. Example of timetable colorizer and description of how it works - cleaning, AI column detect, merge into database, use of interfaces, XML translation. Note CSS use again. VMware, Lack of spell checker - apologise for typos on the website in its current primordial state. Reasons for not using MathML (bulky, not IE compat) and eventual use of LaTeX (lack of nice software for doing individual equations and saving to PNG). |
|||||||||
|
|||||||||
|
Musings from an addled physicist | Mark Cowan © 2009 | Why not have a game of squash? |