Notes on Physics 156

Just finished the Optics Defense... off to the programming lectures in the new NIP

1. check if the software development is still active... unless you are willing to continue the development. :)

2. sparse matrix, matrix na kakaunti ang laman, iba ang handling compared to your other arrays. STORAGE.

3. dense matrices

4. cells, finer cells = mas maraming malalaman about the cell.

5. for the finite element method, the mesh must be clearly defined

6. frontal crash test, mesh must be finer around the impact. data is much more important around the hood

7. iterators

8. 16x16 mesh, mabilis mag scale-up ang complexity ng partial differential equations

9. mahirap na part ang pag-gawa ng mesh

## Tuesday, September 22, 2009

## Saturday, September 19, 2009

### Software Freedom Day 2009

Today is Software Freedom Day.

Rawr.

Earlier today, students from different universities filled the UST Medicine Auditorium to celebrate the SFD. There were talks on the basic ideas of FOSS (Free and Open-Source Software), a tour of an open desktop, an update on the FOSS bill in congress, using ICT to serve the people and on CMS.

By the afternoon, the crowd broke into three groups for specialized topics ala seminar on LAMPP, Blender/GIMP and CMS.

It was my first time to join and it was actually worth it to see/ listen/ interact with the people advocating freedom in information technology. I think that the specialized topics were very interesting and could expand to more topics by the next year.

Also, with a lot of physics people moving to open OS... i hope to find more of my physics friends on the next SFD celebration.

Rawr.

Earlier today, students from different universities filled the UST Medicine Auditorium to celebrate the SFD. There were talks on the basic ideas of FOSS (Free and Open-Source Software), a tour of an open desktop, an update on the FOSS bill in congress, using ICT to serve the people and on CMS.

By the afternoon, the crowd broke into three groups for specialized topics ala seminar on LAMPP, Blender/GIMP and CMS.

It was my first time to join and it was actually worth it to see/ listen/ interact with the people advocating freedom in information technology. I think that the specialized topics were very interesting and could expand to more topics by the next year.

Also, with a lot of physics people moving to open OS... i hope to find more of my physics friends on the next SFD celebration.

## Friday, September 18, 2009

### random walker 2

With the first random walker done and tracing its path, the next thing to do is to make a simulation of a many random walkers that appear as particles moving around the canvas.

Here is the code of a single random walker and a snap shot.

'''

animation of a single random walker

'''

from pylab import *

from numpy import *

import time

ion()

tstart = time.time()

#cheating canvas size

wx = linspace(1,100,100)

wy = linspace(1,100,100)

plot(wx,wy,'white')

steps = 500

xinit = 50

yinit = 50

x = [xinit]

y = [yinit]

rw, = plot(x,y,'go')

for i in arange(1,steps):

d = random.randint(1,5) #selects num from 1,2,3,4

if d == 1:

x = [x[0] + 1]

rw.set_xdata(x)

elif d == 2:

x = [x[0] - 1]

rw.set_xdata(x)

elif d ==3:

y = [y[0] + 1]

rw.set_ydata(y)

elif d == 4:

y = [y[0] - 1]

rw.set_ydata(y)

draw()

Next code, N random walkers.

*** tomorrow is software freedom day, UST Medicine Auditorium

Here is the code of a single random walker and a snap shot.

'''

animation of a single random walker

'''

from pylab import *

from numpy import *

import time

ion()

tstart = time.time()

#cheating canvas size

wx = linspace(1,100,100)

wy = linspace(1,100,100)

plot(wx,wy,'white')

steps = 500

xinit = 50

yinit = 50

x = [xinit]

y = [yinit]

rw, = plot(x,y,'go')

for i in arange(1,steps):

d = random.randint(1,5) #selects num from 1,2,3,4

if d == 1:

x = [x[0] + 1]

rw.set_xdata(x)

elif d == 2:

x = [x[0] - 1]

rw.set_xdata(x)

elif d ==3:

y = [y[0] + 1]

rw.set_ydata(y)

elif d == 4:

y = [y[0] - 1]

rw.set_ydata(y)

draw()

Next code, N random walkers.

*** tomorrow is software freedom day, UST Medicine Auditorium

## Tuesday, September 8, 2009

### random walking part 1

It's a very wet and cold day here in Quezon City, and what better way to spend the afternoon than catching up with unfinished programs for the Physics 156 class.

Last friday, I started with the ray tracer for the Optics class (to be posted when its done). The program is supposed to solve for the system matrix of a given set of interfaces and media and the principal planes of the system. Rays should be allowed to launch from a user-defined position, height and angle from the principal axis and interfaces. The path of the rays should then be traced as it is transmitted and refracted.

Another programming task is animating random walkers. Aargh. This one is long overdue, but I managed to start with a simple single random walker with varying number of steps.

Here is a random walker making 500 steps.

...and another one

Labels:
optics,
physics,
programming,
python,
random walk,
ray tracing,
simulation

Subscribe to:
Posts (Atom)