Sunday, May 5, 2013

Final Post



Dr. Bellis and I had our last internship meeting on May 1st, following the wonderful poster session. Through the internship, I have acquired much knowledge and skills from Dr. Bellis' instructions and from the experience of making the simulations.


Here's a list of things I learned:
  1. How the coordinate system on Processing work
  2. Codes for drawing lines, point, rectangle, ellipse.
  3. Color codes (gray scale, RGB color--> color selector tool, color transparency)
  4. Learned what the basic set-up codes mean.
  5. Designed a free fall simulation
  6. Designed a projectile motion simulation.
  7. Learned how to display text on the window
  8. Codes for displaying a string (time, position)
  9. Learned how to create buttons on Processing (made previous simulations interactive using the buttons).
  10. Background and history of Dark Matter.
  11. Made an interactive model of sun’s orbit around the center of the galaxy, and the Earth’s orbit around the sun (shows epicycles)
  12. Learned about the history of particle physics (quarks, anti-quark, meson, the November Revolution, Samuel Ting, AMS, WIMP)
  13. Started making a plot on Processing by writing codes to draw the axis and tick marks.
  14. Dr. Bellis made my codes easier to access and understand, and created a new tab that contains all the codes that do not need to be altered.
  15. Drew sine, cosine, and exponental curves on the plotting simulation.
  16. Plotted data points by inserting the positions individually.
  17. Learned how to call up data from a file on to Processing and plot it.
  18. Fixed the tick marks on the axis for the AMS experiment.

Though listing is easy, the effort behind each number lists is inexplicable. Dr. Bellis and I worked hard on developing the simulations. Sometimes we twisted our minds to fix each errors and sometimes we surfed online to search for answers. 

The moments were I find out the solution or the correct codes for a project that Dr. Bellis assigned to me were the motivations that kept me going even when the 'error' notification refuse to vanish for more than ten trial-and-errors. Going off with the deadly 'error' notifications, one challenge that I encountered during this internship is probably finding out which code (or codes) was causing Processing to refuse to produce my simulations. These moments were most often frustrating to the point that I wanted to give up and wait for Dr. Bellis' aid, but then whenever this thought came on, I knew that the solution is coming near. According to my experience, it costs me on average of 45 minutes of being stuck on a problem before the solution bulb in my brain 'blinks' and the answer comes out. The best part of encountering each obstacle is the joy I shared with Dr. Bellis when I showed him the simulations I made. There were always high-fives involved and Dr. Bellis' exciting sharing of my simulations with his colleagues.

I really enjoyed this year's STEM internship with Dr. Bellis. He gave me an incomparable introduction to programming and particle physics.

An advice for next year's science interns: It always seems impossible until it's done, so don't be frustrated by each challenge you meet during your internship, keep trying and the answer will eventually find it's way to you. :)

Suggestion to STEM Program: none :P
Have a nice summer vacation! :)
A world with ice cream planets 


Friday, May 3, 2013

5/1 Poster Session + Last Meeting


My Poster! :)

Today Dr. Bellis and a few of Siena's physics professors came to our poster sessions. During the poster session I shared my work with many teachers at Emma and they all seemed to be very intrigued by the simulations I made and the process of making them. I felt very accomplished and excited when I talked them about my work. I was able to answer most questions the teachers asked me, except one. More than three of the teachers asked me "do you know now long it takes for sun to orbit around the galaxy?" when I introduced them my sun and earth simulation.

So, after some search online, here's the answer to that question:
It takes ~230 million years the solar system to orbit once around the Milky Way Galaxy.

That same afternoon, I arrived at Dr. Bellis' office for our last meeting. He was chatting with another professor about how our school looks like Hogwarts and how our traditions are so funny and odd. When we returned to the office, I fixed the axis (the numbers were off) and figured out that the code for labeling Y-axis needed some change, it did not take into the information we put for yhigh and ylow which made the labels messed up.

Fixed version of the codes: 


 // Draw the tick-marks
        textFont (f,12);

        for (int i=0;i<nytick;i++)
        {
            int ytick_loc = yaxis_window_hi+(i*separationy_ticks)+remaindery_ticks;
            line (mid_x-tick_width,ytick_loc,mid_x+tick_width,ytick_loc); //y-axis marks
 
            float val = (yhigh - (deltay_ticks*i));  --> where the problem was. 
            String sval = nf(val,1,2);
            text (sval,mid_x+tick_width,ytick_loc);
        }

Originally we had int val= (xhigh - (deltay_ticks*i)); which caused the tick marks to be 400, 399, 399, 399, 399 etc.  I figured that xhigh had to be changed to yhigh (yhigh= 0.4) because it is for the y-axis (an obvious mistake). After change, the tick makes became all zero. We then figured out that when we do "int" in front of "val" the computer automatically changed deleted the decimal points and make every value an integer (which is zero in this case because yhigh=0.4). By changing int val to float val, the computer stopped changing the tick marks to integers and the problem was fixed. Looking at the numbers, I was disturbed by the fact that the numbers had extra zeros behind their last decimal points (ex: 0.400, 0.390, 0.380, 0.000, etc.) so I decided to fix them so that they only have two decimal points. While Dr. Bellis was talking with another student, I found a code that can limit the amount of integers in front of and behind the decimal (nf(# or variable, # of decimals to the left, # of decimals to the right)). Our final plot looks like this: 
Data from AMS Experiment
:) Everything is right!





Thursday, April 25, 2013

4/17 and 4/24


On 4/18, Dr. Bellis was out in Denver for a meeting, so our internship was canceled.

On 4/24, I got nasal allergy and had to cancel the meeting because of my intense running nose. Fortunately, the allergy went away just before Honors Convocation started, and I was able to receive my award without sneezing. :)
Dr. Bellis and I communicated via e-mail after the ceremony. We made some corrections to my poster. :)

5/1: Poster Presentation!!! Dr. Bellis will be coming to see the posters and tour around the campus.

Friday, April 12, 2013

4/10 Plotting Ting's Data, SUCCESS!!


Rather than inputting all the data by hand into Processing, is there an easier way to do it?
The answer is yes, as long as you have the data saved somewhere in your computer or on a URL. 

My project today was to find out how to tell Processing to call up data just by inserting the file name that contains the data points we want my simulation to plot. Dr. Bellis sent me a tutorial of a code called loadStrings() which I can use to input the data to my plot. After looking at the code description (http://processing.org/reference/loadStrings_.html), I knew what I needed to do to successfully put the data in. I just had to save the data that Dr. Bellis sent me, change it into a .txt file, create a folder called "data" in my simulation file, and enter loadStrigns("ams_data.txt") in the codes I have for plotting a graph. However, I did all the processes that I just mentioned, but there continued to be an error saying that it cannot find a file named ams_data.txt. I was so troubled and tried doing the same thing many times, looked up other codes and similar simulations' codes, but still failed at loading the data to my simulation. I asked Dr. Bellis for assistance and he figured out that the reason that the computer could not find the file is because I created the folder name as "data " (with a space) and not "data". This difference cannot be seen with bare eyes when one clicks on the folder. Now I know the computer treats a word and a word with space differently, that's why my ams_data.txt could not be located.

 The simplest mistake can cause a long time frustration...

After successfully stopped Processing from saying "cannot find the file named ams_data.txt", we encountered another trouble. The plot only shows one dot instead of the many dots we have on our data file. This time, because I read other people code on uploading a .txt file to Processing, I figured out what our mistake was. We had our datapoints separated with spaces, but Processing can only read datapoints that are separated by commas. Dr. Bellis rushed up (because there were only 5 mintues left before I had to leave) and sent me another ams data file, this time, commas replaced the spaces in between the numbers. After all the incidents, we finally were able to plot the data points.
Here are the results: 
Our plot
(data points from the AMS experiment lead by Samuel Ting)
Codes: http://www.sos.siena.edu/~mbellis/ew_processing/ams_data_first_try.html

Official plot with same data
Generated by the AMS team
(notice the difference between their scale and my scale for the plot)
The shape of our plot and the plot made by the AMS team are very similar, they look slightly different because they use a log scale (which I haven't figure out how to do on my simulation).

Next week, Dr. Bellis will be going to Denver for a conference, so we will not be meeting. He will send me readings to read and work to do via e-mail. :)





Wednesday, April 3, 2013

4/3/2013 Plotting Continued

 I worked with Dr. Bellis on plotting during this meeting. Over the break, Dr. Bellis took the code that he and I worked on and simplified it even more. Now, the user just have to enter the equation and does not have to made extra changes to the codes. We also worked on how to input data points and plot them using Processing. We used the data from Samuel Ting's published report on AMS findings (see my previous post for more information on this topic) and plotted the first five points on our simulation.
Instead of drawing lines to form a graph, we drew ellipses (circles) to plot each data point.
Codes used for plotting data points:

  xpts[0] = 0.575;  ypts[0] = 0.0947;
  xpts[1] = 0.730;  ypts[1] = 0.0919;
  xpts[2] = 0.905;  ypts[2] = 0.0902;
  xpts[3] = 1.050;  ypts[3] = 0.0842;
  xpts[4] = 1.330;  ypts[4] = 0.0783;  

  plot.draw_data(xpts,ypts,color(255,0,0)); //instead of drawing equations we draw the x- and y- values. 


There are many things that we can do to improve this graph. We are thinking on how to autoscale the graph produced (we made our simulation able to auto-adjust the tick marks based on the size of the window the users want), but we have not figure it out yet. 

Dr. Bellis and I are the first ones to create graphing codes for Processing (usually it is used for art-related purposes, not science), so we are going to upload or codes to the internet and let more people know about this function and help us improve the codes. :)

For the next few weeks, I am going to start drawing graphs to present Dr. Bellis's thesis on Dark Matter. :) 


Dark Matter News Update- Not discovered


Yesterday, Samuel Ting presented the results that he got from AMS (mentioned in my previous blogs) and indicated that the information does not show signs of Dark Matter. Their results show that AMS has detected an excess of positron that may indicate the existence of dark matter (this is not the first time people find excess positron). However, the data are not conclusive enough, and the researchers need more time analyzing and collecting data for precise conclusions.
Other than the news that dark matter is not found, the data published indicate that the AMS experiment currently have the best set of experimental data, as you can see from the plot below. :)
To state dark matter has been found, the last curve will have to go down and to form a hill, but it doesn't. (This can be dark matter or pulsars) The data after the last point still need more analysis and samples, so they are not published or considered for the conclusion. 

Link to the published report and summary: http://physics.aps.org/articles/v6/40


Wednesday, March 13, 2013

Make Plotting Easier to Access

One of the purpose of my project is also to make the simulation codes easy to access and understand. So in the past two weeks, Dr. Bellis and I have been working on how to make plotting curve codes easier to change (make it more general).

Here are two pictures of the plotting simulations that I have made. On the left, there are two curves (on sine and one cosine) that is moving and. On the left, one can see a exponential curve that is moving to the left as each frame goes by.

Dr. Bellis and I changed the plots so that the coordinate system and the equations that we want to plot is in one tab (called simple_plot), and the code for start plotting and the amplitude and period changes are on the other tab (called plotting_tools).
From the picture above, all the complicated codes are put in one tab, and the one that one may want to manipulate (period, frequency, etc.) are on the plotting_tools tab. To make one simulation, we just have to call up simple_plot in the codes that is under the plotting_tools tab.

Due to spring break, I will not be going to Siena for internship for two weeks. After two week, I hope I can start to make graphs that can show the amount of dark matter captured on earth! :)

Tuesday, March 5, 2013

Dark Matter News

Two days after we left AAAS conference, Samuel Ting, a really accomplished particle physicist who did whatever he could to send make US send a AMS (Alpha Magnetic Spectrometer) to International Space Station to detect anti-Helium that is coming from space to Earth (it was the next to last space shuttle that US sent to the ISS), made announcement at AAAS saying that the AMS had found something. Many rumors say that the 'something' that the AMS found maybe Dark Matter. However, Ting says that they will be ready to announce the results after two or three weeks.

Link to the news:
http://blogs.nature.com/news/2013/02/dark-matter-search-from-the-space-station-continues-to-tease.html

