12.07.2015 Views

Simple Nature - Light and Matter

Simple Nature - Light and Matter

Simple Nature - Light and Matter

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

17 ds = math.sqrt(dx**2+dy**2) # Pythagorean thm.18 dt=ds/v_avg19 t=t+dt20 return tAs a first guess, we could try a straight diagonal line, y = x,which corresponds to setting c 1 = 1, <strong>and</strong> all the other coefficients tozero. The result is a fairly long time:>>> a=1.>>> b=1.>>> n=10000>>> c1=1.>>> c2=0.>>> print(timeb(a,b,c1,c2,n))0.63887656499994161What we really need is a curve that’s very steep on the right, <strong>and</strong>flatter on the left, so it would actually make more sense to try y = x 3 :>>> c1=0.>>> c2=0.>>> print(timeb(a,b,c1,c2,n))0.59458339947087069This is a significant improvement, <strong>and</strong> turns out to be only a hundredthof a second off of the shortest possible time! It’s possible,although not very educational or entertaining, to find better approximationsto the brachistochrone curve by fiddling around withthe coefficients of the polynomial by h<strong>and</strong>. The real point of thisdiscussion was to give an example of a nontrivial problem that canbe attacked successfully with numerical techniques. I found the firstapproximation shown in figure a,y = (0.62)x + (−0.93)x 2 + (1.31)x 3by using the program listed in appendix 2 on page 911 to searchautomatically for the optimal curve. The seventh-order approximationshown in the figure came from a straightforward extension ofthe same program.Section 2.2 Numerical Techniques 95

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!