The Solver function is designed to assist users in determining the precise adjustments required to achieve a specific calculated value in a recipe. This feature is particularly helpful in cases when you need to find the gram amount of an ingredient needed to meet a specific target calculation.
When using Solver, users can decide which aspects of the recipe can and cannot be adjusted by adding locks. This flexibility ensures that variables such as batch size or specific ingredient amounts remain unchanged. The Solver will then work within these constraints, adjusting only the ingredients left unlocked.
Note: Because the Solver relies heavily on ingredient attributes to make adjustments, it is important to ensure that all relevant attribute columns are displayed when using this function.
Use Case Example
Consider a scenario where your current recipe has a glass transition temperature (Tg) of 21°C, but your goal is to increase it to 25°C while maintaining your current batch size. Using the Solver function, you can calculate the necessary changes to your ingredient amounts to achieve this outcome.
Using Solve Mode
1. Create a reference copy of your recipe
Before applying the Solver, it is recommended that you create a copy of your original recipe. Doing so allows you to compare the Solver’s adjustments to your original formulation.
From the Recipe page of your experiment, make a copy by clicking the experiment column header and selecting “Copy Experiment”.
2. Verify ingredient attribute columns are displayed
Since the system relies on these attributes to make adjustments, ensure that all necessary ingredient attribute columns are visible before running the Solver.
Add necessary ingredient attributes by clicking the “Ingredient Attributes” button at the top of the page and selecting them from the dropdown menu.
Note: Attributes are helpful in the beginning but can be removed/hidden later on.
3. Enable Solve Mode
Click “Calculations” in the top toolbar and select “Solve Mode” to enable Solver functions. Once enabled, you will see a pencil icon next to all editable calculations in your recipe.
4. Set your target value in the Calculations section
Input your desired target value by replacing the current calculation with the goal calculation. For example, if you’re targeting a Tg of 25°C, replace the current value (21°C) with 25°C.
Once entered, you will notice that a ≠ and lock symbol. The ≠ indicates that the entered value does not yet match the computed value. The lock icon shows that the Solver will keep this target fixed at 25 while adjusting other unlocked ingredients to help reach that goal.
5. Set additional goals by locking calculations you want to remain constant
If there are certain calculations that you do not want to change (ex: batch size), you lock these parameters by clicking the lock icon associated with that calculation.
6. Lock ingredient values you want to keep constant
You can also lock ingredients you want to remain constant. Click the lock icon associated with an ingredient to instruct the Solver not to adjust that ingredient value.
To lock all ingredient values except for a select few, use the “Lock All Other Ingredients” option. For example, if you only want to adjust the values of Monomers 2 and 3 to reach your target Tg, begin by clicking the lock symbol next to Monomer 2 and selecting “Lock All Other Ingredients” from the dropdown menu. This will lock every ingredient except Monomer 2. To unlock Monomer 3, click on its lock symbol and choose “Unlock Quantity.” This way, the Solver will only adjust Monomers 2 and 3 while keeping the rest of the ingredients unchanged.
7. Run the Solver
Once you’ve set your goals in by locking values in the Calculations section and configured your ingredient locks, click the blue “Solve” button at the top of the page.
If you have multiple formulas in view that you want solved, you can also choose the “Normalize All” option from the dropdown menu will apply the Solver across all visible formulas.
8. View Solver Results
After the Solver has made adjustments, review the changes to your recipe. A warning will also appear at the top of your screen, informing you that ingredient ratios have been normalized.
We can now use the copy of the original experiment to compare against the Solver results. In this case, we see that to reach a 25°C with a batch size of 2100g, the value of Monomer 2 needed to increase by 232g and the value of Monomer 3 needed to decrease by 232g.
Note: If the solution set does not exist/cannot be solved, a warning will appear at the top of the screen.
Using Solver/Locks
Solver functions can also be configured using a separate Solver/Locks side panel, which offers a different view of the same functions. The side panel is also helpful for troubleshooting errors, it displays locks on all ingredients and calculations, including those that have been hidden.
To view the side panel, search for “Solver/Locks” using Search Actions.
With the side panel displayed, you can add your desired locks by clicking the lock icons on the Recipe page as before. Alternatively, you can manually add individual locks within the side panel under “Add Lock”. Once your goals and locks have been added, click the blue “Solve” button.
Proportional/Custom Objective Functions
Using Solver/Locks also allows users to optimize experiment variables by setting specific objectives. To do so, select the “Proportional Objective” or “Custom Objective Function?” checkbox at the top of the side panel.
Proportional Objective
The Proportional Objective option in the instructs the system to adjusts all unlocked inputs proportionally to meet the set goals. For this option to work, there must be at least one target constraint on an input or an input without other constraints.
Note: A proportional solution isn’t guaranteed if the problem is over-constrained, meaning there are too many conflicting restrictions.
Custom Objective Function
The Custom Objective Function allows you to directly control how the solver optimizes a specific calculation. Instead of focusing on proportionality, you can select a metric for the solver to either minimize, maximize, or target.
To set a Custom Objective:
1. Select the Custom Objective Function checkbox
2. Choose whether you want to minimize, maximize, or target a calculation. If “target” is selected, you’ll need to provide the specific target value.
3. From the dropdown menu, select the calculation you wish to optimize, such as volume, batch size, or reacted solid weights.
Undoing the Solver
After using the Solver, you can still undo any changes made. To revert your recipe to its previous configuration, simply click the “Undo” button at the top of the page to undo the latest edit.
What Calculations Can Be Used with the Solver?
When using Solve Mode in a recipe, if you do not see a lock symbol next to a calculation, it means that the calculation cannot be used with the Solver. This happens because not all calculations are Solver-compatible. The two types of calculations that can be used with the solver are: Weighted Sum or Average and Composite.
Weighted Sum or Average Calculations
The first type of calculation to create or select to use with the Solver function is a Weighted Sum or Average. An example of this is a % Monomer calculation, which is the gram total of monomers in a recipe divided by the gram total of all ingredients in that recipe.
For more information on Weighted Sum or Average Calculations, including how to create them, refer to the Weighted Sum or Average Input Calculation Section of the Input Calculation article.
It’s important to note that while Weighted Sum or Average calculations are required for Solver compatibility, not all of them will work. For instance, the following types of Weighted Sum or Average calculations are not Solver-compatible:
- Calculations using “Manually Specified Totals Only”
- Calculations using a “Calculated Total”
- Some calculations using Ingredient Calculation as a multiplier
Composite Calculations
The second type of calculation to create or select to use with the Solver function is a Composite calculation. Composite calculations combine or divide Weighted Sum calculations. An example of this is the OH Number on Solids calculation, displayed below. For more information on Composite calculations, including how to create them, refer to the Composite Input Calculations section of the Input Calculation article.
It is also important to note that that Weighted Average calculations (which involve a denominator) can only function as stand-alone calculations and cannot be used within Composite calculations.
Complex Solves
When performing complex solves—those with multiple calculations locked—a general rule of thumb is to ensure that the number of unlocked ingredients is equal to or greater than the number of locked calculations.
Complex Solve Example
Consider an example scenario in which you want to lock Initiator 1, Initiator 2, and methyl methacrylate. This leaves the four remaining ingredients unlocked:
- Solvent 1 (30 g)
- Monomer 2 (350 g)
- Monomer 3 (550 g)
- Monomer4 (650 g)
With four ingredients unlocked, that mean that you can lock up to four calculations:
- Tg (15°C)
- OH Solids (150)
- Batch Size (2100 g)
- NVM (85%)
In this example there are four unlocked ingredients and four locked calculations, so the the rule of thumb is followed. However, if you tried to lock a fifth calculation, the Solver will display an error message stating that the request is infeasible.
In the image below, adding a fifth locked calculation (OH EW on Solution, Acrylic) causes the Solver to fail.
Complex Solve Exceptions
The exception to this rule of thumb comes when working with column calculations. When locking a column calculation (such as Weight %), the entire column counts as only one unlocked calculation. The number of values within that column calculation do not count toward the total.
Troubleshooting Solver Errors
If you encounter an error message, access the Solver/Locks side panel. Since it shows all the locked calculations, even those hidden, you can use the side panel to verify that you have at least the same amount of unlocked ingredient as you have locked calculations.
For example, if you open the Solver/Locks side panel and realize you have a hidden Volume lock, this may be why the Solver is failing. By unlocking that calculation, you can correct the error and proceed with your Solve.
Using Solver with Column Calculations
As mentioned briefly above, Solver can also be used on column calculations. Like other calculations and ingredients in a recipe, column calculations can also be locked. This can be useful when you are trying to solve for Weight %, for example.
To Solve using a column calculation, first add the desired column to your recipe. Next, with Solve Mode enabled, manually enter your desired column calculation values. In the example below, we will set/lock the Weight % of methyl methacrylate, Monomer 2, Monomer 3, and Monomer 4 to be 20%, 20%, 40%, and 20%, respectively. We will also lock our Batch Size at 2000g and leave all other calculations and ingredients unlocked.
After clicking “Solve”, all unlocked ingredients and calculations will dynamically adjust to best match the locked column calculation values.