The first time I learned about Samuel Ting was actually quite recent. Dr. Bellis was teaching me about the history of particle physics and the discovery of different quarks. Samuel Ting, who was working at MIT lab, and the SLAC lab at Stanford found a new quark called "Charm"on 1974 (this event is also called the November Revolution). According to Dr. Bellis, Ting, as a person with strong opinions, and the SLAC lab had conflict over to name the new meson c(quark+anti-qark), so at the end the name of the meson became the combination of the symbol that each of them wants: J/ψ (J/Psimeson. 
I googled Samuel Ting and found out that he is a American-Taiwanese who studied at the same high school that my father went to! However, His capability was unfortunately not recognized when he was in Taiwan (he flunked a class during college at Taiwan), so he continued his graduate education in the United States. 
Samuel Ting

To Progress is Human



In the past two weeks, I worked more on my Dark Matter simulation. I added the Earth, which is orbiting around the sun. Furthermore, I was able to track the path the sun and the Earth makes around the center of the universe by putting a button on the simulation that can make the background disappear. When I looked at the path at the first time, I thought I had done something wrong, because the path of the earth is creating a shape that I never seen before. Dr. Bellis laughed at my reaction and say that it is correct, I had created a simulation that shows the epicycles (the circular orbits of an object that orbits around another orbiting object) without knowing what epicycles are.

Epicycles

Below are the paths of the Sun and Earth that is shown on my simulation
Blue- Earth's path, Orange- Sun's path
High--> low velocity



We then spend some time at Dr. Cummings', who is also a professor at the Particle physics department, office. Dr. Bellis excitingly shared what I made with Dr. Cummings and they both got really excited and say that they are going to use them in the Astronomy class at Siena. In this office of excitement, I suddenly saw a group of Chinese girls went by. I stared and found out that they were Sherry, Claire, Irene, Etheal, etc and were there for the AMC test. After that incident, Dr. Bellis, Dr. Cummings, and I continued to discuss about our simulation. Dr. Cummings gave us some advice on how to make a graph that will track the amount of dark matter detected on Earth over time change. This is a challenge, because Processing is a program that is mostly used for art and animations rather than science, so Dr. Bellis and I could not find example of how to make a graph on Processing. We realized that we will have to write codes that will draw tiny line segments to create line or curved line graph. 

To practice drawing a graph on Processing, Dr. Bellis showed me how to create a sine curve. He gave me this code that will repeatedly do things over a number of times. Using this code I was able to create a coordinate system on the simulation. Firstly, I drew the x and y axis. Secondly, I drew the tick marks that have numbers on its side by using the code which adds a certain distance to the position of each line segment as "i" (like 'n' in a sequence/series formula) increases. Thirdly, I drew a new sine graph, also using the new codes, with starting point on the end of my x-axis. 
Sine curve on a coordinate system (not to scale)

 It looks very simple but the progress of figuring out how to do it just by looking at sample is actually really difficult. The next thing I did was to draw exponential curves on the coordinate system I created (just copy and past the codes for the ticks and axis to a new file :P and figure out how to make the codes repeatedly draw line segments of the exponential curve). 

The simulations and codes are on the website: http://www.sos.siena.edu/~mbellis/ew_processing/spring_2013.html


Feel free to play with the orbits by using the buttons that changes the speed of the orbiting objects! :)




Wednesday, February 20, 2013

2013 AAAS Annual Meeting--> Boston Trip


On the 14th of February, Mr. Calos, Mr. Evans, Ms. Hatton, few of the science interns and I went to the AAAS meeting at Boston. The first night we had a really nice dinner at Joe's and the next day we woke up at 7:00 am ready to attend the meeting. As a person who lacks a sense of direction (except underground), I was not surprise when we got lost the minute we got to Hynes Convention Center, which was connected to our hotel. However, we got registered and went to forums that each of us are interested in.

2/15
Symposia that I went:
1) Is Beauty Truth? Mathematics in Physics from Dirac to the Higgs Boson and Beyond (went to this because I just read an article online that talked about the Higgs Boson, which was a newly discovered particle. Also because I am interning at the Particle Physics department and want to know more about the topics).
2) The Science of Uncertainty in Genomic Medicine
3) More Than Pretty Pictures: How the Process of Making Science Images and Graphics Clarifies Understanding
//Poster Sessions for 20 minutes//
4)Science Advances and New Strategies for Reconstruction of Oral and Facial Tissues.
5)Stroke Research: New Concepts and Innovative Solutions
6) Sherry Turkle: The Robotic Moment: What Do We Forget When We Talk to Machines.
//Dinner and rest//

Because there were so many talks that I wanted to go, I barely have time to rest and go outside. Sherry and I (we went as a team because I do not own a cellphone) sat through all of the talks except for the Facial Reconstruction one because it was overlapped with the Stroke Research presentations. During the half hour break we had in the morning (in between two talks) Sherry and I went to the exhibitions. We talked to several people and got a lot of souvenirs. :)

2/16
1)The Connectome: From the Synapse to Brain Networks in Health and Disease.
2) Family Science--> this was lots of fun, I saw a lot of demonstrations and attempted to ask a really hard question for the "Ask an Engineer" booth but failed, partly because of the lack of time (only had 10 minutes in the Family Science Event).

I don't know why.. but Sherry and I found extra time to go to the exhibitions again. This time we listened a lecture at NASA's booth and talked to a person from Wolfram who introduced us to Mathemetica and a search engine (the "mother" of Siri)--> more souvenirs ensued~

Sharing time~
The two talks that are easier to explain with only words and are also very interesting are:
1) A Data Driven Pathway to Genomic Medicine (Robert C. Green)
Dr. Green from Partners Center for Personalized Genetic Medicine. As technology advances "personalization" of health care using one's genetic code has became a new possibility. Dr. Green talks about G2P "Genomes to People" which is a research in Translational Genomics and Health outcomes. He focuses on the REVEAL study (Risk Evaluation and Education for Alzheimer's Disease). In the study, each individual has their genes coded and the researchers found out that as individual possess one or more copies of APOE (E4 ) genotype he/she is more likely to develop Alzheimer's Disease. It turns out that APOE gene is also linked to the Heart Disease which is reasonable since Alzheimer's is due to the lack of blood flow. The results also show that after the individuals got their results back, they have increased their exercise and improved their diet. People handled the data well. However, the insurance companies will be at risk after the "personalization" of health care become publicized because they are going to loose a lot of money.
--> a counterargument was presented by James P. Evans (Jim) from University of North Carolina. He said that genomics in clinical medicine may only be useful when the the disease is rare because they have less factors, whereas the common diseases has too many etiologic factors and risk alleles that are going to be hard to predict the possibility of actually getting that disease.

2)Molecules and Mechanisms Involving in Synaptic Plasticity in Health and Disease (Mark F. Bear, MIT)
Dr. Bear talked bout the plasticity of the synapses that leads to Amblyopia and Autism. In my blog I am going to focus on the Autism part.
Fragile X Syndrome: a intellectual disability, a cause of Autism. Has
LTD (Long Term Depressing): serves to selectively weaken specific synapses in order to make constructive use of synaptic strengthening caused by LTP (wikipedia).--> enhanced--> Autism. LTD is enhanced by unusually amount of AMPAR internalization (see figure below) which is due to a lack of FMRP protein that acts as a initiator of the AMPAR internalization and also a negative feedback inhibitor that stops more FMRP protein generation therefore stops the internalization of AMPAR.
http://www.sciencedirect.com/science/article/pii/S0304416509000348

A. In normal brains, FMRP is produced normally, making good amounts of AMPA receptor when mGluR5 receptor is activated. 
B. in Fragile X Syndrome FMRP is silenced therefore there is an abundance of AMPAR internalization causing LTD to be enhanced (causing abnormal dendrites spines to be formed in patients with Fragile X Syndrome, less contact with other neurons, neurons weakened--> mental disability)
C. in therapy MPEP is used to silence mGluR5 which slows down the internalization of AMPA (not in his talk but from the website). What he said was only to inhibit mGluR5 but I did not hear things about MPEP.

Saturday, February 16, 2013

Dark Matter Simulation Step 1


Today, we finished the interactive button pressing projectile motion simulation (which surprisingly only took about ten minutes) and posted on our website. http://www.sos.siena.edu/~mbellis/ew_processing/final_projectile.html

You can click on the button on the upper-right corner and stop the ball. Place the mouse on the ball to see the location of the ball. One thing you'll have to be aware of is that Processing's coordinate system is different than the ordinary coordinating system (see figure below).
So when you are looking at the location make sure to find the relative position based on the starting point's location. 

