Hello Sir, I changed all Integrate
to NIntegrate
as per your suggestion. Also I used NumberQ
function so that NIntegrate
can carry out symbolic integration. This are my new outputs-
Out[449]= objfun[150, 150, 150, 150, 1, 1, 1, 1]
During evaluation of In[413]:= NMaximize::nnum: The function value -objfun[1.20631,1.91918,1.34474,1.24744,1,1,1,1] is not a number at {Q1,Q2,Q3,Q4,y1,y2,y3,y4} = {1.20631,1.91918,1.34474,1.24744,1,0.601167,0.526325,0.919202}.
Previously, the test function was giving output but now it is not giving the output. And the Nmaximize
function is showing that the function is not a number. All the used symbolic variables are either assigned a value or used as an Integration variable. I am attaching the modified code for reference.
Attachments: