Please look at the reults provided below:

The results in the sparse form must be as follows:U.form = 'sparse';

For the full form also:1 1 1

2 1 1

If you need anything else, please let me know.U.form = 'full';

- 1 month ago
- Forum: Tools
- Topic: Importing data from GMAS to MATLAB
- Replies:
**3** - Views:
**483**

Thank you Steve!

Please look at the reults provided below:

Please look at the reults provided below:

The results in the sparse form must be as follows:U.form = 'sparse';

For the full form also:1 1 1

2 1 1

If you need anything else, please let me know.U.form = 'full';

- 1 month ago
- Forum: Tools
- Topic: Importing data from GMAS to MATLAB
- Replies:
**3** - Views:
**483**

Hello everyone, I want to import input data defined in GAMS to MATLAB. I first generate a gdx file of input data (an example file attached), then, I use rgdx function in MATLAB to read sets, scalars and parameters stored in the gdx file. Although I do not have any problem with linking GAMS and MATLA...

- 1 month ago
- Forum: Solvers
- Topic: Save CPU time when running a model for multiple times
- Replies:
**3** - Views:
**472**

- 1 month ago
- Forum: Solvers
- Topic: Save CPU time when running a model for multiple times
- Replies:
**3** - Views:
**472**

Hello, I have an MILP model (with both binary and non-negative variables) that I aim to solve a part of it with the CPLEX solver. In fact, I want to use a meta-heuristic algorithm to first determine the binary variables of this model. Then, I will let GAMS finds the optimal values of non-negative va...

- 1 year ago
- Forum: Syntax
- Topic: Record optimality gap at different CPU times
- Replies:
**1** - Views:
**530**

Dear experts, Suppose a hard constraint mathematical model that could be solved by the CPLEX solver. I want to automatically record the optimality gap at different CPU times, e.g., 5 secs, 10 secs, 30 secs and 60 secs. What is the syntax that I can use to record the above information? If you need mo...

- 1 year ago
- Forum: Tools
- Topic: Exit code = 6 / Unable to open output file
- Replies:
**1** - Views:
**805**

Dear friends, I am solving a multi-echelon supply chain problem with the Benders Decomposition algorithm. When the problem becomes large, I confront with an error shown in the following. http://uupload.ir/files/lr8n_untitled.png To reduce the size of lst file, I have used two below options: Option l...

- 1 year ago
- Forum: Tools
- Topic: Generate an array of random numbers
- Replies:
**6** - Views:
**1214**

You are right. Unfortunately, the compact method of Mr. dirkse does not always work properly. The suggested method by Mr. Manassaldi works perfectly. Thanks.

- 1 year ago
- Forum: Tools
- Topic: Generate an array of random numbers
- Replies:
**6** - Views:
**1214**

Dear Friends, I have defined set W and parameter Coef(W) as follows: Set W /1*10/; Parameter Coef(W); I would like to randomly assign binary values to Coef(W) ; where about %A of elements in W get 1, and %(100-A) of them get 0. For instance, if A is equal to 70, therefore, Coef(W) could be one of th...

- 2 years ago
- Forum: Modeling
- Topic: Division by zero for division of two continuous variables
- Replies:
**4** - Views:
**1088**

I also found another solution to this problem, specifically for the Baron solver. If you add the following code, the Baron could ignore the error and try to find a feasible solution. I think there should be similar options for other solvers as well. But what you mentioned, is a solution for all solv...

- 2 years ago
- Forum: Modeling
- Topic: Division by zero for division of two continuous variables
- Replies:
**4** - Views:
**1088**

... I used a random initializiaton as you subtract x(j,t) from x(i,t) (same for y). Initializing them with the same values would results in zeros. ... Renger Hi Renger, First of all, I have to appreciate your attention. As per as your valuable comment, I have added the following lines to the code (...