cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
stat_ranger
Level I

Help needed with custom DOE with complex constraints.

Greetings JMP community,

 

I am working on customizing a DOE. I have 4 ingredients: X1, X2, X3 and X4. The lowest and highest levels of each ingredient are shown in the attached picture.

stat_ranger_1-1724056803315.png

 

 

I have the following constraints that need to be incorporated:

  • total ingredient concentration in each recipe cannot be lower than 9.
  • total ingredient concentration in each recipe cannot be higher than 18.
  • There are can only be a maximum of 3 ingredients in each recipe.

 

As such, I have specified the above-mentioned constraints under the "Use Disallowed Combinations Script", as follows:

stat_ranger_2-1724056803318.png

 

X1 + X2 + X3 + X4 < 9 corresponds to the 1st constraint: total ingredient concentration in each recipe cannot be lower than 9.

X1 + X2 + X3 + X4 > 18 corresponds to the 2nd constraint: total ingredient concentration in each recipe cannot be higher than 18.

(X1 * X2 * X3 * X4 > 0) corresponds to the 3rd constraint: There are can only be a maximum of 3 ingredients in each recipe.

 

I am specifying a response surface model with the addition of cubic and quartic terms as follows:

stat_ranger_3-1724056803321.png

 

 

And, I am specifying a user-specified 50 runs for this design.

However, I run into an error when generating the design, as shown below:

 

stat_ranger_4-1724056803323.png

 

After some troubleshooting, I am able to successfully generate the design with only the first two constraints (X1 + X2 + X3 + X4 < 9 | X1 + X2 + X3 + X4 > 18). I cannot seem to incorporate the 3rd constraint of having not more than 3 ingredients in any recipe. Am I specifying the 3rd constraint incorrectly? Please help. I do not know how to solve this problem.  

 

Many thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Victor_G
Super User

Re: Help needed with custom DOE with complex constraints.

Hi @Byron_JMP,

 

I also thought about using Mixture design, but since the total quantity of X1+X2+X3+X4 is not fixed (it should be between 9 and 18 units), I switched to an Optimal factorial design.

The Mixture design can be a good alternative for this use case by adding a 5th continuous factor for the total quantity of component that can vary between 9 and 18 :

Victor_G_0-1724137302055.png

Specifying a Scheffé Cubic model and adding a quadratic effect for X5 (Total Quantity) enables to have an interesting design respecting all the constraints : 

Victor_G_1-1724137372671.png

(Value of X4 for row25 could be switched to 0 without big changes, to avoid using 4 components in the mixture if really needed).

 

Script to generate the design :

DOE(
	Custom Design,
	{Add Response( Maximize, "Y", ., ., . ), Add Factor( Mixture, 0, 0.89, "X1", 0 ),
	Add Factor( Mixture, 0, 0.89, "X2", 0 ), Add Factor( Mixture, 0, 0.89, "X3", 0 ),
	Add Factor( Mixture, 0, 0.22, "X4", 0 ),
	Add Factor( Continuous, 9, 18, "Total Quantity", 0 ),
	Set Random Seed( 1320459420 ), Number of Starts( 743 ), Add Term( {1, 1} ),
	Add Term( {2, 1} ), Add Term( {3, 1} ), Add Term( {4, 1} ), Add Term( {5, 1} ),
	Add Term( {1, 1}, {2, 1} ), Add Term( {1, 1}, {3, 1} ),
	Add Term( {1, 1}, {4, 1} ), Add Term( {2, 1}, {3, 1} ),
	Add Term( {2, 1}, {4, 1} ), Add Term( {3, 1}, {4, 1} ),
	Add Term( {1, 1}, {2, 1}, {3, 1} ), Add Term( {1, 1}, {2, 1}, {4, 1} ),
	Add Term( {1, 1}, {3, 1}, {4, 1} ), Add Term( {2, 1}, {3, 1}, {4, 1} ),
	Add Term( {1, 1}, {2, 1} ), Add Term( {1, 1}, {3, 1} ),
	Add Term( {2, 1}, {3, 1} ), Add Term( {1, 1}, {4, 1} ),
	Add Term( {2, 1}, {4, 1} ), Add Term( {3, 1}, {4, 1} ), Add Term( {5, 2} ),
	Add Alias Term( {1, 1}, {5, 1} ), Add Alias Term( {2, 1}, {5, 1} ),
	Add Alias Term( {3, 1}, {5, 1} ), Add Alias Term( {4, 1}, {5, 1} ),
	Set Sample Size( 30 ), Simulate Responses( 0 ), Save X Matrix( 0 ), Make Design}
)

And datatable is attached.

 

Hope this discussion may help @stat_ranger,

 

Victor GUILLER
L'Oréal Data & Analytics

"It is not unusual for a well-designed experiment to analyze itself" (Box, Hunter and Hunter)

View solution in original post

9 REPLIES 9
stat_ranger
Level I

