1

I have a parameter t(i,j) , and set i,j /1*100/ , I want to display only positive t(I,j) .

My try

  Display$(t(I,j)>0), t;

I read following answer too Display only something

When I write my command like abow answer , I have error

  " uncontrolled set entered as constant "

What code should I write?

Thanks & Best

1 Answers1

1

The Display statement with with a symbol will always show the whole symbol. The $ condition you saw in the other post, can only be used to decide, if it should be displayed completely or not at all. You could define a second parameter with just the positive values and display it like this:

Set       i /1*100/,
          j /1*100/;
Parameter t(i,j);

t(i,j) = uniformInt(-50,50);

Parameter tPos(i,j);

tPos(i,j)$(t(i,j)>0) = t(i,j);

Display tPos;
Lutz
  • 2,197
  • 1
  • 10
  • 12
  • Hi. My understanding of your answer is that: In general, we can not use the display command directly when we have multi dimensional parameters with special conditions (for example display only p>3 for p(I,j) ). Is this true? –  Sep 04 '18 at 12:39
  • 1
    You can use a condition also for multi dimensional parameters, butthis will either result in showing nothing, or the complete symbol. E.g. you could have a condition saying, show the (complete) symbol p only, if the maximum of all values of p is greater than 3. – Lutz Sep 04 '18 at 12:53