Unrecognized Responses Error : number of levels not evenly divisible by the number of response functions. #170
-
Hello all, I am having some issues with my Dakota input file interfacing with my python code. I was unable to find an example from Dakota that includes field_responses, so I only used the documentation. However, the error code I am running into says: Error: number of levels not evenly divisible by the number of response functions, and these levels are not covered in the documentation. Attached is my responses function, which is a part of a polynomial chaos method. responses For context, I am giving Dakota a stress matrix with 1000 values. These 1000 values should be written into the responses, but the error message is persisting and there is no documentation on what the number of levels is. Any help is appreciated. with open(output_file,'w',encoding='utf8') as FF: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Is this the error?
This happens when the length of response_levels is not divisible by response_functions. Consider the examples below, where the black box function returns 3 response functions, which we assume are labeled r1, r2 and r3. See listing 1 for an actual Dakota input file to test with. NOT OK - Below response_levels has 7 values, but response_functions is 3. So, 7 is not divisible by 3 and causes the error.
OK - response_levels has 9 values, and response_functions is 3. 9 is divisible by 3, so there is no error.
OK - If divisibility is not guaranteed, use num_response_levels to avoid the error. Below, we have the divisibility issue, but is addressed with num_response_levels. The first 3 response levels are for r1. The next 3 response levels are for r2. The next 1 response level is for r3.
The issue occurs because Dakota does not know which response_levels belong to which response_functions. Do the first 3 response levels belong to response function 1? Do the next 5 response levels belong to response function 2? By default, Dakota will assign the response levels equally, but this will only work if the divisibility condition is satisfied (number of response levels is divisible by response_functions). Alternatively, you use num_response_levels to explicitly tell Dakota which response_levels belong to which response function. Listing 1
|
Beta Was this translation helpful? Give feedback.
Is this the error?
Error: number of levels not evenly divisible by the number of response functions.
This happens when the length of response_levels is not divisible by response_functions.
Consider the examples below, where the black box function returns 3 response functions, which we assume are labeled r1, r2 and r3. See listing 1 for an actual Dakota input file to test with.
NOT OK - Below response_levels has 7 values, but response_functions is 3. So, 7 is not divisible by 3 and causes the error.
O…