The next thing we did was to start making the Dark Matter Simulation!!! (a moment I've been waiting for so long!)
Dr. Bellis wants me to start with making the sun rotate around the center of the Milky Way Galaxy which I represented as a circle in the middle. It was perplexing at first because I did not have any experience on making circular motion before.  Dr. Bellis gave me a hint.. that is: the equation of a circle r^2=x^2+y^2 and I related it to x=rcos(theta) and y=rsin(theta) which I can use for the center of the circle as it moves. To create motion I have to increase the theta as time goes by so the code I made was x=rcos(theta+t*0.1) and similarly with y-coordinate. As for the "r" I made it a float (variable) so that we can modify it whenever we want.
I also added a few increasing transparency circles in the simulation to show the density of the stars in the Galaxy. 
Orange= Sun, Black= Center of the Galaxy

Code:
int windowHeight= 800;
int windowWidth= 800;

float radius= 20;
float t=0.0; 
float x0= 32;
float y0= 32;
float theta=3.142/6;


float meters2pixels= 10;
float pixels2meters= 1/meters2pixels;
int frameRateSpeed= 30;


void setup() {
    size(windowWidth, windowHeight);  
    noStroke();     
    frameRate(frameRateSpeed);   
}

void draw() { 
    
    background(255);  
    float g= 9.8;
    float x=cos(theta+t*.5)*radius+x0;
    float y=sin(theta+t*.5)*radius+y0;
    float ellipse_width=20;
    float ellipse_height=20;
    
    x = meters2pixels*x;
    y = meters2pixels*y;
    
    
    ellipseMode(CENTER);
    fill(230);
    ellipse(320,320,500,500);
    fill(200);
    ellipse(320,320,250,250);
    fill(150);
    ellipse(320,320,120,120);
    fill(0);
    ellipse(320,320,20,20);
    fill(240,127,70);
    ellipse(x,y,ellipse_width,ellipse_height);
    
    PFont f;
    f = createFont("Microsoft Sans Serif", 16, true);
    textFont (f, 24);
    
   fill (182,132,222); 
    String time_text = "time: "+nf(t,1,2);
   text (time_text, 10, 580);
   fill (83,130,229);
   textFont (f,18);
   text("Center of Galaxy", 260,360);


    t= t+(1.0/frameRateSpeed);
    
   
   if (t>400)
   { 
     t= 0;
   }
   if (y>=windowHeight)
   {t=0;}
  
   
}


The next meeting I'll add Earth to our simulation which will rotate around the sun while the sun rotates around the center of the universe.

Because I finished this step early I asked Dr. Bellis about Higgs Boson and the Higgs Mechanism that I read on a website (http://case.ntu.edu.tw/blog/?p=12593#more-12593 ==in Chinese). During our conversation I learned that he was involved in the experiment. The Higgs Boson was found recently by CERN (a large particle physics lab) using the LHC (Large Electron-Positron Collider, so big that it goes across the border of France and Switzerland-underground 27km circumference). It was really interesting to me because the LHC uses the same idea behind PET scan which is a scan used for detecting blood flow in brain (which I just read about a day ago for Neuroscience class). The machine shoots out a position (e+) which is an anti-matter, when it collides with an electron (e-) the collision produces two protons (p+) that shoot out in opposite directions. The circular machine then detects the protons that hit the wall and form a graph/image from the impacts it receive. For PET scan, the patient injects a radioactive substance (collides with positron and shoots out proton) in their blood so when there is more blood flow in a particular area in the brain, the PET scan can sense it. 

LHC and the route the particles travel

LHC air view
A PET scan for brain imaging 



Wednesday, February 6, 2013

Learning about Dark Matter


Today Dr. Bellis posted my simulations on a website so other people can view it~~ :)
Link: http://www.sos.siena.edu/~mbellis/ew_processing/spring_2013.html

It was really fascinating to watch him make the webpage... I couldn't play with it because the program was on his computer. With HTML codes. While he was making the webpage, I searched about HTML codes, maybe next time I can try to get it on my computer (the codes are not that complex), and added mouse tracker for the projectile motion simulation. Our goal is to place a button that will start and stop the ball on the simulation and be able to place the mouse on the ball to see it's location at different times (which I have already done, but not the buttons... still discovering how to do that).


The next thing that I did was to do the worksheet on GoogleDoc about Dark Matter, because we are going to start making the Dark Matter simulations soon. My mentor has a meeting from 3:30 to the end of my internship, so I did the worksheet while he was away.
Here is the work that I've done:

For this assignment, I’ve given you some questions to answer that will hopefully teach you a bit about Dark Matter. You need only answer in a few sentences...or a paragraph at most. Feel free to use Wikipedia or other website, but put the link in this document from where you got the material. Let me know if you have any questions!

Who was Vera Rubin? (picture from Wikipedia)

Vera Rubin is a woman who discovered the galaxy rotation problem (the discrepancy between the predicted angular motion of galaxies and the observed motion) by studying galaxy rotation curves which led to the theory of Dark Matter.
A: Predicted value
B: Observed value.

The link to galaxy rotation problem: http://www.popscicoll.org/dark-matter/galaxy-rotation-problem.html
Theory for the rotational speed claimed that as the stars are farther out from the center the speed will be less but in reality the speed did not change. → Raises the question that there might be some kind of matter that exerts an extra pull on the stars to cause it to have a higher speed.

Who was Fritz Zwicky?
Published extreme concepts of the 1930s—neutron stars, galactic gravitational lensing, supernovas.

Discovered and named the concept of “Dark Matter”.

While observing the rotation of galaxies (which do not orbit around a central heavy object like the sun) and wanting to determine the velocity of the galaxies, he applied the virial theorem. “A straightforward application of classical mechanics, the virial theorem relates the velocity of orbiting objects to the amount of gravitational force acting on them. Isaac Newton's theory tells us that gravitational force is proportional to the masses of the objects involved, so Zwicky was able to calculate the total mass of the Coma Cluster from his measured galactic velocities. Zwicky also measured the total light output of all the cluster's galaxies, which contain about a trillion stars altogether. When he compared the ratio of the total light output to the mass of the Coma Cluster with a similar ratio for the nearby Kapteyn stellar system, he found the light output per unit mass for the cluster fell short of that from a single Kapteyn star by a factor of over 100. He reasoned that the Coma Cluster must contain a large amount of matter not accounted for by the light of the stars. He called it "dark matter." -http://www.learner.org/courses/physics/unit/text.html?unit=10&secNum=2

What is a WIMP, as it pertains to dark matter?
WIMPs are the subatomic particles which are not made up of ordinary matter. They are "weakly interacting" because they can pass through ordinary matter without any effects. They are "massive" in the sense of having mass (whether they are light or heavy depends on the particle).
Source: http://imagine.gsfc.nasa.gov/docs/teachers/galaxies/imagine/dark_matter.html

It is a candidate of the Dark Matter because Dark Matter also does not interact with other matters which is similar to the characteristics of WIMPs.

How big is the Milky Way galaxy?
The Milky Way is a barred spiral galaxy 100,000–120,000 light-years in diameter containing 200–400 billion stars. (Wikipedia).

How far is our sun from the center of our galaxy?
26,000 light years away from the center of Milky Way galaxy.
http://www.enchantedlearning.com/subjects/astronomy/solarsystem/where.shtml

How fast does the sun rotate around the center of the galaxy? (velocity in m/s)
The orbital speed of the Solar System about the center of the Galaxy is approximately 251 km/s. (Wikipedia)

How fast does the Earth rotate around the sun? (velocity in m/s)
The orbital speed of the Earth around the Sun averages about 30 km/s (108,000 km/h).
(Wikipedia)




:)

