Names default to here(1);
dt = New Table( "Robust Simulation Example",
Add Rows( 1000 ),
New Column( "x1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Random Uniform( -1, 1 ) )
),
New Column( "x2",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Random Uniform( -1, 1 ) )
),
New Column( "y",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( -(:x1 ^ 2 + :x2 ^ 2) )
),
New Column( "Feasible Solution",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( If( :x2 > 0.1, 1, 0 ) ),
Set Selected
),
New Column( "Desirability",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( If( If( :x2 > 0.1, 1, 0 ) == 1, -(:x1 ^ 2 + :x2 ^ 2), -2 ) )
)
);
New Window("Finding robust solution",
(
H List Box(
dt << Profiler(
Y( :y, :Feasible Solution ),
Profiler(
1,
Desirability Functions( 1 ),
Term Value(
x1( -0.0000000003269293581, Lock( 0 ), Show( 1 ) ),
x2( 0.100000001061837, Lock( 0 ), Show( 1 ) )
)
),
SendToReport(
Dispatch( {}, "Profiler", OutlineBox, {Set Title( "Optimized Solution" )} )
)
),
dt << Profiler(
Y( :y, :Feasible Solution ),
Profiler(
1,
Desirability Functions( 1 ),
Term Value(
x1( -0.0000000003269293581, Lock( 0 ), Show( 1 ) ),
x2( 0.100000001061837, Lock( 0 ), Show( 1 ) )
),
Simulator(
1,
Factors(
x1 << Random( Normal( -0.0000000003269293581, 0.05 ) ),
x2 << Random( Normal( 0.100000001061837, 0.05 ) )
),
Responses( y << No Noise, Feasible Solution << No Noise ),
Resimulate
)
),
SendToReport(
Dispatch(
{},
"Profiler",
OutlineBox,
{Set Title(
"Simulation of optimized solution if only able to control each x to have standard deviation of 0.05, note the large number of infeasible solution"
)}
),
Dispatch(
{"Prediction Profiler"},
"Profile Simulator Histogram",
FrameBox,
{DispatchSeg(
Hist Seg( 1 ),
{Line Color( {65, 104, 68} ), Fill Color( "Green" ),
Bin Span( 2, 0 )}
)}
),
Dispatch(
{"Prediction Profiler"},
"Profile Simulator Histogram",
FrameBox( 2 ),
{DispatchSeg(
Hist Seg( 1 ),
{Line Color( {65, 104, 68} ), Fill Color( "Green" ),
Bin Span( 2, 0 )}
)}
),
Dispatch(
{"Prediction Profiler"},
"Profile Simulator Histogram",
FrameBox( 3 ),
{DispatchSeg(
Hist Seg( 1 ),
{Line Color( {65, 104, 68} ), Fill Color( "Green" ),
Bin Span( 2, 0 )}
)}
),
Dispatch(
{"Prediction Profiler"},
"",
Border Box( 21 ),
Add Text Annotation(
Text( "Lots of Low
Desirability
Results" ),
Fixed Size( 0 ),
Text Box( {-104, 38, -15, 133} ),
Filled( 0 ),
Text Color( "Medium Dark Magenta" ),
"Font"("Segoe UI", 10, "Bold")
)
),
Dispatch(
{"Prediction Profiler"},
"Profile Simulator Histogram",
FrameBox( 3 ),
{DispatchSeg(
Hist Seg( 1 ),
{Line Color( {65, 104, 68} ), Fill Color( "Green" ),
Bin Span( 2, 0 )}
), Add Line Annotation(
Line( {-8, 68}, {-22, 65} ),
Color( "Medium Dark Magenta" ),
Thick( 1 )
)}
)
)
),
dt << Profiler(
Y( :y, :Feasible Solution ),
Profiler(
1,
Desirability Functions( 1 ),
Term Value(
x1( -0.0000000003269293581, Lock( 0 ), Show( 1 ) ),
x2( 0.203, Lock( 0 ), Show( 1 ) )
),
Simulator(
1,
Factors(
x1 << Random( Normal( -0.0000000003269293581, 0.05 ) ),
x2 << Random( Normal( 0.203, 0.05 ) )
),
Responses( y << No Noise, Feasible Solution << No Noise ),
Resimulate
)
),
SendToReport(
Dispatch(
{},
"Profiler",
OutlineBox,
{Set Title(
"Solution moved away from the 'edge' so an acceptable fraction of simulated solutions are infeasible"
)}
),
Dispatch(
{"Prediction Profiler"},
"Profile Simulator Histogram",
FrameBox,
{DispatchSeg(
Hist Seg( 1 ),
{Line Color( {65, 104, 68} ), Fill Color( "Green" ),
Bin Span( 2, 0 )}
)}
),
Dispatch(
{"Prediction Profiler"},
"Profile Simulator Histogram",
FrameBox( 2 ),
{DispatchSeg(
Hist Seg( 1 ),
{Line Color( {65, 104, 68} ), Fill Color( "Green" ),
Bin Span( 2, 0 )}
)}
),
Dispatch(
{"Prediction Profiler"},
"Profile Simulator Histogram",
FrameBox( 3 ),
{DispatchSeg(
Hist Seg( 1 ),
{Line Color( {65, 104, 68} ), Fill Color( "Green" ),
Bin Span( 2, 0 )}
)}
),
Dispatch(
{"Prediction Profiler"},
"",
Border Box( 21 ),
Add Text Annotation(
Text( "Acceptable
fraction of low
Desirability
Results" ),
Fixed Size( 0 ),
Text Box( {-111, 25, 8, 108} ),
Filled( 0 ),
Text Color( "Medium Dark Magenta" ),
"Font"("Segoe UI", 10, "Bold")
)
),
Dispatch(
{"Prediction Profiler"},
"Profile Simulator Histogram",
FrameBox( 3 ),
{DispatchSeg(
Hist Seg( 1 ),
{Line Color( {65, 104, 68} ), Fill Color( "Green" ),
Bin Span( 2, 0 )}
), Add Line Annotation(
Line( {-8, 68}, {-22, 65} ),
Color( "Medium Dark Magenta" ),
Thick( 1 )
)}
),
Dispatch(
{"Prediction Profiler"},
"Profiler",
FrameBox( 6 ),
Add Text Annotation(
Text( "Moved from 0.1 to 0.2" ),
Fixed Size( 1 ),
Text Box( {7, 20, 72, 89} ),
Filled( 0 ),
Text Color( "Medium Dark Magenta" ),
"Font"("Segoe UI", 10, "Bold")
)
)
)
)
)
)
);