I am trying to maximize an integral function (optval) of multiple variables. I am using NumericQ for symbolic evaluation of NIntegrate. The code is running well when I manually assign values to variables (Q1, Q2, Q3) and gives the output for the integral function (optval) within a few seconds.

But maximizing the same integral function for variables Q1, Q2, Q3 using Nmaximize is not working and the code runs indefinitely.
I have attached the code file seperately. Can someone help in rectifying the problem?
Attachments: