This is a fairly detailed (I hope!) "how-to" for Mizar, taking you through the features by carrying along an example. In this case, I'll start with the initial system that Mizar shows when you start it without a file. Mizar starts with two bodies, Arrakis (one Solar mass), and BoskVeld (one Earth mass). BoskVeld's initial velocity puts it in a fairly elliptical orbit around Arrakis.
To start the simulation, click the [Go] button. BoskVeld will begin orbiting Arrakis. Two-body orbits are pretty simple, so BoskVeld will repeat the same ellipse for a very long time. When you get bored, click the [Pause] button. (The [Pause] button is the same button as the [Go] button; the name changes depending on whether the simulation is running or stopped.) You can also start and stop the simulation with the Go/Pause item in the "Simulation" menu, or the keyboard equivalent, cmd-G.
(You may notice that the orbiting bodies seem to speed up and slow down at odd times. It might also strike you as strange that the bodies seem to move slowest when they're close together and fastest when they're far apart, even though in gravitational systems the reverse is true. In fact, in Mizar's mind, the bodies are moving faster when they're closer together, and vice versa. You can see this if you pause the simulation at various times and look at the velocity values. However, when bodies are close together, Mizar has to be much more careful in its calculations to keep large errors from accumulating, and so the bodies' motion on-screen is much slower. It would be possible to write a simulation that ran at a constant speed, but it would either accumulate unacceptably large errors during close flybys, or it would run excruciatingly slowly when bodies are distant from each other.)
To add a third body to the simulation, choose "New Body" from the "Bodies" menu. The new body that is created is named "Coruscant". Coruscant is created with a mass of zero. (In principle, this doesn't make much sense, since Newtonian gravity ignores zero-mass objects. However, in Mizar, a zero-mass body will behave just like a body with a very very tiny mass. The fact that the mass is exactly zero will just tell Mizar that it can make some optimizations.) However, a zero-mass body will simply go into another elliptical orbit without affecting the other bodies, and the system won't be much more interesting. So we'll give it a bigger mass.
Click in the "Mass" text box, enter the mass that you want, and hit return. 0.05 Solar masses will stir the system up a reasonable amount. The default unit for mass is Solar masses, as indicated by the menu to the right of the Mass box. You can choose another unit from the menu if you want to. If you choose "Jupiter Masses", you will see that 0.05 Solar masses is about fifty Jupiter masses. The units that you choose don't affect the simulation at all. They just control how the data is displayed to you.
Coruscant starts out at coordiates (0,0,0), which is uncomfortably close to Arrakis. To move it away, enter a new position in the X, Y, and Z text boxes. A reasonable place to start is X = 1 AU, Y = 0.7 AU, Z = 0 AU. The default unit for position is astronomical units (AU), which is the distance from the Earth to the Sun.
If we leave Coruscant with its starting velocity of zero, all it will do is fall towards Arrakis and collide with it. To give it a little push to the side, give it a velocity of Vx = -0.01 AU/dy, Vy = 0.014 AU/dy, Vz = 0. The default unit for velocity is astronomical units per day, which is often used in astronomical tables.
If you hit [Go] now, Coruscant will orbit Arrakis in a slightly elliptical orbit. BoskVeld's motion will be seriously affected by Coruscant's presence, and it will probably be thrown out of the system (ejected) before very long.
If BoskVeld has been ejected, you might want to bring it back. Choose BoskVeld from the "Edit:" menu at the top of the data window. The data window will switch to showing BoskVeld's properties. If you need to, you can return BoskVeld to a more reasonable location.
There are other things you can change that change the appearance of the simulation, but don't do anything physically.
You can, of course, change the bodies' names. Maybe you really didn't like Phantom Menace, and you think that "Dantooine" is a much better name than "Coruscant". Just edit Coruscant's name in the Name text box.
You can change how big a body is by entering a number in the "Radius" text box. The default unit is Earth radii. Since astronomical bodies come in such a huge range of sizes, and since they are typically so much smaller than the distances between them, the display doesn't show the bodies' discs to scale. An Earth-sized body shows up as a few pixels across, a Jupiter-sized body (ten times as big) is shown only a little bigger, and a Sun-sized body (another ten times as big) is only a little bigger again.
Technically, changing the radius isn't just a cosmetic change, since Mizar uses the bodies' radii to decide whether or not they've collided with each other, but collisions are pretty rare (unless you accidentally leave a velocity zero, or something), so the primary effect of changing a body's radius is to change how big its little circle looks on-screen.
To change the color of the trail that a body leaves as it orbits, click on the button to the right of the Name box (the one that shows a little sample of what the trail will look like). The trail and disc color selector will appear. Use the color control to change BoskVeld's trail color to whatever you want. You can also uncheck the "Trail On" checkbox if you don't want BoskVeld to leave a trail at all.
You can, of course, change the color used for BoskVeld's disc in the same way.
Often, it's useful to look not at a body's "absolute" position and velocity (relative to the origin of the coordinate system), but at the position and velocity relative to another body in the system. To change a body's reference point for position and velocity, choose another body (or the origin) from the "Relative to" menu.
The display windows can do a few things of their own.
To create a new display, choose "Projection" from the "New Display" menu. (I plan on adding other kinds of displays later, but for now there are only projection displays. Sorry!) The new display that Mizar creates is looking "down" on your system, with X increasing to the right on your screen, and Y increasing towards the top of your screen. It's sighting down the Z axis, so it won't show any motion in the Z direction. This is all pretty much like the display that you already had. However, BoskVeld has motion in the Z direction, so to see that, we'll have to change the display. (This assumes that you've moved BoskVeld back to near the other two bodies if it had been ejected earlier.)
In the display window, choose "Axis..." from the "Display" menu. The "Axis" dialog box will pop up, allowing you to choose to sight along the X, Y, or Z axis. If you choose to sight along the Y axis, you will be looking (relative to the original display) up, towards the top of your screen. If you choose to sight along the X axis, you will be looking in from the right side. Either one will give you a look at your bodies' Z-axis motion.
In the display window, choose "Scale..." from the "Display" menu. The "Scale" dialog box will pop up, allowing you to choose the magnification of your display window. You do this by assigning a length in the simulation to a length on your screen. For example, the simulation's original display window's width corresponded to about 4.4 astronomical units. If you change this to 18 AU, you'll be looking at a region of space four times as wide. You can also choose another reference length to use to set the scale: window height, screen width, screen height, or one pixel. You can, of course, also choose the length units to use.
After the simulation has been running for a while, the display can get pretty cluttered. To erase everything that's been drawn so far, choose "Erase Window" from the "Display" window.
No program is any fun without Undo. Mizar has the usual fine-grained, multi-level Undo/Redo, but it also has another undo-like feature. My intent was to suport using the program experimentally, so that you could set up a simulation, run it for a while, then go back to your initial conditions and change them a little to see how the outcome changes. To support this, Mizar memorizes the state of your system whenever you hit [Go], and whenever you make your first change to the system after hitting [Pause]. Mizar calls each of these memorized setups an "epoch".
You could do this with the normal Undo, since when you hit Undo after a Go/Pause, you return to the state just before you hit [Go]. Unfortunately, if you then make a change, you loose the outcome of your first run, which might have been interesting.
To use epochs, select "Epochs..." from the "Simulation" menu. If you've been playing with Mizar for some time, you'll probably see a list of quite a few epochs. Each one is labeled with a name and the time (in simulation years) that it was started or paused. The current epoch is marked with a star. Unless you change its name, each epoch inherits its name from the epoch above (before) it in the list.
To go back to an earlier epoch, double-click on its entry in the list. The bodies will return to their earlier configuration, and you can edit them again.
A fair amount of the work that Mizar does is in drawing the orbits on the screen. Generally, the smoother and prettier the drawing, the slower Mizar will have to work. "Slower" here means fewer orbits drawn for every minute that you spend in the real world. Mizar defaults to a reasonable tradeoff between speed and smooth drawing, but it also allows you to change the parameters of that tradeoff.
Choose "Animation..." from the "Simulation" menu to bring up the animation dialog box. The first parameter you can control is the length (in pixels) of the lines that Mizar uses to draw the orbits. The default value is two. Increasing it will speed up the drawing somewhat, but at the cost of jaggier orbit trails. (The value that you choose here is more of a guideline than an absolute rule. Various factors could make the actual lines used either longer or shorter than the value you choose. Effectively, you're giving Mizar a rough value to shoot for, but Mizar doesn't worry too much if it misses.)
The second parameter is the number of frames per second. This tells Mizar how often you want it to draw trails and update the displayed positions of the bodies. The default value is 80 times per second, which is faster than most people's monitors refresh. You can vary this value between 1 and 100, speeding the simulation up at the cost of jerkier animation. As with the line length above, this value is a target that Mizar tries for, but can't always achieve. If the system is very busy with other tasks, Mizar might not be able to keep up high update rates. In this case, it will try to draw as often as it can, which unfortunately means that it will spend very little time calculating, and the bodies will orbit very slowly. You can reduce this effect by using somewhat slower refresh rates.
Mizar's calculations aren't perfect. It works by making a first approximation to the right answer, then adding successively smaller corrections to that approximation. By changing the "Correction Cutoff", you decide how good its approximation to exact Newtonian gravity is. Smaller values make a more accurate simulation of Newtonian gravity, but they make the simulation run more slowly. Larger values make the simulation run more quickly, but eventually errors will accumulate that make your simulation bear little resemblance to reality.
The default correction cutoff is 1.0x10^-11, which is fairly strict. For comparison, Newtonian gravity predicts Mercury's orbit to an accuracy of only 1.0x10^-8. To do better than that, you need to use General Relativity. So the default value is really "too good" for analyzing Mercury's orbit; Mizar would spend a lot of time fine-tuning its Newtonian calculations, but it's doomed to get those last few decimal places wrong anyway -- even a perfect Newtonian simulation would get them wrong, since you need General Relativity to get those corrections right.
Changing the correction cutoff to 1.0x10^-8 speeds Mizar up by a factor of about eight.
(The "Order" menu changes the order of the series that Mizar uses to calculate the positions of the bodies. I use it largely for testing purposes; you should probably just leave it at "4", unless you want your simulation to run really slowly.)
Mizar's interface is somewhat configurable. Mostly, you can edit the strings that appear, but you can't affect the layout of the interface.
If you open Mizar with a resource editor, you'll see a lot of string resources. The strings are organized by resource ID into blocks:
The names that Mizar gives to newly-created bodies. | |
The menu for mass units. | |
The menu for length units. | |
The menu for velocity units. | |
The menu for time units. | |
Window titles and strings that are used in several places. | |
Labels and shortcuts in the File menu. | |
Labels and shortcuts in the Edit menu. | |
Labels and shortcuts in the Simulation menu. | |
Labels and shortcuts in the Bodies menu. | |
Labels and shortcuts in the New Display menu. | |
Labels in the area that displays a body's mass, position, etc. | |
Labels in the Trail & Disc Colors dialog box. | |
Labels in the area that displays global properties, like how many simulated years have elapsed, the correction cutoff, etc. | |
Labels in the Animation Options dialog box. | |
Labels and shortcuts in the Display menu (found in display windows). | |
Labels in the Scale dialog box. | |
Labels in the Axis dialog box. | |
Labels and shortcuts in the Application (Mizar icon) menu. | |
Labels in the Epoch-selection window. | |
Labels and shortcuts in the Epoch menu. | |
Labels in the "Are you sure you want to quit without saving your changes?" dialog box. | |
The text of the About box. |
Editing many of these is fairly self-explanatory. Menu items that have keyboard shortcuts are followed immediately by the shortcut character to use.
The units menus need a little more explanation. Every item in a unit menu is represented by three consecutive resources. The first gives the name of the unit (e.g., "Centimeters"). The second gives the abbreviation for that unit (e.g., "cm"). The third gives a numerical value for that unit (e.g., "0.01"). The numerical value tells Mizar how many of its internal units are in one of these units. The internal units that Mizar uses are:
Meters. | |
Meters per second. | |
Seconds. | |
A weird unit, equal to about 1.4988x10^10 kg. I use this unit internally because, when expressed in this unit (and meters and kilograms), Newton's gravitational constant G is exactly one (that's actually the definition of this unit). As it turns out, we know the masses of astronomical bodies in terms of this unit much better than we know them in kilograms. This is a side effect of the fact that we know the value of G in kilogram units very poorly. In any case, if you want to define a new mass unit, you can figure out how many kilograms it would be, and multiply that number by 6.672x10^-11, the number of internal mass units in a kilogram. |
You can add new units to the end, but you must define all three strings, and give them IDs that are consecutive with the ones already in the menu. Likewise, you can delete units that you don't like, but you must renumber the IDs of the following units (or else Mizar will just skip them), and you must be sure to delete all three of the resources that define the unit you want to remove.
The resource with type code "mzrf" is a Mizar save file which Mizar uses as its prototype system when you start it without a file.