Hi

You might have a look at savepoint and split your models in two files.

Cheers

Renger

## Search found 441 matches

- 1 day ago
- Forum: Syntax
- Topic: Is there a way for GAMS interruption and re-run from where it lasted?
- Replies:
**5** - Views:
**75**

- 1 day ago
- Forum: Archive Google Group
- Topic: How to maximise a non-scalar objective?
- Replies:
**2** - Views:
**33**

### Re: How to maximise a non-scalar objective?

Hi

If you want to solve for every combination of i and t (ixt solves), you might wright a scalar function and scalar equations and loop your solve over i and t. Otherwise, it doesn't make much sense.

Cheers

Renger

If you want to solve for every combination of i and t (ixt solves), you might wright a scalar function and scalar equations and loop your solve over i and t. Otherwise, it doesn't make much sense.

Cheers

Renger

### pySetup=0

Hi

Back to the discussion on setting up python using another Python distribution.

In the documentation/discussions it is said that one should use "pySetup=0" but it is not clear how to use this: In my code? When setting up python for Gams?

Any help would be appreciated.

Cheers

Renger

Back to the discussion on setting up python using another Python distribution.

In the documentation/discussions it is said that one should use "pySetup=0" but it is not clear how to use this: In my code? When setting up python for Gams?

Any help would be appreciated.

Cheers

Renger

- 2 days ago
- Forum: Solvers
- Topic: Couenne- NLP heuristic: time limit reached
- Replies:
**2** - Views:
**63**

### Re: Couenne- NLP heuristic: time limit reached

Hi Lily According to the documentation you can use reslim (in seconds). "GAMS/Couenne understands currently the following GAMS parameters: reslim (time limit), nodlim (node limit), cutoff, optca (absolute gap tolerance), and optcr (relative gap tolerance). Further, the option threads can be used to ...

- 2 days ago
- Forum: Syntax
- Topic: Providing initial solution and reoptimizing
- Replies:
**3** - Views:
**82**

### Re: Providing initial solution and reoptimizing

Hi Nikou

You could do this as follows:
Gams will automatically use the solution from your first solve for the next solve.

Cheers

Renger

You could do this as follows:

Code: Select all

```
MODEL MyModel /ALL/;
SOLVE MyModel USING MILP MAXIMIZING Z ;
model MyModel2 /... all equations without eq2/;
SOLVE MyModel2 USING MILP MAXIMIZING Z ;
```

Cheers

Renger

- 3 days ago
- Forum: Syntax
- Topic: Sum with index as a function
- Replies:
**5** - Views:
**95**

### Re: Sum with index as a function

Hi Here is a little example that you can use to implement your equation. I assume that a is a parameter. (you can't use a variable in a $-condition in an equation) set j /1*20/, i /1*20/; parameter a /-2/, b(i), x(j); x(j) = uniform(1,10); b(i) = Sum (j$(j.val = i.val - a + 1) , x(j)); display b, x;...

- 4 days ago
- Forum: Syntax
- Topic: replicas model
- Replies:
**2** - Views:
**65**

### Re: replicas model

Hi Diana

You can use a loop to do this:

Cheers

Renger

You can use a loop to do this:

Code: Select all

```
set l Loops /l1*l20000/;
parameter results(l,*);
loop(l,
assign the random variable
solve your model
save the results in results(l,*) results(l,"MyResult") = X.L;
```

Renger

- 4 days ago
- Forum: Syntax
- Topic: creation of vectors from normal distribution
- Replies:
**3** - Views:
**96**

### Re: creation of vectors from normal distribution

Hi Diana

If I understand you correctly, the table t contains several variables and you want to use the mean of these values for j.

You can then just sum over p and divide by the rank of p (which gives you the number of elements of p):

Cheers

Renger

If I understand you correctly, the table t contains several variables and you want to use the mean of these values for j.

You can then just sum over p and divide by the rank of p (which gives you the number of elements of p):

Code: Select all

```
a(i,j)= normal(x(j,i),sum(p,t(j,p))/rank(p));
```

Renger

- 5 days ago
- Forum: Syntax
- Topic: sets in gams
- Replies:
**1** - Views:
**45**

### Re: sets in gams

Hi You can either use card in the equation X(i,j,k)$(ord(k) = card(k)) = ... or use a dynamic set: SET k /1 * 3/, klast(k) ; klast(k)$(ord(k) = card(k))= YES; X(i,j,klast) = .... In both cases, you can change the cardinality of the set and this will be reflected in your assignment of X. Cheers Renger

- 5 days ago
- Forum: Archive Google Group
- Topic: MCP solver Infeasible
- Replies:
**6** - Views:
**92**

### Re: MCP solver Infeasible

Hi

You mean that L(t) is exogenous in every period like L(t) = (1+n)**t.val * L0?

Cheers

Renger

You mean that L(t) is exogenous in every period like L(t) = (1+n)**t.val * L0?

Cheers

Renger