Wednesday, January 30, 2013

Learning about Buttons


Today, I learned how to place buttons on my simulations and how to track the position of my mouse.

My project today

Fourth exercise


For this exercise we will work with adding buttons to the simulation. And this will allow us to control the simulation better.
1) Go over the two examples and try to learn how they work. For reference, see the Processing documentation about buttons.
http://processing.org/reference/
http://processing.org/learning/topics/button.html

2) Make a copy of button_exercise_2 and rename it. Modify this new version so that it prints to the window (using the Text stuff you learned last week) the x and y position of the cursor. 


3) Modify the code so that when the button is pressed it displays some new text. Pick whatever text you like!  :)


4) Place some text next to the button that explains what it does.


Dr. Bellis told me to try to figure out what each codes mean by myself, and understand it more as I create one of my own.

It was really confusing at first but as I tried changing the numbers for each code I got the gist of what the codes represent on the simulation. 
For the second question where it asks me to make the window display the x and y positions of the cursor. I used the string method that I did for last internship and put in all the correct codes. The problem is, the texts did not show up on my simulation. I asked Dr. Bellis for help and we found that texts I want to display on the simulation window have to be written under void draw (), whereas before I just wrote the codes on the very bottom of the series of codes.

The outcome is:
Codes for cursor tracking:
PFont f;
 f= createFont("Times New Romans", 16, true);
 textFont (f, 24);
 fill (83,130,229);
 String MouseX_text= "MouseX:"+ nf(mouseX,1,2);          //for X-coordinates
 text (MouseX_text, 10, 400); fill (83, 130, 229);
 String MouseY_text= "MouseY:"+ nf(mouseY,1,2);          //for Y-coordinates
 text (MouseY_text, 10, 420);
The screenshot eliminated my cursor automatically so you can see it, but the mouseX and mouseY shows the coordinates where the cursor is located. 


When the button (the box) is clicked by the cursor, it turns purple. (yea, I had fun with choosing the colors XD)
After this I found that the box button is also draggable... which I think was an interesting unintentional outcome...
As for the second project I added texts to the button so that when one clicks it, it shows "hello" and click it again it shows "bye". I had a little trouble with that too, the same thing with placement, but is was easily solved.

Codes for stimulating a button with words showing:


int windowHeight = 640;              //This sets the size of the window. 
int windowWidth = 700;

float bx;                                        // button x-position
float by;                                       // button y-position
int boxSize = 75;                         //set the size for the box (square with 75 on each side)

boolean overBox = false;            // This tracks whether or not the mouse is over the box.
boolean locked = false;               // This tracks whether or not the box is ``locked". (I was not sure what        "locked means, I am going to find it out on our next meeting)
float xOffset = 0.0;
float yOffset = 0.0;

int background_color = 0;
int display_text = 0;

void setup()
{
    size(640, 360);
    size(windowWidth, windowHeight);  // Size must be the first statement
    bx = 100;
    by = 100;
    //rectMode(RADIUS); //
}

