http://www.thenakedscientists.com/fo...1656#msg251656
The differences came out less than 2%
Code:
Code: Select all
# Fall of Physics
#
# Case #1 2.5, 2.5, 2.5, 2.5 2.554 sec @ 43.82 ft/sec
# 0 16 23.85 29.93
# Program 0 15.84 23.79 29.6 2.57 sec @ 43.36 ft/sec
#
# Case #2 1, 2, 3, 4 2.854 sec @ 38.66 ft/sec
# 0 10.67 16.87 21.70
# Program 0 10.56 16.8 21.6 2.87 sec @ 38.24 ft/sec
#
# Case #3 4, 3, 2, 1 2.381 sec @ 50.37 ft/sec
# 0 18.29 29.05 38.91
# Program 0 18.10 28.52 38.3 2.41 sec @ 49.856 ft/sec
#
Code: Select all
#
#
# This program simulates a magical collapse of a skyscraper.
#
# It is magical in that the mass at each level is supported
# by nothing! Each mass is simply suspended in space
# until struck from above. At which point the conservation
# of momentum determines the velocity of the combined
# masses.
#
# Up to line #69 with the f.close() the data for the
# collapse is read from the argv[1] file. It can have
# any name since it is a command line argument. This
# program is started with:
#
# python 911claps.py 911clpdt.csv
#
# The data file has comma separated values with 5
# parameters per line. The first is the USE Flag which
# tells the gravity function whether or not to ignore the
# entire line. If the mass has been absorbed in a
# collision the USE Flag will be ZERO. The next value is
# the MOTION Flag. This tells the gravity function
# whether of not the mass is in motion. If it is ONE then
# the mass is accelerated for 0.01 second and velocity
# and altitude are changed. The 3rd value is Mass, the
# 4th is Velocity and the 5th is Altitude.
#
# If the USE Flag is ONE and the MOTION Flag is ZERO then
# the gravity function only reads and saves the altitude
# for comparison to test for collisions. This program
# scans from the bottom up so the last altitude can be
# compared to the new computed altitude of a Mass in
# MOTION to do the collision test.
#
# NOTE: There is a peculiarty in the program, most likely
# because I haven't figured out something about Python. The # very first data line for the level at 12 feet is in the
# program not the data file. I was getting various errors
# and just kludged it to get it done rather than spend more
# time on Python syntax and error messages.
#
# Creates array of collapse data by reading file
# seems to work OK, 2010-05-07 12:14:20
import csv
import sys
# Haven't figured out the proper way to read in data so
# first data line for bottom of building is in program not the
# data file.
toweray = []
toweray.append(["1","0","2080.0","0.0","12.0"])
f = open(sys.argv[1], 'rt')
# create global variables
Time = 0.0
falling = 1
lastuslvl = 0
lastalt = 0.0
newalt = 0.0
velo = 0.0
dist = 0.0
# read data to fill array
reader = csv.reader(f)
rownum = 1
for row in reader:
toweray.append([row[0],row[1],row[2],row[3],row[4]])
rownum += 1
f.close()
print "\n\nTower Array is Loaded with",rownum,"Levels.\n\n"
inloop = 0
while inloop < 109:
toweray[inloop][0]=int(toweray[inloop][0])
toweray[inloop][1]=int(toweray[inloop][1])
toweray[inloop][2]=float(toweray[inloop][2])
toweray[inloop][3]=float(toweray[inloop][3])
toweray[inloop][4]=float(toweray[inloop][4])
inloop += 1
inloop = 0
def collide(curntlvl):
global Time
global falling
global lastalt
global lastuslvl
global newalt
print "Collision at",(newalt + lastalt)/2,"feet!!!"
print "Mass @:",toweray[curntlvl][4],"ft. hit Mass @:",toweray[lastuslvl][4],"ft.",
print "at:",Time,"sec."
print toweray[curntlvl][2],"tons traveling:",
print toweray[curntlvl][3],"ft/sec hit",
print toweray[lastuslvl][2],"tons moving at:",
print toweray[lastuslvl][3],"ft/sec\n\n"
# Assimilate impacted Mass and turn off USE Flag
newmass = toweray[curntlvl][2] + toweray[lastuslvl][2]
toweray[lastuslvl][0] = 0
# Apply Conservation of Momentum to compute new velocity
newvel = (toweray[curntlvl][2] * toweray[curntlvl][3] + toweray[lastuslvl][2] * toweray[lastuslvl][3])/newmass
print "New mass is:",newmass,"tons moving:",newvel,
print "ft/sec\n\n"
toweray[curntlvl][2] = newmass
toweray[curntlvl][3] = newvel
lastalt = (newalt + lastalt)/2
toweray[curntlvl][4] = lastalt
lastuslvl = curntlvl
return
def gravity(curntlvl):
global Time
global falling
global lastalt
global lastuslvl
global newalt
# print "CL=",curntlvl,
if int(toweray[curntlvl][0]) == 0: # If Use Flag Off return
toweray[curntlvl][4] = lastalt
return
elif int(toweray[curntlvl][1]) == 0: #If Motion Off get alt
lastalt = toweray[curntlvl][4]
lastuslvl = curntlvl
falling = 1
return
else:
falling = 1
dist = 0.0016 + toweray[curntlvl][3] * 0.01
velo = 32 * 0.01 + toweray[curntlvl][3]
newalt = toweray[curntlvl][4] - dist
if newalt <= 0:
print "Mass: #",curntlvl,"hit the ground.",
print toweray[curntlvl][2],"tons at:",
print toweray[curntlvl][3],"ft/sec"
toweray[curntlvl][0] = 0
lastuslvl = curntlvl
return
elif newalt <lastalt> 0:
falling = 0
lastalt = 0
inloop = 0
Time += 0.01
if Time > 30: # End prog after 30 sec simulat
break
print "At the tone the Time will be:", Time,"\n"
while inloop < 109:
gravity(inloop)
inloop += 1
Code: Select all
1,0,2070.0,0.0,24.0
1,0,2060.0,0.0,36.0
1,0,2050.0,0.0,48.0
1,0,2040.0,0.0,60.0
1,0,2030.0,0.0,72.0
1,0,2020.0,0.0,84.0
1,0,2010.0,0.0,96.0
1,0,2000.0,0.0,108.0
1,0,1990.0,0.0,120.0
1,0,1980.0,0.0,132.0
1,0,1970.0,0.0,144.0
1,0,1960.0,0.0,156.0
1,0,1950.0,0.0,168.0
1,0,1940.0,0.0,180.0
1,0,1930.0,0.0,192.0
1,0,1920.0,0.0,204.0
1,0,1910.0,0.0,216.0
1,0,1900.0,0.0,228.0
1,0,1890.0,0.0,240.0
1,0,1880.0,0.0,252.0
1,0,1870.0,0.0,264.0
1,0,1860.0,0.0,276.0
1,0,1850.0,0.0,288.0
1,0,1840.0,0.0,300.0
1,0,1830.0,0.0,312.0
1,0,1820.0,0.0,324.0
1,0,1810.0,0.0,336.0
1,0,1800.0,0.0,348.0
1,0,1790.0,0.0,360.0
1,0,1780.0,0.0,372.0
1,0,1770.0,0.0,384.0
1,0,1760.0,0.0,396.0
1,0,1750.0,0.0,408.0
1,0,1740.0,0.0,420.0
1,0,1730.0,0.0,432.0
1,0,1720.0,0.0,444.0
1,0,1710.0,0.0,456.0
1,0,1700.0,0.0,468.0
1,0,1690.0,0.0,480.0
1,0,1680.0,0.0,492.0
1,0,1670.0,0.0,504.0
1,0,1660.0,0.0,516.0
1,0,1650.0,0.0,528.0
1,0,1640.0,0.0,540.0
1,0,1630.0,0.0,552.0
1,0,1620.0,0.0,564.0
1,0,1610.0,0.0,576.0
1,0,1600.0,0.0,588.0
1,0,1590.0,0.0,600.0
1,0,1580.0,0.0,612.0
1,0,1570.0,0.0,624.0
1,0,1560.0,0.0,636.0
1,0,1550.0,0.0,648.0
1,0,1540.0,0.0,660.0
1,0,1530.0,0.0,672.0
1,0,1520.0,0.0,684.0
1,0,1510.0,0.0,696.0
1,0,1500.0,0.0,708.0
1,0,1490.0,0.0,720.0
1,0,1480.0,0.0,732.0
1,0,1470.0,0.0,744.0
1,0,1460.0,0.0,756.0
1,0,1450.0,0.0,768.0
1,0,1440.0,0.0,780.0
1,0,1430.0,0.0,792.0
1,0,1420.0,0.0,804.0
1,0,1410.0,0.0,816.0
1,0,1400.0,0.0,828.0
1,0,1390.0,0.0,840.0
1,0,1380.0,0.0,852.0
1,0,1370.0,0.0,864.0
1,0,1360.0,0.0,876.0
1,0,1350.0,0.0,888.0
1,0,1340.0,0.0,900.0
1,0,1330.0,0.0,912.0
1,0,1320.0,0.0,924.0
1,0,1310.0,0.0,936.0
1,0,1300.0,0.0,948.0
1,0,1290.0,0.0,960.0
1,0,1280.0,0.0,972.0
1,0,1270.0,0.0,984.0
1,0,1260.0,0.0,996.0
1,0,1250.0,0.0,1008.0
1,0,1240.0,0.0,1020.0
1,0,1230.0,0.0,1032.0
1,0,1220.0,0.0,1044.0
1,0,1210.0,0.0,1056.0
1,0,1200.0,0.0,1068.0
1,0,1190.0,0.0,1080.0
1,0,1180.0,0.0,1092.0
1,0,1170.0,0.0,1104.0
1,0,1160.0,0.0,1116.0
1,0,1150.0,0.0,1128.0
1,0,1140.0,0.0,1140.0
1,1,1130.0,0.0,1152.0
1,1,1120.0,0.0,1164.0
1,1,1110.0,0.0,1176.0
1,1,1100.0,0.0,1188.0
1,1,1090.0,0.0,1200.0
1,1,1080.0,0.0,1212.0
1,1,1070.0,0.0,1224.0
1,1,1060.0,0.0,1236.0
1,1,1050.0,0.0,1248.0
1,1,1040.0,0.0,1260.0
1,1,1030.0,0.0,1272.0
1,1,1020.0,0.0,1284.0
1,1,1010.0,0.0,1296.0
1,1,1000.0,0.0,1308.0
So we are being blathered to death to see that the obvious is never resolved. I have spreadsheet data from Urich and femr2 and they differ significantly so I will have to try them against my program.
But what calculation method can be used to simulate the structural resistance that doesn't just provide more junk to argue about?
This is discussed on another more technical website:
http://the911forum.freeforums.org/post10572.html#p10572
psik [3625]