GDXMRW not working at all

Archive of Gamsworld Google Group
Post Reply
Archiver
User
User
Posts: 7876
Joined: 2 years ago

GDXMRW not working at all

Post by Archiver » 4 years ago


Hey all!

I have a bit of a trouble forcing Matlab and Gams to work together. I run the newest version of the gams 24.4.1 on the Mac (OS X 10.10.2) together with Matlab 2014b. Gams alone works just fine, just as Matlab.

I followed every step in the installation tutorial in here:

http://www.gams.com/dd/docs/tools/gdxmr ... APPENDIX_A

I was able to unpack the "gdxmrw0*" files, but when I actually try to run a test, it doesn't work. That means, when I enter into Matlab command window following ...

>> gams gdxmrw03.gms

I receive an error saying ...

Error using gams
abnormal GAMS termination running /Applications/GAMS/gams24.4_osx_x64_64_sfx/gams gdxmrw03.gms lo=0:
check listing file

The actual listing file is attached.

The weird thing is, that when I run "testinst.m" file ...

>> testinst

testinst run completed successfully: no errors
See testinst log file testinstlog.txt for details

it reports no error. (log also attached).

Can anybody direct me where in the process of trying to connect Matlab and Gams I did mistake?

Thank you :)

Pavol

--
Attachments
testinstlog.txt
(303 Bytes) Downloaded 54 times

[The extension lst has been deactivated and can no longer be displayed.]


Archiver
User
User
Posts: 7876
Joined: 2 years ago

Re: GDXMRW not working at all

Post by Archiver » 4 years ago

Pavol,

Your claim that GDXMRW is not working at all isn't consistent with the result you report running testinst: that worked OK for you. So something is working. To find out why gdxmrw03 isn't able to run, do some debugging. For example, the .lst file indicates the matlab call failed. Do all Matlab calls fail when you make them from GAMS? What is in the log file created by Matlab?

It's also useful to create a minimal example that illustrates the problem. Usually you learn something in the process.

-Steve

On Thu, Jan 29, 2015 at 8:38 AM, Pavol Hronsky wrote:

Hey all!

I have a bit of a trouble forcing Matlab and Gams to work together. I run the newest version of the gams 24.4.1 on the Mac (OS X 10.10.2) together with Matlab 2014b. Gams alone works just fine, just as Matlab.

I followed every step in the installation tutorial in here:

http://www.gams.com/dd/docs/tools/gdxmr ... APPENDIX_A

I was able to unpack the "gdxmrw0*" files, but when I actually try to run a test, it doesn't work. That means, when I enter into Matlab command window following ...

>> gams gdxmrw03.gms

I receive an error saying ...

Error using gams
abnormal GAMS termination running /Applications/GAMS/gams24.4_osx_x64_64_sfx/gams gdxmrw03.gms lo=0:
check listing file

The actual listing file is attached.

The weird thing is, that when I run "testinst.m" file ...

>> testinst

testinst run completed successfully: no errors
See testinst log file testinstlog.txt for details

it reports no error. (log also attached).

Can anybody direct me where in the process of trying to connect Matlab and Gams I did mistake?

Thank you :)

Pavol

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.




--
Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com

Archiver
User
User
Posts: 7876
Joined: 2 years ago

Re: GDXMRW not working at all

Post by Archiver » 4 years ago


Dear Steve,

in gdxmrw03.gms I uncommented matlab call in the beginning in the document and it seems that some of them works. I do not know if 'gen_rbig.gms' is missing intentionally, or I just missed it somewhere.

So I tried to run a small example, because actually what I need to do is just to run a model couple times with different parameters and then plot some results. So I just need to extract the optimal solution after the model is solved. The small example I try to run is one described in that tutorial I posted before. I also attach the qp.gms file I use.

First thing I noticed is, that when I run

>> gams qp.gms

It actually does not solve the model. But again maybe it is just right that this does not work and if I want to solve it this way, I just need to use Terminal. However, following the instructions for this example, I should run following command in matlab and it should me store at least values from x into the matlab workspace

>> x = gams('qp.gms')

But instead I receive

Error using gams
Number of output argument in Matlab exceed output argument specified in gams

And finally, when I checked the function gams.m in the gams folder, it has only commented help in it and no body. And again, I find this a bit strange, but at least it explains me the error if there is actually no function coded in the m-file.

Thank you,

Pavol


On Thursday, 29 January 2015 16:14:58 UTC+1, Steven Dirkse wrote:

Pavol,

Your claim that GDXMRW is not working at all isn't consistent with the result you report running testinst: that worked OK for you. So something is working. To find out why gdxmrw03 isn't able to run, do some debugging. For example, the .lst file indicates the matlab call failed. Do all Matlab calls fail when you make them from GAMS? What is in the log file created by Matlab?

It's also useful to create a minimal example that illustrates the problem. Usually you learn something in the process.

-Steve

On Thu, Jan 29, 2015 at 8:38 AM, Pavol Hronsky wrote:

Hey all!

I have a bit of a trouble forcing Matlab and Gams to work together. I run the newest version of the gams 24.4.1 on the Mac (OS X 10.10.2) together with Matlab 2014b. Gams alone works just fine, just as Matlab.

I followed every step in the installation tutorial in here:

http://www.gams.com/dd/docs/tools/gdxmr ... APPENDIX_A

I was able to unpack the "gdxmrw0*" files, but when I actually try to run a test, it doesn't work. That means, when I enter into Matlab command window following ...

>> gams gdxmrw03.gms

I receive an error saying ...

Error using gams
abnormal GAMS termination running /Applications/GAMS/gams24.4_osx_x64_64_sfx/gams gdxmrw03.gms lo=0:
check listing file

The actual listing file is attached.

The weird thing is, that when I run "testinst.m" file ...

>> testinst

testinst run completed successfully: no errors
See testinst log file testinstlog.txt for details

it reports no error. (log also attached).

Can anybody direct me where in the process of trying to connect Matlab and Gams I did mistake?

Thank you :)

Pavol

--
Attachments

[The extension m has been deactivated and can no longer be displayed.]

[The extension lst has been deactivated and can no longer be displayed.]

qp.gms
(849 Bytes) Downloaded 47 times

[The extension lst has been deactivated and can no longer be displayed.]

gdxmrw03.gms
(1.75 KiB) Downloaded 43 times

monireh
User
User
Posts: 3
Joined: 5 months ago

Re: GDXMRW not working at all

Post by monireh » 5 months ago

Hey all,

I used Matlab R2017a, Gams 24.1 and the guidance of GDXMRW: Interfacing GAMS and MATLAB by Michael C. Ferris Rishabh Jainy Steven Dirksez (May 11, 2010).
I run all tests (gdxmrw03, gdxmrw04, gdxmrw05) with successfully messages, but gdxmrw04 had no message.
when i want calling GAMS model from MATLAB with Input data from matlab, it gives this error: " Error using gams
abnormal GAMS termination running E:\GAMS \win64\24.1\gams.exe model name lo=0: check listing file" while calling GAMS model from MATLAB without Input data from matlab, shows correctly the objective function..
.lst, matdata.gdx, matdata.gms and output.gdx are created but I think .gdx file Are incomplete.
What is the meaning of listing file? please help me.

Gams code: set b/1*10/
Matlab code: b.name='b'; b.uels={{'1' '2' '3' '4' '5' '6' '7' '8' '9' '10'}} ;[Z,W]=gams('model name', b);

User avatar
dirkse
Moderator
Moderator
Posts: 56
Joined: 2 years ago
Location: Fairfax, VA

Re: GDXMRW not working at all

Post by dirkse » 5 months ago

You should not use the gams() Mex-function. It works, but if there is any error in your model, or your data, or your connection, it gives very little help or feedback to fix your error.

Instead, you should call GAMS via Matlab's system() call. This will allow you to address any failures outside the Matlab environment. More on this topic is available here:

https://support.gams.com/matlab_and_gam ... and_matlab

-Steve

monireh
User
User
Posts: 3
Joined: 5 months ago

Re: GDXMRW not working at all

Post by monireh » 4 months ago

Thank you so much

Post Reply