# An error occurs when the.run file is written in matlab

**URL:** <https://discuss.ampl.com/t/an-error-occurs-when-the-run-file-is-written-in-matlab/494>\
**Category:** New to AMPL\
**Tags:** solvers, errors-and-messages\
**Created:** [April 14, 2023, 1:17am UTC](https://discuss.ampl.com/t/an-error-occurs-when-the-run-file-is-written-in-matlab/494 "2023-04-14T01:17:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yuanmin](https://avatars.discourse-cdn.com/v4/letter/y/8e7dd6/32.png) [@Yuanmin](https://discuss.ampl.com/u/Yuanmin)\
**Post date:** [April 14, 2023, 1:17am UTC](https://discuss.ampl.com/t/an-error-occurs-when-the-run-file-is-written-in-matlab/494/1 "2023-04-14T01:17:34Z")

</div>

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

## reset; 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; solve;

## 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 r0.run, 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.

---

<div class="post-metadata">

**Author:** ![fdabrandao](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/fdabrandao/32/63_2.png) [@fdabrandao](https://discuss.ampl.com/u/fdabrandao)\
**Post date:** [April 14, 2023, 11:41am UTC](https://discuss.ampl.com/t/an-error-occurs-when-the-run-file-is-written-in-matlab/494/2 "2023-04-14T11:41:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Yuanmin](https://avatars.discourse-cdn.com/v4/letter/y/8e7dd6/32.png) [@Yuanmin](https://discuss.ampl.com/u/Yuanmin)\
**Post date:** [April 17, 2023, 3:05am UTC](https://discuss.ampl.com/t/an-error-occurs-when-the-run-file-is-written-in-matlab/494/3 "2023-04-17T03:05:38Z")

</div>

## 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?

---

<div class="post-metadata">

**Author:** ![fdabrandao](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/fdabrandao/32/63_2.png) [@fdabrandao](https://discuss.ampl.com/u/fdabrandao)\
**Post date:** [April 19, 2023, 3:19pm UTC](https://discuss.ampl.com/t/an-error-occurs-when-the-run-file-is-written-in-matlab/494/4 "2023-04-19T15:19:16Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Phoebe](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@Phoebe](https://discuss.ampl.com/u/Phoebe)\
**Post date:** [April 24, 2024, 3:14pm UTC](https://discuss.ampl.com/t/an-error-occurs-when-the-run-file-is-written-in-matlab/494/5 "2024-04-24T15:14:06Z")

</div>

Hello, I‘m writing to see whether you solve this problem, I am also encountered a similar problem.

---

<div class="post-metadata">

**Author:** ![4er](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/4er/32/530_2.png) [@4er](https://discuss.ampl.com/u/4er)\
**Post date:** [April 25, 2024, 10:32pm UTC](https://discuss.ampl.com/t/an-error-occurs-when-the-run-file-is-written-in-matlab/494/6 "2024-04-25T22:32:51Z")

</div>

It seems that Yuanmin had two different problems — a crash in Ipopt, and “option solver ipopt;” not being set. Which of these problems are you having?

Also since your problem may not be exactly the same, it may help if you can show an example of what you are running and what error messages you are seeing.
