Hi ?
You should define most of your equations over f,m as they, as the equations are defined for each f,m pair:
cmodulus(f,m)… amodulus(f,m)=e=[fspec(“fibre modulus”,f)phi+mspec(“matrix modulus”,m)(1-phi)]*1000;
strain(f,m)… astrain(f,m)=e=aforce/(acrosssection*amodulus(f,m));
matcost(f,m)…
Cheers
Renger
From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Baas-T melo
Sent: Samstag, 28. November 2015 22:28
To: gamsworld
Subject: Re: HELP with ERROR 149 and other ERRORS
Hi all,
several of the $149 errors show up after running my model. I have been trying a lot of different opportunities of referencing and also read the existing posts but couldn´t find a working solution. That´s why I would like to ask for help in this group.
Is it necessary to combine the two tables into one? Why is the set considered uncontrolled? How can I fix this?
Part of the source code is shown below. The full model is attached.
Thanks for your support.
Bea
8 Sets f components fibre materials /“glass fibre”
9 “carbon fibre HT”,
10 “carbon fibre HM”/
13 m components matrix materials /epoxy,
14 “phenolic resin”/
17 table fspec (*,f) properties fibres
18 “glass fibre” “carbon fibre HT” “carbon fibre HM”
19 “fibre diameter” 25 7 7
20 “fibre cost” 3 20 200
21 “fibre modulus” 72 228 417
22 “fibre UTS” 3.4 2.7 2.2
23 “fibre density” 2.52 1.8 1.8
24 ;
30 table mspec (*,m) properties matrix
31 “epoxy” “phenolic resin”
32 “matrix cost” 6 8
33 “matrix modulus” 4 3.3
34 “matrix UTS” 110 52
35 “matrix density” 1.9 1.4
36 ;
42 scalars acrosssection total crosssection composite compound (mm^2) /300/
43 aforce applied force (N) /50000/
44 length length of composite compound (mm) /1000/
48
49 positive variables phi fibre volume ratio (-)
50 amodulus(f,m) E-modulus of composite (MPa)
51 astrain(f,m) current strain of composite compound(-)
52 ccost cost composite material (Eur)
53 pcost production cost depending on fibre volumeratio (Eur)
54 acost total cost
55
56 equations strain strain (-)
57 cmodulus E-modulus of composite (MPa)
58 prodcost production cost
59 matcost material cost
60 tcost total cost (material+production) of selected comp
osite components;
61
62 cmodulus… amodulus(f,m)=e=[fspec(“fibre modulus”,f)*phi+mspec("matr
**** $149,149 $149
ix modulus",m)*(1-phi)]*1000;
$149
63 strain… astrain(f,m)=e=aforce/(acrosssection*amodulus(f,m));
**** $149,149 $149,149
64 matcost… ccost=e=fspec(“fibre cost”,f)phiacrosssectionlengthfs
**** $149
pec(“fibre density”,f)+mspec(“matrix cost”,m)*(1-phi)acrosssectionlength
$149 $149
*mspec(“matrix density”,m);
$149
67
68 model compmaterial choice of composite material components /all/;
69
70 phi.up=0.7;
71 astrain.up(f,m)=0.0025;
72
73 solve compmaterial using lp minimizing acost;
**** $246,257
74
Am Montag, 27. Oktober 2014 04:06:35 UTC-4 schrieb Roger Cremades:
Hi Stacy,
I found your problem more interesting than a Sunday’s sudoku, hope
Renger does not mind I respond, nonetheless I fully support his
statement.
Besides the GAMS programming questions related to the errors you have
shown, I am sure there is a problem in the mathematical formulation,
you should revise, for instance, why you use indices in the variable
x(i) in the Demand equation that are not in the definition of the
variable x(i)…
see below a possible suggestion for solving the errors, that should
be taken with care because there is at least a problem in the
mathematical formulation.
Best, Roger
Sets
i machine /1,2/
j month /1,2/
k product /1,2,3/
l cost /1,2,3/;
Parameter
s(k) Storage Expenses in Dollars /
1 15
2 10
3 5
/;
Table d(j,k) Demand for Production
1 2 3
1 50 70 80
2 60 90 120 ;
Table t(j,k) Production Time in Minutes
1 2 3
1 30 20 0
2 0 18 15 ;
Table c(i,l) Cost of Production
1 2 3
1 40 45
2 60 55 ;
Positive Variable x(i) Total Demand for All Products ;
Variable
z Total Cost ;
Equations
Cost(l,j,k) Objective Function
Allowedtime(i,j,k) total number of minutes per month the machines may be used
Demand The number of products required for distribution each month;
Cost(l,j,k)… z=e=sum(i,c(i,l)*x(i)+(x(i)-d(j,k))+s(k)) ;
Allowedtime(i,j,k)… x(i)*t(j,k)=l=2400 ;
Demand… sum(i,x(i))=g=0 ;
Model transport /all/;
Solve transport using lp minimizing z;
Display x.L;
2014-10-26 7:28 GMT+01:00 Renger van Nieuwkoop :
Hi Stacy
If I search for 149 in this group, I get 77 hits …
It might be a good idea to read the guidelines of this forum before posting.
Cheers
Renger
sent from my iPad
Am 25.10.2014 um 22:23 schrieb Stacy Holton :
Hello All,
Im working on a project and error 149 appears multiple time in the code.
If someone could explain how the ‘Uncontrolled Set’ error works I’d GREATLY
appreciate it!
Note: Ive also highlighted where GAMS appears to show the errors.
Thanks in advance,
Stacy
2
3 Sets
4 i machine /1,2/
5 j month /1,2/
6 k product /1,2,3/
7 l cost /1,2,3/;
8
9 Parameter
10 s(k) Storage Expenses in Dollars /
11 1 15
12 2 10
13 3 5
14 /;
15
16 Table d(j,k) Demand for Production
17 1 2 3
18 1 50 70 80
19 2 60 90 120 ;
20
21 Table t(j,k) Production Time in Minutes
22 1 2 3
23 1 30 20 0
24 2 0 18 15 ;
25
26 Table c(i,l) Cost of Production
27 1 2 3
28 1 40 45
29 2 60 55 ;
30
31 Positive Variable x(i) Total Demand for All Products ;
32
33 Variable
34 z Total Cost ;
35
36 Equations
37 Cost Objective Function
38 Allowedtime(j) total number of minutes per month the machines may be
used
39 Demand The number of products required for distribution each
month;
40
41 Cost… z=e=sum(i,c(i,l)*x(i)+(x(i)-d(j,k))+s(k)) ;
**** $149
$149,149$149
42 Allowedtime(j)… x(i)*t(j,k)=l=2400 ;
**** $149 $149
43 *Demand… sum(i,x(i,j,k))=g=0 ;
44
45 Model transport /all/;
46 Solve transport using lp minimizing z;
**** $257
47 Display x.L;
**** $141
48
–
“gamsworld” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
–
“gamsworld” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
–
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.
–
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.