> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ionworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Optimization Overview

> Automatically find optimal battery design and charging parameters with multistart Bayesian and evolutionary optimizers

# Optimization

Optimization in Ionworks Studio allows you to automatically find the best parameter values for your battery models. Instead of manually running many simulations with different parameter combinations, the optimization engine intelligently searches the parameter space to find values that maximize or minimize your objectives while respecting constraints.

## When to Use Optimization

Optimization is ideal for:

* **Charge Protocol Design** - Find optimal charging currents and voltage profiles that minimize charge time while avoiding lithium plating
* **Cell Design** - Optimize electrode thicknesses, porosities, and other geometric parameters to maximize energy density or power capability
* **Multi-Objective Trade-offs** - Balance competing goals like capacity vs. charge time, or energy vs. power

## How Optimization Works

The optimization process follows these steps:

1. **Name your optimization** (optional) - Give the run a descriptive name, or leave it blank to auto-generate one
2. **Select a cell and model** - Choose the cell specification and parameterized model to optimize against
3. **Define Objectives** - Specify what you want to maximize or minimize, and add constraints that must be respected
4. **Define Parameters** - Select which model parameters to optimize and set their bounds (minimum and maximum values)
5. **Configure Algorithm** - Set the number of multistarts and maximum iterations
6. **Run Optimization** - The algorithm explores the parameter space to find the optimal values for the given objective and constraints
7. **Review Results** - Compare the optimized results against your baseline and examine the iteration history

### Multistart Optimization

Optimization problems can have multiple local optima. To increase the chance of finding the global optimum, Ionworks uses **multistart optimization**:

* Multiple optimization runs start from different initial points
* Each run converges to a local optimum
* The best result across all runs is selected as the final answer

The default number of multistarts depends on your chosen optimizer. Global optimizers like Differential Evolution default to 1 multistart since they explore the search space broadly on their own. Local optimizers like XNES and CMA-ES default to 4. You can always adjust this to balance thoroughness and computation time. See [Parallelisation](/optimize/parallelization) for details on how CPUs are allocated across multistart runs.

## Optimization Templates

Ionworks provides pre-configured **optimization templates** to help you get started quickly. Templates are scoped to individual projects, so each project can have its own set of templates tailored to its specific needs. Built-in **system templates** (Design and Charge) are available in every project as read-only starting points.

### Design Optimization

Optimize cell design parameters like electrode thicknesses and material properties to achieve target performance characteristics.

**Common use cases:**

* Maximize cell capacity for a given form factor
* Optimize electrode thickness ratios for fast charging
* Balance energy density and power capability

### Charge Optimization

Optimize charging protocol parameters to minimize charge time while respecting safety constraints.

**Common use cases:**

* Multi-step constant current charging
* Minimizing 0-80% charge time
* Avoiding lithium plating (maintaining positive anode potential)

