Install
$ agentstack add skill-amanbh997-claude-skills-for-computational-designers-optimization-methods ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Optimization Methods for AEC Computational Design
1. Optimization in AEC Design
The Role of Optimization
Optimization is the systematic process of finding the best solution from a set of feasible alternatives according to one or more criteria. In the Architecture, Engineering, and Construction (AEC) industry, optimization transforms design from an intuition-driven craft into a rigorous, evidence-based discipline that can explore thousands of alternatives in the time a human designer evaluates a handful.
Every AEC project embeds optimization problems whether practitioners recognize them or not. Selecting a column grid that minimizes steel tonnage, arranging rooms to maximize adjacency satisfaction, routing ductwork to minimize pressure loss, or shaping a facade to balance daylight and solar heat gain -- all are optimization problems with design variables, objectives, and constraints.
Design Optimization vs. Mathematical Optimization
Mathematical optimization seeks a global or local extremum of a function subject to constraints, governed by theorems about convexity, differentiability, and feasibility. Design optimization in AEC adds layers of complexity:
- Multiple stakeholders with conflicting objectives (cost vs. aesthetics vs. performance)
- Mixed variable types: continuous (member thickness), discrete (bolt count), categorical (material grade), topological (connectivity)
- Expensive evaluations: a single FEA run may take minutes; a CFD simulation hours; an energy model tens of minutes
- Ill-defined objectives: "architectural quality" resists quantification
- Regulatory constraints: building codes, zoning ordinances, fire safety -- hard constraints that cannot be relaxed
- Manufacturing constraints: available section catalogs, sheet sizes, fabrication tolerances
- Uncertainty: loads are probabilistic, material properties vary, construction tolerances exist
Problem Classification
| Classification Axis | Categories | AEC Examples | |---|---|---| | Variable type | Continuous, discrete, integer, mixed, combinatorial | Member sizing (continuous), bolt count (integer), material choice (categorical) | | Objective count | Single-objective, multi-objective, many-objective (>3) | Weight minimization (single), weight vs. cost vs. carbon (many) | | Constraint type | Unconstrained, equality-constrained, inequality-constrained, bound-constrained | Stress 10,000
- Use case: medium to large smooth unconstrained or bound-constrained problems; the default recommendation for smooth problems in scipy
Sequential Quadratic Programming (SQP)
- Solves a sequence of quadratic subproblems approximating the original NLP
- Handles equality and inequality constraints via active-set or interior-point strategies
- Superlinear convergence under regularity conditions
- Use case: smooth constrained optimization; structural sizing with stress/displacement constraints
Gradient-Free / Direct Search Methods
When gradients are unavailable, unreliable, or expensive to compute (numerical differentiation in noisy simulations), direct search methods explore the landscape using only function values.
Nelder-Mead Simplex
- Maintains a simplex of n+1 points in n dimensions
- Operations: reflection, expansion, contraction, shrink
- No convergence guarantee for n > 1; can stall on non-smooth landscapes
- Use case: low-dimensional (n 0.5), cool faster; if low ( 0 (worsening moves). This is the Boltzmann distribution from statistical mechanics. Key properties:
- As T approaches infinity, P approaches 1 (accept everything)
- As T approaches 0, P approaches 0 (accept only improvements)
- Larger delta (bigger worsening) = lower acceptance probability at any T
Neighbor Generation
The neighborhood structure N(x) is problem-specific and critically important:
- Continuous: Perturb each variable by Gaussian noise scaled by T (larger moves at high T)
- Discrete: Swap two elements, flip a bit, change one variable value
- Structural: Add/remove a member, change a connection type
- Layout: Move a room, swap two rooms, resize a zone
Reheating Strategies
When SA stalls in a local minimum at low temperature, reheating can restart exploration:
- Periodic reheating: Every N iterations, reset T to a fraction (e.g., 0.5) of T_0
- Stagnation-based: If no improvement for M iterations, reheat
- Non-monotonic SA: Allow temperature to oscillate
Multi-Start SA
Run SA multiple times from different random starting solutions. Return the best solution found across all runs. Simple parallelization strategy. Each run is independent. Effective when single-run SA has moderate probability of finding the global basin.
SA vs. GA for AEC Problems
| Aspect | SA | GA | |---|---|---| | Population | Single solution | Population of solutions | | Parallelization | Multi-start only | Naturally parallel | | Discrete variables | Excellent | Excellent | | Continuous variables | Good (with good neighbor) | Excellent (with SBX) | | Tuning difficulty | Moderate (T_0, alpha) | High (pop, pc, pm, selection) | | Multi-objective | Awkward (weighted sum) | Natural (NSGA-II) | | Memory | O(1) | O(pop * n) | | Solution diversity | Low (single trajectory) | High (population) |
5. Particle Swarm Optimization
Standard PSO Equations
Each particle i has position xi and velocity vi in the design space.
v_i(t+1) = w * v_i(t) + c1 * r1 * (pbest_i - x_i(t)) + c2 * r2 * (gbest - x_i(t))
x_i(t+1) = x_i(t) + v_i(t+1)
Where:
- w = inertia weight (controls momentum / exploration-exploitation balance)
- c1 = cognitive coefficient (attraction to personal best)
- c2 = social coefficient (attraction to global best)
- r1, r2 = uniform random numbers in [0, 1], generated independently per dimension
- pbest_i = best position found by particle i historically
- gbest = best position found by any particle in the swarm
Inertia Weight Strategies
Constant w: w = 0.729 (Clerc's constriction coefficient) with c1 = c2 = 1.49445. Theoretically derived for convergence.
Linearly decreasing w: w decreases from wmax (0.9) to wmin (0.4) over the run. Early exploration, late exploitation. Most common strategy.
Adaptive w: Adjust w based on swarm diversity or improvement rate. High diversity -> lower w (exploit); low diversity -> higher w (explore).
Random w: w ~ U(0.5, 1.0) each iteration. Adds stochasticity. Surprisingly competitive.
Cognitive and Social Parameters
- c1 = c2 = 2.0 is the classical setting (but can cause divergence without constriction)
- c1 = c2 = 1.49445 with w = 0.729 (Clerc-Kennedy constriction) is theoretically sound
- c1 > c2: more self-reliant particles, better exploration, slower convergence
- c1 f_min), stability (buckling), code-specific checks (interaction equations for steel, capacity ratios).
Characteristics: Design variables are typically continuous or selected from discrete catalogs (AISC W-shapes, HSS sections). The search space is moderate. Gradient-based methods work well for continuous sizing; GA or enumeration for catalog selection.
Example: Minimize weight of a steel frame by selecting W-shape sections for each member group, subject to AISC 360 strength checks, story drift 1.0 Hz.
Shape Optimization
Variables: Boundary node coordinates, control point positions (B-spline, NURBS), arch rise, shell curvature parameters, truss node locations.
Typical constraints: Stress, displacement, frequency, geometric constraints (minimum clearance, maximum height), manufacturing constraints (minimum radius of curvature, developability).
Characteristics: Mesh quality can degrade as shape changes -- requires remeshing or parameterization that maintains mesh quality. Sensitivity analysis uses shape derivatives (material derivative approach). Gradient-based methods are efficient but require careful shape parameterization.
Example: Optimize the height profile of a truss bridge by moving interior node positions vertically, minimizing weight subject to stress and deflection constraints.
Topology Optimization
Variables: Element densities (SIMP), element existence (BESO), level-set function values, ground structure member existence.
Typical constraints: Volume fraction (limit total material), stress (local or global), displacement, frequency, manufacturing (minimum member size, connectivity, symmetry, overhang angle for additive manufacturing).
Characteristics: Highest design freedom but most complex. Produces organic, often non-intuitive forms. Post-processing required to extract clean geometry from density fields. Checkerboard filtering, minimum length scale control, and projection methods ensure manufacturability.
Example: Given a 2D design domain with specified loads and supports, find the optimal material distribution using at most 30% of the domain volume, minimizing compliance (maximizing stiffness).
Multi-Scale Optimization
Concept: Simultaneously optimize the macro structure (overall form and topology) and micro structure (unit cell / lattice architecture) at different scales.
Variables: Macro-level density/topology + micro-level unit cell parameters (strut thickness, cell type, orientation).
Application: Lattice-filled structures for additive manufacturing, functionally graded materials, metamaterial design for vibration isolation.
Comparison Table
| Aspect | Size | Shape | Topology | Multi-Scale | |---|---|---|---|---| | Design freedom | Low | Medium | High | Very high | | Variable count | 10-100 | 10-1000 | 1000-1000000 | 10000+ | | Preferred algorithm | SQP, catalog search | SQP, GA | SIMP+MMA, BESO, Level-set | Homogenization + SIMP | | Computational cost | Low | Medium | High | Very high | | Post-processing | Minimal | Moderate | Significant | Significant | | Typical AEC use | Member sizing | Shell/roof form-finding | Structural nodes, brackets | Research, AM parts |
8. AEC Optimization Problem Formulation
Problem 1: Minimize Structural Weight (Truss)
Design variables: Cross-sectional area Ai for each member group i = 1..n (continuous or from catalog) Objective: Minimize sum(rho Ai Li) for all members Constraints: sigmai = N_i for compression members Suggested algorithm: SQP (continuous), GA with catalog encoding (discrete), DE (continuous)
Problem 2: Maximize Daylight with Energy Constraint
Design variables: Window-to-wall ratio (WWR) per facade orientation, shading device depth, glazing U-value, glazing SHGC Objective: Maximize spatial Daylight Autonomy (sDA_300/50) Constraints: Annual energy use intensity (EUI) 50
- For discrete/combinatorial: larger populations help (100-500)
- For NSGA-II: population should be at least 4 * number of objectives; 100-300 is typical
- For CMA-ES: 4 + floor(3 * ln(n)) is the default and usually sufficient
Convergence Detection
Generation-based: Stop after G_max generations (simple but wasteful or insufficient).
Improvement-based: Stop if best fitness has not improved by more than epsilon for N consecutive generations. epsilon = 0.1-1% of current best. N = 20-50 generations.
Population diversity: Stop if population diversity (standard deviation of fitness or genotype) falls below threshold. Low diversity = converged or premature convergence.
Hypervolume (multi-objective): Stop if hypervolume improvement < epsilon for N generations.
Budget-based: Stop after E_max function evaluations. Important when evaluation cost is known and budget is fixed.
Result Validation
After optimization, always validate results:
- Re-evaluate the optimal solution with the full-fidelity model (not surrogate or simplified model)
- Check constraints independently -- optimizer penalty methods may allow slight violations
- Sensitivity analysis: perturb optimal design variables by +/- 5-10% and check objective stability. If objective changes dramatically, the optimum is fragile
- Physical plausibility: does the optimal design make engineering sense? If not, check problem formulation
- Multiple runs: run the optimizer 5-10 times with different random seeds. If results vary significantly, the optimizer has not converged reliably
- Compare with baseline: how much does the optimum improve over the initial/conventional design? If improvement is < 1%, optimization may not be worth the effort
Sensitivity Analysis Post-Optimization
Local sensitivity: partial derivative of objective with respect to each variable at the optimum. Identifies which variables most influence the objective. Computed via finite difference or adjoint method.
Global sensitivity: Sobol indices, Morris screening, or variance-based methods. Identifies which variables matter across the entire design space, not just at the optimum.
Constraint activity: which constraints are active (binding) at the optimum? Active constraints are the "bottleneck" -- relaxing them would improve the objective. Inactive constraints with large margins can potentially be removed to simplify the problem.
Reporting Optimization Results
An optimization study report should include:
- Problem statement: objectives, variables (with ranges), constraints, evaluation method
- Algorithm choice justification and parameter settings
- Convergence plot (best fitness vs. generation/evaluation count)
- For multi-objective: Pareto front plot, selected solution(s), trade-off discussion
- Optimal design variable values and objective value(s)
- Constraint satisfaction verification
- Sensitivity analysis results
- Comparison with baseline design
- Computational cost (wall time, number of evaluations, hardware used)
- Recommendations and limitations
Common Mistakes and How to Avoid Them
Mistake 1: Over-constraining the problem. Too many tight constraints leave no room for optimization. The optimizer finds the same feasible design regardless of initial conditions. Fix: relax non-critical constraints, increase variable ranges.
Mistake 2: Wrong algorithm for the problem. Using GA for a smooth, 3-variable problem (use BFGS). Using gradient descent for a discrete, multi-modal problem (use GA/DE). Fix: match algorithm to problem characteristics per the taxonomy in Section 2.
Mistake 3: Insufficient evaluations. Stopping too early yields suboptimal solutions presented as "optimal." Fix: run convergence study; increase budget until convergence plateaus.
Mistake 4: Ignoring premature convergence. Population converges to a local optimum. Fix: increase population size, use diversity-preserving mechanisms (niching, island model), increase mutation rate.
Mistake 5: Poorly scaled variables. Variables with vastly different ranges (e.g., beam depth in mm [100-1000] and prestress in kN [100-10000]) cause search inefficiency. Fix: normalize all variables to [0, 1] or similar range.
Mistake 6: Black-box penalty functions. Arbitrary penalty coefficients can make constraint handling erratic. Fix: use Deb's feasibility rules (parameter-free), adaptive penalty, or constraint-handling built into the algorithm (NSGA-II handles constraints natively).
Mistake 7: Not validating with full-fidelity model. Optimizing with a simplified model and assuming results hold for the real system. Fix: always re-evaluate final design with the highest-fidelity model available.
Mistake 8: Presenting a single optimal solution without sensitivity context. Stakeholders need to understand robustness. Fix: provide Pareto front, sensitivity analysis, and performance under perturbation.
Mistake 9: Forgetting manufacturing/construction constraints. An "optimal" design that cannot be built is worthless. Fix: include fabrication, erection, and construction constraints from the start.
**Mistake 10: Treating optimization as a substitute for engineering
…
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: Amanbh997
- Source: Amanbh997/Claude-skills-for-Computational-Designers
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.