> For the complete documentation index, see [llms.txt](https://tlcfem.gitbook.io/suanpan-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tlcfem.gitbook.io/suanpan-manual/constraint/mpc.md).

# MPC

General Multiple Point Constraint

The Lagrange multiplier method can be used to define constraints. Extra storage is required for the so-called auxiliary bordered stiffness matrix. The constraint is satisfied exactly.

Although the `MPC` object belongs to the `Constraint` class, it behaves like a `Load` object. Hence, a proper `Amplitude` object is required to be present. If `0` is assigned to `(2)`, a default ramp function will be assigned automatically.

!!! warning "no bc" It is not expected to assign boundary conditions via `MPC` constraint or `Tie` element.

The `MPC` is a general-purpose constraint that enforces the following condition:

$$
\sum\omega\_iu\_i=A,
$$

where $$u\_i$$ are target displacements (designated by node tag and DoF token), $$\omega\_i$$ are the corresponding weights and $$A$$ is the magnitude that is controlled by the attached `Amplitude`.

## Syntax

```
mpc (1) (2) (3) [(4) (5) (6)...]
constraint mpc (1) (2) (3) [(4) (5) (6)...]
# (1) int, unique constraint tag
# (2) int, amplitude tag, can be zero
# (3) double, right hand side of the constraint equation, the constraint is homogeneous if this parameter is zero
# (4) int, node tag
# (5) string, dof token
# (6) double, weight
```

For example, to enforce identical displacement between `U1` of node `101` and `U2` of node `102`, one can use the following definition.

```
constraint mpc 1 0 0. 101 u1 1. 102 u2 -1.
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://tlcfem.gitbook.io/suanpan-manual/constraint/mpc.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