////////////////////////////////////////////////////////////////////////////////
// This is always the part where we deal with all the drawing.
////////////////////////////////////////////////////////////////////////////////
void draw()
{
    background(background_color);

    // Test if the cursor is over the box
    if (mouseX > bx-boxSize && mouseX < bx+boxSize && mouseY > by-boxSize && mouseY < by+boxSize) {               //A command to tell the computer that if the cursor is within the box range, and is clicked the "if()" commands will show. 
        overBox = true;
        if(!locked) {
            stroke(255);        // If we are over the box, change the colors.
            fill(153);
        }
    } else {
        stroke(153);
        fill(153);
        overBox = false;
    }

    // Draw the box
    rect(bx, by, boxSize, boxSize);
    PFont f;
    if (display_text==1)
    {
     f= createFont ("Times New Romans", 16, true);                   //Here is where I added the texts and set the text to display_text= 1. 
      textFont (f, 24);
      fill (224,97,97);
      text ("HELLO~", 100, 240);                                                //Hello will show up when the button is pressed. 
    }
     else if (display_text==2)
     {
            f= createFont ("Times New Romans", 16, true);
            textFont (f, 24);
            fill (56,183,214);
            text ("BYE", 100, 240);                                                  //Same idea here. 
     }
}

////////////////////////////////////////////////////////////////////////////////
// Here is where we tell the program how to deal with:
//   1) When the mouse button is pressed.
////////////////////////////////////////////////////////////////////////////////

// This code tells us what to do when the box is pressed.
void mousePressed() {

    if(overBox) {
        locked = true;
        fill(19, 230, 128);
        if ( background_color == 0 )
        {
                   background_color = 100;
         display_text = 1;                                           //display_text= 1 is the command for calling up the "hello" when the button is pressed. 
      }
        else if ( background_color == 100 )             //When it is clicked again, if background color is 100 (gray) it will change to 0 (black) as written below+ call up display_text= 2 which is the command for "bye". 
     
        {
            background_color = 0;
            display_text = 2;
         
          }
    } else {
        locked = false;
   
    }
    //xOffset = mouseX-bx;
    //yOffset = mouseY-by;

}

Clicked once
Click back. 
For the next meeting, Dr. Bellis and I are going to start discussing our Dark Matter simulations and he is also working with the computer science department to see if we can upload the simulations that I have done on the internet for people to play with. :)



Saturday, January 19, 2013

1/16/2012


Today's shuttle to Siena College was canceled due to the large amount of snow. However, I met with my mentor through GChat and e-mail. It was really hard, because I have more than five windows open on my laptop and questions that took a long time to answer.

The homework I did for this meeting was to change units of my simulation to pixels to make it look more realistic. Before we had to change gravity to a small value to make it fit in the screen and make the ball drop slower, but with the conversion gravity can be 9.8 m/s^2 and would still look the same. To do this I had to add two more variables to my simulation:
float pixels2meters=___;
float meters2pixels=___;
In my case my one pixel is equal to 10 meters, and one meter equals to .1 pixel. This did not work so well after all. I sent my simulation to Mr. Bellis so that he could check it for me. We ended up putting more variables in:
float meters2pixels = 10;
float pixels2meters = 1/meters2pixels;
int frameRateSpeed = 30; // frames per second

size(windowWidth, windowHeight);
   noStroke();     
   frameRate(frameRateSpeed);   //set frameRat to the same as frameRate Speed

t = t+(1.0/frameRateSpeed); // Also changed the time so that time increases when one frame goes through (1/30 sec= one frame)

Another homework was to find how to add text to my simulation. It was really fun, because I kept changing the text color to the colors I want. The things I typed to make text appear was:

PFont f;
    f = createFont("Microsoft Sans Serif", 16, true);   //first one was font type (I looked at the font types in my files for word and feel like this is the best one, second one is font size, and third one means anti-aliasing on)
    textFont (f, 24);
    fill (255);
    text("Yvonne Yen", 10, 240);        //text, size, and location (y-coordinate)
    text("Free Fall", 10, 270); 
During the meeting today, I learned how to add timer on my simulation.

String time_text = "time: "+nf(t,1,2);
   text (time_text, 10, 580);
I took this as an example and created a height measurer on my simulation too! :)

String Height_text= "Height:"+ nf(-y+y0,1,2);    //it is -y+y because I want to know how far the ball traveled as it drops so I set the "y" as the negative value (dropping) and add the initial position to exclude it from the measurement. 
   text (Height_text, 10, 610);

I also changed the color of the texts for height and time too~:)

HERE IS THE END PRODUCT:

Looking at this we can know how much the height has dropped in how many sections. I will check if this simulation is accurate later...

Next week, I will have to communicate with my mentor through e-mail again, because it is Emma's MLK service day.

:)