Example #1
0
def compute_ecf():
    
    parameters = []
    parameters.append(0.50) #Mean of Heff/Ht
    parameters.append(50)   #COV of Heff/Ht
    parameters.append(0.1) #Lower bound
    parameters.append(1.0) #Upper bound
    distribution = 'normal'
    ecf = portfolio_builder.compute_continuous_prob_value(parameters,distribution,rvs=None)

    return ecf
Example #2
0
File: test.py Project: VSilva/DBELA
    def test_compute_random_value(self):
        normal = 'true'
        lognormal = 'true'
        gamma = 'true'
        
        for i in range(10):
            normal_result=portfolio_builder.compute_continuous_prob_value(self.par_normal, self.dist_normal, None)
            lognormal_result=portfolio_builder.compute_continuous_prob_value(self.par_lognormal, self.dist_lognormal, None)
            gamma_result=portfolio_builder.compute_continuous_prob_value(self.par_gamma, self.dist_gamma, None)
            
            if normal_result > self.par_normal[3] or normal_result < self.par_normal[2]:
                normal = 'false'

            if lognormal_result > self.par_lognormal[3] or lognormal_result < self.par_lognormal[2]:
                lognormal = 'false'
                
            if gamma_result > self.par_gamma[3] or gamma_result < self.par_gamma[2]:
                gamma = 'false'

        self.assertEqual(normal,'true')
        self.assertEqual(lognormal,'true')
        self.assertEqual(gamma,'true')
Example #3
0
def compute_efh(data,collapse_type):
    
    structureType=data[0]
    number_storeys=data[2]    
    steel_modulos=data[3]
    steel_yield=data[4]
    ec_ls2=data[12]
    ec_ls3=data[13]
    es_ls2=data[14]
    es_ls3=data[15]
    ey = steel_yield/steel_modulos
    
    if structureType == 'Bare_Frame' or structureType == 'Infilled_Frame':
        
        if collapse_type == 'Beam Sway':
        
            if number_storeys <= 4:
                efh = 0.64
            elif number_storeys > 4 and number_storeys < 20 :
                efh = 0.64-0.0125*(number_storeys-4)
            elif number_storeys >= 20:
                efh = 0.44
            
        if collapse_type == 'Column Sway': 
            efh = []
            efh.append(0.5)
            efh.append(0.5)
            efh.append(0.5)
            #efh.append(0.67)
            #efh.append(0.67-0.17*(es_ls2-ey)/es_ls2)
            #efh.append(0.67-0.17*(es_ls3-ey)/es_ls3)
            
    if structureType == 'Frame_Wall':
        
        parameters = []
        parameters.append(0.61) #Mean of Heff/Ht
        parameters.append(11)   #COV of Heff/Ht
        parameters.append(0.5) #Lower bound
        parameters.append(0.7) #Upper bound
        distribution = 'normal'
        efh = portfolio_builder.compute_continuous_prob_value(parameters,distribution,rvs=None)
        
    return efh
Example #4
0
betas = [0.52, 0.46, 0.28] 

# COMPUTE THE DISPLACAMENT FOR EACH BUILDING
for asset_category in range(number_categories):
    for asset in range(number_assets[asset_category]):

        data = portfolio_builder.create_asset(lines[asset_category])
        code=data[1]

        if code == "Low_Code":
            ec_ls2 = 0.0035
        #    ec_ls3 = 0.0075
            es_ls2 = 0.0150
        #    es_ls3 = 0.0350
        #    ec_ls2 =  portfolio_builder.compute_continuous_prob_value([0.0035,1,0,'inf'], 'lognormal', rvs=None)
            ec_ls3 =  portfolio_builder.compute_continuous_prob_value([0.0075,30,0,'inf'], 'normal', rvs=None)
        #    es_ls2 =  portfolio_builder.compute_continuous_prob_value([0.015,2,0,'inf'], 'normal', rvs=None)
            es_ls3 =  portfolio_builder.compute_continuous_prob_value([0.035,30,0,'inf'], 'normal', rvs=None)          
        
        if code == "High_Code":
            ec_ls2 = 0.0035
            ec_ls3 = 0.020
            es_ls2 = 0.035
            es_ls3 = 0.060
        
        data.append(ec_ls2)
        data.append(ec_ls3)
        data.append(es_ls2)
        data.append(es_ls3)
        data.append(betas)