Re: Help needed with custom DOE with complex constraints.

An additional note:

 

I run into the error even when only specifying the 3rd constraint: (X1 * X2 * X3 * X4 > 0). Is there anything wrong with this expression?

Victor_G
Super User

Re: Help needed with custom DOE with complex constraints.

Hi @stat_ranger,

 

Welcome in the Community !


@stat_ranger wrote:

I have the following constraints that need to be incorporated:

  • total ingredient concentration in each recipe cannot be lower than 9.
  • total ingredient concentration in each recipe cannot be higher than 18.
  • There are can only be a maximum of 3 ingredients in each recipe.

May I ask the reason behind your third constraint ? If there is a practical reason (solubility for example), you can keep it, but else, I would not restrict the experimental space beforehand, but more likely do it afterwards. This helps increasing the inference space, finding optimums, and make sure you didn't explore a promising area, as well as making sure that your third constraint is feasible (perhaps you won't reach an optimum if you don't have the 4 components).

 

It seems there are some errors in defining your design :

  1. You can use "Specify Linear Constraints" for your first and second constraints, it will be a lot easier to set up :
    Victor_G_0-1724058180244.png

     

  2. Your third constraint doesn't correspond to what you intend to do and create a dependance between your factors (hence the error message). If you want to have experiments with up to 3 components maximum, specify a more simple model with up to third order terms (not higher). This way, the design generation will mostly create runs with 1 to 3 components for each experiment (only 5 out of 28 experiments in my generated design have 4 components). 
    Victor_G_0-1724059533486.png
  3. Finally, if you are interested in prediction over your experimental space, you can set up the optimality criterion to "I optimal" by clicking on red triangle next to Custom Design, "Optimality Criterion", and "Make I-Optimal Design". More infos on optimality criteria here : Optimality Criteria

Then select the number of runs you want, and with this setup you should have your first 2 constraints respected in the design, without error message and most of the runs with 2 to 3 components :

Victor_G_2-1724058953067.png

 

Here is the script to generate the design (and table attached) : 

DOE(
	Custom Design,
	{Add Response( Maximize, "Y", ., ., . ),
	Add Factor( Continuous, 0, 16, "X1", 0 ),
	Add Factor( Continuous, 0, 16, "X2", 0 ),
	Add Factor( Continuous, 0, 16, "X3", 0 ),
	Add Factor( Continuous, 0, 4, "X4", 0 ), Set Random Seed( 2088020479 ),
	Number of Starts( 719 ), Add Constraint( [-1 -1 -1 -1 -9, 1 1 1 1 18] ),
	Add Term( {1, 0} ), Add Term( {1, 1} ), Add Term( {2, 1} ), Add Term( {3, 1} ),
	Add Term( {4, 1} ), Add Term( {1, 1}, {2, 1} ), Add Term( {1, 1}, {3, 1} ),
	Add Term( {1, 1}, {4, 1} ), Add Term( {2, 1}, {3, 1} ),
	Add Term( {2, 1}, {4, 1} ), Add Term( {3, 1}, {4, 1} ), Add Term( {1, 2} ),
	Add Term( {2, 2} ), Add Term( {3, 2} ), Add Term( {4, 2} ),
	Add Term( {1, 1}, {2, 1}, {3, 1} ), Add Term( {1, 1}, {2, 1}, {4, 1} ),
	Add Term( {1, 1}, {3, 1}, {4, 1} ), Add Term( {2, 1}, {3, 1}, {4, 1} ),
	Add Term( {1, 3} ), Add Term( {2, 3} ), Add Term( {3, 3} ), Add Term( {4, 3} ),
	Set Sample Size( 28 ), Optimality Criterion( "Make I-Optimal Design" ),
	Simulate Responses( 0 ), Save X Matrix( 0 ), Make Design}
)

 