You can also [copy templates between projects](/optimize/templates#copying-templates-between-projects) to reuse configurations across your organization.

## Key Concepts

### Parameters

Parameters are the values you want to optimize. Each parameter has:

* **Name** - The model parameter to vary (e.g., "Positive electrode thickness \[m]")
* **Bounds** - The minimum and maximum allowed values
* **Initial Value** - The starting point for optimization (defaults to model value)

### Objectives

Objectives define what you want to achieve. Each objective includes:

* **Experiment** - The simulation protocol to run (in UCP format)
* **Goals** - What to maximize or minimize
* **Constraints** - Limits that must be respected

### Metrics

Metrics extract values from simulation results for use in goals and constraints:

| Metric Type    | Description                         | Example Use             |
| -------------- | ----------------------------------- | ----------------------- |
| **Maximum**    | Maximum value during simulation     | Peak temperature        |
| **Minimum**    | Minimum value during simulation     | Minimum anode potential |
| **Mean**       | Average value over time             | Average power           |
| **Sum**        | Total accumulated value             | Energy throughput       |
| **Time**       | Value at a specific time point      | Final capacity          |
| **SOC**        | Value at a specific state of charge | Voltage at 80% SOC      |
| **Voltage**    | Value at a specific voltage         | Time to reach 4.2V      |
| **PointBased** | Single-point value (no time series) | Cell cost               |

### Constraints

Constraints define limits that must be respected. If a constraint is violated, a penalty is added to the cost function. Each constraint has:

* **Action** - "GreaterThan" or "LessThan"
* **Value** - The threshold value
* **Penalty** - The penalty weight for violations (default: 1e6)

## Algorithm Configuration

### Optimizer selection

Ionworks supports several optimization algorithms. The default is **Differential Evolution**, a global optimizer that works well across a wide range of problems without manual tuning.

| Optimizer                            | Type                         | Best for                                                                         | Default multistarts |
| ------------------------------------ | ---------------------------- | -------------------------------------------------------------------------------- | ------------------- |
| **Differential Evolution** (default) | Population-based, global     | General-purpose optimization; noisy or multimodal landscapes                     | 1                   |
| **XNES**                             | Population-based             | General-purpose; smooth landscapes                                               | 4                   |
| **CMA-ES**                           | Population-based             | Difficult non-separable problems                                                 | 4                   |
| **PSO**                              | Population-based, global     | Broad exploration via swarm intelligence                                         | 1                   |
| **Nelder-Mead**                      | Single-point, gradient-free  | Fast convergence on simple problems; may find local optima                       | 4                   |
| **Bayesian Optimization**            | Surrogate (Gaussian process) | Expensive simulations with up to \~10 parameters and a small evaluation budget   | 1                   |
| **TuRBO**                            | Surrogate, trust-region      | Expensive simulations evaluated in parallel batches; scales to higher dimensions | 1                   |
| **SOBER**                            | Surrogate, batch quadrature  | Wide parallel batches where quadrature-style batch selection is desirable        | 1                   |

Global optimizers like Differential Evolution and PSO explore the search space broadly on their own, so they typically need only 1 multistart. Local optimizers benefit from multiple multistarts to avoid getting stuck in local optima. Surrogate optimizers fit a probabilistic model of the objective so every evaluation counts, which makes them the best choice when each simulation is expensive.

### When to choose a surrogate optimizer

Surrogate methods do more work *per round* in order to save simulations:

* **Bayesian Optimization** — sequential, sample-efficient. Use it when each evaluation is expensive, you have ten or fewer parameters, and you only have budget for a few dozen simulations.
* **TuRBO** — trust-region Bayesian optimization designed for parallel batches and higher dimensions. Set the warm-up size to match the parallel batch width so the first round fully uses the available workers.
* **SOBER** — batch Bayesian optimization with quadrature-style recombination. Useful when you want wide, diverse batches; for pure best-cost optimization, prefer TuRBO or Bayesian Optimization.

See the [Design Optimization guide](/guide/optimize/design-optimization#choosing-an-optimizer) for a deeper discussion of when each algorithm pays off.

### Algorithm parameters

You can tune the optimization algorithm:

* **Multistarts** - Number of parallel optimization runs (1-50). The default depends on the optimizer — global optimizers default to 1, while local optimizers default to 4.
* **Max Iterations** - Maximum iterations per run (10-1000, default: 100)
* **Population size** (Differential Evolution and PSO) - Number of candidates evaluated per generation. Defaults scale with the number of fit parameters and are **capped at 40** to keep a single generation from ballooning worker demand on higher-dimensional problems. See [Population size](/optimize/running-optimization#population-size) for details.

More multistarts increase reliability but take longer. More iterations allow finer convergence but may not be needed for simple problems.

## Next Steps

* Learn about [Optimization Templates](/optimize/templates) to understand available templates
* Follow the guide on [Running an Optimization](/optimize/running-optimization) for step-by-step instructions
* Read the [Design Optimization](/guide/optimize/design-optimization) concept guide for the mathematical formulation and design-space intuition
