Skip to content

Commit

Permalink
damping param
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed Oct 16, 2024
1 parent 45868ec commit bf710ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Changed constraint location setter to not check for existence of attribute `projected`.
* Changed plane projection to use closest point method.
* Changed constraint update damping parameter to `damping` instead of `c`.

### Removed

Expand Down
5 changes: 4 additions & 1 deletion src/compas_dr/solvers/dr_constrained_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def dr_constrained_numpy(
tol2: float = 1e-6,
c: float = 0.1,
rk_steps: Literal[1, 2, 4] = 2,
damping: float = 0.1,
callback: Callable = None,
callback_args: list = None,
) -> compas_dr.numdata.ResultData:
Expand Down Expand Up @@ -199,6 +200,8 @@ def acceleration(t, v):
# --------------------------------------------------------------------------

for k in range(kmax):
print(k)

q_fpre = fpre / l
q_lpre = f / lpre
q_EA = EA * (l - linit) / (linit * l)
Expand Down Expand Up @@ -235,7 +238,7 @@ def acceleration(t, v):
continue
constraint.location = x[vertex]
constraint.residual = r[vertex]
constraint.update(damping=c)
constraint.update(damping=damping)
x[vertex] = constraint.location
r[vertex] = constraint.residual

Expand Down

0 comments on commit bf710ca

Please sign in to comment.