So i have read other or similar posts about this message and I have read about it online, but I still am not able to make sense of it. I think understand that the error is caused by the fact that taking the sqrt( NEG #) is what is supposed to cause this error, but what i dont understand with my code, is that I have the term squared to correct this. I am a programming newbie so this is probably an easily fixable syntax or input error. Would someone look at my code and tell me what they see?? I have included a picture of the equation i am trying to model.
When I run the code, I receive the following message: FUNC DOMAIN: x**y, x<0. There are no red error messages. Also, Im not exactly sure if I need to sum this for what I am trying to do so If that might be relevant information, there it is.
Also, I am aware that there is information in my code that does not actually get used, I just placed it in there because I am trying to compile everything I think is relevant information. Also, this model is far from being complete, I am just trying to fix one error at a time i guess and slowly build from there.
Any information or insight that anyone may offer would be greatly appreciated.
Set i well /1/;
K hydraulic conductivity m_d /100/
q1 uniform freshwater discharge /0.6/
d mean ocean SWE /14/
Rs saltwater density /1.025/
Rf freshwater density /1.000/
s saltfreshwater ratio /1.025/
xw well distance from coast line /1000/
y distance between wells /0/
phi_1 saltwater head at tow /2.5/;
positive variable phi_2 freshwater head
Q Optimal pumping rate
x saltwater toe length;
free variable obj objective variable;
E1 constraint on well pumping equation
E2 Equation for the Freshwater potential
E3 toe constraint
E4 objective fcn for max toe length;
model saltwater /all/;
solve saltwater using MINLP maximize obj;
* I dont know what execerror does
display Q.l, x.l, obj.l;