Message Boards Message Boards

0
|
2665 Views
|
4 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Minimise error: Variable domain should be Reals or Integers?

Posted 1 year ago

Hi, any idea how to resolve this error?

Minimize::vdom: Variable domain {ps} should be either Reals or Integers.

enter image description here

The code

Minimize[(svccoef*ststddev*
Sqrt[dcproclt + transportlt + storeproclt]) 
+ (Ceiling[(stfreq*ads), ps]/2) + minpres, 
1 <= ps <= 48, Element[{ps}, Integers], {ps}] // N
POSTED BY: Oliver Blombery
4 Replies

Multiple constraints on the variable (here, ps) are written with And (&&) between them.

A minor change gets your code to work.

In[1]:= Minimize[{(1.64*1*Sqrt[3 + 1 + 1]) + (Ceiling[(7*5), ps]/2) + 6, 
          1 <= ps <= 48 && Element[ps, Integers]}, ps]
Out[1]= {27.1672, {ps -> 1}}
POSTED BY: Adiba Shaikh

That fixed it, thanks so much!

POSTED BY: Oliver Blombery

Hi, I've changed all the variables to specific values to remove any unknowns. I've also cleared ps as you mentioned. Still coming up with the same error:. The code is now:

Minimize[(1.64*1*Sqrt[3 + 1 + 1]) + (Ceiling[(7*5), ps]/2) + 6, 
   1 <= ps <= 48, 
   Element[{ps}, Integers], 
   {ps}] // N;

Minimize::vdom

POSTED BY: Oliver Blombery

It would help if you could provide the values of all of the other symbols used in the expression. Are you sure ps is not already set to some value? Try ClearAll[ps].

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract