기능 내에서 바람직성을 설정하고 극대화하는 데 도움을 요청하세요.안녕하세요 여러분, 장비에서 사용자가 지정한 목표값을 달성하는 함수를 작성하려고 합니다. 제공된 인수는 일치시킬 목표 지표의 이름, 일치시킬 값, 장비 이름, 그리고 목표 장비의 무게입니다.
응답 한계와 일치 목표를 사용하여 바람직성 곡선을 설정하여 이 문제를 해결하려고 합니다. 열을 지정하고 함수 외부에서 독립형 코드 조각으로 코드를 작성했을 때 코드가 작동하는지 테스트했습니다. 이제 이 코드를 함수로 래핑하려고 하는데, 응답 한계를 설정하는 특정 코드가 작동하지 않습니다. 제가 무엇을 잘못하고 있는지 알려주실 분 계신가요? 감사합니다!
제가 얻은 그래픽 출력은 다음과 같습니다. 필수 응답 지표, 요인 값, 잠금은 잘 작동하지만, 바람직성 곡선은 변하지 않습니다.

dt = currentdatatable();
// FindMatchingAgiSpeed is a function that finds the agitation speed in Brx_B that will
// match the hydrodynamic quantity requested as the input
FindMatchingAgiSpeed = Function( {dt, HydyMetricMixing, valueOfHydyMetric, Brx_Name_B, Brx_Volume_B},
// HydyMetricMixing is a string and can be either "P/V (W/m^3)" or "Top 10% EDR (W/kg)" or "Tip Speed (m/s)" and so on
// valueOfHydyMetric is a float that is the value of the chosen HydyMetricMixing that we want to achieve in Brx_B
// Brx_Name_B is a string which is our target production bioreactor we want to find the agitation setpoint for
// Brx_Volume_B is the amount of liquid in the bioreactor
HydyMetricMixing_col = Column (dt, HydyMetricMixing);
// this part of the code works perfectly
profiler = dt << Profiler(
Y( HydyMetricMixing_col ),
Confidence Intervals( 1 ),
Desirability Functions( 1 ),
Term Value(
:"Bioreactor"n( Brx_Name_B, Lock( 1 ), Show( 1 ) ),
:"Volume (L)"n( Brx_Volume_B, Lock( 1 ), Show( 1 ) ),
:"Agitation (RPM)"n(50, Min(12), Max(263), Lock(0), Show(1))
),
);
// This part of the code does not work at all
profiler << Response Limits(
Eval( Parse( ":" || Char(HydyMetricMixing) ) ), // Convert string to symbol
{
Lower( valueOfHydyMetric*0.8, 0.0183 ),
Middle( valueOfHydyMetric, 1 ),
Upper( valueOfHydyMetric*1.2, 0.0183 ),
Goal( "Target" ), Importance( 1 )
}
);
// Maximize desirability
profiler << Maximize and Remember;<BR /><BR /> // "Agitation (RPM)" obtained after maximization is the result we want to return from this function
);
// call the function to find the optimized value
FindMatchingAgiSpeed(dt, "P/V (W/m^3)", 93.0, "SSB_10kL_ABEC", 9000);
자동화 및 스크립팅윈도우제목: 함수 내에서 바람직성을 설정하고 극대화하는 데 대한 도움 요청.Profiler와 별도로 이런 방식으로 응답 제한을 사용하는 방법을 잘 모르겠습니다. 관련 문서가 부족하고, 선택한 구문이 제 생각에는 꽤 형편없습니다. 전체 Profiler 표현식을 빌드하고 거기에 응답 제한을 포함할 수 있다는 건 알고 있습니다. 다른 방법으로는 응답 제한 열 속성을 활용하는 방법이 있지만, Profiler를 실행하기 전에 설정해야 할 것 같습니다. 함수를 Profiler에 빌드하는 것을 보면 괜찮을 것 같습니다. 이 글은 모델에 적합하고, 바람직성을 극대화하며, 사용자가 선택할 수 있는 열로 결과를 추출하는 기본적인 JSL 개념을 제공합니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Tiretread.jmp");
lval = 150;
mval = 200;
uval = 300;
col = "Pred Formula ABRASION";
pf = Eval(Substitute(
Expr(dt << Profiler(
Y(_col_),
_colw_ << Response Limits(
{Lower(_lval_, 0.9819), Middle(_mval_, 0.5), Upper(_uval_, 0.066),
Goal(Maximize), Importance(1)}
)
)),
Expr(_col_), Name Expr(As Column(dt, col)),
Expr(_colw_), Parse(col),
Expr(_lval_), lval,
Expr(_mval_), mval,
Expr(_uval_), uval
));
Eval 없이 Substitute 부분만 실행하면 사용되는 표현식을 확인할 수 있습니다.

