Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A framework for structural shape optimization based on automatic differentiation (AD) and the adjoint method, enabled by JAX
A framework for structural shape optimization based on automatic differentiation (AD) and the adjoint method, enabled by JAX.
Developed by Gaoyuan Wu @ Princeton.
We have a preprint under review where you can find details regarding this framework. Please share our project with others and cite us if you find it interesting and helpful. Cite us using:
@misc{https://doi.org/10.48550/arxiv.2211.15409,
doi = {10.48550/ARXIV.2211.15409},
url = {https://arxiv.org/abs/2211.15409},
author = {Wu, Gaoyuan},
title = {A framework for structural shape optimization based on automatic differentiation, the adjoint method and accelerated linear algebra},
publisher = {arXiv},
year = {2022},
}
Here is an implementation of JaxSSO to form-find a structure inspired by Mannheim Multihalle using simple gradient descent. (First photo credit to Daniel Lukac)
We consider the minimization of the strain energy by changing the shape of structures, which is equivalent to maximizing the stiffness and reducing the bending in the structure. The mathematical formulation of this problem is as follows, where no additional constraints are considered. $$\text{minimize} \quad C(\mathbf{x}) = \frac{1}{2}\int\sigma\epsilon \mathrm{d}V = \frac{1}{2}\mathbf{f}^\mathrm{T}\mathbf{u}(\mathbf{x}) $$ $$\text{subject to: } \quad \mathbf{K}(\mathbf{x})\mathbf{u}(\mathbf{x}) =\mathbf{f}$$ where $C$ is the compliance, which is equal to the work done by the external load; $\mathbf{x} \in \mathbb{R}^{n_d}$ is a vector of $n_d$ design variables that determine the shape of the structure; $\sigma$, $\epsilon$ and $V$ are the stress, strain and volume, respectively; $\mathbf{f} \in \mathbb{R}^n$ and $\mathbf{u}(\mathbf{x}) \in \mathbb{R}^n$ are the generalized load vector and nodal displacement of $n$ structural nodes; $\mathbf{K} \in \mathbb{R}^{6n\times6n}$ is the stiffness matrix. The constraint is essentially the governing equation in finite element analysis (FEA).
To implement gradient-based optimization, one needs to calculate $\nabla C$. By applying the adjoint method, the entry of $\nabla C$ is as follows: $$\frac{\partial C}{\partial x_i}=-\frac{1}{2}\mathbf{u}^\mathrm{T}\frac{\partial \mathbf{K}}{\partial x_i}\mathbf{u}$$ The use of the adjoint method: i) reduces the computation complexity and ii) decouples FEA and the derivative calculation of the stiffness matrix $\mathbf K$. To get $\nabla C$:
Install it with pip: pip install JaxSSO
JaxSSO is written in Python and requires:
pip install nlopt
, please refer to
nlopt-python.The project provides you with interactive examples with Google Colab for quick start:
FAQs
A framework for structural shape optimization based on automatic differentiation (AD) and the adjoint method, enabled by JAX
We found that JaxSSO demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.