Optimization Templates
Optimization templates provide pre-configured starting points for common optimization scenarios. Each template defines default parameters, objectives, experiments, and constraints that you can customize for your specific needs.Template types
Ionworks Studio has two types of optimization templates:- System templates — Built-in templates (Design, Charge) provided by Ionworks. These are read-only and available in every project.
- Project templates — Templates you create within a specific project. These are only visible to members of that project and can be fully edited or deleted.
Available system templates
Design Template
The Design template is optimized for cell design optimization, where you want to find optimal geometric and material parameters for your battery cell. Default Configuration:- Objectives: Maximize capacity or energy density
- Parameters: Electrode thicknesses, porosities, particle sizes
- Constraints: Manufacturing limits, safety requirements
- Optimizing electrode thickness ratios for a target application
- Balancing energy density vs. power capability
- Finding optimal particle sizes for rate capability
Charge Template
The Charge template is designed for charging protocol optimization, where you want to find optimal current profiles to minimize charge time while respecting safety constraints. Default Configuration:- Objectives: Minimize total charge time (uses the
Lastmetric onTime [s]to capture the final simulation time) - Parameters: Two charging currents (
I_charge_0,I_charge_1) bounded between 0.1–10 A - Experiment: Two CC steps followed by a CV hold to 4.20 V (
C-rate < 0.05), starting from 0% SOC - Constraints: Minimum negative-electrode surface potential difference at the separator interface > 0 V (to avoid lithium plating)
- Multi-step constant current (MSCC) charging optimization
- Fast charging protocol design
- Balancing charge speed vs. battery health
The Charge template was simplified from six CC steps to two CC + CV. If you
need finer-grained control (more CC stages, different cut-off voltages), copy
the template into your project and add steps to the experiment as
described below.
Template Structure
Each optimization template consists of:Parameters Section
Defines which model parameters will be optimized:- bounds: [min, max] range for the parameter
- initial_value: Starting point for optimization
For charging currents, PyBaMM uses negative values for charging (positive
= discharging). So a charge current of -2.0 A means charging at 2.0 A.
Objectives Section
Defines the experiments to run and what to optimize:Experiment Definition
Experiments are defined using UCP format. Templates useInput["parameter_name"] syntax to reference optimizable parameters:
Custom Variables
Templates can define custom variables - derived quantities computed from simulation outputs using PyBaMM expressions. These are useful when you want to optimize based on quantities that aren’t directly available as model outputs.Creating Custom Variables
Custom variables are defined per-objective with:- Name: A descriptive name for the variable
- Expression: A PyBaMM expression string
Metric Types
Templates use various metric types to extract values from simulation results:Aggregation Metrics
These compute a single value from a time series:Crossing Metrics
These evaluate the variable at a specific point:
Example: Time to 80% SOC
Time metric to read the variable at each time in a single evaluation. The metric returns one value per time, in order.
The vector form of the
Time metric is intended for continuous, experiment-free
solves where there are no per-cycle or per-step sub-solutions to slice. It is
not supported inside a DesignObjective — use a scalar value there, or wrap
the metric in a StepwiseMetric / CyclewiseMetric to target specific
segments.Iterative metrics (per-cycle and per-step)
Use iterative metrics when you need to evaluate a goal or constraint on a specific subset of cycles or steps inside a multi-cycle experiment, rather than over the whole simulation. They wrap any aggregation or crossing metric and tell the optimizer to apply it to the chosen indices only. There are two wrapper types:
In the optimization form, toggle Evaluate per step/cycle under any goal or constraint, then choose Per Cycle or Per Step:
- Per Cycle exposes a Step field (step index within each cycle) and a Cycles field that takes a comma-separated list of cycle indices, e.g.
0, 2, 4. - Per Step exposes a Steps field that takes a comma-separated list of absolute step indices, e.g.
0, 1, 2.
Customizing templates
When you select a template, all values are pre-filled but fully editable:- Modify Parameters - Add/remove parameters, adjust bounds
- Edit Objectives - Change the experiment protocol, add/remove goals
- Adjust Constraints - Modify constraint thresholds and penalties
- Add Custom Variables - Create derived quantities for your specific needs
- Configure Algorithm - Set multistarts and max iterations
Templates provide a starting point — you’re encouraged to customize them for
your specific cell chemistry, form factor, and optimization goals.
Saving an optimization as a template
Once you’ve tuned an optimization’s parameters, objectives, and constraints to a configuration you want to reuse, you can save it as a new project template directly from the optimizations list — no need to rebuild the form by hand. To save an optimization as a template:- Open the Optimizations list in your project.
- Click the three-dot menu on the row of the optimization you want to reuse.
- Select Save as template.
- In the dialog, enter a Template Name (required) and an optional description.
- Click Save Template.
The optimization’s saved configuration and a template’s
initial_form_data
share the same schema, so settings like validate_against_experiment_steps,
iterative metric wrappers, and custom variables are preserved exactly. The
template stays in sync with what the optimization actually ran — not a
re-derived form view of it.Copying templates between projects
You can copy any template — including system templates — into another project in your organization. This is useful when you want to reuse a template configuration across multiple projects or create a project-specific version of a system template that you can then customize. To copy a template:- Open the optimization templates list in your project
- Click the three-dot menu on the template you want to copy
- Select Copy to project
- Choose the target project from the dialog
- Click Copy
Template names must be unique within a project. If the target project already
has a template with the same name, the copy will fail. Rename the conflicting
template in the target project first to free up the name, then retry the copy.
Template permissions
Template permissions are managed at the project level:System templates are read-only for all users. To modify a system template,
copy it to your project first — the copy becomes a fully editable project
template.
Next steps
- Follow the Running an Optimization guide for step-by-step instructions
- Review Simulation documentation to understand the underlying simulation process