

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/reply-77152-1509205583-4385901081-1620763196-1424910271%40helpscout.net.
Yes that what I means
Thank you for write objective functions and c4 in algebraic form
Can you help me please in the other constraints (c1,c2,c3,c5)
I need to write this constraints in the algebraic forms
في ثلاثاء، ١١ مايو، ٢٠٢١ في ١٠:٥٩ م، كتب AMPL Google Group <am...@googlegroups.com>:
On Tue, May 11, 2021 at 7:59 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Do you mean that you would like to convert your AMPL model to a mathematical statement of your objective and constraints -- for example, using Σ signs instead of AMPL's "sum" operator? Then your objective function could be
and constraint c4 could be
If you want it to look more like a traditional math formulation, you could replace names like "door", "cost", and "trans_1" by single letters.
--
Robert Fourer
am...@googlegroups.com
What can I change in the restrictions to obtain a result in which the students of different courses are not mixed in the same class?
Or how can I write a new restrictions to obtain a result in which the students of different courses are not mixed in the same class?
I need some help as well as writing this restrictions
hello Mr. Robert Fourer
thank you to write objective function and the constraint c4 In the previous
I tried to write the restrictions in algebraic form
Can you correct it for me please
and I have a question when viewing results
What can I change in the restrictions to obtain a result in which the students of different courses are not mixed in the same class?
Or how can I write a new restrictions to obtain a result in which the students of different courses are not mixed in the same class?
I need some help as well as writing this restrictions
Thank you …
On Wed, May 12, 2021 at 2:38 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
I intended that c4 would serve as an example of how to write a constraint mathematically. By studying it, you can figure out how to write the other constraints.
--
Robert Fourer
am...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/reply-77152-1509205583-4395393941-1621012371-1171460287%40helpscout.net.
i'm tried to write the constraint to relate the CourseClass variables to the trans_1 variables,
But I have an error that keeps popping up and I don't know the cause of this error and how to fix it
Can you help me with this constraint to discover the error and how to fix it
thank you ...
On Fri, May 14, 2021 at 7:12 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Hmm, thank you for your suggestions and help me solve this problem, but I don't know what you mean by indexed constraints , I am not a program specialist and I have not studied it extensively, can you help me write the indexed constraints and what they mean and how they differ from the normal restrictions
On Fri, May 14, 2021 at 5:12 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
I looked quickly at your algebraic description, and did not see any corrections that were needed.
Since I am not familiar with your application, I cannot say exactly how you should add a constraint so that "students of different courses are not mixed in the same class". I can suggest that the following approach often works:After you write the needed constraints in AMPL, you should run the model again with your data, and confirm that you get an acceptable solution.
- Add a binary variable -- like "var CourseClass {k in courses, j in class} binary;" -- that equals 1 if course k uses class j, and 0 otherwise.
- To prevent mixing, write a constraint indexed over {j in class} that says sum {k in courses} CourseClass[k,j] <= 1.
- To relate the CourseClass variables to the trans_1 variables, add a constraint that says if CourseClass[k,j] is 0, then no students from course k can be assigned to class j. This would be something like sum {i in door} trans_1[i,k,j] <= demand[j] * CourseClass[k,j].
--
Robert Fourer
am...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/reply-77152-1509205583-4399843773-1621186246-1054605656%40helpscout.net.
hello Mr. Robert Fourer
Thank you for all your previous help and clarifications
I wrote down the restrictions but I'm still facing the same problem, I don't know what to do
Why does this problem occur
Why are students mixed from different courses in the same classroom?
I don't want that to happen
I want students of one course in one classroom without mixing with students of the other course in the same classroom
Please see at the classroom B(8-10) course students have been mixed in
I have tried a lot to find a solution to this problem but I don't know what to do
I thought a lot and could not find a solution to this problem
Thank you again.
في الأحد، 16 مايو 2021 في تمام الساعة 8:49:40 م UTC+3، كتب Manal AL-Mousa رسالة نصها:
Thank you very much for this clarification, but I have a problem that I have never previously written an indexed constraint , can you write one of the indexed constraint for me in an indexed manner so that I can see the way of writing, and then I do all the remaining indexed constraint in the same way, because I have no experience with that.
When writing indexed constraint, does something change in the model other than restrictions? Are there other adjustments that I need to make in the model when writing indexed constraint?
في أحد، ١٦ مايو، ٢٠٢١ في ٨:٣٠ م، كتب AMPL Google Group <[url=]am...@googlegroups.com>:
You need to say that there is a c7 constraint for each member of {j in class, k in courses}:
subject to c7 {j in class, k in courses}:
sum {i in door} trans_1[i,k,j] <= demand[j] * courses_class[k,j];
An indexed constraint is one that has an indexing expression { . . . } after the constraint name. All of your constraints except c1 are indexed.
--
Robert Fourer
On Sun, May 16, 2021 at 5:49 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Thank you very much for this clarification, but I have a problem that I have never previously written an indexed constraint , can you write one of the indexed constraint for me in an indexed manner so that I can see the way of writing, and then I do all the remaining indexed constraint in the same way, because I have no experience with that.
When writing indexed constraint, does something change in the model other than restrictions? Are there other adjustments that I need to make in the model when writing indexed constraint?
في أحد، ١٦ مايو، ٢٠٢١ في ٨:٣٠ م، كتب AMPL Google Group <am...@googlegroups.com>:
On Sun, May 16, 2021 at 5:30 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
You need to say that there is a c7 constraint for each member of {j in class, k in courses}:
subject to c7 {j in class, k in courses}:
sum {i in door} trans_1[i,k,j] <= demand[j] * courses_class[k,j];
An indexed constraint is one that has an indexing expression { . . . } after the constraint name. All of your constraints except c1 are indexed.
--
Robert Fourer
am...@googlegroups.com
hello Mr. Robert Fourer
I would like to thank you for explaining many things to me on the model , I am so happy
Now I see a nice results with the program
Currently, I am thinking about how I can develop the model
In the group that was defined as courses, I had only two courses, and these courses had data for only one day.
If I have a full schedule for a number of days (Sunday - Monday - Tuesday - Wednesday - Thursday)
I have a different number of courses every day
These courses have different times
Each course has a specific time of two hours
How can I develop the model with this information so that I transfer students without mixing them from different courses in the same classroom?
I thought about adding a new group that expresses the days (Sunday - Monday - Tuesday - Wednesday - Thursday)
Then I add a parameter in which I write the days of the week from Sunday to Thursday
But I encountered a problem, how do I link the group that expresses different days of the week with different courses that have different times
I have not previously written anything like this in the program
Mr. Robert Fourer, Please can you suggest some ideas for this development
thank you so much.
On Mon, May 17, 2021 at 11:30 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
The message from the solver explains the problem:
ampl: model covid-19.mod;
ampl: data covid-19.dat;
ampl: solve;
MINOS 5.51: ignoring integrality of 52 variables
The MINOS solver does not support integer variables, including variables defined as "binary". As a result it ignores the "binary" restriction, and gives a solution where the courses_class values for B8-10 are 0.433333 and 0.566667. That allows the two courses to be mixed in classroom B8-10.
To avoid this problem, use a solver that can find an optimal solution subject to all binary variables being 0 or 1, such as CPLEX, Gurobi, Xpress, or CBC.
--
Robert Fourer
am...@googlegroups.com
On Sun, May 16, 2021 at 7:38 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
hello Mr. Robert Fourer
Thank you for all your previous help and clarifications
I wrote down the restrictions but I'm still facing the same problem, I don't know what to do
Why does this problem occur
Why are students mixed from different courses in the same classroom?
I don't want that to happen
I want students of one course in one classroom without mixing with students of the other course in the same classroom
Please see at the classroom B(8-10) course students have been mixed in
I have tried a lot to find a solution to this problem but I don't know what to do
I thought a lot and could not find a solution to this problem
Thank you again.
--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/9JznqHXIYwk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/reply-77152-1509205583-4412574399-1621513968-794653%40helpscout.net.
hello Mr. Robert Fourer
Show me this message
When I run the code in ampl program
Is there a solution to this problem without having to purchase the program?
Are there other programs that I can write the code in?
Or can I transfer the code to the Matlab program?
thank you.
On Thu, May 20, 2021 at 8:15 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
hello Mr. Robert Fourer
I want to ask
Is there a way to convert, write and run the ampl code in the Matlab program ?
because when I write my code and solve
I can not see the result
Since I have demo version
And it has limited for variables and constraints
Thank you.
On Thu, May 20, 2021 at 12:32 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Here are some ideas, but you will have to take responsibility for working out the details:
You could start by just considering different times on one day. Define a new set "time" and add it to the indexing wherever that is appropriate in your model, for example "param capacity {i in door, t in time} >= 0;" and "var trans_1 {i in door, k in courses, j in class, t in time} >= 0;". You will also have to add indexing over "time" in your constraints (including the ones that limit each classroom to one course) and you will have to expand your data to represent courses at different times.
When your formulation is complete, examine your solutions to see whether they are acceptable. If not, you may have to consider adding constraints.
After you have this working, you can consider further expanding the model, either by letting the members of "time" represent times on different days, or by adding a new set "day".
--
Robert Fourer
am...@googlegroups.com
hello Mr. Robert Fourer
On Fri, May 21, 2021 at 8:18 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
AMPL is very different from MATLAB, so there is no automatic way to convert from AMPL to MATLAB. You would have to start over and rewrite your model in completely different way for MATLAB to be able to solve it.
You can run AMPL and many popular solvers for free on the NEOS Server, without the tight problem size limitations of the AMPL demo license you are currently using. (The only limits are 8 hours and 3 gigabytes of memory.) Also if you are using AMPL in an educational setting, see our AMPL for Courses and AMPL for Students pages for other free possibilities.
--
Robert Fourer
am...@googlegroups.com
hello Mr. Robert Fourer
On Mon, May 24, 2021 at 1:31 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Chapter 9 of the AMPL book explains the different ways of writing data for a parameter indexed over 3 sets, with examples. See in particular the sections on "Lists of higher-dimensional sets and parameters" (page 148) and "Higher-dimensional tables" (page 157).
Your time set could contain, for example, "Monday1000", "Monday1130", "Monday1300", "Tuesday1030", "Tuesday1300", etc. -- so that each member represents a particular day at a particular time. Then you only need to add one set to your indexing.
Or, if the times are the same every day, you could have a separate time set ("1000", "1130", "1300", etc.) and day set ("Monday", Tuesday", etc.) and add both the time and day sets to your indexing, as in "param capacity {i in door, t in time, d in day} >= 0;".
--
Robert Fourer
am...@googlegroups.com