' h5blib.bas - jackord@kw.igs.net - revised 10 Sep 02 - Liberty Basic v3.01 ' Initialize Window nomainwin button#1, "Plot", [plt], UL, 10, 10, 40, 20 WindowWidth=610 ' pixel scale 0-600 WindowHeight=329 ' pixel scale 0-300 UpperLeftX=10: UpperLeftY=100 open "Bouncing Ball Probability Density" for graphics_nsb as #1 #1 "trapclose [quit]" [waitHere] wait [plt] goto [eigen] [eigen] #1 "cls": #1 "down" #1 "color blue" e=2.33811: vo=6.61317: gosub [fey] #1 "color darkpink" e=4.08793: vo=11.5622: gosub [fey] #1 "color red" e=5.5205: vo=15.61338: gosub [fey] goto [waitHere] [fey] dx=.002 x=0: y=0: v=vo: #1 "place 0 0" a=e*e*e*(x-1)*y: v=v+a*dx/2 while (x<1 or v*y<0) and x<8 x=x+dx: y=y+v*dx: #1 "goto "; int(75*e*x); " "; int(60*(5-y*y)) a=e*e*e*(x-1)*y: v=v+a*dx wend x=0: y=4/e: #1 "place 0 "; int(60*(5-y)) while y<5 x=x+dx: y=4/e/(1-x)^.5: #1 "goto "; int(75*e*x); " "; int(60*(5-y)) wend x1=int(75*e): #1 "line "; x1; " 0 "; x1; " 300" return [quit] close #1 end