Пример #1
0
    D = D_from_lampam(lampam, mat)

    Pop.loc[ipop, 'D11'] = D[0, 0]
    Pop.loc[ipop, 'D22'] = D[1, 1]
    Pop.loc[ipop, 'D12'] = D[0, 1]
    Pop.loc[ipop, 'D66'] = D[2, 2]
    Pop.loc[ipop, 'D16'] = D[0, 2]
    Pop.loc[ipop, 'D26'] = D[1, 2]

    Pop.loc[ipop, 'N0'] = N0
    Pop.loc[ipop, 'N45'] = N45
    Pop.loc[ipop, 'N90'] = N90
    Pop.loc[ipop, 'N-45'] = N135

    ss = np.array(ss, dtype=str)
    ss = '  '.join(ss)
    Pop.loc[ipop, 'ss'] = ss

    ipop += 1

Pop.drop_duplicates(keep='first', inplace=True)
Pop.reset_index(inplace=True)

print(f'The population consist of {len(Pop.index)} individuals')

save_constraints_LAYLA(filename, constraints)
save_materials(filename, mat)
append_df_to_excel(filename, Pop, 'stacks', index=True, header=True)
autofit_column_widths(filename)
Пример #2
0
        = abs((D22 - D22_target)/D22_target)
        if abs(D12_target / D11_target) > 1e-8:
            table_result.loc[i, 'diff D12 percentage'] \
            = abs((D12 - D12_target)/D12_target)
        else:
            table_result.loc[i, 'diff D12 percentage'] = np.NaN
        if abs(D66_target / D11_target) > 1e-8:
            table_result.loc[i, 'diff D66 percentage'] \
            = abs((D66 - D66_target)/D66_target)
        else:
            table_result.loc[i, 'diff D66 percentage'] = np.NaN
        if abs(D16_target / D11_target) > 1e-8:
            table_result.loc[i, 'diff D16 percentage'] \
            = abs((D16 - D16_target)/D16_target)
        else:
            table_result.loc[i, 'diff D16 percentage'] = np.NaN
        if abs(D26_target / D11_target) > 1e-8:
            table_result.loc[i, 'diff D26 percentage'] \
            = abs((D26 - D26_target)/D26_target)
        else:
            table_result.loc[i, 'diff D26 percentage'] = np.NaN

### Write results in a excell sheet
writer = pd.ExcelWriter(result_filename)
table_result.to_excel(writer, 'results')
writer.save()
save_constraints_LAYLA(result_filename, constraints)
save_parameters_LAYLA(result_filename, parameters)
save_materials(result_filename, mat_prop)
autofit_column_widths(result_filename)