If your third constraint is necessary, there are workarounds that can help you, for example by generating a large amount of design runs, removing the ones with 4 components, and then using this filtered table as a candidate set for the final design creation. See Candidate Set Designs: Tailoring DOE Constraints to the Problem (2021-EU-30MP-78... - JMP User Commu...

 

Hope these suggestions will help you,

Victor GUILLER
L'Oréal Data & Analytics

"It is not unusual for a well-designed experiment to analyze itself" (Box, Hunter and Hunter)

Re: Help needed with custom DOE with complex constraints.

What is the reason for the third constraint?

stat_ranger
Level I

Re: Help needed with custom DOE with complex constraints.

Hello Mark,

 

The 3rd constraint of having no more than 3 ingredients stems from logistical reasons; not related to physical limitations (e.g. coagulation, etc).

Byron_JMP
Staff

Re: Help needed with custom DOE with complex constraints.

it kind of sounds like you want a mixture design like this

Byron_JMP_0-1724087679357.png

16/18=.89

In the model, select all 4 terms, and click Scheffe Cubic

You'll get a 30 run design like this

Byron_JMP_1-1724087790078.png

 

Once you've analyzed the experiment, you can model all the different combinations

 

Byron_JMP_2-1724087932770.png

 

JMP Systems Engineer, Health and Life Sciences (Pharma)
Victor_G
Super User

Re: Help needed with custom DOE with complex constraints.

Hi @Byron_JMP,

 

I also thought about using Mixture design, but since the total quantity of X1+X2+X3+X4 is not fixed (it should be between 9 and 18 units), I switched to an Optimal factorial design.

The Mixture design can be a good alternative for this use case by adding a 5th continuous factor for the total quantity of component that can vary between 9 and 18 :

Victor_G_0-1724137302055.png

Specifying a Scheffé Cubic model and adding a quadratic effect for X5 (Total Quantity) enables to have an interesting design respecting all the constraints : 

Victor_G_1-1724137372671.png

(Value of X4 for row25 could be switched to 0 without big changes, to avoid using 4 components in the mixture if really needed).

 

Script to generate the design :

DOE(
	Custom Design,
	{Add Response( Maximize, "Y", ., ., . ), Add Factor( Mixture, 0, 0.89, "X1", 0 ),
	Add Factor( Mixture, 0, 0.89, "X2", 0 ), Add Factor( Mixture, 0, 0.89, "X3", 0 ),
	Add Factor( Mixture, 0, 0.22, "X4", 0 ),
	Add Factor( Continuous, 9, 18, "Total Quantity", 0 ),
	Set Random Seed( 1320459420 ), Number of Starts( 743 ), Add Term( {1, 1} ),
	Add Term( {2, 1} ), Add Term( {3, 1} ), Add Term( {4, 1} ), Add Term( {5, 1} ),
	Add Term( {1, 1}, {2, 1} ), Add Term( {1, 1}, {3, 1} ),
	Add Term( {1, 1}, {4, 1} ), Add Term( {2, 1}, {3, 1} ),
	Add Term( {2, 1}, {4, 1} ), Add Term( {3, 1}, {4, 1} ),
	Add Term( {1, 1}, {2, 1}, {3, 1} ), Add Term( {1, 1}, {2, 1}, {4, 1} ),
	Add Term( {1, 1}, {3, 1}, {4, 1} ), Add Term( {2, 1}, {3, 1}, {4, 1} ),
	Add Term( {1, 1}, {2, 1} ), Add Term( {1, 1}, {3, 1} ),
	Add Term( {2, 1}, {3, 1} ), Add Term( {1, 1}, {4, 1} ),
	Add Term( {2, 1}, {4, 1} ), Add Term( {3, 1}, {4, 1} ), Add Term( {5, 2} ),
	Add Alias Term( {1, 1}, {5, 1} ), Add Alias Term( {2, 1}, {5, 1} ),
	Add Alias Term( {3, 1}, {5, 1} ), Add Alias Term( {4, 1}, {5, 1} ),
	Set Sample Size( 30 ), Simulate Responses( 0 ), Save X Matrix( 0 ), Make Design}
)

And datatable is attached.

 

Hope this discussion may help @stat_ranger,

 

Victor GUILLER
L'Oréal Data & Analytics

"It is not unusual for a well-designed experiment to analyze itself" (Box, Hunter and Hunter)
stat_ranger
Level I

Re: Help needed with custom DOE with complex constraints.

Greetings Victor,

 

I very much appreciate your expedient detailed responses to my query. It has helped me conceive the desired design. The 3rd constraint of having no more than 3 ingredients stems from logistical reasons; not related to physical limitations (e.g. coagulation).

 

One quick question: how would you evaluate the quality of a mixture design?

 

Thank you once again!

Victor_G
Super User

Re: Help needed with custom DOE with complex constraints.

Hi @stat_ranger,

 

Ok, thanks for the clarification about the logistical reason behind the 3 components.

 

Mixture design are typically optimization design, where you try to predict and optimize your response based on components ratio. So I would use the Evaluate Designs platform and look at informations related to predictivity, like Prediction Variance Profile, Fraction of Design Space Plot, and Design Diagnostics like G-Efficiency and Average Variance of Prediction (related to I-Efficiency). The goal of this evaluation would be to get an understanding about the predictive performances of the design used. 

Note that it can be difficult to evaluate a design without any reference design/benchmark, so I would recommend creating several designs and use the platform Compare Designs to better assess the pros and cons of each design. You can vary the number of runs, complexity of the model, etc...

 

Hope this quick answer will help you,

Victor GUILLER
L'Oréal Data & Analytics

"It is not unusual for a well-designed experiment to analyze itself" (Box, Hunter and Hunter)
stat_ranger
Level I

Re: Help needed with custom DOE with complex constraints.

Thank you Byron for this suggestion. Your suggestion gave the critical foundation for Victor to build on. So, I appreciate this suggestion from you. Many thanks for taking the time to reply.