示例#1
0
beam_properties = properties()
bc = boundary_conditions(load=np.array([
    [0, 0],
]))
analytical_solution = bc.concentrated_load[0][0] / (beam_properties.young *
                                                    beam_properties.area)

mesh = mesh_1D(alpha=[
    1 + analytical_solution, 1 + analytical_solution, 1 + analytical_solution
],
               alpha_nodes=[0, .5, 1],
               mesh_n=10)
curve_parent = poly(coefficients)
curve_child = poly(coefficients)

beam = structure(curve_parent, curve_child, mesh, beam_properties, bc)
strain = beam.strain()
stress = beam.stress()

n = 10

problem = DOE(levels=n, driver='Full Factorial')
problem.add_variable('a1', lower=0, upper=.001, type=float)
problem.add_variable('a2', lower=0, upper=.001, type=float)
problem.define_points()
print(problem.domain)
strain_matrix = np.array(
    list(zip(problem.domain['a1'], problem.domain['a2'],
             problem.domain['a2'])))
strain_x = np.array(
    list(zip(0 * np.ones(n * n), 0.5 * np.ones(n * n), 1 * np.ones(n * n))))
示例#2
0
# Results from Abaqus
abaqus_data = pickle.load(open('neutral_line.p', 'rb'))

# Beam properties
bp = properties()
bc = boundary_conditions(load=np.array([
    [0, -1],
]))
EB_solution = bc.concentrated_load[0][1]/(6*bp.young*bp.inertia) * \
    np.array([0, 0, 3, -1])

mesh = mesh_1D(mesh_n=11, alpha=[1, 1], alpha_nodes=[0, 1])
curve_parent = poly(a=[0, 0, 0, 0])
curve_child = poly(a=EB_solution)

beam = structure(curve_parent, curve_child, mesh, bp, bc)
beam.calculate_position()
eulerBernoulle = beam.r_c

# Find stable solution
bounds = np.array(((-0.02, 0.02), (-0.02, 0.02)))

x, fun = beam.find_stable(beam.g_c.a[2:4],
                          bounds=bounds,
                          input_type='Geometry',
                          loading_condition='plane_stress',
                          input_function=input_function)
beam.g_c.a = input_function(x)
beam.mesh.mesh_child()
beam.calculate_position()
beam.strain()
示例#3
0
L = 1
E = 70e9
Area = h * b
Inertia = b * h**3 / 12.

# For Euler Bernouille
# a = P/(6*E*Inertia)*np.array([-1, 3*L, 0, 0])
# For axial deformation
a = np.array([0, 0, 0, 0])
alpha = [1 + P / Area / E]

curve_parent = poly(a, config='parent')
curve_child = poly(a, alpha, config='child')
r_p = curve_parent.r(x1, x2)
r_c = curve_child.r(x1, x2)
beam = structure(curve_parent, curve_child, area=Area, young=E, load=P)
u = beam.u(x1)
strain = beam.strain(x1)
stress = beam.stress()
# print('strain', strain)
# print('target', beam.load/beam.area/beam.young)
#
# plt.figure()
# plt.plot(r_p[0], r_p[1], label='parent', color='r')
# plt.plot(r_c[0], r_c[1], label='child', color='b')
# Q = plt.quiver(r_p[0], r_p[1], u[0], u[1], angles='xy', scale_units='xy',
#                scale=1, width=0.005, color='0.5')
# plt.legend()
# plt.show()
#
# ux1 = beam.u(r_p[0], diff='x1')