An error occurs when file is written in matlab

I am a new user of ampl and recently tried to make calls in matlab. This is file I wrote.

model model.mod;
include data.INIVAL;
#option solver path “E:/AMPL/amplbundle.mswin64/ampl.mswin64”;
#option solver path ‘E:/AMPL/amplbundle.mswin64/ampl.mswin64’;
option solver ipopt;

However, when I run it, I get an error with the following message:

Ipopt 3.12.13:
Error at _cmdno 507 executing “solve” command
(file, line 7, offset 194):
can’t open C:\Users\WYM\AppData\Local\Temp\at2444.sol .

I would appreciate it if anyone could give me some answers.

1 Like

Hi @Yuanmin,

It looks like ipopt crashed. What happens when you run it directly from the AMPL prompt? Isn’t there any additional output from ipopt?

Thank you very much for your reply.
Typing directly at the ampl command line looks like this

ampl: model E:/AMPL/ampl_model/M0.mod
ampl: data E:/AMPL/ampl_model/ig0.dat
ampl: solve;
MINOS 5.51:
Sorry, a demo license is limited to 300 variables and
300 constraints and objectives.
You have 1111 variables, 808 constraints, and 1 objective.
exit value 1

I am a graduate student. Can I apply for such a free license?

Hi @Yuanmin,

That error message is due to minos being the default solver. Could you please set option solver ipopt; before solve; and send us the output?