cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
ChrisMuenzer
Level I

How to use a variable in JSL to set the levels of a DOE factor?

I'm trying to add a factor to a DOE using a variable instead of hard coding the levels. The end goal is to provide the user with a simple interface set the levels for one of the factors.

 

The following code doesn't work and the factor just ends up with L1 and L2 as levels.

 

Names Default To Here( 1 );

levels = List(1,2,3);

d = DOE(
	Custom Design,
	Add factor(Discrete Numeric, levels)
);
d << Make Design;
d << Make Table;
1 REPLY 1

Re: How to use a variable in JSL to set the levels of a DOE factor?

Here is an example I created interactively with a Continous factor and a Discrete Numeric factor.

levels = {1, 2, 3};

obj = DOE(
	Custom Design,
	{Add Response( Maximize, "Y", ., ., . ),
	Add Factor( Continuous, -1, 1, "X1", 0 )}
);

Eval(
	Substitute(
		Expr( obj << Add Factor( Discrete Numeric, LLL, "X2", 0 ) ),
		Expr( LLL ),
		levels
	)
);