Skip to content

compas_cra.equilibrium ¤

Functions:¤

cra_penalty_problem ¤

cra_penalty_problem(assembly, mu=0.84, density=1.0, d_bnd=0.001, eps=0.0001)

Build the CRA penalty problem (paper Eq. 14) for an assembly.

Variable layout: x = [f-tilde (4V), q (6F), alpha (V)] with f-tilde = [fn+, fn-, fu, fv] per contact vertex.

cra_penalty_solve ¤

cra_penalty_solve(
    assembly: Assembly,
    mu: float = 0.84,
    density: float = 1.0,
    d_bnd: float = 0.001,
    eps: float = 0.0001,
    verbose: bool = False,
    timer: bool = False,
) -> Assembly

CRA penalty solver (paper Eq. 14) using the in-process IPOPT binding.

cra_penalty_solve_native ¤

cra_penalty_solve_native(
    assembly: Assembly,
    mu: float = 0.84,
    density: float = 1.0,
    d_bnd: float = 0.001,
    eps: float = 0.0001,
    verbose: bool = False,
    timer: bool = False,
) -> Assembly

CRA penalty solver (paper Eq. 14) using the in-process IPOPT binding.

cra_problem ¤

cra_problem(assembly, mu=0.84, density=1.0, d_bnd=0.001, eps=0.0001)

Build the CRA NLP for an assembly.

Returns:

  • tuple(:class:`~compas_cra.nlp.problem.NLPProblem`, dict)

    The problem, and a layout dict with the index ranges needed to interpret the solution vector (nv, nfree, f, q, alpha slices).

cra_solve ¤

cra_solve(
    assembly: Assembly,
    mu: float = 0.84,
    density: float = 1.0,
    d_bnd: float = 0.001,
    eps: float = 0.0001,
    verbose: bool = False,
    timer: bool = False,
) -> Assembly

CRA solver (paper Eq. 11) using the in-process IPOPT binding.

cra_solve_native ¤

cra_solve_native(
    assembly: Assembly,
    mu: float = 0.84,
    density: float = 1.0,
    d_bnd: float = 0.001,
    eps: float = 0.0001,
    verbose: bool = False,
    timer: bool = False,
) -> Assembly

CRA solver (paper Eq. 11) using the in-process IPOPT binding.

density_setup ¤

density_setup(assembly, density)

Set up material density.

Parameters:

  • assembly (:class:`~compas_assembly.datastructures.Assembly`) –

    The rigid block assembly.

  • density (dict of float) –

    density values, the dict key should match with assembly.graph.nodes()

Returns:

  • None

equilibrium_setup ¤

equilibrium_setup(assembly, penalty=False)

Set up equilibrium matrix.

Parameters:

  • assembly (:class:`~compas_assembly.datastructures.Assembly`) –

    The rigid block assembly.

  • penalty (bool, default: False ) –

    if True then return penalty matrix.

Returns:

  • class:`~scipy.sparse.csr_matrix`

    Equilibrium matrix Aeq (penalty=False) or Equilibrium penalty matrix Aeq@B (penalty=True).

external_force_setup ¤

external_force_setup(assembly, density)

Set up external force vector.

Parameters:

  • assembly (:class:`~compas_assembly.datastructures.Assembly`) –

    The rigid block assembly.

  • density (float) –

    Density of the material. If density attribute is not set, optimisation will use this density value.

Returns:

  • class:`~numpy.ndarray`

    External force p.

free_nodes ¤

free_nodes(assembly)

Return free and fixed node list.

Parameters:

  • assembly (:class:`~compas_assembly.datastructures.Assembly`) –

    The rigid block assembly.

Returns:

  • free_block ( float ) –

    Node id of free node/blocks

friction_setup ¤

friction_setup(assembly, mu, penalty=False, friction_net=False)

Set up friction matrix.

Parameters:

  • assembly (:class:`~compas_assembly.datastructures.Assembly`) –

    The rigid block assembly.

  • mu (float) –

    Friction coefficient value.

  • penalty (bool, default: False ) –

    if True then return penalty matrix.

  • friction_net (bool, default: False ) –

    Friction net formulation if True for the penalty formulation, friction plus formulation if True.

Returns:

  • class:`~scipy.sparse.csr_matrix`

    Afr (penalty=False) or Afr@B (penalty=True)

make_aeq ¤

make_aeq(assembly, flip=False, penalty=False)

Create equilibrium matrix Aeq or penalty formulation matrix Aeq@B.

Parameters:

  • assembly (:class:`~compas_assembly.datastructures.Assembly`) –

    The rigid block assembly.

  • flip (bool, default: False ) –

    Flip all interfaces if True.

  • penalty (bool, default: False ) –

    Return penalty matrix if True.

Returns:

  • class:`~scipy.sparse.csr_matrix`

    Equilibrium matrix Aeq or penalty formulation matrix Aeq@B

make_afr ¤

make_afr(total_vcount, fcon_number=8, mu=0.8, penalty=False, friction_net=False)

Create friction matrix Afr and Afr@B.

Parameters:

  • total_vcount (int) –

    The total number of vertices

  • fcon_number (int, default: 8 ) –

    N-sided of linearised friction cone.

  • mu (float, default: 0.8 ) –

    Friction coefficient.

  • penalty (bool, default: False ) –

    Return penalty matrix if True.

  • friction_net (bool, default: False ) –

    Friction net formulation if True for the penalty formulation, friction plus formulation if True.

Returns:

  • class:`~scipy.sparse.csr_matrix`

    the basis matrix # Nx3

num_free ¤

num_free(assembly)

Return number of free blocks.

Parameters:

  • assembly (:class:`~compas_assembly.datastructures.Assembly`) –

    The rigid block assembly.

Returns:

  • num_free_block ( float ) –

    Number of free node/blocks

num_vertices ¤

num_vertices(assembly)

Total number of vertices.

Parameters:

  • assembly (:class:`~compas_assembly.datastructures.Assembly`) –

    The rigid block assembly.

Returns:

  • v_count ( int ) –

    Number of total vertices of assembly

rbe_problem ¤

rbe_problem(assembly, mu=0.84, density=1.0)

Build the RBE quadratic program (paper Eq. 6) for an assembly.

Variables are the penalty forces f-tilde = [fn+, fn-, fu, fv] per contact vertex; the constraints are linear (equilibrium and friction cone), the objective a diagonal quadratic with the historical component weights.

rbe_solve ¤

rbe_solve(
    assembly: Assembly,
    mu: float = 0.84,
    density: float = 1.0,
    verbose: bool = False,
    timer: bool = False,
) -> Assembly

RBE solver (paper Eq. 6) using the in-process IPOPT binding.

rbe_solve_native ¤

rbe_solve_native(
    assembly: Assembly,
    mu: float = 0.84,
    density: float = 1.0,
    verbose: bool = False,
    timer: bool = False,
) -> Assembly

RBE solver (paper Eq. 6) using the in-process IPOPT binding.

unit_basis ¤

unit_basis(assembly, penalty=False)

Create interface reference system as unit basis.

Parameters:

  • assembly (:class:`~compas_assembly.datastructures.Assembly`) –

    The rigid block assembly.

  • penalty (bool, default: False ) –

    Return penalty matrix if True.

Returns:

  • class:`~numpy.ndarray`

    the basis matrix # is Nx3