compas_cra.equilibrium
¤
Functions:¤
cra_penalty_problem
¤
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.
- Getting Started Tutorial How to use CRA for your analysis 5. Solving equilibrium
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.
- Getting Started Tutorial How to use CRA for your analysis 5. Solving equilibrium
cra_problem
¤
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,alphaslices).
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.
- Getting Started Tutorial How to use CRA for your analysis 5. Solving equilibrium
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.
- Getting Started Tutorial How to use CRA for your analysis 5. Solving equilibrium
density_setup
¤
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
¤
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
¤
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
¤
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
¤
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
¤
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
¤
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
¤
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
¤
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
¤
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.
- Getting Started Tutorial How to use CRA for your analysis 5. Solving equilibrium
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.
- Getting Started Tutorial How to use CRA for your analysis 5. Solving equilibrium