No variables declared - how can I get rid of this message and solve?

Hi @rchw,

There is a * next to the file name and this indicates that the file was not saved. Could you please save it and rerun the comnands?

Thanks for the reply - I have saved it now but still no variables declared - any idea what to do now?

Hi @rchw ,
Can you please select the “HeartMonitorProposal.mod” file (click somewhere inside it) then in the toolbar select Commands → Send to AMPL and post the message you get?

Hi, this is what I got

@rchw Thank you!
If you call solve it should work now.
If I’m not mistaken, the file you have opened in your IDE is “/Users/raffaelawatson/Desktop/HeartMonitorProposal.mod” but when you use the command “model HeartMonitorProposal.mod;” you are calling the file with the same name from “/Users/raffaelawatson/HeartMonitorProposal.mod”.
Note that in the top left of the IDE you have the “Current Directory” that is pointing to “/Users/raffaelawatson”.
Probably the best option would be to create a “HeartMonitorProposal” folder in the Desktop or Documents folder, move the relevant files into it, in the IDE navigate to the created folder and double click the relevant files to open them in your session and start modelling from there.

Hi, I think I’ve done what you suggested and created a new folder in my desktop for the IDE.
However, I’m still getting the same message! Do you have any more ideas?

Hi @rchw ,

Sorry, I probably forgot to tell you the most important part. The Current Directory, at the top left corner of the IDE, must match the folder where you have the files.

I’ll ask you to do the following:

  • close the “HeartMonitorProposal.mod” file
  • double click the “HeartMonitorProposal” folder you have on the directory tree on the left. The Current Directory on the top left corner should change to “/Users/raffaelawatson/Desktop/HeartMonitorProposal”.
  • double click the “HeartMonitorProposal.mod” file in the “Desktop/HeartMonitorProposal” folder

After that you can select Commands → Send to AMPL from the toolbar or type “model HeartMonitorProposal.mod” followed by a solve command.

Please let us know if it’s working!

Thanks for your help! I did that and tried to solve - unfortunately I was presented with this:

Hi @rchw,

There is no default solver set in AMPL now, so you need to specify the solver to use before solving. You can select for instance the open-source solver HiGHS with:

ampl: option solver highs;
ampl: solve;