123

Hi

It is hard to help you with your question as you don’t post any code. Please read the rules of the forum.

Cheers

Renger

12

Hi

Your code is not complete, so it doesn’t produce your problem.

Cheers

Renger

What does it mean? What produces my ploblems?

The whole file is very large so I can’t upload it, I have to remove the data and put it in the code. Can you explain to me why my results are corrupted? Thank you

You can attach a file…and it is hard to check what is going wrong without a running model. Perhaps there are problems with your data, what you do with your data, mistakes in your equations, infeasible problems, …

You can’t expect from people that they go through your code of 1134 lines line-by-line.

Cheers

Renger

Hi

I attached file. Check file, please. Thanks you very much!

Cheers,

Nguyên Xuân.

Hello,

CONOPT has hit the iteration limit you set, so it stopped. Always look at the SOLVER STATUS and the MODEL STATUS before looking at the variable values. You could also use some GAMS code to print a message or abort if the solver didn’t find a solution. This is sometimes better than continuing on.

**** SOLVER STATUS 2 ITERATION INTERRUPT

**** MODEL STATUS 6 INTERMEDIATE INFEASIBLE

**** OBJECTIVE VALUE 1191.9553

RESOURCE USAGE, LIMIT 1533.254 20000.000

ITERATION COUNT, LIMIT 20000 20000

EVALUATION ERRORS 0 0

Why do you set iterlim = 20000 ??

-Steve

1

I forget attach file. I’'m sorry.

I attached file below.

Check, please.

Thanks alot!

Cheers,

Nguyên Xuân.

Doc18.docx (143 KB)

Hi

A few remarks on your model (using pathnlp as solver):

- Your data seems to be not scaled very well. Your national account values go up to 1E8. You have many equality-equations where you force, for example, demand to be equal to supply. If the level of your values is around 1E8, equality is only reached if the difference is very small (e.g. 1E-7). Example, if you have all your values in dollars, this would mean that your precision to be met is 1E-7$. You might try to scale your values around 1.
- Your starting values are often far away from your lower and upper bounds (often they are not within their bounds). As you use national account data, it should be possibility to initialize your data properly, e.g. such that the initial value is very close to the actual value.

Hope this helps

Cheers

Renger

Dear Renger,

Could you show me how to test the infeasible to give the same results as you (code, step, etc.) or give me your file with code for check?

Thanks a lot!

Cheers,

Nguyen Xuan.

Hi

If you use conopt you get a warning that your data is badly scaled:

```
** Warning ** The variance of the derivatives in the initial
point is large (= 4.5 ). A better initial
point, a better scaling, or better bounds on the
variables will probably help the optimization.
```

Here it says that a better starting initial point could help. Your starting points are sometimes a factor 10 away from the upper and lower bounds.

You get lots of information if you comment out the first few lines of your code and as the model doesn’t seem to converge, you can stop it after iteration 0. The equations listing shows you the size of infeasibilities

```
*option limcol=0, limrow=0;
*$offsymxref offsymlist
*$offlisting
*option solprint = off;
*option reslim = 20000;
option iterlim = 0;
[\code]
Now you can check in the equation listing how your first initialization differs from the bounds and if it makes sense to set upper and lower bounds for certain variables.
I would suggest the following:
[list]
[*] Scale your parameters,
[*] Initialize your variables better.
[*] Run your estimation for just one year for debugging purposes as I suspect that you might find more easily a solution with one time period and debugging your code gets also easier. If you don't find a solution, you might have made some mistakes in your equations/model.
If you want to run your model for one year, I would move the data out of your gams file to an excel sheet and read them with gdxxrw. You can then easily adjust your commands to read one or more years from the excel sheet.
Hope this helps
Cheers
Renger
[/list]
```

Dear Renger,

I solved my problems.

Thanks a lot!

Cheers,

Nguyen Xuan.