Jim's
Tutorials

Spring 2019
course
site

Jack - Jan 29

I read through the first chapter of the IPython Cookbook, and I think I understand at least the basics of Jupyter. I wish the text had some exercises or something in it. Reading code can be helpful, but actually making your own code is the best way to understand. I'm probably going to continue reading the IPython Cookbook.

I also read through the paper I'm basing my experiment off of. Now I know why I couldn't remember the quantity I wanted to simulate; more people should be made to pass the clear writing requirement, even if they already have a PhD. Maybe I'm just bad at reading. Anyway, I essentially want to know the intensity of the scattered light at the detector. There's some math done to that info to make it more legible and useful, but the key is the intensity. The intensity itself comes from a sum of the different beads scattering the light. The change in phase of the scattered light waves (which results in the fluctuating intensity) is a result of the actual "steps" of the bead undergoing Brownian motion.

With this in mind, I think I have three levels of goals for my simulation:

  1. The bare-bones worst case scenario is that I simulate the light scattering off a single bead doing Brownian motion and I get the intensity from that.
  2. My simulation records the intensity of scattered light from a large number of beads.
  3. The simulation also spits out the data derived from the intensity (power spectrum and auto-correlation function)

I think I will check out a book from the library so I can get a better understanding of light scattering, or maybe I can find something online.

I looked to see if there was anything on light scattering with python and I found something called HoloPy which might be useful. I need to understand both light scattering and HoloPy better to determine it's usefulness however. I also found a Wikipedia page on "Codes for electromagnetic scattering by spheres" which seems pretty useful. I haven't spent much time at all looking at either of these they are just things I found on google.

Jim says

I've set up a cloud jupyter server which may be useful, though I would need to also install whatever libraries you need (e.g. HoloPy).

I also have some examples I set up for the algorithms class which I know run on jupyter.marlboro.college

If you're looking for some exercises to get more comfortable with jupyter and numerical python, I found these by googling which may be helpful :

I don't yet understand what exactly you mean by the three steps you outline.

First you say "simulate the light scattering off a single bead" ... which I would expect is a messy algebraic 3D function. You can draw some images of that in a Jupyter notebook if you know the equation but I'm not sure what "simulate" means here ... unless HoloPy is general enough to do the "scattering off a spherical bead" calculation for you. Or unless you want to numerically approximate the equation ... as I say, I can't tell since I don't know the equations. The fact that the bead is undergoing Brownian motion will I guess give some discrete jumps in time for the equation, but I'd guess that you need to sum over the "many particles" before doing a time average.

Second, the "large number of beads" may need some thinking. If we're talking about numbers like Avagadro's number, then you cannot do a direct sum numerically. Either a much smaller number (thousands or at most millions) will be enough to give interesting results, or you'll need to treat them as a continuous distribution. Again, I don't know enough of the actual equations to know.

In any case, I'm glad to see that you're digging in. Hopefully once you have a better handle on the physics equations then we can talk about what simulating numerically might entail.

I can help with questions about Jupyter or how to work numerically to solve a given set of equations.

In this case, I think you'll need to prioritize the goal of "what equations am I actually trying to model", perhaps with Sara's help.

https://cs.marlboro.college /cours /spring2019 /jims_tutorials /jtuttle /jan29
last modified Mon November 25 2024 12:23 pm