def normalprobsb(): niel_dose = sb.getConstant('SB_K').get_value() * sb.getConstant( 'SCREEN_THICKNESS').get_value() * (day_var.get_value() / 365.0) x = (1 - sb.getConstant('SB_P_THRESHOLD').get_value()) / \ log(1 + niel_dose * sb.getConstant('SB_B').get_value()) std_x = (x - sb.getConstant('SB_A_MU').get_value() / sb.getConstant('SB_A_SIGMA').get_value()) return pcf(std_x)
def inner(): day = day_var.getValue() dose = module.getConstant('SB_K') * config.getParam( 'SCREEN_THICKNESS') * day / 365.0 x = (-module.getConstant('SB_P_THRESHOLD') + 1) / \ (log(module.getConstant('SB_B') * dose + 1)) std_x = 1.0 / (module.getConstant('SB_A_SIGMA') / (-module.getConstant('SB_A_MU') + x)) return 1 - pcf(std_x)
def normalprobs3r(): iel_dose = day_var.get_value() / 365.0 * (s3r.getConstant('S3R_K').get_value() / \ s3r.getConstant('SCREEN_THICKNESS').get_value()) x = s3r.getConstant('S3R_DELTAV_THRESHOLD').get_value() / ( s3r.getConstant('S3R_B').get_value() * pow(e, s3r.getConstant('S3R_B').get_value() * iel_dose)) std_x = (x - s3r.getConstant('S3R_A_MU').get_value()) / \ s3r.getConstant('S3R_A_SIGMA').get_value() return pcf(std_x)
def failprobsb(): # return the failure probability of solar battery after day-dose niel_dose = sb.getConstant('SB_K').get_value() * sb.getConstant( 'SCREEN_THICKNESS').get_value() * (day_var.get_value() / 365.0) x = (1 - sb.getConstant('SB_P_THRESHOLD').get_value()) / \ log(1 + niel_dose * sb.getConstant('SB_B').get_value()) std_x = (x - sb.getConstant('SB_A_MU').get_value() / sb.getConstant('SB_A_SIGMA').get_value()) temp = pcf(std_x) i = id(day_var) return 1 - temp
def inner(): day = day_var.getValue() dose = config.getParam('S3R_K') / config.getParam( 'SCREEN_THICKNESS') * (day / 365.0) x = config.getParam('S3R_DELTAV_THRESHOLD') / ( config.getParam('S3R_B') * pow(e, config.getParam('S3R_B') * dose)) std_x = (-config.getParam('S3R_A_MU') + x) / \ config.getParam('S3R_A_SIGMA').getValue() p = 1 - pcf(std_x) return p
def inner(): day = day_var.getValue() dose = config.getParam('S3R_K') / config.getParam( 'SCREEN_THICKNESS') * (day / 365.0) x = config.getParam('S3R_DELTAV_THRESHOLD') / ( config.getParam('S3R_B') * pow(e, config.getParam('S3R_B') * dose)) std_x = (-config.getParam('S3R_A_MU') + x) / \ config.getParam('S3R_A_SIGMA').getValue() p = 1 - pcf(std_x) # logger.info('day:{0}, bcr failure prob:{1}'.format(day, p)) return p
def rewrite(): k = 0.0039 thickness = 35 doses = map(lambda day: day/365.0* k* thickness, range(1, 1000)) # 电池输出功率与NIEL剂量之间的关系 # 其中a服从一个正态分布 a_mu = 0.1754 # expectation of a a_sigma = 0.02319029 # 标准差 b = 12.142 P_threshold= 0.8 xs = map(lambda dose: (1 - P_threshold)/log(1 + dose * b), doses) std_xs = map(lambda x: (x-a_mu)/a_sigma, xs) probs = map(lambda x: 1 - pcf(x), std_xs) rates = map(lambda p: p/(1-p), probs) plt.plot(range(1, 1000), probs) # 失效概率与天数的关系曲线 plt.plot(range(1, 1000), rates) # 失效速率与天数的关系曲线 plt.show()
def fail_prob_of_model(model, vfmap): vs = model.localVars cs = model.constants sb_stdx = stdx_sb(vs, cs, vfmap) s3r_stdx = std_x_s3r(vs, cs, vfmap) return map(lambda x: 1-pcf(x), (sb_stdx, s3r_stdx))
def resolveexprfunc(funcname, *params): if funcname != 'stdcdf': raise Exception("not supported func :{}".format(funcname)) param = params[0] return pcf(param)