Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: [Phys-l] accurate numerical solution of equations of motion



On Nov 3, 2009, at 21:56 , Bernard Cleyet wrote:

Must I forget BASIC and learn C or Excel?

bc brought up on fortran 2 and algol.

I'd say, learn Python...the best language. ;)

I have a nice wrapper around the ODE solvers in Python (SciPy) that I use in some of my classes, so that an entire simulation looks like:

from sim import *

s=Simulation()

s.add("theta''= -(g/l)*sin(theta) -q*theta' + Fd*sin(wd*t)",
[pi/3,0], # initial conditions for theta and theta'
plot=True)

s.params(g=9.8,l=9.8,wd=2.0/3.0,q=.5,Fd=1.5)

s.run(0,120)


if anyone is interested, I can post it somewhere.



bb - brought up with BASIC on the VIC20 and TRS80, Pascal, then Fortran and C...then saw the light.


--
Brian Blais
bblais@bryant.edu
http://web.bryant.edu/~bblais