Beispiel #1
0
 def test_compute_save_imlVales(self):
     IMLs = demand_calculations.compute_imls_damage_states([1],self.accs_path,self.IMTs,self.imlsValues_path)
     self.assertTrue(numpy.allclose(IMLs[0],[0.0266941,1.39846,0.0445457799089,0.0169756639973]))
     self.assertTrue(numpy.allclose(IMLs[2],[0.1264644,0.06819,0.2304,0.0847],atol=0.001))
Beispiel #2
0
        capacityDisp = capacity_calculations.compute_disps(data,collapse_type)
        ductilities = capacity_calculations.compute_ductility(capacityDisp)           
        periods = capacity_calculations.compute_periods(data,ductilities) 
        elasticPeriods.append(periods[0])  
                 
        #Compute demand displacement
        demandDisp = demand_calculations.compute_demand_displacement(data,periods,spectraDisp,spectraPeriods,damping,ACCELEROGRAMS,ductilities)
        DSpositions = damage_allocator.damage_state_position(capacityDisp, demandDisp)
        damageStates=damageStates+DSpositions
        print capacityDisp
 #       print demandDisp
#        print ductilities
 #       print periods

# Compute the imls for each accelerogram    
imlDamageStates = demand_calculations.compute_imls_damage_states(elasticPeriods,ACCELEROGRAMS,IMTs,IMTVALUES)

# Compute the best logarithmic mean and standard deviation for each curve
fit_curve.compute_best_curves(imlDamageStates,damageStates,IMTs)          

# Compute statistics for each fragility curve
setIMLs,LS1PEs,LS2PEs,LS3PEs = fit_curve.generate_synthetic_datasets(imlDamageStates,damageStates,5)
statistics = fit_curve.compute_statistics(setIMLs,LS1PEs,LS2PEs,LS3PEs)

# Compute Vulnerability functions
                                                            
setMeanStddev = fit_curve.compute_set_mean_stddev(statistics,25)
imls, vulFunc = fit_curve.compute_vulnerability_functions(imlDamageStates, setMeanStddev,25)
finalVulFunc = fit_curve.compute_final_vulnerability_function(imls, vulFunc)
print finalVulFunc