Using MiePlot to Simulate a Rainbow
MiePlot is a graphing and simulation program for rainbows, glories, and coronae developed by Philip Laven; you can download it for free from his site!
Figuring out how to simulate a rainbow was a little tricky for me at first, so I have documented my findings here. You're presented with a graph for a single wavelength, showing how intense its light is at different angles away from the sun (0 deg is the center of the sun and 180 deg is the antisolar point).
How to meet the Simulation Conditions
You can't simulate anything at first, because you can't simulate with only a single wavelength.
Under the light group we can change how many wavelengths are simulated, which will be distributed across 380-700 nm. I chose 30, but 10 will also work. Just keep in mind the the more wavelengths you select, the more calulations the program will have to do, which may take longer to load.
Speaking of calculations, I am going to change the mathematical model for these simulations. By default it uses Mie theory, hence the name MiePlot, but I am going to change it to Airy theory which is less intensive. This is to the right of the light field.
Before simulating, we have to redo the plot with our updated information. It will give two pop ups about the complex values of the reflective index, you can just hit OK on these. The simulate button will now apear, but before you rejoice, you will have to click the New plot button again. Your chart should look like this now:
Notice the bars at the top, with the banding on the right, this is what we want to see.
We can finally hit Simulation now! It's in the same secion as the calculations drop down.
Simulation Photo Notes
You'll get this screen, which already has a picture preloaded. The intention of the simulation mode is to actually lay your simulation over a photo as a way to evaulate your image of a rainbow, glory, or corona. By changing the parameters to better match your photo, you can learn more about the conditions that resulted in the phenomenon, such as what drop size produced it.
But I'm not looking to use it for that, as cool as that may be. I mention it because instead of giving you zoom options, MiePlot gives you focal length based on which kind of camera you used for your photo. I'm not using a real photo, so I use this as my zoom, small values for zooming out, and high values for zooming in.
The documentation notes that the uploaded image should be in 3:2 or 4:3 ratio, so I made a flat color image 700px wide by 525px tall. You may be able to use a larger image if your screen is larger than mine. It has to be in jpg format.
There is also a field for background color. I change the RGB values to match that of my image. You don't actually need an image if your simulation covers the entire default photo, but its nice for when your simulation is smaller than the photo, or you want a larger canvass than the default image.
If you select Show simulation a soft glory will slowly plot over the image. The next section will cover how to do a rainbow rather than a glory.
Simulating a Rainbow
Let's go back to the graph window, but don't close the simulation window. The next important thing we are going to change is the drop size.
The default drop size has a 10μm radius, making it 20μm wide. Thats fine for a glory or corona, but rainbows have larger drops, so you'll want a radius from about 200μm to 1000μm (0.4-2mm in diameter). I chose a 200μm radius.
You will also want to change the light source from a point, to the sun. If you click New plot again, you'll get this:
If you simulate it and select Show simulation, you will get plain grey, but its okay, you didn't do anything wrong, you're just "zoomed" too far in.
Change the focal length to 14. Also be sure that your center is the Anti-solar point, click it again even if it already says anti-solar point. This centers the rainbow or glory since the preview image is offcenter, and just clicking the picture can change the center (by design, for evaluating photos).
Now we get to see a rainbow! One made by small 400μm wide drops, giving it nice supernumerary bands. They are very defined, as all the drops are exactly the same size, this tutorial will cover simulating rainbows with drop size variation.
Go ahead and play around! Change the drop size, your background image, etc!
Graph notes
You can change the limits of the x axis for the graph, which can allow you to crop out excess empty space. By default it is 0-180 degrees away from the sun, but since we are simulating rainbows, we can crop it to 130-180 degrees (180 - 42 = 138)
This will change our graph like so:
Both the line and the preview bars are streched out to take up more of the field. You may notice that there is color banding in the bars. This won't affect the appearance of the simulation, but if you are interested in these bars themselves you can smooth them out without additional calculations.
Under the Advanced tab, you can select Cubic interpolation, which will automatically smooth out the bands.
Simulating single color rainbows
If you can't simulate with only one wavelength, how do we simulate what a certain color component of the rainbow (or glory/corona) would look like?
It turns out you can edit the range of wavelengths!
Go to the Advanced tab again, then to Spectrum, and then 380 - 700 nm band. This will bring up a small window where you can change this range from the sun's visible spectrum, to whatever you prefer (as long as it is within this range).
I changed this range to 410 - 420 nm, which should be violet. You could even do something like 410-411 if you want to be more precise. You'll have to click New plot again to recalculate. We can keep our number of wavelengths as 30, MiePlot will just use values between whole numbers.
We can simulate this to get a violet rainbow with supernumeraries. The default image shows through because we cropped the angle to 130-180. The circle border is the 130 limit. We can either extend our limit back and resimulate, or change our image to a flat black one to match the simulation background.
Drop size variation
We are going to switch our math model back to Mie for this one, and since mie calculations are more intensive, we are going reduce our number of wavelengths to 10. I'm keeping the radius as 200μm.
As shown in the screenshot, we are also going to reduce our brightness to 0.3; this is not necessary, but will look more realistic.
We are also going to start our angle range at 120 (minimum angle), to reduce to calculation load, but to also include the secondary. Go ahead and see what it looks like without drop variation (New plot > Simulation > Show simulation). You may have to reset the center and change the focal length to 14 again.
You should see a primary rainbow with clearly defined supernumerary bands and a secondary rainbow showing in the corners.
Now lets add the drop variation.
Select Disperse and that will bring up a few settings below it. I chose 10% for the standard deviation (how much the drops will vary in size) and 5 for N, which will produce 5 different drop sizes for each wavelength, increasing our calculations from just 10, to 50. This will take a little while to load, which is why we chose so few wavelengths and the smallest N value.
After the calculations are complete, do a new plot and simulate it, the bands will be softer and less distinct, more realistic.
Here in the simulation settings I changed the background color and plotted the disperse rainbow over the monodisperse rainbow by deselecting the two top quadrants before clicking Show simulation. I added the line and annotations afterwards.
Thats the end of my insight, have fun making simulations!
Go home? Home