제목: 함수 내에서 바람직성을 설정하고 극대화하는 데 대한 도움 요청.안녕하세요, Jarmo님.
제안해 주셔서 감사합니다. 말씀하신 대로 프로파일러를 다시 작성해 보겠습니다. 하지만 구문과 관련하여 여전히 궁금한 점이 있습니다. 별도의 단계 대신 프로파일 내에서 "응답 제한"을 설정하도록 함수를 다시 작성했습니다. 여전히 작동하지 않습니다. 하지만 열 변수 이름을 바꾸고 열 이름으로 하드 코딩하면 작동합니다. 제가 잘못하고 있는 부분이 무엇인지 알려주시겠습니까?
함수 내부에 정의된 프로파일러에서 이 작업을 수행하면 다음과 같이 작동합니다.
"P/V (W/m^3)"n << Response Limits(
{
Goal("Match Target"),
Importance( 1 ),
Lower(valueOfHydyMetric*0.8, 0.0183),
Middle(valueOfHydyMetric, 1),
Upper(valueOfHydyMetric*1.2, 0.0183)
}
),
하지만 이렇게 하면 작동하지 않습니다
Column (dt, HydyMetricMixing) << Response Limits(
{
Goal("Match Target"),
Importance( 1 ),
Lower(valueOfHydyMetric*0.8, 0.0183),
Middle(valueOfHydyMetric, 1),
Upper(valueOfHydyMetric*1.2, 0.0183)
}
),
I tried everything, parsing, eval, expr, etc. I just want the column name stored as a string to work with the Response Limits message. Here HydyMetricMixing is just a variable that stores the string "P/V (W/m^3)".
제목: 함수 내에서 바람직성을 설정하고 극대화하는 데 대한 도움 요청.응답 제한은 실제로 열이 아니라 JMP 이름으로 전송됩니다. 그래서 Column()/AsColumn() 대신 Parse()를 사용합니다. 왜 이렇게 구현되었는지 모르겠습니다.
귀하의 경우 열 이름에 특수 구문(""n)이 필요하므로 Parse() 대신 As Name()을 사용해 보세요.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Tiretread.jmp");
Column(dt, "Pred Formula ABRASION") << Set Name("Pred Formula ABRASION/123-");
lval = 120;
mval = 150;
uval = 190;
col = "Pred Formula ABRASION/123-";
pf = Eval(Substitute(
Expr(dt << Profiler(
Y(_col_),
_colw_ << Response Limits(
{Lower(_lval_, 0.9819), Middle(_mval_, 0.5), Upper(_uval_, 0.066),
Goal(Maximize), Importance(1)}
)
)),
Expr(_col_), Name Expr(As Column(dt, col)),
Expr(_colw_), As Name(col),
Expr(_lval_), lval,
Expr(_mval_), mval,
Expr(_uval_), uval
));
pf << Desirability Functions(1);
Substitute와 EvalExpr을 사용하여 작성 중인 표현식을 확인하는 것이 좋습니다. 강조 표시된 부분만 실행하면 됩니다.

저는 이런 일을 처리하는 데 훨씬 더 견고하고 가장 올바른 방법일 가능성이 높은 그것을 사용하기 시작할 것입니다.
제목: 함수 내에서 바람직성을 설정하고 극대화하는 데 대한 도움 요청.안녕하세요, Jarmo님.
완벽하게 작동했습니다! Parse()를 As Name()으로 변경하니 모든 문제가 해결되었고, 이제 변수에 저장된 이름 문자열을 Response Limits를 전달해야 하는 열로 올바르게 할당합니다.
다시 한번 귀하의 도움에 감사드립니다!